HEX
Server: Apache/2.4.25 (Debian)
System: Linux server17 4.9.0-19-amd64 #1 SMP Debian 4.9.320-2 (2022-06-30) x86_64
User: web37 (1062)
PHP: 7.4.30
Disabled: show_source, highlight_file, apache_child_terminate, apache_get_modules, apache_note, apache_setenv, virtual, dl, disk_total_space, posix_getpwnam, posix_getpwuid, posix_mkfifo, posix_mknod, posix_setpgid, posix_setsid, posix_setuid, posix_uname, proc_nice, openlog, syslog, pfsockopen
Upload Files
File: /var/www/web37/htdocs/0900topliste/index.php
<?php 
############################################
### Top-XL V.1.24 Free  -  Topsite itself index.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
////////////////////////////////////////////
////////////////////////////////////////////
@ini_set ('error_reporting', 0);
@error_reporting (0);
$scriptpath=$_SERVER['DOCUMENT_ROOT'];
include("inc/sql.php");
include("inc/vars.php");
function safety($var)
	{
	$var=addslashes($var);
	$var=strip_tags($var);
	return $var;
	}
function get_lang()
	{
	$lang=$_SERVER["HTTP_ACCEPT_LANGUAGE"];
	$lang=substr($lang, 0, 2);
	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;
	}
$langget=get_lang($stanlang);
include("lang/".get_lang_file($langget,$stanlang,$langarray,$langdetect).".php");
$start=safety($_GET["$kwholder1"]);
function getip() 
   {
    if(getenv("HTTP_X_FORWARDED_FOR")) 
        $ip=getenv("HTTP_X_FORWARDED_FOR"); 
    else 
        $ip=getenv("REMOTE_ADDR"); 
    return $ip; 
   }
$ip=getip();
$day=date("d");
$onlinetime=time()-1200;
$timestamp=time();
mysql_query("DELETE FROM $topxl_stats1_table WHERE timestamp<='$onlinetime'") or die ("Msql_Error");
$statsquery=mysql_query("SELECT * from $topxl_stats1_table WHERE ip='$ip' and timestamp>='$onlinetime'") or die ("Msql_Error");
$statsqueryrow=mysql_fetch_array($statsquery);
if (!$statsqueryrow[ip] or $statsqueryrow[ip]=="" or $statsqueryrow[ip]==0)
	{
	mysql_query("INSERT INTO $topxl_stats1_table SET ip='$ip',timestamp='$timestamp'") or die ("Msql_Error1");
	mysql_query("UPDATE $topxl_admin_table SET hitstoday=hitstoday+1,hitstotal=hitstotal+1,loadstotal=loadstotal+1,day='$day'") or die ("Msql_Error2");
	}
else
	{mysql_query("UPDATE $topxl_admin_table SET loadstotal=loadstotal+1,day='$day'") or die ("Msql_Error4");}
if ($day != $day4hit)
	{mysql_query("Update $topxl_admin_table set hitsyesterday=hitstoday,hitstoday='0'") or die ("Msql_Error");}
if ($filename=="index.php")
	{$filenamex=="";}
else {$filenamex=$filename;}
if (!is_numeric($start) and !empty($start)) 	
	{header("HTTP/1.1 301 Moved Permanently");header ("location: ".$topsiteurl."/".$filenamex); exit;}
if (empty ($start) || $start<0) 
	{$start=0;}
else {$start=($start-1)*$linkspersite;}	
if ($sorting=="out")
	{$sqlorder="ORDER BY hitout";$sqlwhere="hitout>='$hitsneeded'";}
if ($sorting=="outtotal")
	{$sqlorder="ORDER BY hitouttotal";$sqlwhere="hitouttotal>='$hitsneeded'";}	
if ($sorting=="intotal")
	{$sqlorder="ORDER BY hitintotal";$sqlwhere="hitintotal>='$hitsneeded'";}	
if ($sorting=="in")
	{$sqlorder="ORDER BY hitin";$sqlwhere="hitin>='$hitsneeded'";}
if ($onlyactive=="yes")
	{
	$inacttime=$timestamp-$inactivetime;
	$sqllastactive=" and lastactive>='$inacttime'";
	}
$query = mysql_query("SELECT * from $topxl_user_table WHERE active='yes' and $sqlwhere$sqllastactive $sqlorder DESC LIMIT $start,$linkspersite") or die ("Msql_Error");
$rank=$start;
$bannershow="0";	
if(!file_exists("html/".$design."/topsite-rows.html"))
	{echo "The template file html/".$design."/topsite-rows.html does not exist."; exit;}
if(!file_exists("html/".$design."/topsite-rows-header.html"))
	{echo "The template file html/".$design."/topsite-rows-header.html does not exist."; exit;}
$fp3=fopen("html/".$design."/topsite-rows-header.html","r");  
$zeile3=fread ($fp3, filesize ("html/".$design."/topsite-rows-header.html"));
$zeile3=ereg_replace("{text_rank}",$text_rank,$zeile3);
$zeile3=ereg_replace("{text_description}",$text_topdescription,$zeile3);
$zeile3=ereg_replace("{text_in}",$text_in,$zeile3);
$zeile3=ereg_replace("{text_out}",$text_out,$zeile3);
fclose($fp3);
if ($showadds != "no")
	{
	$promorowquery=mysql_query("SELECT row FROM $topxl_promotial_table") or die ("Msql_Error");
	while ($promorowget=@mysql_fetch_array($promorowquery))
		{$promorows.="$promorowget[row],";}
	$promorows=trim($promorows);
	$promorows=substr("$promorows", 0, -1);
	$promorows=explode(",",$promorows);
	$rowscount=(count($promorows));
	}
$countuser=mysql_query("SELECT COUNT(id) as cnt FROM $topxl_user_table WHERE active='yes'$sqllastactive") or die (mysql_error()); 
$row=@mysql_fetch_array($countuser);
$allusers=$row["cnt"];
while($userget=@mysql_fetch_array($query))
	{
	$id=$userget[id];
	$url=$userget[url];
	$bannerurl=$userget[bannerurl];
	$title=$userget[title];
	$description=$userget[description];
	$hitin=$userget[hitin];
	$hitout=$userget[hitout];
	$hitintotal=$userget[hitintotal];
	$hitouttotal=$userget[hitouttotal];
	$validationdate=$userget[validationdate];
	$rank++;
	$bannershow++;
	$fp2=fopen("html/".$design."/topsite-rows.html","r");  
	$zeile2=fread ($fp2, filesize ("html/".$design."/topsite-rows.html"));
	$zeile2=ereg_replace("{top_rank}","$rank",$zeile2);
	$zeile2=ereg_replace("{top_url}",$url,$zeile2);
	$zeile2=ereg_replace("{top_id}",$id,$zeile2);
	$zeile2=ereg_replace("{top_title}",$title,$zeile2);
	$zeile2=ereg_replace("{top_description}",$description,$zeile2);
	$zeile2=ereg_replace("{top_hitin}",$hitin,$zeile2);
	$zeile2=ereg_replace("{top_hitintotal}",$hitintotal,$zeile2);
	$zeile2=ereg_replace("{top_hitout}",$hitout,$zeile2);
	$zeile2=ereg_replace("{top_hitouttotal}",$hitouttotal,$zeile2);
	/// marknew
	if ($marknew=="yes")
		{
		$now = time();
		$checkvalidationdate=$now-$newtime;
		if ($checkvalidationdate<=$validationdate)
			{$zeile2=ereg_replace("{newsite}",$text_newsite,$zeile2);}
		else
			{$zeile2=ereg_replace("{newsite}","",$zeile2);}
		}
	else
		{$zeile2=ereg_replace("{newsite}","",$zeile2);}
	/// showbanner
	if ($showbanner=="yes")
		{
		if ($bannerrows>=$bannershow)
			{
			if ($staticbannersize=="yes")
				{$bannersize=" width=\"".$bannerwidth."\" height=\"".$bannerheight."\"";}
			$bannerlink="<a href=\"".$url."\" target=\"_blank\" onmousedown=\"return out('".$id."')\"><img src=\"".$bannerurl."\"".$bannersize." alt=\"".$id." ".$title."\" border=\"0\" class=\"banner\" vspace=\"4\" hspace=\"4\"></a>";
			$zeile2=ereg_replace("{top_banner}", $bannerlink,$zeile2);
			}
		else 
			{$zeile2=ereg_replace("{top_banner}", "",$zeile2);}
		}
	else 
		{$zeile2=ereg_replace("{top_banner}", "",$zeile2);}
	$listtable.=$zeile2;
	if ($showadds != "no")
		{
		for($i=0;$i<$rowscount;$i++)
			{
			if ($promorows[$i]==$rank)
				{
				$promoquery=mysql_query("SELECT * from $topxl_promotial_table where row='$promorows[$i]'") or die ("Msql_Error");
				$promoget=@mysql_fetch_array($promoquery);
				$addcode=$promoget[code];
				if ($rank!=($start+$linkspersite-1) and $rank<$allusers) 
					{$listtable.=$addcodebegin." ".$addcode." ".$addcodeend." ".$zeile3;}
				else
					{$listtable.=$addcodebegin." ".$addcode;}
				}
			}
		}
	}
$counthits = mysql_query("SELECT sum(hitintotal) AS insumme,sum(hitouttotal) AS outsumme,sum(hitin) AS curinsumme,sum(hitout) AS curoutsumme FROM $topxl_user_table WHERE active='yes'") or die (mysql_error()); 
$counthitsrow=@mysql_fetch_array($counthits);
$allhitsin=$counthitsrow[insumme];
$allhitsout=$counthitsrow[outsumme];
$currenthitsin=$counthitsrow[curinsumme];
$currenthitsout=$counthitsrow[curoutsumme];
if ($row["cnt"]>$linkspersite)
	{
	$menu.=" | "; 
	$max=$row["cnt"]/$linkspersite;
	$max=ceil($max);
	$next=0;
	for($i=0;$i<$max;$i++)
		{
		if ($next==$start)
			{
			$nextsite=$i+1;
			if ($nextsite==1)
				{$menu.=""; }
			else
				{$menu.= "<strong>".$nextsite."</strong> | "; }
			}
		else
			{
			if ($next=="0")
				{$menu.="<a href=\"".$topsiteurl."/".$filenamex."\" class=\"topsitemenu\"> 1</a> | ";}
			else
				{
				$nextsite=$i+1;
				$menu.="<a href=\"".$topsiteurl."/".$filename."?".$kwholder1."=".$nextsite."\" class=\"topsitemenu\">".$nextsite."</a> | ";
				}
			}
		$next=$next+$linkspersite;
		}
	}
if ($currenthitsin and $currenthitsin !=0 and $currenthitsout and $currenthitsout !=0)
	{
	$ratiohits=$currenthitsout/$currenthitsin;
	$ratiohits=substr($ratiohits, 0, 4);
	}
else {$ratiohits = 1;}
if ($allhitsin and $allhitsin !=0 and $allhitsout and $allhitsout !=0)
	{
	$ratiohitstotal=$allhitsout/$allhitsin;
	$ratiohitstotal=substr($ratiohitstotal, 0, 4);
	}
else {$ratiohitstotal = 1;}
$nextreset=$lastreset+$resettime;
$nextreset=date("Y.m.d-H.i.s", $nextreset); 
$lastreset=date("Y.m.d-H.i.s", $lastreset); 
if(!file_exists("html/".$design."/topsite.html"))
	{echo "The template file html/".$design."/topsite.html does not exist."; exit;}
$fp1=fopen("html/".$design."/topsite.html","r");  
$zeile=fread ($fp1, filesize ("html/".$design."/topsite.html"));
$zeile=ereg_replace("{listtable}",$listtable,$zeile);
$zeile=ereg_replace("{menu}",$menu,$zeile);
$zeile=ereg_replace("{listheader}",$zeile3,$zeile);
$zeile=ereg_replace("{text_hitsin}",$text_hitsin,$zeile);
$zeile=ereg_replace("{text_hitsout}",$text_hitsout,$zeile);
$zeile=ereg_replace("{allhitsin}",$allhitsin,$zeile);
$zeile=ereg_replace("{allhitsout}",$allhitsout,$zeile);
$zeile=ereg_replace("{currenthitsin}",$currenthitsin,$zeile);
$zeile=ereg_replace("{text_currenthitsin}",$text_currenthitsin,$zeile);
$zeile=ereg_replace("{currenthitsout}",$currenthitsout,$zeile);
$zeile=ereg_replace("{text_currenthitsout}",$text_currenthitsout,$zeile);
$zeile=ereg_replace("{allusers}",$allusers,$zeile);
$zeile=ereg_replace("{lastreset}",$lastreset,$zeile);
$zeile=ereg_replace("{text_lastreset}",$text_lastreset,$zeile);
$zeile=ereg_replace("{nextreset}",$nextreset,$zeile);
$zeile=ereg_replace("{text_nextreset}",$text_nextreset,$zeile);
$zeile=ereg_replace("{topsiteurl}",$topsiteurl,$zeile);
$zeile=ereg_replace("{topsitename}",$topsitename,$zeile);
$zeile=ereg_replace("{text_members}",$text_members,$zeile);
$zeile=ereg_replace("{text_signup}",$text_signup,$zeile);
$zeile=ereg_replace("{ratiohits}",$ratiohits,$zeile);
$zeile=ereg_replace("{ratiohitstotal}",$ratiohitstotal,$zeile);
$zeile=ereg_replace("{text_ratiototal}",$text_ratiototal,$zeile);
$zeile=ereg_replace("{text_ratio}",$text_ratio,$zeile);
$zeile=ereg_replace("{text_code}",$code,$zeile);
if ($showbanner=="yes" and $rank>=1)
	{@fclose($fp2);}
@fclose($fp1);
echo $zeile;
exit;
?>