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
  #22  
Old 01-22-2005, 10:26 PM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
Reply With Quote
  #23  
Old 01-23-2005, 12:44 AM
Bison's Avatar
Bison Bison is offline
 
Join Date: Jun 2002
Location: Virginia Beach, Virginia
Posts: 522
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by The Realist
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
PHP Code:
$DB_site->query("
            UPDATE " 
TABLE_PREFIX "thread 
            SET forumid = 
$newforum 
            Where lastpost <= 
$movedate
            AND forumid != 
$newforum
            AND sticky != 1
        "
); 
Reply With Quote
  #24  
Old 01-23-2005, 10:17 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This would stop the stickies being moved yes?

Quote:
Originally Posted by Bison
PHP Code:
$DB_site->query("
            UPDATE " 
TABLE_PREFIX "thread 
            SET forumid = 
$newforum 
            Where lastpost <= 
$movedate
            AND forumid != 
$newforum
            AND sticky != 1
        "
); 
Reply With Quote
  #25  
Old 01-23-2005, 10:19 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

yep i didnt take stickies into concideration ... good job
Reply With Quote
  #26  
Old 01-23-2005, 10:28 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
")
Reply With Quote
  #27  
Old 01-23-2005, 10:30 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

ahhh ... ooops

should be
PHP Code:
$DB_site->query(
UPDATE " 
TABLE_PREFIX "thread 
SET forumid = 
$newforum 
Where lastpost <= 
$movedate 
AND forumid != 
$newforum 
OR sticky != 1 
"
); 
Reply With Quote
  #28  
Old 01-23-2005, 10:32 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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
")
Reply With Quote
  #29  
Old 01-23-2005, 10:44 AM
trafix's Avatar
trafix trafix is offline
 
Join Date: Dec 2002
Location: Australia
Posts: 1,021
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ummm i just tested that code on my dev forum and it ran without an error ..... im confused
Reply With Quote
  #30  
Old 01-23-2005, 10:49 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I'll run it again.
Reply With Quote
  #31  
Old 01-23-2005, 10:51 AM
The Realist's Avatar
The Realist The Realist is offline
 
Join Date: Oct 2001
Location: UK
Posts: 842
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Same error.

Im using phpmyadmin to run the query.
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 11:51 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.06841 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
  • (3)bbcode_php
  • (2)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