File: /var/www/web37/htdocs/0900topliste/admin/active.php
<?php
############################################
### Top-XL V.1.24 Free - Inactive Users inactive.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;}
if ($do=="changeinactive" or $do=="inactive")
{$siteholder="inactive";$fsiteholder="active";$textholder=$text_active1;}
if ($do=="changeactive" or $do=="active")
{$siteholder="active";$fsiteholder="inactive";$textholder=$text_inactiveuser;}
$start=safety($_GET["start"]);
if (empty ($start) || $start<0 || $start!=is_numeric($start))
{$start=0;}
$sorter=safety($_GET["sorter"]);
$inactivetime=safety($_POST["inactivetime"]);
if (!$inactivetime or $inactivetime=="")
{$inactivetime=safety($_GET["inactivetime"]);}
if ($inactivetime!=is_numeric($inactivetime) or $inactivetime==0)
{
$inactivetimevars=mysql_query("SELECT inactivetime FROM $topxl_admin_table") or die (mysql_error());
$inactivetimeget=@mysql_fetch_array($inactivetimevars);
$inactivetime=$inactivetimeget[inactivetime];
$inactivetime=$inactivetime/86400;
}
$accountsspersite=check_accountspersite(safety($_POST["accountsspersite"]),$linkspersite,$show);
if ($do=="change".$siteholder)
{
$ids=safety(trim($_POST["ids"]));
$ids=substr($ids, 0, -1);
$ids=explode(",",$ids);
$max=(count($ids));
for ($i= 0; $i<=$max; $i++)
{
$status=safety($_POST["$ids[$i]"]);
if ($status=="yes")
{mysql_query("Update $topxl_user_table SET active='no' WHERE id=$ids[$i]") or die (mysql_error());}
}
header ("Location: index.php?do=".$siteholder."&start=".$start."&inactivetime=".$inactivetime."&sorter=".$sorter."&accountsspersite=".$accountsspersite);
exit;
}
$fromsite="inactive";
$sortid="idasc";
$sorturl="urlasc";
$sorttin="tindesc";
$sorttout="toutdesc";
$sortfecha="fechadesc";
if ($sorter=="iddesc")
{$sqlholder="ORDER BY id DESC";}
elseif ($sorter=="idasc")
{$sqlholder="ORDER BY id ASC";$sortid="iddesc";}
elseif ($sorter=="urldesc")
{$sqlholder="ORDER BY url DESC";}
elseif ($sorter=="urlasc")
{$sqlholder="ORDER BY url ASC";$sorturl="urldesc";}
elseif ($sorter=="tindesc")
{$sqlholder="ORDER BY hitintotal DESC";$sorttin="tinasc";}
elseif ($sorter=="tinasc")
{$sqlholder="ORDER BY hitintotal ASC";}
elseif ($sorter=="toutdesc")
{$sqlholder="ORDER BY hitouttotal DESC";$sorttout="toutasc";}
elseif ($sorter=="toutasc")
{$sqlholder="ORDER BY hitouttotal ASC";}
elseif ($sorter=="fechaasc")
{$sqlholder="ORDER BY lastactive ASC";$sortfecha="fechadesc";}
else {$sqlholder="ORDER BY lastactive DESC";$sortfecha="fechaasc";$sorter="fechadesc";}
$now=time();
$inactivetime1=$now-($inactivetime*86400);
if ($do=="changeactive" or $do=="active")
{$countuser=mysql_query("SELECT id FROM $topxl_user_table WHERE active='yes' and lastactive>='$inactivetime1'") or die (mysql_error());}
if ($do=="changeinactive" or $do=="inactive")
{$countuser=mysql_query("SELECT id FROM $topxl_user_table WHERE active='yes' and lastactive<'$inactivetime1'") or die (mysql_error()); }
$allusers=@mysql_num_rows($countuser);
// the page-forward and backward links
if ($allusers > $accountsspersite)
{
$max=$allusers/$accountsspersite;
$max=ceil($max);
$next=0;
for($i=0; $i < $max; $i++)
{
if ($next==$start)
{$menu.="";}
else
{
if ($next=="0")
{$menu.="<a href=\"index.php?do=".$siteholder."&sorter=".$sorter."&inactivetime=".$inactivetime."&show=".$show."&accountsspersite=".$accountsspersite."\"><b>1</b></a> ";}
else
{
$nextsite=$i+1;
$menu.="<a href=\"index.php?do=".$siteholder."&start=".$next."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sorter."&show=".$show."\"><b>".$nextsite."</b></a> ";
}
}
$next=$next+$accountsspersite;
}
}
$next=$start;
$rowmarker=0;
$main_content="
<table width=\"874\" border=\"0\" cellpadding=\"0\" cellspacing=\"1\" bgcolor=\"#CCCCCC\">
<tr>
<td height=\"35\" colspan=\"11\" bgcolor=\"#FFFFFF\" class=\"top\"><strong class=\"heading\">".$text_allinactiveusers."</strong></td>
</tr>
<form name=\"form2\" method=\"post\" action=\"index.php?do=".$siteholder."&sorter=".$sorter."&start=".$start."\">
<tr>
<td height=\"35\" colspan=\"12\" bgcolor=\"#FFFFFF\" class=\"top\" style=\"padding:0px;\">
<table width=\"872\" border=\"0\" cellpadding=\"0\" cellspacing=\"0\">
<tr>
<td height=\"20\" width=\"273\" bgcolor=\"#FFFFFF\" align=\"left\" valign=\"middle\" class=\"top\" style=\"border-right:1px solid #CCCCCC;\">
<a href=\"index.php?do=".$fsiteholder."\"><strong>".$textholder."</strong></a> |
<a href=\"index.php?do=searchuser\"><strong>".$text_searchaccount."</strong></a> |
<a href=\"index.php?do=user&show=toplike\"><strong>".$text_showtopsitelike."</strong></a>
</td>
<td width=\"167\" bgcolor=\"#FFFFFF\" align=\"center\" valign=\"middle\">
<strong>".$text_setinactivetime.":</strong> <input type=\"text\" name=\"inactivetime\" value=\"".$inactivetime."\" style=\"width:25px;\"> <strong>".$text_days."</strong>
</td>
<td width=\"157\" bgcolor=\"#FFFFFF\" align=\"center\" valign=\"middle\" style=\"border-left:1px solid #CCCCCC;\">
<strong>".$text_show."</strong>
<input type=\"text\" name=\"accountsspersite\" value=\"".$accountsspersite."\" style=\"width:25px;height:16px;\"> <strong>".$text_persite."</strong>
</td>
<td width=\"83\" bgcolor=\"#FFFFFF\" align=\"center\" valign=\"middle\" style=\"border-left:1px solid #CCCCCC;\">
<input name=\"Submit\" type=\"submit\" class=\"submitbuton\" value=\"".$text_submit."\" style=\"width:80px;height:22px;\">
</td>
<td width=\"186\" bgcolor=\"#FFFFFF\" align=\"left\" valign=\"middle\" class=\"top\" style=\"border-left:1px solid #CCCCCC;\">
<strong>".$text_sitemenu."</strong> ".$menu."
</td>
</tr>
</table>
</tr>
</form>
<form name=\"form1\" method=\"post\" action=\"index.php?do=change".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sorter."&start=".$start."\">
<tr>
<td width=\"40\" bgcolor=\"#E4E4E4\" align=\"right\" nowrap>
<a href=\"index.php?do=".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sortid."\">".$text_id."</a></td>
<td width=\"417\" bgcolor=\"#E4E4E4\" align=\"center\">
<a href=\"index.php?do=".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sorturl."\">".$text_url."</a></td>
<td width=\"150\" bgcolor=\"#E4E4E4\" align=\"center\" nowrap>
<a href=\"index.php?do=".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sortfecha."\">".$text_lasthit."</a>
</td>
<td width=\"40\" bgcolor=\"#E4E4E4\" align=\"right\" nowrap>
<a href=\"index.php?do=".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sorttin."\">".$text_totalins."</a>
</td>
<td width=\"45\" bgcolor=\"#E4E4E4\" align=\"right\" nowrap>
<a href=\"index.php?do=".$siteholder."&inactivetime=".$inactivetime."&accountsspersite=".$accountsspersite."&sorter=".$sorttout."\">".$text_totalouts."</a>
<td width=\"40\" bgcolor=\"#E4E4E4\" align=\"right\">".$text_email."</td>
<td width=\"55\" bgcolor=\"#E4E4E4\" align=\"center\"><a href=\"index.php?do=validate\">".$text_status."</a></td>
<td width=\"30\" bgcolor=\"#E4E4E4\" align=\"right\">".$text_del."</td>
<td width=\"30\" bgcolor=\"#E4E4E4\" align=\"right\">".$text_edit."</td>
<td width=\"40\" bgcolor=\"#E4E4E4\" align=\"right\">".$text_show."</td>
</tr>";
if ($do=="changeinactive" or $do=="inactive")
{$userget=mysql_query("SELECT * FROM $topxl_user_table WHERE active='yes' and lastactive<'$inactivetime1' $sqlholder LIMIT $start,$accountsspersite") or die (mysql_error());}
if ($do=="changeactive" or $do=="active")
{$userget=mysql_query("SELECT * FROM $topxl_user_table WHERE active='yes' and lastactive>='$inactivetime1' GROUP BY id $sqlholder LIMIT $start,$accountsspersite") or die (mysql_error());}
while ($usergetrows=@mysql_fetch_array($userget))
{
$fecha=$usergetrows[lastactive];
if ($fecha=="" or $fecha==" " or $fecha==0)
{$fecha="Not found";}
else
{$fecha=date("d.m.y--H.i.s",$fecha);}
$ids.=$usergetrows[id].",";
$rowmarker++;
if ($rowmarker==2)
{$tdbgcolor="bgcolor=\"#F7F7F7\"";$rowmarker=0;}
else
{$tdbgcolor="bgcolor=\"#FFFFFF\"";}
$main_content.="
<tr>
<td ".$tdbgcolor." align=\"right\">".$usergetrows[id]."</td>
<td ".$tdbgcolor." nowrap><div id=\"Layer1\" style=\"position:relativ; width:340px; height:22px; z-index:1; overflow: hidden;\"><a href=\"".$usergetrows[url]."\" target=\"_blank\">".$usergetrows[url]."</a></div></td>
<td ".$tdbgcolor." align=\"center\">".$fecha."</td>
<td ".$tdbgcolor." align=\"right\">".$usergetrows[hitintotal]."</td>
<td ".$tdbgcolor." align=\"right\">".$usergetrows[hitouttotal]."</td>
<td ".$tdbgcolor." align=\"right\"><a href=\"mailto:".$usergetrows[email]."\" target=\"_blank\">".$text_email."</a></td>
<td ".$tdbgcolor." align=\"right\">
<select name=\"".$usergetrows[id]."\">
<option value=\"no\"";
if ($usergetrows[active]=="yes")
{$main_content.=" selected";}
$main_content.=">".$text_no."</option>
<option value=\"yes\"";
if ($usergetrows[active]=="no")
{$main_content.=" selected";}
$main_content.=">".$text_yes."</option>";
$main_content.="
</select>
</td>
<td ".$tdbgcolor." align=\"right\"><a href=\"index.php?do=delete&id=".$usergetrows[id]."&fromsite=".$fromsite."\">".$text_del."</a></td>
<td ".$tdbgcolor." align=\"right\"><a href=\"index.php?do=editaccount&id=".$usergetrows[id]."&fromsite=".$fromsite."\">".$text_edit."</a></td>
<td ".$tdbgcolor." align=\"right\"><a href=\"".$topsiteurl."/members/index.php?do=main&id=".$usergetrows[id]."\" target=\"_blank\">".$text_show."</a></td>
</tr>";
}
$main_content.="
<tr>
<td height=\"42\" colspan=\"11\" bgcolor=\"#FFFFFF\" align=\"right\"><input type=\"hidden\" name=\"ids\" value=\"".$ids."\"><input type=\"hidden\" name=\"sorter\" value=\"".$sorter."\"><input type=\"hidden\" name=\"start\" value=\"".$start."\"><input name=\"Submit\" type=\"submit\" class=\"submitbuton\" value=\"".$text_submit."\"></td>
</tr>
</form>
</table>";
/// Template
if(!file_exists($file))
{echo "The template ".$file." does not exist."; exit;}
$fp1=fopen($file,"r");
$zeile=fread ($fp1, filesize ($file));
include("template.php");
echo $zeile;
exit;
?>