vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Beta Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=5)
-   -   Find, Optionally Email and Optionally Delete Inactive Members (https://vborg.vbsupport.ru/showthread.php?t=48964)

amykhar 02-15-2003 10:00 PM

Find, Optionally Email and Optionally Delete Inactive Members
 
This hack is designed to allow you to:

a) Find users who have not logged in to your board in X days. X is configurable by you in the control panel.

b) Email the inactive users. When the email is set, the date is recorded so that you will not email them again within X days

c) Delete the inactive users. This can happen in two ways:
1) If you don't have email users set, it will simply delete users who have not logged in to your forums in the past X days.
2) If you have emails turned on, it will delete users who have not logged in during the past X days AND who were sent the warning email more than 15 days before.

The email is a template configurable by you.

Here is how this hack will behave:

If you have email on and delete off, it will email inactive users every X days.

If you have email on and delete on, it will email a warning then delete 15 days later.

If you have emails off and delete on, it will delete users who have been incactive for X days.

If you have email off and delete off, it will list the inactive users for you in a very crude plain text list.

This is not a hack for newbies. If you don't know how to run Queries, don't touch this hack. It is still In Beta. If I get bored and ambitious, I will write an install script and make it idiot-proof.

Screen Shots to Follow

I will Support this hack for users with some hacking experience. I will fix bugs. I will not teach hacking basics though.

!Important - After You Install the hack, go to your Control Panel and Set the Options! Otherwise it will NOT work.

amykhar 02-16-2003 12:13 AM

This shows that this hack is configured under the Options Section of your Control Panel.

amykhar 02-16-2003 12:14 AM

Configuring the Options is easy:

Koutaru 02-16-2003 12:55 AM

Great hack! I know a lot of people who are looking for this-- I'll check it out :)

afterlab 02-16-2003 01:26 AM

Nice. A great use for us over at FFR. Thanks greatly.

amykhar 02-16-2003 01:29 AM

Let me know how it works, OK? The email message template needs work. You should probably include the url to your board and maybe a link to the reset password form.

Amy

empreur76 02-16-2003 08:09 AM

great hack !! thx

Tim Wheatley 02-16-2003 09:24 AM

Yeah it works, needed to make some small mods etc, but it certainly works fine. Superb work. :)

One problem I had was with running the query to enter 68,Inactivememberoptions,68 into the settinggroupid table. I did it manually - not sure if there's a problem with your query?

ULTIMATESSJ 02-16-2003 11:48 AM

heh great, a hack i've always wanted

/me licks install

JulianD 02-16-2003 02:32 PM

Does it use some kind of cron?

amykhar 02-16-2003 03:51 PM

You can either run it manually or set up a cron job. I recommend cron but explaining how to set that part up is beyond the scope of this hack because it is different on different web hosts.

Amy

amykhar 02-16-2003 03:51 PM

BTW, if you run it manually, make SURE you install the new templates on the style that you typically use to browse. Otherwise, you will send out blank emails.

diettalk 02-16-2003 05:30 PM

When the user gets deleted.. the posts are removed too?

amykhar 02-16-2003 05:55 PM

Quote:

Originally posted by diettalk
When the user gets deleted.. the posts are removed too?
No. They are not.

Amy

tkeil69575 02-16-2003 07:58 PM

hi amy,
thank you for this great hack :)

i have a couple of questions. the variable $daysInactive in the inactiveEmailMessage template doesnt seem to be working. its not including the number of days inactive in the email.

Is it correct the in the colum emailDate in the user table all values are "127" ? and that they dont change when users are emailed? I have a feeling there should be a unix timestamp in there? or is that the 15 days value?

thanks for your help
tina

amykhar 02-16-2003 08:03 PM

Quote:

Originally posted by tkeil69575
hi amy,
thank you for this great hack :)

i have a couple of questions. the variable $daysInactive in the inactiveEmailMessage template doesnt seem to be working. its not including the number of days inactive in the email.

Is it correct the in the colum emailDate in the user table all values are "127" ? and that they dont change when users are emailed? I have a feeling there should be a unix timestamp in there? or is that the 15 days value?

thanks for your help
tina

You caught a glitch in the install instructions. Change the emailDate to Int instead of TinyInt and it should fix that problem.

Regarding the $daysInactive, it worked for me. I will look into it.

I have updated the zip file reflecting the query change.

tkeil69575 02-16-2003 08:05 PM

great stuff - thanks amy :)

amykhar 02-16-2003 08:11 PM

Found the problem. In the message template, change daysInactive to inactiveDays. That should do it.

tkeil69575 02-16-2003 08:18 PM

yep that did it - working great now - thanks

amykhar 02-16-2003 08:19 PM

No prob. Thanks for helping to test it.

Amy

Dean C 02-17-2003 03:43 PM

Sounds good so far... I'll wait till this is out of beta before i install :)

Regards

- miSt

amykhar 02-17-2003 04:28 PM

I am going to give it a few more days. I think It's good to go, but want to wait and see if anyone else has issues.

Amy

djr 02-17-2003 09:57 PM

Does this email every users with xxx inactive days regardless of their usergroup? I have a seperate usergroup 'inactive' which holds all members who were inactive for a year and longer. I want to test it on myself first though (by manually putting myself to 365 inactive days)

Great hack! Absolutely what I've been waiting for!

/me clicks *installed*

- djr

amykhar 02-17-2003 09:59 PM

Regardless of the user group, it emails them.

Amy

djr 02-17-2003 10:03 PM

Sorry, already found out! The answer is obviously in the output of manageInactive.php :)
Ok, have to set myself to a longer inactive time then! ;)

Thanks for the prompt answer :cool:

- djr

djr 02-18-2003 06:56 PM

I'm having troubles, or I don't understand the hack. It installed without problems. I've set the options 'Email' and 'Delete' both to ON, so users will be warned first, wait for 15 days and then deleted if I understood correctly?

I add a user via vB Admin CP with the following info:
Username: Testuser
Usergroup: Inactive
Join Date: 1999-01-01 01:00:00
Last Activity: 1999-01-01 01:00:00 (same for Last Post and Last Visit)
All other relevant info set.

Fire up manageInactive.php. Output: Email Testuser
And boom! The user is deleted immediately, instead of waiting for fifteen days.

The e-mail got sent out, though (I used my own email-address). When I search for 'Testuser' in phpMyAdmin in the User table, NADA! Same for vB Admin CP.

What am I doing wrong? Please advise.

- djr

amykhar 02-18-2003 07:24 PM

I know what the problem is. Back in a sec with the fix.

Amy

amykhar 02-18-2003 07:28 PM

K, fixed. I updated the zip file. To upgrade, open your manageInactive.php and

Find:
Code:

$DB_site->query("UPDATE user set emailDate=".time()." WHERE userid=$user[userid]");
Add After
Code:

$user[emailDate] = time();

djr 02-18-2003 07:57 PM

Thanks for the quick fix!
I have been looking up and down the .php file, but just couldn't find it.. shows I'm better at hacking than coding ;)

All working great now.

If you want the lost password added to the message:
Quote:

If you lost your password for $bbtitle, please click the following link and follow the procedure. A new password will be set and emailed to you.
$bbtitle/member.php?s=&action=lostpw

djr 02-18-2003 08:38 PM

Sorry, back again :cool:

As this hacks only deletes the user, but leaves the redundant user settings (customavatar, private messages, etc etc) in the db, I was wondering if it's possible to update this hack so it deletes everything bound to that userid?
In admin/user.php there's already the php code for it (find // ###################### Start Remove #######################). Or maybe alot easier, just redirect to the user.php with all the paramaters necessary (userid, http_action 'kill'). I'd love to do it myself, but as said in my earlier post, I can't code :-(

Thanks for looking into it!

- djr

amykhar 02-18-2003 08:40 PM

No prob djr. I shall get right on it and be back with a fix.

Amy

amykhar 02-18-2003 09:10 PM

updated the zip. All you need to do is upload the php file again.

I recommend renaming this script to something else on your server for security reasons. I haven't been able to find a way to pass in the username and password for a cron job to be able to run this in the admin folder yet.

djr 02-19-2003 06:21 PM

Hi amy,

The hack gets better and better! Thank you VERY MUCH for implementing all my feat reqs.
I have (what's new) another one :D Because most of the forum-admins will run this script as cronjob, it's probably nicer to have the output how many users (and optionally which usernames) are deleted emailed to the admin. If there's no pruning done, have the script e-mail that, so we know it's up and running and doin' its (very good) job!

If somebody can be of help to Amy for dealing with potentially security risks, please don't hesitate! In the meantime i've renamed the script to something insignificant ;)

Thanks again!
- djr

amykhar 02-19-2003 06:44 PM

The email is a good idea. I will do it tomorrow cause I'm working on somebody else's hack right now. :)

Amy

amykhar 02-23-2003 11:43 PM

OK. I just updated the zip file. The program now emails the webmaster email with information about members who were emailed or deleted.

To update: You will need to add the two new templates and reupload the zip file.

Within the templates, you have access to counts telling how many inactive members there are, how many were emailed, how many were deleted, and list the emailed or deleted members.

Amy

djr 02-25-2003 04:56 PM

Hi Amy,

I forgot to say thank you for all that you've added to the hack. Major thumbs up for making this an excellent hack for the very hard needed forum maintenance a.k.a spring cleaning :D

I love everything about this hack. The fact it's fully automated via cron, the fact it keeps us webmasters notified of its duty and the fact that I feel assured that no redundant user info is left behind in the db!

This is definitely in my Top 10 list of favourite hacks!

- djr

amykhar 02-25-2003 05:14 PM

Thank you, djr :)

Amy

hypedave 02-26-2003 10:46 PM

So bascially, If I set it to 30 Days, then it will look users that havent been active in 30 Days send them an email warning, then in 15 days if that person hasn't logged on then their account will be automatically deleted.

amykhar 02-26-2003 10:49 PM

Yes Dave - if you have both email and delete turned on, that's how it will work.

Amy

hypedave 02-27-2003 01:15 PM

Is there a way to exempt posters with XX amount of posts?

Some users may have like 100 post, and get real busy with school and can't log on for like 2 months.

That would be a nice add-on


All times are GMT. The time now is 05:02 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01300 seconds
  • Memory Usage 1,810KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete