logged in to perform that operation."; } header("HTTP/1.0 404 Object not found or user is not logged in"); apidb_header("Oops"); echo "
$message
\n"; apidb_footer(); exit; } /** * redirect to $url */ function util_redirect_and_exit($url) { header("Location: ".html_entity_decode($url)); exit; } function build_urlarg($vars) { $arr = array(); while(list($key, $val) = each($vars)) { if(is_array($val)) { while(list($idx, $value) = each($val)) { //echo "Encoding $key / $valueApplication Name | \n"; echo "Description | \n"; echo "No. Versions | \n"; echo "
".html_ahref($oRow->appName,$oApp->objectMakeUrl())." | \n"; echo "".util_trim_description($oRow->description)." | \n"; echo "$y->versions | \n"; echo "
$c match(es) found |
'); $sDescription = str_replace($aReplace, "\n", $sDescription); // 2) let's split the dsecription into lines $aDesc = explode("\n",trim($sDescription)); // 3) Avoid empty lines for($i = 0; $i < sizeof($aDesc); $i++) if(($sText = trim(strip_tags($aDesc[$i])))) return $sText; return ''; } /* This allows us to pass on the current URL to the login form so that the user is returned to the current page once he has logged in */ function login_url() { $sCurrentUrl = urlencode($_SERVER['REQUEST_URI']); $sLoginUrl = BASE."account.php?sCmd=login"; /* If we are on the login page that means the URL already contains an sReturnTo value, and we don't want two. Besides, there is little point in redirecting to the login page after login. */ if(!strpos($sCurrentUrl, "sReturnTo") && !strpos($sCurrentUrl, "account.php")) $sLoginUrl .= "&sReturnTo=".$sCurrentUrl; return $sLoginUrl; } // representation of an html color value class color { var $iRed; var $iGreen; var $iBlue; function color($iRed = 0, $iGreen = 0, $iBlue = 0) { $this->iRed = $iRed; $this->iGreen = $iGreen; $this->iBlue = $iBlue; } function SetColorByName($sColorName) { switch(strtolower($sColorName)) { case "platinum": $this->iRed = 0xEC; $this->iGreen = 0xEC; $this->iBlue = 0xEC; break; case "gold": $this->iRed = 0xFF; $this->iGreen = 0xF6; $this->iBlue = 0x00; break; case "silver": $this->iRed = 0xC0; $this->iGreen = 0xC0; $this->iBlue = 0xC0; break; case "bronze": $this->iRed = 0xFC; $this->iGreen = 0xBA; $this->iBlue = 0x0A; break; case "garbage": $this->iRed = 0x99; $this->iGreen = 0x96; $this->iBlue = 0x66; break; case "white": $this->iRed = 0xff; $this->iGreen = 0xff; $this->iBlue = 0xff; break; case "color0": $this->iRed = 0xe0; $this->iGreen = 0xe0; $this->iBlue = 0xe0; break; case "color1": $this->iRed = 0xc0; $this->iGreen = 0xc0; $this->iBlue = 0xc0; break; default: break; } } // convert the color value into a html rgb hex string function GetHexString() { return sprintf("#%02X%02X%02X", $this->iRed, $this->iGreen, $this->iBlue); } // add $iAmount to each color value, maxing out at 0xFF, the largest // color value allowed function Add($iAmount) { if($this->iRed + $iAmount > 0xFF) $this->iRed = 0xFF; else $this->iRed += $iAmount; if($this->iGreen + $iAmount > 0xFF) $this->iGreen = 0xFF; else $this->iGreen += $iAmount; if($this->iBlue + $iAmount > 0xFF) $this->iBlue = 0xFF; else $this->iBlue += $iAmount; } } ?>