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
  #52  
Old 07-14-2007, 01:12 PM
telc's Avatar
telc telc is offline
 
Join Date: Dec 2001
Posts: 128
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by telc View Post
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.

Anyway I can do this?

Thanks
Reply With Quote
  #53  
Old 07-30-2007, 10:08 AM
DeanoG DeanoG is offline
 
Join Date: Feb 2002
Location: UK
Posts: 17
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works on version 3.6.8
Reply With Quote
  #54  
Old 08-08-2007, 08:22 AM
junkeeper junkeeper is offline
 
Join Date: Aug 2006
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by unnpro View Post
- 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
Hi,

I'm just curious, how to specify the x days for each forum like the one in Forum Manager since the plugin has already been disabled or removed ?

I'm still stuck here.
Reply With Quote
  #55  
Old 09-13-2007, 04:18 AM
l@z's Avatar
l@z l@z is offline
 
Join Date: Jul 2006
Location: Australia
Posts: 53
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

wtf you lose your forum posts ammount
Reply With Quote
  #56  
Old 02-10-2008, 08:58 AM
Andreas's Avatar
Andreas Andreas is offline
 
Join Date: Jan 2004
Location: Germany
Posts: 6,863
Благодарил(а): 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.
If you run in only once/day, the amount of threads to delete is higher, eg. the script runs longer.
That's the reason why it is (by default) executed every hour, as this keeps the amount small.

Quote:
wtf you lose your forum posts ammount
What else did you expect?
Pruned posts/threads are gone - forever.
Reply With Quote
  #57  
Old 02-21-2008, 05:04 PM
mariocaz mariocaz is offline
 
Join Date: Feb 2008
Location: Mexico, D.F.
Posts: 424
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is this work fine in 3.6.8 ?, because I installed it and set it in a specific forum that I want to delete all the threads that are 30 days old or more, but nothing happened the old threads still there in that forum.

Or only works since now for the future threads that will be in that forum ?

Mario
Reply With Quote
  #58  
Old 04-09-2008, 09:26 AM
coffee's Avatar
coffee coffee is offline
 
Join Date: Oct 2002
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Andreas
Compatibilitty 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
Thank you for the update!
Reply With Quote
  #59  
Old 04-20-2008, 02:36 PM
todosbaneados todosbaneados is offline
 
Join Date: Feb 2008
Posts: 44
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This mod works in vbulletin 3.7.0?
Reply With Quote
  #60  
Old 04-24-2008, 01:09 PM
coffee's Avatar
coffee coffee is offline
 
Join Date: Oct 2002
Posts: 154
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yes it does!

One thing you need to do is to change the hook location as mentioned above.
Reply With Quote
  #61  
Old 05-21-2008, 12:02 AM
mariocaz mariocaz is offline
 
Join Date: Feb 2008
Location: Mexico, D.F.
Posts: 424
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

and how can I change the hook ???, help!!
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 01:35 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.05289 seconds
  • Memory Usage 2,314KB
  • 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
  • (5)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