Version: 1.00, by jamoss
Developer Last Online: Jan 2021
Version: 2.2.x
Rating:
Released: 02-11-2003
Last Update: Never
Installs: 5
No support by the author.
If you get the kind of traffic like we do-- average 2,000 messages post per day-- you need to do a lot of pruning.
Here's a hack that will automatically run a script daily (or weekly) that will select forums to prune, choose how old the pruned threads must be, deletes the threads, then updates the thread and post counts (all configurable). Author assumes that you have access to your server's filesystem and can edit your crontab file, located in /etc
Steps:
1. Edit your crontab file (in /etc) and add one of these lines:
If you want to run it DAILY at 12:01am
01 00 * * * root /usr/local/bin/php /fullpath/to/yourboard/admin/cron_prune.php >dev/null
If you want to run it WEEKLY, every SUNDAY at 12:01am
01 00 * * 0 root /usr/local/bin/php /fullpath/to/yourboard/admin/cron_prune.php >dev/null
(replace /fullpath/to/yourboard/admin/ with the actual server path to your vB admin directory)
2. Put the attached file (cron_prune.php) in your board's admin directory.
3. Edit the cron_prune.php file and enter your own settings at the top of the file.
If you have any questions, post them here (I'll subscribe to this thread) or email me at jennifer@babynames.com
Let me know if it works for ya! It works for us!
Jenn
Show Your Support
This modification may not be copied, reproduced or published elsewhere without author's permission.
You can run the script manually from the browser to see if it's working for you, but note that you will not receive any output in the browser. When it's done, it will either just stop running with a blank screen or say "No Data".
04-12-03 at 04:47 AM jamoss said this in Post #11 Thanks, Ryan!
You can run the script manually from the browser to see if it's working for you, but note that you will not receive any output in the browser. When it's done, it will either just stop running with a blank screen or say "No Data".
Jennifer.
Well it works but I get a database error:
Database error in vBulletin Control Panel 2.3.0:
Invalid SQL: DELETE FROM searchindex WHERE wordid IN (0) AND postid=
mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1
Warning: main(./config.php) [http://www.php.net/function.main]: failed to create stream: No such file or directory in /home/virtual/site1/fst/var/www/html/forums/admin/global.php on line 96
yet if I go direct to the admin dir and run the script w/o the whole path but with just the file, it works no prob.
Just what I needed! Thanks! I think there's a lot of people that are looking for something like this but didn't type in the right search terms to find it. Works great in combination with the newsgroup hack for deleting old threads that can take up extra space.