- Impact
- 7
Below is a piece of code you can add to make it so that a get firefox logo is only displayed in IE
:
Below is a piece of code that displays the above plus it will say underneath '<num downloads> other people have'. I did not write that code though
np$ donation appreciated if used :bah:
PHP:
<center><?php
//Coded by JoshHendo (with a bit of help from php.net:P)
//www.joshhendo.com
//Please don't remove this notice if you use this :D
//A link back to joshhendo.com on your site is greatly appreciated
//if you use this script.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
echo '<a href="http://getfirefox.com"><img border="0" alt="Get Firefox!" title="Get Firefox!" src=" http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png"/></a>';
}
?></center>
Below is a piece of code that displays the above plus it will say underneath '<num downloads> other people have'. I did not write that code though
PHP:
<center><?php
//Coded by JoshHendo (with a bit of help from php.net:P, top half only,
//not the counter)
//www.joshhendo.com
//Please don't remove this notice if you use this :D
//A link back to joshhendo.com on your site is greatly appreciated
//if you use this script.
if (strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE') !== FALSE) {
echo '<a href="http://getfirefox.com"><img border="0" alt="Get Firefox!" title="Get Firefox!" src=" http://sfx-images.mozilla.org/affiliates/Buttons/125x50/takebacktheweb_125x50.png"/></a>
<br />';
$CharSet = "windows-1250";
$CssFile = "/css/style.css";
$Lang = array_key_exists("lang", $_GET) ? $_GET["lang"] : "";
if (($Lang == NULL) || ($Lang == "")) {
if (array_key_exists("HTTP_ACCEPT_LANGUAGE", $_SERVER)) $Lang = substr($_SERVER["HTTP_ACCEPT_LANGUAGE"], 0, 2);
else $Lang = "en";
}
if (($Lang != "en") && ($Lang != "sl")) $Lang = "en";
$StringList = array(
"downloads" => array("en" => "other people already have.", "sl" => "prenosov do sedaj"),
);
function GetNumFirefoxDownloads($Url, $Port, $Timeout) {
global $Lang;
$XmlData = file_get_contents($Url);
if ($XmlData === NULL) return "?";
global $ReturnValue;
global $IsRightTag;
$ReturnValue = "?";
$IsRightTag = false;
function XmlStartElement($Parser, $Name, $Attrs) {
global $IsRightTag;
if ($Name == "DESCRIPTION") $IsRightTag = true;
}
function XmlEndElement($Parser, $Name) {
global $IsRightTag;
if ($Name == "DESCRIPTION") $IsRightTag = false;
}
function XmlTextData($Parser, $Data) {
global $ReturnValue;
global $IsRightTag;
if ($IsRightTag) $ReturnValue = $Data;
}
$XmlParser = xml_parser_create();
xml_set_element_handler($XmlParser, "XmlStartElement", "XmlEndElement");
xml_set_character_data_handler($XmlParser, "XmlTextData");
xml_parse($XmlParser, $XmlData, true);
xml_parser_free($XmlParser);
if ($Lang == "sl") $ReturnValue = str_replace(",", ".", $ReturnValue);
return $ReturnValue;
}
$NumDownloads = GetNumFirefoxDownloads("http://feeds.spreadfirefox.com/downloads/firefox", 80, 25);
echo
"<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n".
"<html>\n".
"<head>\n".
"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=".$CharSet."\" />\n".
"<meta http-equiv=\"refresh\" content=\"10; url=firefoxcounter.php?lang=".$Lang."\" />\n".
"<title></title>\n".
"<link rel=\"stylesheet\" href=\"".$CssFile."\" type=\"text/css\" />\n".
"</head>\n".
"<body style=\"margin:0px;\">\n".
"<font color=\"#A0A0A0\">".$NumDownloads." ".$StringList["downloads"][$Lang]."</font>\n".
"</body>\n".
"</html>\n";
}
?>
np$ donation appreciated if used :bah:
Last edited:




