vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Auto Prune Threads (https://vborg.vbsupport.ru/showthread.php?t=99881)

Quarterbore 08-29-2006 07:55 PM

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:

adusei 09-14-2006 03:32 PM

Hi,

tried this hack - and nothing happened :confused:
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

coffee 11-17-2006 10:10 PM

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

TsirhCitna 12-25-2006 02:12 PM

Does this work on sub-forums too?

As in will the setting it to prune on the parent effect the child forums too?

telc 01-27-2007 01:23 AM

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.

Sir_Yaro 04-09-2007 06:19 PM

works for 3.6.5:D

xrayeramy 04-10-2007 05:24 AM

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.

MikeWarner 04-11-2007 11:51 AM

Yes - over night (once a day) seems like a better idea than runing an intensive script like this each hour. How please? Thanks.

unnpro 05-07-2007 08:03 AM

Quote:

Originally Posted by MikeWarner (Post 1224898)
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 :)

DieselMinded 07-06-2007 01:51 PM

Is there a better version for this? 3.6.7 ?

telc 07-14-2007 01:12 PM

Quote:

Originally Posted by telc (Post 1168127)
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

DeanoG 07-30-2007 10:08 AM

Works on version 3.6.8

junkeeper 08-08-2007 08:22 AM

Quote:

Originally Posted by unnpro (Post 1242937)
- 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.

l@z 09-13-2007 04:18 AM

wtf you lose your forum posts ammount

Andreas 02-10-2008 08:58 AM

Quote:

Originally Posted by MikeWarner (Post 1224898)
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.

mariocaz 02-21-2008 05:04 PM

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

coffee 04-09-2008 09:26 AM

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!

todosbaneados 04-20-2008 02:36 PM

This mod works in vbulletin 3.7.0?

coffee 04-24-2008 01:09 PM

Yes it does!

One thing you need to do is to change the hook location as mentioned above.

mariocaz 05-21-2008 12:02 AM

and how can I change the hook ???, help!!

sdsvtdriver 05-21-2008 11:45 PM

after installing into 3.5.4 I get this error message when I attempt to set the number of days on a forum:

Quote:

Fatal error: Field pruneafter is not defined in $validfields in class vB_DataManager_Forum in includes\class_dm.php on line 485

Nogura 05-23-2008 10:32 AM

Quote:

Originally Posted by mariocaz (Post 1526292)
and how can I change the hook ???, help!!

In your admin panel, go to Plugins & Products and then Plugin Manager. Select Edit on Auto-Prune Threads and select cron_script_cleanup_hourly from the drop-down box.

mariocaz 05-23-2008 11:28 PM

Thank you very much Nogura!!

I did it, so I hope with this the mod works again perfectly.

sdsvtdriver 06-17-2008 07:03 AM

Quote:

Originally Posted by sdsvtdriver (Post 1527434)
after installing into 3.5.4 I get this error message when I attempt to set the number of days on a forum:

Any ideas?

This appears to be the only autoprune for 3.5.4 and I run an NNTP gateway which fills up fast. :)

sdsvtdriver 06-26-2008 09:18 AM

anyone? :(

sdsvtdriver 06-30-2008 08:46 AM

I had to manually add:

PHP Code:

    'pruneafter'        => array(TYPE_UINT,          REQ_NO), 

in
./includes/class_dm_forum.php

the plugin
Quote:

$this->validfields['pruneafter'] = array(TYPE_UINT, REQ_NO);
should have done the same thing, but didn't. Ideas?

isearchclick 08-02-2008 12:06 AM

Andreas, i have uploaded your hack for auto prune i want to know if set to 0 will it delete threads or posts and if i just want the hack to delete thread say every 30 days will it do this no matter wheather the threads have replies or not please advise?
Tony

M.C. 01-19-2009 11:39 AM

HI! is this hack will be released for 3.7-3.8?

creativepart 03-03-2009 06:30 PM

Is there any reason it has to use cron_cleanup_hourly? Could it be set to cron_cleanup_daily and run only once per day?

Dimoks 05-21-2009 06:58 AM

Hi
Please help me... I need mod for auto delete thread after X day... but amount of days set separately for each thread.

swapps 06-03-2009 11:50 AM

Installed @ Vbulletin 3.8.1
Changed hook to "cron_script_cleanup_hourly1"

Works! Thx!

Darthvader2007 06-06-2009 11:33 AM

I need this mod for auto prune topic's that cleanup by ( topic start date ) and not by ( last reply date )
Can someone help me please ??

Vbulletin 3.8.1

SBlueman 06-06-2009 08:48 PM

Is there a SQL query to auto update the length of time for all your forums without having to go and edit each forum?

Darthvader2007 06-10-2009 11:31 AM

Quote:

Originally Posted by Darthvader2007 (Post 1824413)
I need this mod for auto prune topic's that cleanup by ( topic start date ) and not by ( last reply date )
Can someone help me please ??

Vbulletin 3.8.1

Nobody ?
Or is there a better MOD for vBulletin 3.8 ?

SirHappy 06-20-2009 03:18 PM

thx. works in 3.8.3.

xlguy 08-17-2009 10:37 AM

Quote:

Originally Posted by Darthvader2007 (Post 1824413)
I need this mod for auto prune topic's that cleanup by ( topic start date ) and not by ( last reply date )
Can someone help me please ??

Vbulletin 3.8.1

Yes I'd also like this modification, let me know if you find anything.

appsfinder 01-31-2010 09:43 AM

howdo i do this please change the Hook location to cron_script_cleanup_hourly

plus i cannot see setting in forum manager for this mod?

im on vb3.7 beta4

gunboard 06-11-2010 12:53 PM

Hello,

here the xml for VB 3.8.x at own risk :) on gunboard.de it works perfect.
settings are in the forummanagement.

greets gunboard

Acido 06-23-2010 11:07 PM

Someone have it working on vb4 ?

Macindy 07-03-2010 11:32 AM

Does this plugin work with vb4?


All times are GMT. The time now is 08:34 PM.

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.01312 seconds
  • Memory Usage 1,829KB
  • 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_code_printable
  • (3)bbcode_php_printable
  • (12)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
  • (40)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