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/topsex/index.php
<?php 
############################################
### Top-XL - 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: https://www.paddelberg.de
////////////////////////////////////////////
////////////////////////////////////////////
@ini_set ('error_reporting', 0);
@error_reporting (0);
@ini_set ('default_charset', 'utf-8');
header ('Content-Type: text/html; charset=utf-8');

$scriptpath=$_SERVER['DOCUMENT_ROOT'];
include("inc/sql.php");
include("inc/vars.php");

function safety($var)
	{return strip_tags(addslashes($var));}

function get_lang()
	{
	$lang = !empty ($_SERVER["HTTP_ACCEPT_LANGUAGE"]) ? substr (safety ($_SERVER["HTTP_ACCEPT_LANGUAGE"]), 0, 2) : '';
	return empty ($lang) ? $stanlang : $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();
include ("lang/".get_lang_file ($langget, $config['stanlang'], $config['langs'], $config['langdetect']).".php");

$start = !empty ($_GET[$config['kwholder1']]) ? safety ($_GET[$config['kwholder1']]) : '';;
$ip = getenv("REMOTE_ADDR");
$day = date("d");
$onlinetime = time()-1200;
$timestamp = time();

$db -> query ("SELECT ip from ".$topxl_stats1_table." WHERE ip='".$ip."' and timestamp>='".$onlinetime."'");
$statsqueryrow = $db -> fetch ();
if (empty ($statsqueryrow['ip']))
	{
	$db -> query ("INSERT INTO ".$topxl_stats1_table." SET ip='".$ip."',timestamp='".$timestamp."'");
	$db -> query ("UPDATE ".$topxl_admin_table." SET hitstoday=hitstoday+1,hitstotal=hitstotal+1,loadstotal=loadstotal+1,day='".$day."'");
	}
else
	{$db -> query ("UPDATE ".$topxl_admin_table." SET loadstotal=loadstotal+1,day='".$day."'");}

if ($day != $config['day'])
	{$db -> query ("Update ".$topxl_admin_table." set hitsyesterday=hitstoday,hitstoday='0'");}

$filenamex = $config['filename']=="index.php" ? '' : $config['filename'];

if (!empty ($start) && !is_numeric ($start)) 	
	{
	header ("HTTP/1.1 301 Moved Permanently");
	header ("location: ".$config['topsiteurl']."/".$filenamex); 
	exit;
	}
$start = empty ($start) || $start < 0 ? 0 : ($start-1)*$config['linkspersite'];	

if ($config['sorting']=="out")
	{
	$sqlorder="ORDER BY hitout";
	$sqlwhere="hitout>='".$config['hitsneeded']."'";
	}
elseif ($config['sorting']=="outtotal")
	{
	$sqlorder="ORDER BY hitouttotal";
	$sqlwhere="hitouttotal>='".$config['hitsneeded']."'";
	}	
elseif ($config['sorting']=="intotal")
	{
	$sqlorder="ORDER BY hitintotal";
	$sqlwhere="hitintotal>='".$config['hitsneeded']."'";
	}	
elseif ($config['sorting']=="in")
	{
	$sqlorder="ORDER BY hitin";
	$sqlwhere="hitin>='".$config['hitsneeded']."'";
	}
$sqllastactive = '';
if ($config['onlyactive']=="yes")
	{
	$inacttime=$timestamp-$config['inactivetime'];
	$sqllastactive=" and lastactive>='".$inacttime."'";
	}

if(!file_exists("html/".$config['design']."/topsite-rows-header.html"))
	{echo "The template file html/".$config['design']."/topsite-rows-header.html does not exist."; exit;}
$fp=fopen("html/".$config['design']."/topsite-rows-header.html","r"); 
$rows_header_html=fread ($fp, filesize ("html/".$config['design']."/topsite-rows-header.html"));
$rows_header_html=str_replace("{text_rank}",$text_rank,$rows_header_html);
$rows_header_html=str_replace("{text_description}",$text_topdescription,$rows_header_html);
$rows_header_html=str_replace("{text_in}",$text_in,$rows_header_html);
$rows_header_html=str_replace("{text_out}",$text_out,$rows_header_html);
fclose($fp);

$db -> query ("SELECT id FROM ".$topxl_user_table." WHERE active='yes'".$sqllastactive.""); 
$allusers = $db -> numRows ();

if(!file_exists("html/".$config['design']."/topsite-rows.html"))
	{echo "The template file html/".$config['design']."/topsite-rows.html does not exist."; exit;}
$fp=fopen("html/".$config['design']."/topsite-rows.html","r");  
$topsite_row_template=fread ($fp, filesize ("html/".$config['design']."/topsite-rows.html"));
@fclose($fp);

$promorows = '';
if ($config['showadds'] != "no")
	{
	$db -> query ("SELECT * from ".$topxl_promotial_table." where row>='".$start."' AND row<=".($start+$config['linkspersite']));
	while ($row = $db -> fetch ())
		{$promorows[$row['row']] = $row['code'];}
	}

$listtable='';
$rank=$start;
$db -> query ("SELECT * from ".$topxl_user_table." WHERE active='yes' and ".$sqlwhere.$sqllastactive." ".$sqlorder." DESC LIMIT ".$start.",".$config['linkspersite']);

if ($start > 1 && $db -> numRows () < 1)
	{
	header("HTTP/1.1 302 Moved Temporarily");
	header ("location: ".$config['topsiteurl']."/".$filenamex); 
	exit;
	}

while($row = $db -> fetch ())
	{
	$rank++;
	$rows_html=str_replace("{top_rank}",$rank,$topsite_row_template);
	$rows_html=str_replace("{top_url}",stripslashes ($row['url']),$rows_html);
	$rows_html=str_replace("{top_id}",$row['id'],$rows_html);
	$rows_html=str_replace("{top_title}",stripslashes ($row['title']),$rows_html);
	$rows_html=str_replace("{top_description}",stripslashes ($row['description']),$rows_html);
	$rows_html=str_replace("{top_hitin}",$row['hitin'],$rows_html);
	$rows_html=str_replace("{top_hitintotal}",$row['hitintotal'],$rows_html);
	$rows_html=str_replace("{top_hitout}",$row['hitout'],$rows_html);
	$rows_html=str_replace("{top_hitouttotal}",$row['hitouttotal'],$rows_html);

	/// marknew
	$rows_html = ($config['marknew']=="yes" && time() - $config['newtime'] <= $row['validationdate']) ? str_replace ("{newsite}", $text_newsite, $rows_html) : str_replace ('{newsite}', '', $rows_html);

	/// showbanner
	if ($config['showbanner']=="yes" && $config['bannerrows']>=$rank-$start)
		{
		$bannersize = $config['staticbannersize']=="yes" ? ' style="max-width:'.$config['bannerwidth'].'px; max-height='.$config['bannerheight'].'px;"' : '';
		$bannerlink = '<a href="'.$row['url'].'" target="_blank" onmousedown="return out(\''.$row['id'].'\')"><img src="'.stripslashes ($row['bannerurl']).'" '.$bannersize.' alt="'.$row['id'].' '.stripslashes ($row['title']).'" title="'.$row['id'].' '.stripslashes ($row['title']).'" class="banner" /></a>';
		$rows_html=str_replace("{top_banner}", $bannerlink,$rows_html);
		}

	else 
		{$rows_html=str_replace("{top_banner}", "",$rows_html);}

	$listtable.=$rows_html;
	if ($config['showadds'] == "yes" && !empty ($promorows[$rank]))
		{
		if ($rank!=($start+$config['linkspersite']-1) and $rank<=($start+$config['linkspersite']))
			{$listtable.=stripslashes($config['addcodebegin'])." ".stripslashes ($promorows[$rank])." ".stripslashes ($config['addcodeend'])." ".$rows_header_html;}
		else
			{$listtable.=stripslashes($config['addcodebegin'])." ".stripslashes ($promorows[$rank])." ".stripslashes ($config['addcodeend']);}
		}
	}

$db -> 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'"); 
$counthitsrow = $db -> fetch ();

$menu='';
if ($allusers>$config['linkspersite'])
	{
	$menu=" | "; 
	$max=ceil($allusers/$config['linkspersite']);
	$next=0;
	for($i=0;$i<$max;$i++)
		{
		if ($next==$start)
			{
			$nextsite = $i+1;
			$menu .= ($nextsite == 1) ? '' : "<strong>".$nextsite."</strong> | "; 
			}
		else
			{
			if ($next=="0")
				{$menu.="<a href=\"".$config['topsiteurl']."/".$filenamex."\" class=\"topsitemenu\"> 1</a> | ";}
			else
				{
				$nextsite=$i+1;
				$menu.="<a href=\"".$config['topsiteurl']."/".$config['filename']."?".$config['kwholder1']."=".$nextsite."\" class=\"topsitemenu\">".$nextsite."</a> | ";
				}
			}
		$next=$next+$config['linkspersite'];
		}
	}

$ratiohits = !empty ($counthitsrow['curinsumme']) && !empty($counthitsrow['curoutsumme']) ? substr($counthitsrow['curoutsumme']/$counthitsrow['curinsumme'], 0, 4) : 1;
$ratiohitstotal = !empty ($counthitsrow['insumme']) && !empty ($counthitsrow['outsumme']) ? substr($counthitsrow['outsumme']/$counthitsrow['insumme'], 0, 4) : 1;

if(!file_exists("html/".$config['design']."/topsite.html"))
	{echo "The template file html/".$config['design']."/topsite.html does not exist."; exit;}
$fp=fopen("html/".$config['design']."/topsite.html","r");  
$zeile=fread ($fp, filesize ("html/".$config['design']."/topsite.html"));
$zeile=str_replace("{listtable}",$listtable,$zeile);
$zeile=str_replace("{menu}",$menu,$zeile);
$zeile=str_replace("{listheader}",$rows_header_html,$zeile);
$zeile=str_replace("{text_hitsin}",$text_hitsin,$zeile);
$zeile=str_replace("{text_hitsout}",$text_hitsout,$zeile);
$zeile=str_replace("{allhitsin}",$counthitsrow['insumme'],$zeile);
$zeile=str_replace("{allhitsout}",$counthitsrow['outsumme'],$zeile);
$zeile=str_replace("{currenthitsin}",$counthitsrow['curinsumme'],$zeile);
$zeile=str_replace("{text_currenthitsin}",$text_currenthitsin,$zeile);
$zeile=str_replace("{currenthitsout}",$counthitsrow['curoutsumme'],$zeile);
$zeile=str_replace("{text_currenthitsout}",$text_currenthitsout,$zeile);
$zeile=str_replace("{allusers}",$allusers,$zeile);
$zeile=str_replace("{lastreset}",date("Y.m.d-H.i.s", $config['lastreset']),$zeile);
$zeile=str_replace("{text_lastreset}",$text_lastreset,$zeile);
$zeile=str_replace("{nextreset}", date("Y.m.d-H.i.s", ($config['lastreset']+$config['resettime'])) ,$zeile);
$zeile=str_replace("{text_nextreset}",$text_nextreset,$zeile);
$zeile=str_replace("{topsiteurl}",$config['topsiteurl'],$zeile);
$zeile=str_replace("{topsitename}",$config['topsitename'],$zeile);
$zeile=str_replace("{text_members}",$text_members,$zeile);
$zeile=str_replace("{text_signup}",$text_signup,$zeile);
$zeile=str_replace("{ratiohits}",$ratiohits,$zeile);
$zeile=str_replace("{ratiohitstotal}",$ratiohitstotal,$zeile);
$zeile=str_replace("{text_ratiototal}",$text_ratiototal,$zeile);
$zeile=str_replace("{text_ratio}",$text_ratio,$zeile);
$zeile=str_replace("{text_code}",$code,$zeile);
@fclose($fp);
echo $zeile;

$db -> query ("DELETE FROM ".$topxl_stats1_table." WHERE timestamp<='".$onlinetime."'");

if ($config['lastreset'] < $timestamp-($config['resettime']))
	{
	$lastresettime1 = $timestamp-$config['lastreset'];
	$db -> query ("UPDATE ".$topxl_admin_table." SET lastreset='".$now."',lastresettime='".$lastresettime1."'");
	$db -> query ("Update ".$topxl_user_table." SET hitin=0,hitout=0");
	}
exit;
?>