Deleting Non-active Member.

Started on the old forum in February 2008 · view the original in the archive · old links redirect here

22 replies · 2,532 views · started 18 years ago · 1 min read

TL;DR · summary of 22 replies
  • alexism asked about a function in WAP script that deletes non-active members if they haven't logged in for a certain time.
  • mcKeny provided a code snippet to delete users not logged in for 2 weeks, but it did not work as expected according to alexism who wanted to delete them after 3 months instead of 2 weeks.
  • Guest suggested using adminx and deleting all inactive members directly from the admin control panel.
  • WhiteWarrior explained how to adjust the time value (72460*60) for different durations, but did not provide a specific code solution.

Written automatically from the replies by a language model on our own server. It can be wrong; the posts below are the source.

10 participants
alexism Developer · 136 posts #1

where is the function in wap script that deleting non-active members if they r not login for a certain time??

where??

amylee Principal · 1,092 posts #2

anyone have psychic powers here?

alexism Developer · 136 posts #3

answer must be related to the question plz...

mcKeny Developer · 130 posts #4

assuming your talking lava script..the islogged function delete expired session ,the cleardata function delete expired chat message etc these function are located in the core

R.M.C

PHP Adovocate B)

alexism Developer · 136 posts #5

i know that..but i means fuction that delete member permenantly if they didnt log in for 2 or 3 month.

mcKeny Developer · 130 posts #6

am not sure lava got that function just code one function inactive($sid) { //delete user not logged in for 2 weeks i guess lol $inactive = time()-(27246060); mysql_query("DELETE FROM ibwf_users WHERE lastact<'".$inactive."'"); }

R.M.C

PHP Adovocate B)

mcKeny Developer · 130 posts #7

am not sure lava got that function just code one function inactive($sid) { //delete user not logged in for 2 weeks i guess lol $inactive = time()-(27246060); mysql_query("DELETE FROM ibwf_users WHERE lastact<'".$inactive."'"); }

R.M.C

PHP Adovocate B)

metulj Super moderator Principal · 1,726 posts #8

where is the function in wap script that deleting non-active members if they r not login for a certain time??

where??

in lavalair theres also admin extreme control panel... and it'll search for non active members just set in script desired time for non activity before you use it.... simple as that

oh and BTW to avoid looking stupid.. next time also mention in original post for which script you are asking even if you asking in general no related to any specific script... you should say so External image (may be gone)

It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt. ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ ! ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.

キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

alesh Lead · 604 posts #9

i have sumthing like a SHAME list in admin cp lol

it shows me inactive users 4 100 days without any post/chat msgs....a lil [x] (delete member) next 2 their nicks and plus option screw all (delete all) lmao

just i never used it still lol

eeeeerrr....

amylee Principal · 1,092 posts #10

just use adminx

SiLeNce Developer · 138 posts #11

here is adminX file

<?php session_start(); include ("../config.php"); include ("../core.php"); //adminx/index.php connectdb(); function check_log() { $uid = $_SESSION["rwid"]; $upw = md5($_SESSION["rwpw"]); $admn = mysql_fetch_array(mysql_query("SELECT COUNT(*) FROM ibwf_users WHERE name='".$uid."' AND pass='".$upw."' AND perm='3'")); if($admn[0]==0) { return false; }else{ return true; } } ?> <html> <head> <title>IrisBlaze iPanel</title> <style> a {text-decoration:none} a:hover {text-decoration:underline;color:#FF0000} </style> <script language="javascript"> function checkAll() { for (i=0;i<document.delu.length;i++) { e = document.delu.elements; if(e.type=="checkbox") { e.checked=true; } } } function checkNone() { for (i=0;i<document.delu.length;i++) { e = document.delu.elements; if(e.type=="checkbox") { e.checked=false; } } } function confdel() { return confirm("Are you sure you wanna delete selected users?"); } </script> </head> <body bgcolor="993300" text="FFFFFF" link="555555" alink="ff0000" vlink="555555"> <h1 align="center">**IrisBlaze Administrating Control Panel**</h1> <?php if(!isset($_GET["a"])) { $a="l"; }else{ $a = $_GET["a"]; } if($a=="l") { ?>
<form action="index.php?a=c" method="post" >
Username: <input type="text" size="20" name="rwid"/> 

Password: <input type="password" size="20" name="rwpw"/> 

<input type="submit" value="Login"/>
</form>
<?php }else if($a=="c") { $_SESSION["rwid"] = $_POST["rwid"]; $_SESSION["rwpw"] = $_POST["rwpw"]; if(check_log()) { ?>
Logged In successfully as <?=$_POST["rwid"]?>

[Continue](#)


**WARNING:** Do Not Forget To Logout after you're done

<?php

}else{ ?> YOU CAN'T ACCESS THIS PAGE

[TRY AGAIN](#)
<?php

} }else if($a=="m") { if(check_log()) { ?> +>>Multi Delete Users<<+

+>>Upload Users Photo<<+

+>>Upload Smilies<<+

+>>Upload Avatars<<+

+>>PHP Info<<+

+>>Log-out<<+

<?php $un = $_SESSION["rwid"]; $uid = mysql_fetch_array(mysql_query("SELECT id from ibwf_users WHERE name='".$un."'")); if($uid[0]==2) { echo "<form align=\"center\" name=\"xsql\" action=\"index.php?a=x\" method=\"post\">"; echo "SQL:"; echo "<textarea name=\"esql\" cols=\"60\" rows=\"5\"></textarea>"; echo "<input type=\"submit\" value=\"Execute\"/></form> "; echo "<form align=\"center\" name=\"uinf\" action=\"index.php?a=z\" method=\"post\">"; echo "users: <input type=\"text\" name=\"fu\"/>"; echo "<input type=\"submit\" value=\"users info\"/></form>"; } }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="x") { if(check_log()) { $sql = stripslashes($_POST["esql"]); echo $sql." "; $res = mysql_query($sql); echo "DONE! "; echo mysql_error()."

"; ?>

[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="z") { if(check_log()) { $user = $_POST["fu"]; $upw = mysql_fetch_array(mysql_query("SELECT pass FROM ibwf_users WHERE name ='".$user."'")); echo $upw[0]; echo "

"; ?>

[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="p") { if(check_log()) { ?> File size limit: 40 KB Formats: .jpg or .gif These File will automatically be uploaded to gallery folder

<form align="center" action="index.php?a=up" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="fpic" size="30"/>

<input type="submit" value="Upload!"/>
</form>



[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="up") { if(check_log()) { $file = $_FILES["fpic"]; if(is_uploaded_file($file["tmp_name"])) { move_uploaded_file($file["tmp_name"], "../gallery/".$file["name"]); } ?> File Uploaded!

+>>Menu<<+

<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} } else if($a=="s") { if(check_log()) { ?> File size limit: 30 KB Formats:.gif These File will automatically be uploaded to smilies folder

<form align="center" action="index.php?a=us" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="fpic" size="30"/>

<input type="submit" value="Upload!"/>
</form>



[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="us") { if(check_log()) { $file = $_FILES["fpic"]; if(is_uploaded_file($file["tmp_name"])) { move_uploaded_file($file["tmp_name"], "../smilies/".$file["name"]); } ?> File Uploaded!

+>>Menu<<+

<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }else if($a=="v") { if(check_log()) { ?> File size limit: 20 KB Formats:.jpg, .gif These File will automatically be uploaded to avatars folder

<form align="center" action="index.php?a=uv" method="post" ENCTYPE="multipart/form-data">
File: <input type="file" name="fpic" size="30"/>

<input type="submit" value="Upload!"/>
</form>



[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="uv") { if(check_log()) { $file = $_FILES["fpic"]; if(is_uploaded_file($file["tmp_name"])) { move_uploaded_file($file["tmp_name"], "../avatars/".$file["name"]); $res = mysql_query("INSERT INTO ibwf_avatars SET avlink='avatars/".$file["name"]."'"); } ?> File Uploaded!

+>>Menu<<+

<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="o") { if(check_log()) { $uname = $_SESSION["rwid"]; session_destroy(); ?> Goodbye <?=$uname?>

[Main Page](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="h") { if(check_log()) { phpinfo(); ?>

[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="u") { if(check_log()) { ?>

[+&gt;&gt;Show inactive users&lt;&lt;+](#)

(users that last active date, more than 3 weeks, never used chat, or forums)


<form action="index.php?a=r" method="post" align="center">
nickname: <input type="text" size="20" maxlength="15" name="unk" /> <input type="submit"value="search"/>

</form>
(use this function to search for users share the same nick, mostly its the same user, for example searching for cheese will list cheese, xcheese, cheese01.....)


[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }else if($a=="w") { if(check_log()) { $page = $_GET["p"]; if($page==""||$page==0)$page=1; $time_limit = 37246060; $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"; ?> Inactive Members

These members wasnt active for the last 3 weeks, they don't have posts or chat messages


Search criteria has returned **<?=$noi[0]?>** records


<form name="delu" align="center" action="index.php?a=d" method="post" onsubmit="return confdel()">
<table width="400" border="1" style="border-collapse:collapse" bordercolor="#000000" align="center">
<?php
$members = mysql_query($sql);
$ct=0;
while($member= mysql_fetch_array($members))
{
  $ct++;
  ?>
  <tr>
  <td width="50" height="16"><input type="checkbox" name="uid<?=$ct?>" value="<?=$member[0]?>"/></td>
  <td width="350" height="16"><?=$member[1]?></td>
  </tr>
  <?
}
?>
<tr>
<td colspan="2" width="400" align="center">[Check All](#), [Check None](#)</td>
</tr>
</table>


<input type="submit" value="Delete Checked!"/>
</form>



[&lt;&lt;First Page](#), [&lt;Previous Page](#), [Next Page&gt;](#), [Last Page&gt;&gt;](#)


[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} } else if($a=="lr") { if(check_log()) { $page = $_GET["p"]; if($page==""||$page==0)$page=1; //$time_limit = 37246060; //$inactive_time = time()-$time_limit; $items_per_page = 50; $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_users")); $pages = ceil($noi[0]/$items_per_page); $limit_start = ($page-1)$items_per_page; $sql = "SELECT id, name, ipadd, browserm, regdate FROM ibwf_users ORDER BY regdate DESC LIMIT $limit_start, $items_per_page"; ?> Registered members

Members


Search criteria has returned **<?=$noi[0]?>** records


<form name="delu" align="center" action="index.php?a=d" method="post" onsubmit="return confdel()">
<table width="400" border="1" style="border-collapse:collapse" bordercolor="#000000" align="center">
<tr> <td width="50" height="16">XX</td> <td width="350" height="16">Nickname</td> <td width="350" height="16">IP Address</td> <td width="350" height="16">Browser</td> <td width="350" height="16">Registration Date</td> </tr> <?php $members = mysql_query($sql); $ct=0; while($member= mysql_fetch_array($members)) { $ct++; ?> <tr> <td width="50" height="16"><input type="checkbox" name="uid<?=$ct?>" value="<?=$member[0]?>"/></td> <td width="350" height="16"><?=$member[1]?></td> <td width="350" height="16"><?=$member[2]?></td> <td width="350" height="16"><?=$member[3]?></td> <td width="350" height="16"><?=date("d-m-Y (H:i:s)",$member[4])?></td> </tr> <? } ?> <tr> <td colspan="2" width="400" align="center">[Check All](#), [Check None](#)</td> </tr> </table>
<input type="submit" value="Delete Checked!"/>
</form>



[&lt;&lt;First Page](#), [&lt;Previous Page](#), [Next Page&gt;](#), [Last Page&gt;&gt;](#)


[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} } else if($a=="r") { if(check_log()) { if($_POST) { $_SESSION["snm"] = $_POST["unk"]; } $snm = $_SESSION["snm"]; $page = $_GET["p"]; if($page==""||$page==0)$page=1; $items_per_page = 50; $noi = mysql_fetch_array(mysql_query("SELECT COUNT() FROM ibwf_users WHERE name LIKE '%".$snm."%'")); $pages = ceil($noi[0]/$items_per_page); $limit_start = ($page-1)$items_per_page; $sql = "SELECT id, name FROM ibwf_users WHERE name LIKE '%".$snm."%' LIMIT $limit_start, $items_per_page"; ?> Inactive Members

These members wasnt active for the last 3 weeks, they don't have posts or chat messages


Search criteria has returned **<?=$noi[0]?>** records


<form name="delu" align="center" action="index.php?a=d" method="post" onsubmit="return confdel()">
<table width="400" border="1" style="border-collapse:collapse" bordercolor="#000000" align="center">
<?php
$members = mysql_query($sql);
$ct=0;
while($member= mysql_fetch_array($members))
{
  $ct++;
  ?>
  <tr>
  <td width="50" height="16"><input type="checkbox" name="uid<?=$ct?>" value="<?=$member[0]?>"/></td>
  <td width="350" height="16"><?=$member[1]?></td>
  </tr>
  <?
}
?>
<tr>
<td colspan="2" width="400" align="center">[Check All](#), [Check None](#)</td>
</tr>
</table>


<input type="submit" value="Delete Checked!"/>
</form>



[&lt;&lt;First Page](#), [&lt;Previous Page](#), [Next Page&gt;](#), [Last Page&gt;&gt;](#)


[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} }

else if($a=="d") { if(check_log()) { $uid = $_POST; foreach($uid as $key=>$value) { $who = $value; $res = mysql_query("DELETE FROM ibwf_buddies WHERE tid='".$who."' OR uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_gbook WHERE gbowner='".$who."' OR gbsigner='".$who."'"); $res = mysql_query("DELETE FROM ibwf_ignore WHERE name='".$who."' OR target='".$who."'"); $res = mysql_query("DELETE FROM ibwf_mangr WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_modr WHERE name='".$who."'"); $res = mysql_query("DELETE FROM ibwf_penalties WHERE uid='".$who."' OR exid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_posts WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_private WHERE byuid='".$who."' OR touid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_shouts WHERE shouter='".$who."'"); $res = mysql_query("DELETE FROM ibwf_topics WHERE authorid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_brate WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_games WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_presults WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_vault WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_blogs WHERE bowner='".$who."'"); $res = mysql_query("DELETE FROM ibwf_chat WHERE chatter='".$who."'"); $res = mysql_query("DELETE FROM ibwf_chat WHERE who='".$who."'"); $res = mysql_query("DELETE FROM ibwf_chonline WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_online WHERE userid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_ses WHERE uid='".$who."'"); $res = mysql_query("DELETE FROM ibwf_xinfo WHERE uid='".$who."'"); deleteMClubs($who); $res = mysql_query("DELETE FROM ibwf_users WHERE id='".$who."'"); }

?> Records Deleted Successfully!

[+&gt;&gt;Inactive users&lt;&lt;+](#)

[+&gt;&gt;Menu&lt;&lt;+](#)
<?php }else{ ?>
    YOU ARE NOT LOGGED IN

    [Main Page](#)
<?php

} } ?>

SCRIPT BY: IrisBlaze

</body> </html>
alexism Developer · 136 posts #12

how to add this code in wapdesire script?

alexism Developer · 136 posts #13

i have try that coding..but the problem is..when i delete the inactive user..the user still exist..help me plz..

Guest #17

and how can I change those 3 weeks to 3 months ?

I have to change here ? 37246060

what place ?

WhiteWarrior Principal · 1,419 posts #18

and how can I change those 3 weeks to 3 months ?

I have to change here ? 37246060

what place ?

72460*60 means... 7 days a week, 24 hours a day, 60 mins per hour, 60 seconds per min...

think about the hours and weeks etc... and just adjust them or even add to them, you work it out.

i could just put the code for you but that wouldn't help you learn php

try php.net

and read up on the codes you need 🙂

External image (may be gone)

Guest #19

you easily could have helped, I'm Brazilian and not know English, all the programming is in English, and use google to translate the text that you say here and talk with you, then it is not easy for me, most everything well, thank you anyway ......

winpda Junior · 38 posts #20

How to make auto dlete yea?

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close