Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.5 > vBulletin 3.5 Add-ons
FAQ Community Calendar Today's Posts Search

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

Version: 3.5.0 Rating:
Released: 11-01-2005 Last Update: Never Installs: 175
DB Changes Uses Plugins
 
No support by the author.

<font size="3">Auto Prune Threads</font>

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

Details
1 Product XML (3 Plugins, 1 Phrase)

Compatibility Note vBulletin 3.7
As of vBulletin 3.7 Beta 4, the hook used for this Mod does not exist any longer.
After installting this Mod, please change the Hook location to cron_script_cleanup_hourly

Show Your Support

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

Comments
  #42  
Old 08-29-2006, 07:55 PM
Quarterbore Quarterbore is offline
 
Join Date: Mar 2005
Location: Valley Forge PA
Posts: 538
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this physically remove the old threads from the database? Does the line of code that says "delete_thread($thread['threadid'], false, true, NULL, false, $thread);" use the built in vBulletin functions to remove the thread and posts?

Can someone help me find the "delete_thread" function?

Please confirm just what this script does...

Thanks!

EDIT:

OK, I think I figured out what this calls but it will take me some time to figure the code out.. I assume this is using the class_dm_threadpost.php file to handle the removal of the thread and that it will also remove the posts and that these removals are by removal or the rows of data from the database...

:alien:
Reply With Quote
  #43  
Old 09-14-2006, 03:32 PM
adusei adusei is offline
 
Join Date: Jan 2004
Posts: 33
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hi,

tried this hack - and nothing happened
Ok, read the small text in the forum manager again, and it says:

"will automatically prune all Threads from this Forum where the last reply is older then the set amount of days"

A-HA! So, if I have threads WITHOUT any replies they won't be deleted. Is that right?
How can the code be changed to enable the pruning of threads without replies older than x days??? Possible?

TIA and best regards,

adusei
Reply With Quote
  #44  
Old 11-17-2006, 10:10 PM
coffee's Avatar
coffee coffee is offline
 
Join Date: Oct 2002
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Adusie,

Open the xml file and Edit line #27, by replacing where it says: "lastpost" with "dateline".

Then import the product with: "Allow Overwrite" option enabled.

btw, Working perfect in 3.6.3
Reply With Quote
  #45  
Old 12-25-2006, 02:12 PM
TsirhCitna TsirhCitna is offline
 
Join Date: Jul 2005
Location: Kent, OH
Posts: 158
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does this work on sub-forums too?

As in will the setting it to prune on the parent effect the child forums too?
Reply With Quote
  #46  
Old 01-27-2007, 01:23 AM
telc's Avatar
telc telc is offline
 
Join Date: Dec 2001
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Does anyone know the function to move a thread? I rather have it move all the threads to a dedicated forum, then I can manually prune that single forum when my server is offline, since pruning is extremly CPU intensive when pruning thousands of threads.

I would like to change this:

PHP Code:
delete_thread($thread['threadid'], falsetrueNULLfalse$thread); 

To move the thread to a dedicated forumID, that I use as a recycle bin.
Reply With Quote
  #47  
Old 04-09-2007, 06:19 PM
Sir_Yaro's Avatar
Sir_Yaro Sir_Yaro is offline
 
Join Date: Jun 2004
Location: Ireland
Posts: 98
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

works for 3.6.5
Reply With Quote
  #48  
Old 04-10-2007, 05:24 AM
xrayeramy xrayeramy is offline
 
Join Date: Mar 2007
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone willing to hold a n00bs hand? I would love to use this to delete all threads in one forum at midnight each night. I need explicit instructions though, not just a bunch of code. Tell me where to put it, copy this, paste here, change this....and I can fly with it. But just giving me code...I'm lost.
Reply With Quote
  #49  
Old 04-11-2007, 11:51 AM
MikeWarner's Avatar
MikeWarner MikeWarner is offline
 
Join Date: Nov 2001
Location: UK
Posts: 133
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes - over night (once a day) seems like a better idea than runing an intensive script like this each hour. How please? Thanks.
Reply With Quote
  #50  
Old 05-07-2007, 08:03 AM
unnpro unnpro is offline
 
Join Date: Sep 2006
Location: Milan
Posts: 11
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MikeWarner View Post
Yes - over night (once a day) seems like a better idea than runing an intensive script like this each hour. How please? Thanks.
- Disable or remove "Auto-Prune Threads" plugin in the plugin section
- Upload in your cron dir (includes/cron/) a php file (e.g. autoprune.php) with this code:
Code:
<?php
error_reporting(E_ALL & ~E_NOTICE);
if (!is_object($vbulletin->db))
{
    exit;
}

require_once(DIR . '/includes/functions_databuild.php');
$forums = $vbulletin->db->query_read("SELECT forumid, pruneafter FROM " . TABLE_PREFIX . "forum WHERE pruneafter > 0");
while ($forum = $vbulletin->db->fetch_array($forums))
{
    $threads = $vbulletin->db->query_read("SELECT threadid, forumid, visible, open, pollid, title FROM " . TABLE_PREFIX . "thread WHERE forumid=$forum[forumid] AND visible IN (0,1,2) AND sticky != 1 AND lastpost <= " . (TIMENOW - ($forum['pruneafter'] * 86400)));
      while ($thread = $vbulletin->db->fetch_array($threads))
    {
            delete_thread($thread['threadid'], false, true, NULL, false, $thread);
      }
      build_forum_counters($forum['forumid']);
}

log_cron_action('Forums pruned', $nextitem);

?>
- Create a new cronjob that runs autoprune.php whenever you want

That's all
Reply With Quote
  #51  
Old 07-06-2007, 01:51 PM
DieselMinded's Avatar
DieselMinded DieselMinded is offline
 
Join Date: Mar 2007
Posts: 1,655
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a better version for this? 3.6.7 ?
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 04:57 AM.


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.05360 seconds
  • Memory Usage 2,310KB
  • Queries Executed 25 (?)
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
  • (1)bbcode_code
  • (1)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
  • (4)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)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