![]() |
Auto move threads to archive forum after x days
Requested by Floris
This is another simple script based on the Close thread after 30 days .... BUT ... This one will auto move all threads to an archive forum where the last post is 365 days or older There is 2 variables for you to edit 1) Defult is set to "1" $newforum = the forum number that these threads are to be moved to 2) Defult is set to 365 this means that threads that havnt been replied to in the last 365 days will be moved to the nominated archive forum you can change 365 to whatever days you like :) Trafix Please click Install Update Found an error in the code please download new zip and replace the file on your forum Added file ... This file will move threads from a specific forum to another spacific forum, edit as instructed :) |
Update
Found an error in the code please download new zip and replace the file on your forum |
Way cool!
I asked you less then a few hours ago to give me a birthday present hack. And here it is, exactly what I asked. As always - very pleased with your professional services trafix. |
This likes me a lot more than the close after X days.
** Install Thanks trafix ;) |
Nice one, sure could use this !
Possible to also do one "Auto Close thread after 100 posts and create a new one with the same title" ( but append a part X to it where X is 2 if the new post created has been branched once, 3 if branched twice and so on .. ) and with the first post of this new thread to have the content : " In continuation of this previous thread here: XX )" where XX is the link to the previous closed thread ? Have always been meaning to try something like this for my forums but never got round to doing it. Hope you can release something like this, since you seem to be on a roll with these cron jobs trafix :D |
yep ok ill try to do it for you :)
just call me the King of Cron ;) |
Quote:
|
Fantastic ;)
|
Quote:
|
Quote:
The hint here is to keep them bumped before the move time has expired |
How hard would it be to amend the script to move the messages from a live forum inside a sub-category to an archived forum within a designated "Archives" category?
For example: LIVE CATEGORY All The Latest (sub-category) |---> News (forum) ARCHIVES CATEGORY ---> News (archived forum) What I'm trying to achieve is not to place "all" messages from all forums into a single forum....rather....place messages from a single forum into a designated archived forum of the same name but within a category called "Archives". Hope that makes sense!?!? Thanks. |
Quote:
|
So it's something you would consider to incorporate into this hack or something I would need to request of you off the forum?
|
i have added the script for this to the first post :)
|
Many thanks trafix - excellent work, thank you.
Just to push the envelope a little further ;) How might I be able to include a start & end time? In other words, let's say I wanted to move all messages from a specific year, so for example....January 1st, 2002 to December 31st, 2002....into an archive sub-forum called 2002 Archives? That way, at the end of each year, I'd be able to archive it's messages and start over from scratch with a 'clean' set of live forums for the new year. Just an idea. Thanks. |
ill look at it for you ... again it should be easy
|
What about a script that follows on from your close posts after 30 days. I need one that automatically moved these closed threads/posts to a section called cemetary IE posts/threads that are no longer active.
Laters |
yep run the cron scripts back to back :) ... the otherone closes the thread then this one come in and moves them :)
|
Quote:
|
Ahhhh nice one :)
Quote:
|
One thing I've noticed is this.
It moves the closed stickies as well? Can it have options in the code so we can specify what sections not to move closed posts from. We dont want staff or stickies moving to an open forum do we. Laters |
Quote:
PHP Code:
|
This would stop the stickies being moved yes?
Quote:
|
yep i didnt take stickies into concideration ... good job :)
|
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem
ERROR: Unknown Punctuation String @ 10 STR: -> SQL: $DB_site->query(" UPDATE " . TABLE_PREFIX . "thread SET forumid = $newforum Where lastpost <= $movedate AND forumid != $newforum AND sticky != 1 ") |
ahhh ... ooops
should be PHP Code:
|
Still the same M8 :)
There seems to be an error in your SQL query. The MySQL server error output below, if there is any, may also help you in diagnosing the problem ERROR: Unknown Punctuation String @ 10 STR: -> SQL: $DB_site->query(" UPDATE " . TABLE_PREFIX . "thread SET forumid = $newforum Where lastpost <= $movedate AND forumid != $newforum OR sticky != 1 ") |
Ummm i just tested that code on my dev forum and it ran without an error ..... im confused
|
I'll run it again.
|
Same error.
Im using phpmyadmin to run the query. |
thats where you are going wrong ..... your phpmyadmin wont understand $DB_site
if you put the script in the cron folder you can use the task manager to "run now" |
Lost on this one M8.
|
Quote:
If you want to test the query (the MySQL way), just type this (and fill in the blanks): PHP Code:
|
Quote:
|
This is the closest hack to what I'm looking for that I've found.
Except... Instead of moving, closing, or what not, I'd just like it to add a little clock icon in the left column if the thread is older than xx, when someone replies to it. Is there an easy way to mod this mod to do that? Thanks. This cron stuff is just a little beyond my programming skills ATM. This is a great looking hack. |
Quote:
|
Quote:
I'm not really sure it's a cron job thing though..? Maybe just a conditional. |
Quote:
|
Thanks man, but I got it now. :smoke:
fury@otcentral replied and told me how he did it. http://otcentral.com/forum/showthread.php?t=17762 |
here's the code I did:
place it the "threadbit" template where you want it... PHP Code:
http://catocom.com/forum/images/smilies/clock.gif |
All times are GMT. The time now is 05:08 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|