Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Auto move threads to archive forum after x days Details »»
Auto move threads to archive forum after x days
Version: 1.00, by trafix trafix is offline
Developer Last Online: Jul 2008 Show Printable Version Email this Page

Version: 3.0.5 Rating:
Released: 01-20-2005 Last Update: 01-20-2005 Installs: 15
 
No support by the author.

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

Show Your Support

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

Comments
  #42  
Old 01-31-2005, 09:08 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

nice work
Reply With Quote
  #43  
Old 01-31-2005, 08:54 PM
catocom2 catocom2 is offline
 
Join Date: Aug 2002
Location: Gainesville, Georgia
Posts: 85
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by trafix
nice work
well not quite. :surprised:
It seems when I search, or goto 'new posts' it shows on all the threads.
Reply With Quote
  #44  
Old 03-04-2005, 09:00 PM
Moncha's Avatar
Moncha Moncha is offline
 
Join Date: Apr 2002
Posts: 52
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

With this cron, it runs without error but nothing get moved. I do have it set for 2 different forums to move into one. Here's a peek:
Code:
error_reporting(E_ALL & ~E_NOTICE);

if ($DB_site == NULL)
{
	exit;
}

global $DB_site;

// you only need to edit the number of days only
$movedate = strtotime("now -365 days");

//##############################################

 // edit the forum id number where the threads have to be moved FROM
$fromforuma="10";

// edit the forum id number where the threads have to be moved TO
$toforuma="60";

// do not edit below

$DB_site->query("
			UPDATE " . TABLE_PREFIX . "thread 
			SET forumid = $toforuma 
			Where lastpost <= $movedate
			AND forumid = $fromforuma
		");

// do not edit above

//##############################################
 // edit the forum id number where the threads have to be moved FROM
 $fromforumb="17";

 // edit the forum id number where the threads have to be moved TO
 $toforumb="60";

 $DB_site->query("
			UPDATE " . TABLE_PREFIX . "thread 
			SET forumid = $fromforumb 
			Where lastpost <= $movedate
			AND forumid = $toforumb
		");

// do not edit above
Any ideas?
Reply With Quote
  #45  
Old 04-15-2005, 01:45 PM
Kruppa Kruppa is offline
 
Join Date: Apr 2003
Location: Canada
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I get this error when I try to run it:

Database error in vBulletin 3.0.6:

Invalid SQL:
UPDATE thread
SET forumid =
Where lastpost <= 1110979914
AND forumid =

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Where lastpost <= 1110979914
AND forumid =' at line 3

mysql error number: 1064

Any ideas?

Here's a sample of the php file I've edited:

// edit the forum id number where the threads have to be moved FROM
$fromforuma="153";

// edit the forum id number where the threads have to be moved TO
$toforuma="63";

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET forumid = $toforuma
Where lastpost <= $movedate
AND forumid = $fromforuma
");

// edit the forum id number where the threads have to be moved FROM
$fromforumb="4";

// edit the forum id number where the threads have to be moved TO
$toforumb="63";

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET forumid = $toforumb
Where lastpost <= $movedate
AND forumid = $fromforumb
");
.
.
.
.
.
.
Reply With Quote
  #46  
Old 04-26-2005, 04:36 PM
Kruppa Kruppa is offline
 
Join Date: Apr 2003
Location: Canada
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Nobody?
Reply With Quote
  #47  
Old 05-05-2005, 05:06 PM
KevinL KevinL is offline
 
Join Date: Apr 2005
Posts: 1,287
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is almost what I have looking for!

Is it possible for this to move a thread once some one posts in it?

Like..a thread is started in one forum (news forum) and once someone replies it then moves to a discussion forum so others can reply?
Reply With Quote
  #48  
Old 05-23-2005, 01:31 AM
Kruppa Kruppa is offline
 
Join Date: Apr 2003
Location: Canada
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kruppa
I get this error when I try to run it:


Database error in vBulletin 3.0.6:

Invalid SQL:
UPDATE thread
SET forumid =
Where lastpost <= 1110979914
AND forumid =

mysql error: You have an error in your SQL syntax. Check the manual that corresponds to your MySQL server version for the right syntax to use near 'Where lastpost <= 1110979914
AND forumid =' at line 3

mysql error number: 1064



Any ideas?


Here's a sample of the php file I've edited:


// edit the forum id number where the threads have to be moved FROM
$fromforuma="153";

// edit the forum id number where the threads have to be moved TO
$toforuma="63";

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET forumid = $toforuma
Where lastpost <= $movedate
AND forumid = $fromforuma
");

// edit the forum id number where the threads have to be moved FROM
$fromforumb="4";

// edit the forum id number where the threads have to be moved TO
$toforumb="63";

$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET forumid = $toforumb
Where lastpost <= $movedate
AND forumid = $fromforumb
");
.
.
.
.
.
.
Imagine a world where my mods would get off my back to make this hack work....please help if you can. I only install hacks that are supposed to be supported, as this one is advertised.
Reply With Quote
  #49  
Old 05-23-2005, 10:07 AM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Kruppa
Imagine a world where my mods would get off my back to make this hack work....please help if you can. I only install hacks that are supposed to be supported, as this one is advertised.
This all code you edited?
Reply With Quote
  #50  
Old 05-24-2005, 01:40 PM
Kruppa Kruppa is offline
 
Join Date: Apr 2003
Location: Canada
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarcoH64
This all code you edited?
No it was only a sample. Here's the full file I uploaded:
Reply With Quote
  #51  
Old 05-24-2005, 08:06 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

PHP Code:
// edit the forum id number where the threads have to be moved TO
$toforumi="161";

$DB_site->query("
            UPDATE " 
TABLE_PREFIX "thread 
            SET forumid = 
$toforumai 
            Where lastpost <= 
$movedate
            AND forumid = 
$fromforumai
        "
); 
$toforumai is not defined.

PS:
OMG This is the worst script i have ever seen. Do you realize you could also have done this in a 6-line loop?

No offence ment, not trying to put you down, but this really brought a smile on my face. (and a headache looking for the wrong spelled var)
Reply With Quote
Reply

Thread Tools

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 07:47 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.04521 seconds
  • Memory Usage 2,312KB
  • 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
  • (4)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