File: /var/www/web37/htdocs/0900topliste/admin/functions.php
<?php
############################################
### Top-XL V.1.24 Free - Topsite Language File English lang/en.php
############################################
/// 1. You are NOT entiteld to rent, lease, transfer, reproduce or distribute this Software.
/// 2. You are entiteld to adapt, and modify the Software to your need.
/// 3. You can use this Script on all of YOUR Domains.
/// 4. Any modification or removal to the links in the footer and member area shall terminate this license immediately .
/// 5. The Script has been tested on different Servers and found free of any notable errors by the author. The Author shall not in any case be liable for any special, incidental indirect or other similar damages arising from the use of this Script.
/// 6. Author: Simon Zehender - Contact: http://www.derwebgestalter.de or http://www.paddelberg.de
////////////////////////////////////////////
////////////////////////////////////////////
if ($scriptpath!=$_SERVER['DOCUMENT_ROOT'])
{echo "Are you looking for something?";exit;}
function safety($var)
{
$var=addslashes($var);
$var=strip_tags($var);
return $var;
}
function get_lang($stanlang)
{
$lang = $_SERVER["HTTP_ACCEPT_LANGUAGE"];
$lang = substr($lang, 0, 2);
if($lang=="")
{$lang=$stanlang;}
return $lang;
}
function get_lang_file($language,$stanlang,$langarray,$langdetect)
{
if ($langdetect=="no")
{return $stanlang;}
$langarray=explode(",",$langarray);
$max=count($langarray);
for($i=0;$i<$max;$i++)
{
if ($langarray[$i]==$language)
{return $langarray[$i];}
}
return $stanlang;
}
function useragent($browser)
{
if ( strpos($browser, 'Gecko'))
{
if (strpos($browser, 'Netscape')) {$browser = 'Netscape';}
elseif (strpos($browser, 'Firefox')) {$browser = 'Firefox';}
elseif (strpos($browser, 'Konqueror')) {$browser = 'Konqueror';}
elseif (eregi("Thunderbird",$browser)) {$browser = 'Thunderbird';}
else {$browser = 'Mozilla';}
}
elseif (strpos($browser, 'MSIE'))
{
if (strpos($browser, 'Opera')) {$browser = 'Opera';}
else {$browser = 'I. Ex.';}
}
elseif (eregi("Opera",$browser)){$browser = 'Opera';}
elseif (eregi("Epiphany",$browser)){$browser = 'Epiphany';}
elseif (eregi("Thunderbird",$browser)){$browser = 'Thunderbird';}
elseif (eregi("Konqueror",$browser)){$browser = 'Konqueror';}
else {$browser = 'Other';}
return $browser;
}
function slashcheck($url)
{
$result = 1; /// Dateiname vorhanden
if (!eregi(".htm|.html|.php|.asp|.swf|.cgi|.shtml",$url))
{
$url_info = parse_url($url);
$result = 2; /// kein Dateiname und slash am ende
if (!$url_info[query])
{
$urlcheck = substr (strrchr ($url, "/"), 1 );
if ($urlcheck and $urlcheck != '/')
{$result = 3;} /// kein Dateiname und kein slash am ende
}
}
return $result;
}
function check_accountspersite($accountsspersite,$linkspersite,$show)
{
if (!$accountsspersite or $accountsspersite=="")
{$accountsspersite=safety($_GET["accountsspersite"]);}
if (($accountsspersite!=is_numeric($accountsspersite) or $accountsspersite==0) and $show!="toplike")
{$accountsspersite=25;}
return $accountsspersite;
}
function get_stats_overview($sqlcount,$sqlwhere,$topxl_hits_table)
{
$getdata=mysql_query("SELECT count(".$sqlcount.") AS hits FROM $topxl_hits_table WHERE $sqlwhere") or die (mysql_error());
$data=@mysql_fetch_array($getdata);
return $data[hits];
}
function get_ratio($number1,$number2)
{
if ($number1 and $number1 !=0 and $number2 and $number2 !=0)
{
$ratio = $number2/$number1;
$ratio = substr($ratio, 0, 4);
}
else {$ratio = 1;}
return $ratio;
}
?>