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..

Jujimufu 08-25-2004 01:08 PM

This is a great hack, especially for general discussion forums that never have anything of value. In some of the other forums though, it takes out the stickied threads too. Is there a way to prevent it from taking out your stickied threads, no matter the date?

jluerken 08-26-2004 11:40 AM

Hi,

I am searching for a small addition to this hack.
I would delete all Posts from a forum after X days but only from a special user.

Background is that I installed the Article Hack to post RSS Articles under a special userid into some of my forums. I want to delete those Articles all X days but want to let the others untouched.

Is it possible to update this hack that you have the choice to either delete all threads in a forum after X days or to chose to have all from a single user deleted after X days?

ethics 08-26-2004 04:13 PM

Awesome, just what I needed!

venomx 09-04-2004 11:39 PM

Wont this mess up post counts?

adp 10-17-2004 07:26 AM

Is there any chance that this can be modified to close threads instead of deleting them?

thanks,
adp

Candycane 12-31-2004 04:08 AM

Hi there,
Does this mod work for version 3.0.3?

Acido 03-23-2005 11:35 AM

Hi KirbyDE

Sorry if this is a Stupid question, but i want to know if when the thread is deleted, the POSTS are deleted too. I mean to delete records in the POST table.
The autoprune Option could be cool to have "chit chat" forums without moderation (and not count for posts there), but with threads and post deleted in few days or weeks.

Great Solution for users that can avoid use the forum as chat, forcing to the moderators to delete posts (or worse: move it), explain to the newbies how the forums works, discuss with users about that, etc, etc..


But if the table POST mantain all the records, i think this could be a bad idea.

Can you clarify this to me?
Thanx . (sorry my bad english)

CrazyLady 04-06-2005 06:42 PM

so am I to understand that this mod only deletes the thread and NOT the posts? can someone clarify before I add this hack?

thanks

CrazyLady 04-09-2005 04:18 PM

does this hack remove both threads AND posts?

Acido 04-19-2005 10:43 AM

Quote:

Originally Posted by CrazyLady
does this hack remove both threads AND posts?

This hack remove threads, but post remain in database. You still can remove orphan post on database from update counters >> Remove Orphan Posts:

"This function will delete any posts that belong to threads that no longer exist. Such posts are not accessible via the forums but they do add your your totals. You will see the number of orphan posts in parenthesis."

;)

Cyricx 04-20-2005 04:28 PM

Is it just me or does this seem to be pruning based on last views instead of last post?

Looking at the code it shouldn't be, but on my test site it is pruning by views...

Any one else having that problem? or any ideas what could be wrong?

almqdad 05-04-2005 09:28 AM

great hack

Andreas 06-02-2005 01:05 AM

Quote:

Originally Posted by Acido
This hack remove threads, but post remain in database.

This is not true. Function delete_thread() also removes the posts, edit-notes, etc.

@Cyricx
No. Threads don't even have a 'last view' property ...

Acido 06-02-2005 01:08 AM

Quote:

Originally Posted by KirbyDE
This is not true. Function delete_thread() also removes the posts, edit-notes, etc.

@Cyricx
No. Threads don't even have a 'last view' property ...

Thanx for clarify that :)

HeloHi 06-08-2005 11:03 PM

How would one modify this to auto-move threads to a specific forum instead of deleting them?

SuprSurfr 07-20-2005 11:45 AM

KirbyDE could you explain this step a little further?
I am new to VB and i am not sure what i should do here.

Thanks

Quote:

2. Add the following phrase to phrasegroup Forum-Related Phrases
varname: prune_after
text: Prune After<dfn>Stetting this to a value > 0 will automatically prune all threads from this forum where the last reply is older then the set amount of days</dfn>
I found where i needed to apply step 2.

Thanks

FROGGYJ 10-23-2005 02:01 AM

would this work in vb 3.5 gold?

Acido 10-27-2005 03:25 PM

I really need this hack ported to vb 3.5


All times are GMT. The time now is 05:06 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.01104 seconds
  • Memory Usage 1,778KB
  • 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
  • (5)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (28)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete