vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Auto Prune Threads (https://vborg.vbsupport.ru/showthread.php?t=67049)

Andreas 07-10-2004 10:00 PM

Auto Prune Threads
 
Description
-----------
This hack gives you the ability to specify if you want to automatically have
threads pruned from a x days after the last post.
The amount of days can be set separately for each forum in forum manager.

Files to modify: 1
Queries to run: 1

Difficulty
----------
Easy-Medium

Compatibility
-------------
I coded this snippet for RC3 quite a while ago, but it should work with all 3.x-Versions.

Bison 07-11-2004 02:51 AM

Could we have a little Show and Tell here?

mrboz 07-12-2004 08:26 PM

i've been looking for this for some time :) great hack

--

is there also a way to only delete threads that have not been replied to.

i am using the RSS Bot mod to add posts from an RSS feed and i'd like to delete all the posts that have not been replied to after say 2 days and leave the ones that have had replies

thanks ;)

Andreas 07-12-2004 08:36 PM

> is there also a way to only delete threads that have not been replied to.

Pretty easy:

In autoprune.php FIND

PHP Code:

$threads $DB_site->query("SELECT threadid FROM " TABLE_PREFIX "thread WHERE forumid=$forum[forumid] AND lastpost <= " . (TIMENOW - ($forum['pruneafter'] * 86400))); 

REPLACE that with
PHP Code:

$threads $DB_site->query("SELECT threadid FROM " TABLE_PREFIX "thread WHERE forumid=$forum[forumid] AND replycount = 0 AND lastpost <= " . (TIMENOW - ($forum['pruneafter'] * 86400))); 

@Bison
Hmm ... there's not much to see, just a new input-box in forum manager.

mrboz 07-12-2004 08:39 PM

thanks very much ;)

Andreas 07-12-2004 08:43 PM

Attention. There was a typo in my last post. Of course it must be replycount = 0 instead of replycount > 0 (which would delete all threads that have replies and leave those which haven't).

Sir_Yaro 07-12-2004 11:16 PM

Its possible to add "auto prune" to each thread separately?
For ex:
Im create thread "aaaaaaaaa" and set him auto-prune date - 5 days.
Another user create thread "bbbbbbbb" and set him 30 days
And another create "ccccccccc" but auto-prune is unset (0 days) - thread will be never deleted

Such hack exist in phpBB and is veeeeeeeeery useful (especially for moderators)

mrboz 07-13-2004 06:37 PM

got it, thanks

romeshomey 08-02-2004 02:45 AM

Awsome hack.. Thanks!

romeshomey 08-04-2004 06:40 PM

How would I go about just pruning posts by certain users?

Like MrBoz above, I want to pruno only RSS Feeds, but dont want to prune other users posts at the same time.

So basically, can I enter a username(s) or user id(s) in this line somewhere?

Quote:

$threads = $DB_site->query("SELECT threadid FROM " . TABLE_PREFIX . "thread WHERE forumid=$forum[forumid] AND replycount = 0 AND lastpost <= " . (TIMENOW - ($forum['pruneafter'] * 86400)));

Thanks...

Also, is there a way to make it run on all forums istead of having to specify it on each forum in the forum manager? Id like it to run Global if possible..


All times are GMT. The time now is 06:53 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.01057 seconds
  • Memory Usage 1,738KB
  • 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_php_printable
  • (1)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
  • (10)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