Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto Prune Threads Details »»
Auto Prune Threads
Version: 1.00, by Andreas Andreas is offline
Developer Last Online: Jan 2023 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 07-10-2004 Last Update: Never Installs: 19
 
No support by the author.

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.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #2  
Old 07-11-2004, 02:51 AM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Could we have a little Show and Tell here?
Reply With Quote
  #3  
Old 07-12-2004, 08:26 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #4  
Old 07-12-2004, 08:36 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

> 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.
Reply With Quote
  #5  
Old 07-12-2004, 08:39 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks very much
Reply With Quote
  #6  
Old 07-12-2004, 08:43 PM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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).
Reply With Quote
  #7  
Old 07-12-2004, 11:16 PM
Sir_Yaro's Avatar
Sir_Yaro Sir_Yaro is offline
 
Join Date: Jun 2004
Location: Ireland
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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)
Reply With Quote
  #8  
Old 07-13-2004, 06:37 PM
mrboz's Avatar
mrboz mrboz is offline
 
Join Date: Feb 2003
Posts: 13
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

got it, thanks
Reply With Quote
  #9  
Old 08-02-2004, 02:45 AM
romeshomey romeshomey is offline
 
Join Date: Oct 2002
Location: Ohio
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Awsome hack.. Thanks!
Reply With Quote
  #10  
Old 08-04-2004, 06:40 PM
romeshomey romeshomey is offline
 
Join Date: Oct 2002
Location: Ohio
Posts: 119
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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..
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 02:41 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06041 seconds
  • Memory Usage 2,299KB
  • Queries Executed 23 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (2)bbcode_php
  • (1)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (10)post_thanks_box
  • (10)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (10)post_thanks_postbit_info
  • (9)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.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
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete