Call us Toll-Free:
1-800-218-1525
Live ChatEmail us

 Sponsors

Small Function Library SFL v1 0

Code Wizard, 12-30-2006

Small Function Library (SFL v1.0) for (PHP v4.01pl2 required for some functions; noted in text). Displays graphics, and displays online status of various instant message services (Yahoo! / AIM). To be updated at a later date into a better compilation.

<?

//
// Small Function Library (SFL v1.0)
// Compiled by Andrew Heebner
//

$yahooStatusFile = "http://opi.yahoo.com/online?u=$yahooUID";
$icqStatusFile = "http://wwp.icq.com/scripts/online.dll?icq=$icqUID&img=1";

// displays internal PHP graphic (PHP 4.0 + ONLY)
function showPHPLogo($pagename) {
$uri = basename($pagename);
$server = phpversion();
$img = php_logo_guid();
return "<img src="$uri?=$img" border="0" alt="Powered by PHP Version $server">";
}

// displays internal *Zend* graphic (PHP 4.0 + ONLY)
function showZendLogo($pagename) {
$uri = basename($pagename);
$img = zend_logo_guid();
return "<img src="$uri?=$img" border="0" alt="Powered by *Zend* Scripting Engine">";
}

// get user's status from ICQ in a textual display
// CODE NEEDS TO BE UPDATED : INCOMPATIBLE WITH ICQ 2000a
function icqStatus($icqUID) {
$arr = @file($icqStatusFile);
$len = strlen($arr[1]);
if ($len == "") return "ICQ: <span style="color:#707070">Local Server</span>";
if ($len == 96) return "ICQ: <span style="color:#009000">Online</span>";
if ($len == 83) return "ICQ: <span style="color:#B00000">Offline</span>";
if ($len == 1) return "ICQ: <span style="color:#000080">Disabled</span>";
}

// get single numeral PHP Version
function singlePHPVersion() {
$sn = floor(phpversion());
return "PHP Version $sn";
}

function showLogo($pagename,$type) {
if($type == "Zend") {
$img = zend_logo_guid();
} elseif($type == "PHP") {
$img = php_logo_guid();
}
$uri = basename($pagename);
return "<img src="$uri?=$img" border="0" alt="Powered by *Zend* Scripting Engine">";
}

?>

Example Output below....
<hr noshade><br><br>
Function: showPHPLogo() <? print showPHPLogo($PHP_SELF); ?>
<hr noshade>
Function: showZendLogo() <? print showZendLogo($PHP_SELF); ?>
<hr noshade>
Function: icqStatus() <? print icqStatus(30159850); ?>
<hr noshade>
Function: singlePHPVersion() <? print singlePHPVersion(); ?>
<hr noshade>
Function: showLogo() <PHP> <? print showLogo($PHP_SELF,Zend); ?>
<hr noshade>
Function: showLogo() <Zend> <? print showLogo($PHP_SELF,PHP); ?>
Enjoyed this post?

Subscribe Now to receive new posts via Email as soon as they come out.

 Comments
Post your comments












Note: No link spamming! If your message contains link/s, it will NOT be published on the site before manually approved by one of our moderators.



About Us  |  Contact us  |  Privacy Policy  |  Terms & Conditions