View Full Version : Hunt out Inactive Users
Takara
05-08-2002, 10:00 PM
I made this cause someone asked for it in the requests. I'm not even sure if it counts as a hack (just two lines of code to hack :p)!
Basically you plop the inactiveusers.php down in your admin dir. It will list all your users, show important info such as When they were last active, when they last posted, when they joined etc.
If they havent posted at all, and have been a user for more than 3 days (you can specify how many days) then it will say they are inactive! And if you click the "YES!" link (under the Inactive? column) it will let you delete the person (it prompts you first).
You can add a link to the admin CP. Here are the 'full' steps on how to install the 'hack':
Step One: open index.php in your admin folder
Find:
makenavoption("Build Mailing List","email.php?action=genlist");
REPLACE WITH:
makenavoption("Build Mailing List","email.php?action=genlist","<br>");
makenavoption("Find Inactive Users","inactiveusers.php?");
Step Two:
Copy inactiveusers.php (attached below) into your admin folder
And you're done! hard, eh ;p
I was going to add the option to specifiy how many users per page since this would be bad for larger forums. But I couldnt figure it out. If anyone wants to give me a hand with that I would appreciate it.
Have fun ^_^ :bunny:
[EDIT: This hack is really old, and currently nothing (other than stuff on the first page) is added in this hack. I'll update this soon with something new for you guys with mods form this thread. Aswell there was a small update on post #29, go here for the update: https://vborg.vbsupport.ru/showthread.php?postid=249719#post249719 ]
Takara
05-09-2002, 04:50 AM
Screen shot ^-^
scsa20
05-09-2002, 04:55 AM
thanks :D
Admin
05-09-2002, 04:58 AM
Nice, could be useful.
Takara
05-09-2002, 05:03 AM
Could be, but there is that problem of it loading all 10 000 users on one page (for you Fire), lol. Do you think you could direct me in the right direction on how to add 'pages' for this hack? I took a look but got confused @_@;
Aswell I used your instructions on how to do alternating table columns ^_^ thanks
Admin
05-09-2002, 05:10 AM
Check out icon.php there's some pagination code there.
Takara
05-09-2002, 05:12 AM
Thanks :)
I'll take a look at it and see if I can manage to put something together, hehe.
dadymac
05-09-2002, 05:14 AM
oh man, u just made my life a million times easier
SaintDog
05-09-2002, 05:36 AM
Nice hack, no matter how small, it plays a pretty good role in forum management. Many forums could benifit from this hack, I know when I actually get around to finishing my community and releasing it, I will be using this as I can not stand having people take up database space if they have no actual intention of posting.
Nice Work, I knew someone would finally get around to doing it ;).
- SaintDog
Slynderdale
05-09-2002, 05:39 AM
Originally posted by SaintDog
Nice hack, no matter how small, it plays a pretty good role in forum management. Many forums could benifit from this hack, I know when I actually get around to finishing my community and releasing it, I will be using this as I can not stand having people take up database space if they have no actual intention of posting.
Nice Work, I knew someone would finally get around to doing it ;).
- SaintDog
Just do what i do, bug the heck out of them till they start posting, works for me lol
adtestvb
05-09-2002, 06:11 AM
sweet, thanks
Takara
05-09-2002, 06:19 AM
Originally posted by Slynderdale
Just do what i do, bug the heck out of them till they start posting, works for me lol [/B]
I hate you >:|
lol, jk ;)
Boofo
05-09-2002, 06:36 AM
Found a problem. It shows the exact same date and time for the last post of anyone who has ever posted.
Takara
05-09-2002, 06:53 AM
eurgh, I cant make anything without it having atleast one bug ;p
Just re-download the php file attached above >.< I updated it.
Admin
05-09-2002, 09:35 AM
Code looks the same to me...
KuraFire
05-09-2002, 10:18 AM
What exactly does this hack do, except list all users and give an indication if they are inactive???
Does it allow you to delete all inactive ones with one click? Or send a mail to all of the inactive ones???
@ Firefly: I was going to ask the exact same thing :-)
@ Takara: Also, can you make it where you have the option to e-mail all the inactive users so they know they will be deleted in say one week. Last warning note or something :-)
- djr
ceo_tfw
05-09-2002, 11:26 AM
this is more like a visual addition to your adminCP that allows you to see members that NEVER post or inactive. there is also a quick delete user (YES) at the end of the query
I find this a brilliant addition
inetd
05-09-2002, 12:40 PM
How make to Super Moderators can use this hack?
ceo_tfw
05-09-2002, 12:52 PM
As far as I know the administrator of the forum & website have to give you administrative permissions to the forum you are querying about to access the control panel, however if this person knows you and trusts you then it will work with this additionÂ…Â…?
however there might be another way, not to sure
scsa20
05-09-2002, 01:01 PM
you basicly do the same why as you installed it for the admin cp but in the mod cp ;)
Frank
05-09-2002, 01:27 PM
Nice hack :)
inetd
05-09-2002, 01:31 PM
I need next:
If the user did not come on a forum of XX days, irrespective of quantity of his reports - he inactive
If at the user of 0 reports - he too inactive
Help me.
Siggi
05-09-2002, 02:14 PM
:D :D :D :D Nice hack :D :D :D
:bandit: :bandit: THX :bandit: :bandit:
bonnmac
05-09-2002, 02:59 PM
Very nice... thanks :)
NTLDR
05-09-2002, 06:05 PM
Another usefull and good adition for my board Takara, many thanks :D
Takara
05-09-2002, 06:49 PM
Just to clear it up for some people.
What it does is lists every user on your forums. If the user has NEVER posted, and the user has been a member of your forums for 3 days (you can change that specific amount of days) then it tells you they are inactive. If you click the 'YES!' link, indicating they are inactive, you can delete that person.
And Firefly, yea the code was the same, lol. <-- stupid :bunny:
Takara
05-09-2002, 07:04 PM
Originally posted by inetd
How make to Super Moderators can use this hack?
Well, it wasnt made for non admins.. It uses the cpheader(); and in there it requires you to be have access to the control panel. I'm not aware of any supermoderatorheader();
lol
Takara
05-09-2002, 07:09 PM
Originally posted by inetd
I need next:
If the user did not come on a forum of XX days, irrespective of quantity of his reports - he inactive
If at the user of 0 reports - he too inactive
Help me.
lol, what a very nice request ;p
Anyway, find this in the inactiveusers.php $isinactive=$ddate-$row["joindate"];
if (($row["lastpost"]==0)&&($isinactive>$timeactive)) {
$yninactive="<font color=\"#FF0000\"><a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'>YES!</a></font>";
} else {
$yninactive="No</font>";
}if you just take out the $row["lastpost"]==0 part it will do what you want (thought I'm not sure what you mean by.. 'too inactive'.
So replace the code above with: $isinactive=$ddate-$row["joindate"];
if ($isinactive>$timeactive) {
$yninactive="<font color=\"#FF0000\"><a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'>YES!</a></font>";
} else {
$yninactive="No</font>";
}
That auta do it. But I attached the updated file for you.
ZiRu$
05-09-2002, 07:47 PM
beautiful! I requested something like this
takara, good job :)
not sure, but does it email automatically the user if deleted?
i dont know if this is default in VB... :)
Takara
05-09-2002, 07:55 PM
uuummm, I'm not really sure you know. It uses vB's built in deleting functions. I was going to add an option to be able to email the person, however it required some editing of some additional files. (adding value="$userid" etc to the email forum in the admin CP, so the hack can just easily refrence the page and have it complete its self. a simple thing).
If you still want it I'll go ahead and give you it :p
BrAinZ
05-09-2002, 08:04 PM
Is there any way this can be adapted to show anyone who hasn't visited the board for a specified number of days?
I want to "cull" any users who MAY have posted in the past, but haven't logged into the board for a while.
Any ideas?
i personally think is really important to let the user know he(she) was deleted. :)
BrAinZ
05-09-2002, 08:17 PM
Originally posted by nakkid
i personally think is really important to let the user know he(she) was deleted. :)
Yeah I agree with that.. only curteous :)
Thanks for the hack by the way.. very useful!
Takara
05-09-2002, 08:26 PM
Originally posted by BrAinZ
Is there any way this can be adapted to show anyone who hasn't visited the board for a specified number of days?
I want to "cull" any users who MAY have posted in the past, but haven't logged into the board for a while.
Any ideas?
I alredy made a version like this :p
https://vborg.vbsupport.ru/showthread.php?postid=249719#post249719
midad
05-09-2002, 08:46 PM
Great hack Takara I've been looking for such hack for a while. Can we put an option to send inactive users for 30 days for example a default e-mail. Just to let them know that we still care about them.....!!! can anyone do that for me please :)
Installed of course....
BrAinZ
05-09-2002, 08:51 PM
This is good.. but it makes it difficult to see exactly WHO you should delete.
Needs to ONLY say "YES" if they have not VISITED the site for the last XX days.
Is that possible ?
BrAinZ
05-09-2002, 08:55 PM
Thanks Takara, still needs to be a little easier to use for lazy gits like me though :)
BrAinZ
05-09-2002, 09:13 PM
I've ALMOST done it myself... but whats the difference between "Last Visit" and "Last Activity" ?
This is what I have so far:
Find this...
if (($row["lastpost"]==0)&&($isinactive>$timeactive))
and replace with:
$inactivedays=$ddate-$row["lastvisit"];
if (($inactivedays>$timeactive)&&($isinactive>$timeactive)) {
Boofo
05-09-2002, 09:40 PM
Takara,
Is there any way that you can make it so it will follow however we have the date and time set up on our boards individually? I went in and tried to edit the date and time in the php file but it wouldn't wrap the date right when I did. Also, in order to make the RED color appear for the YES option on Inactive?, I had to move the font color to just before the YES word. Like this:
$yninactive="<a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'><font color=\"#FF0000\">YES!</a></font>";
or it wouldn't show YES in red. Just thought you might want to know. :)
And thanks for the fix! It works great now!
Boofo
05-09-2002, 10:01 PM
Sorry about this Takara, but I noticed that when you enter another amount of days to check for in the Days Inactive box, when you click submit, the number reverts back to 3 instead of staying at whatever number you put in there. Wouldn't it be better to stay at the new number until you change it again so you can tell by looking at it how many days you specified the last time you changed it? :)
Also, I tried the inactiverusers-se file you have up here and it said YES in the last column of users that had posted today and left messages today also. Is that how it is supposed to work? Just curious. :)
Takara
05-10-2002, 12:28 AM
Originally posted by Boofo
Is there any way that you can make it so it will follow however we have the date and time set up on our boards individually?
I'm not quite sure what you mean >.<
But thanks for the suggestions you two. I've updated both PHP files ^-^ :bunny:
Boofo
05-10-2002, 04:05 AM
I have my date showing as May 6, 2002 and my time showing as 5.45 pm on the board. Is there any way to have it show in the listing according to how we have it set on our board? I tried changing it in the php file, but it didn't wrap the time right when I did.
BrAinZ
05-10-2002, 06:07 AM
Thanks for the FONT COLOUR fix Boofo, I thought it should be in RED :)
So now we just need a ONE CLICK.. DELETE and EMAIL (individual or ALL Yes's) :)
midad
05-10-2002, 06:46 AM
Takara please could you please answer my question in post # https://vborg.vbsupport.ru/showthread.php?postid=249758#post249758 (Takara please could you please answer my question in post # 37
I really need that :(
Boofo
05-10-2002, 06:48 AM
The font color=red was already there, just had it in the wrong spot. :)
The one Click idea would be a good addition. (Hint...Hint...) :)
Takara
05-10-2002, 07:18 AM
You're guys requests are getting beyond my abilities ;p
But, I'll look at it never the less. and see what I can do.
Boofo
05-10-2002, 07:32 AM
Sorry about that. If you can get the time thing set (or tell me how to so it wraps right), I'll be happy with that. :)
By the way...what is the main difference between the standard file and the se file you made? Just curious. :)
KuraFire
05-10-2002, 08:38 AM
I think that I'll stick to running a phpMyAdmin query after giving a warning, first..
Much easier, and with one hit on the Enter button, all users who didn't heed the warning and stayed inactive, are all deleted... :)
Boofo
05-10-2002, 12:14 PM
Waht query is that? And what does it exacly do?
Boofo
05-10-2002, 03:50 PM
Takara,
The number you enter in the top box for how many days you want to check for still reverts back to 3 instead of staying at the number you have chosen. Is there any way to make this number configurable or to at least stay in the box until you change it again? :)
BrAinZ
05-10-2002, 06:38 PM
Originally posted by KuraFire
I think that I'll stick to running a phpMyAdmin query after giving a warning, first..
Could you explain in more detail please?
IllNation
05-11-2002, 12:29 PM
help me out..I try to get the inactiveusers.php file and it won't let me, I want to open it in a text file but I need to know how
MrBojangle1
05-11-2002, 10:49 PM
Nice hack. I have been lookin for one like this
Could we also maybe see something that would aloow us to find users who have only a said amount of posts but have been members longer then a said amoutn of time?
Ihsahn
05-14-2002, 07:50 AM
I downloaded your hack and tested it and i felt something wrong ...
members were called inactive even if they are not ...
so, i just made a little change to your code:
Find
$isinactive=$ddate-$row["joindate"];
and Replace by
$isinactive=$ddate-$row["lastactivity"];
for me, its ok now ;)
Cheers
Ihsahn
Webmasta XT
05-14-2002, 08:45 AM
ehh can you add a function to mail the inactive users for there last chance to go active or they will be deleted in 2 or 3 days?
just a question..
Fatty_Bolger
05-19-2002, 05:58 AM
Thanks Takara!!! Works like a champ. Hopefully they delete option will be seldom used!! ;)
StarBuG
05-24-2002, 12:42 PM
Thx for the hack!
Looks great! I have a suggestion to make it more usefull (at least for me).
In your hack if u click on a username you are linkt to the users Profil! I don?t need to view the profile from the user I want the admin user menu! So I tempered a little with your code!
to do the changes open inactiveusers.php
find:
echo ("<tr class=\"$bgcolor\"><td align=\"left\">".$row["userid"]."</td><td align=\"left\"><a href='../member.php?s=$session[sessionhash]&action=getinfo&userid=$row[userid]' target='_blank'>".$row["username"]."</a></td><td align=\"left\">$extendateJD</td><td align=\"left\">$lastpost</td><td align=\"left\">$extendateLA</td><td align=\"center\">".$row["posts"]."</td><td align=\"left\">".$row["ipaddress"]."</td><td align=\"left\">$yninactive</td></tr>");
replace it with:
echo ("<tr class=\"$bgcolor\"><td align=\"left\">".$row["userid"]."</td><td align=\"left\"><a href='user.php?s=$session[sessionhash]&action=edit&userid=$row[userid]'>".$row["username"]."</a></td><td align=\"left\">$extendateJD</td><td align=\"left\">$lastpost</td><td align=\"left\">$extendateLA</td><td align=\"center\">".$row["posts"]."</td><td align=\"left\">".$row["ipaddress"]."</td><td align=\"left\">$yninactive</td></tr>");
then save it and re upload
Thx again for your hack!!
Greetings
StarBuG
voogru
05-24-2002, 04:55 PM
i have 100+ inactive members..Umm how do i Mass delete?
Floris
06-05-2002, 08:43 AM
I was just wondering.
In the screenshot from post 2, and sorry if this already has been mentioned, you can see Rahvin having last post to NEVER, and posts colums says 0, but Redemption 09 also has posts to zero, yet he has last post date, and not never. ERR ?
takara, could you please be kind and let ur know if the attachment in the first post have all the mods listed in the thread?
thanks.
Look at this piece of code in inactiveusers.php
while ($row=$DB_site->fetch_array($result) and ++$bgcounter) {
$bgcolor = iif($bgcounter%2==0, 'firstalt', 'secondalt');
$ddate=time();
$isinactive=$ddate-$row["joindate"];
if (($row["lastpost"]==0)&&($isinactive>$timeactive)) {
$yninactive="<a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'><font color=\"#FF0000\">YES!</font></a>";
} else {
$yninactive="No</font>";
}
if ($row["lastpost"]==0) {
$lastpost="<font color=\"red\">NEVER</font>";
}else {
$timefull=time();
$lastpost=date("m-d-Y h:i A", $row["lastpost"]);
}
$extendateLA=date("m-d-Y h:i A", $row["lastactivity"]);
$extendateJD=date("m-d-Y h:i A", $row["joindate"]);
echo ("<tr class=\"$bgcolor\"><td align=\"left\">".$row["userid"]."</td><td align=\"left\"><a href='../member.php?s=$session[sessionhash]&action=getinfo&userid=$row[userid]' target='_blank'>".$row["username"]."</a></td><td align=\"left\">$extendateJD</td><td align=\"left\">$lastpost</td><td align=\"left\">$extendateLA</td><td align=\"center\">".$row["posts"]."</td><td align=\"left\">".$row["ipaddress"]."</td><td align=\"left\">$yninactive</td></tr>");
}
in this if-else structure
if (($row["lastpost"]==0)&&($isinactive>$timeactive)) {
$yninactive="<a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'><font color=\"#FF0000\">YES!</font></a>";
} else {
$yninactive="No</font>";
}
delete the else {.....}, and move the closing } for the if to right before the closing } for the while loop. The altered code looks like this:
while ($row=$DB_site->fetch_array($result) and ++$bgcounter) {
$bgcolor = iif($bgcounter%2==0, 'firstalt', 'secondalt');
$ddate=time();
$isinactive=$ddate-$row["joindate"];
if (($row["lastpost"]==0)&&($isinactive>$timeactive)) {
$yninactive="<a href=\"user.php?s=$session[sessionhash]&action=remove&userid=".$row["userid"]."\" target='_blank'><font color=\"#FF0000\">YES!</font></a>";
if ($row["lastpost"]==0) {
$lastpost="<font color=\"red\">NEVER</font>";
}else {
$timefull=time();
$lastpost=date("m-d-Y h:i A", $row["lastpost"]);
}
$extendateLA=date("m-d-Y h:i A", $row["lastactivity"]);
$extendateJD=date("m-d-Y h:i A", $row["joindate"]);
echo ("<tr class=\"$bgcolor\"><td align=\"left\">".$row["userid"]."</td><td align=\"left\"><a href='../member.php?s=$session[sessionhash]&action=getinfo&userid=$row[userid]' target='_blank'>".$row["username"]."</a></td><td align=\"left\">$extendateJD</td><td align=\"left\">$lastpost</td><td align=\"left\">$extendateLA</td><td align=\"center\">".$row["posts"]."</td><td align=\"left\">".$row["ipaddress"]."</td><td align=\"left\">$yninactive</td></tr>");
}
}
You're welcome in advance :)
Nice hack, works like a charm.
Beware zero posters! ;)
inetd
07-31-2002, 02:46 AM
Size, big thx for addon ;)
mewgood
08-20-2002, 12:10 AM
how do you delete the inactive user? like mass delete
wolfe
09-01-2002, 02:53 PM
can someone please help on this hack i have added all the above but it is saying i am inactive and i am admin i am online but it still says i am inactive.
wolfe
09-03-2002, 09:26 PM
* wolfe BUMPS post and Crys for help :D HELP!!!
Illuvatar
09-06-2002, 08:19 PM
Hey Takara!
/me moves site to new server, installs VB 2.2.7, re-applies this most excellent hack!
lol
Works like a charm.....again!
Many thanks,
Illu
Illuvatar
09-06-2002, 10:57 PM
Wolfe...
The only thing I can think of is that you have tried to apply that addition to the original hack which removed the (($row["lastpost"]==0) in order to try and get it to show all inactive users REGARDLESS of thier post count.
When I removed that piece, EVERYONE that has been registered over 1 day showed as inactive, no matter how many days I told it to search for!
So, now I'm just trying to figure out how to code php so that I can get it to search out maybe folks with less than 5 posts and no actvity for 30 days.....
Wish me luck...
I'll poster an answer here if I find one.
Illuvatar
09-10-2002, 04:21 AM
Well folks....no joy :ermm:
I researched php coding and tried several adjustments to the equation ==0, I tried <=5 as it should be, but that didn't work!
Can anyone sort this?
It would be so great if you could plug in 30 days and see how many folks are inactive regardless of thier post counts.
If you just remove the post count bit from the code as indicated in an earlier post, everyone EXCEPT for those that registered on the day you run the search show as inactives.
/me begs for help!!!
Takara
09-10-2002, 04:53 AM
Originally posted by TECK
takara, could you please be kind and let ur know if the attachment in the first post have all the mods listed in the thread?
thanks.
Unfortunatly not. This little thing is just a bunch of sloppy code by me. I didn't think people would actually ever use it. If anyone has a moded version I'll put it in the original thread.
Unfortunatly I no longer maintain a vB and I don't really have much time. I just stoped by for a view. If no one posts an updated version I supose I could take a look through the entire thread and put something together with the modifications.
Takara
09-10-2002, 05:01 AM
Originally posted by xiphoid
I was just wondering.
In the screenshot from post 2, and sorry if this already has been mentioned, you can see Rahvin having last post to NEVER, and posts colums says 0, but Redemption 09 also has posts to zero, yet he has last post date, and not never. ERR ?
Thats because I had a testing forum where posts don't increase post count. red hadn't posted anywhere else but that forum. Sorry about that confusion
Dynamic One
11-10-2002, 07:08 PM
Thanks for this handy code m8.
wolfe
11-22-2002, 11:18 PM
there is a problem 0 posters aren ot the only none active members what about the people who have notposted for 1 mounth can you add this :D
spaceb
11-28-2002, 06:24 PM
this is the problem it should show you the members who was inactive for 3 days as inactive but i have member that not active already a month but it still show him as active and i cant change the number of days its always on 3 days and it impposible to change it it always stays on 3 :(
]|fre$h-LoRd|[
12-23-2003, 09:38 PM
Very fine work, thank you!
Illuvatar
04-10-2004, 11:55 PM
Has anybody tried this or made any mods that would allow me to use it with VB 3.0 Gold?
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.