idle user delete
Started on the old forum in November 2009 · view the original in the archive · old links redirect here
hey i have the lavalair version if this helps.........
This is the link to idle members
echo "<a href=\"ownercp.php?action=idlemembers&sid=$sid\">Idle Members List</a><br/>";
This is the code in ownercp
//////////////////////////////////////// idle members
else if($action=="idlemembers")
{
echo "<head>";
echo "<title>Owner Tools</title>";
echo "<link rel=\"stylesheet\" type=\"text/css\" href=\"../themes/$theme[0]\">";
echo "</head>";
echo "<b>Idle Members</b><br/>";
$timeout2 = 1209600;
$timeon2 = time()-$timeout2;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact>'".$timeon2."'"));
echo "Current Number of Idle Members:".$noi[0]."<br/><br/>";
$tdte = date("d m y-H:i:s", $timeon2);
echo "Idle Date: $tdte,<br/>Only Members Who have NOT been online after this date are displayed below<br/><br/>";
$nolq = mysql_query("SELECT * FROM ibwf_users WHERE lastact<'".$timeon2."'");
while ($row=mysql_fetch_array($nolq))
{
echo "Username: <a href=\"index.php?action=viewuser&who=$row[id]&sid=$sid\">$row[name]</a>";
echo "<br/>";
$jdt = date("d m y-H:i:s",$row[lastact]);
echo "Last Online: $jdt <br/><br/>";
}
echo "<br/><b>9 </b><a accesskey=\"9\" href=\"ownercp.php?action=admincp&sid=$sid\"><img src=\"../images/admn.gif\" alt=\"\"/>Admin Tools</a><br/>";
echo "<b>0 </b><a accesskey=\"0\" href=\"index.php?action=main&sid=$sid\"><img src=\"../images/home.gif\" alt=\"\"/>Home</a>";
echo "</p>";
echo "</body>";
}
This is the sql just insert into your ibwf_users
`lastact` int(100) NOT NULL DEFAULT '0',
hope this helps you
// convert seconds into month $b = $time_wait; // time to wait - default 3 month - after last visit - 3 month in seconds $c = $time_month; // time - default 1 month - seconds for 1 month - 1 month in seconds $a = $b/$c; // difference total seconds / seconds for 1 month => number of month
$e = $time_delete_final/$time_month;
// start delete users with no visits in 4 month - default
$dulv = "SELECT username, last_visit FROM users WHERE presence < ".$now." - '$time_delete_final' ORDER BY presence DESC";
$result = mysql_query($dulv);
or proceed to delete.... remember this is a little example.
u can modify this
<?php
}
}else if($a=="w")
{
if(check_log())
{
$page = $_GET["p"];
if($page==""||$page==0)$page=1;
$time_limit = 3*7*24*60*60;
$inactive_time = time()-$time_limit;
$items_per_page = 50;
$noi = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE lastact<'".$inactive_time."' AND chmsgs='0' AND posts='0'"));
$pages = ceil($noi[0]/$items_per_page);
$limit_start = ($page-1)*$items_per_page;
$sql = "SELECT id, name FROM ibwf_users WHERE lastact<'".$inactive_time."' AND chmsgs='0' AND posts='0' LIMIT $limit_start, $items_per_page";
?>
it shows inactive users
com site: http://vampist.net download site: http://wapdloads.net fb: http://www.facebook.com/pmplx