Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Auto close thread after x days. Details »»
Auto close thread 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: 16
 
No support by the author.

Requested by Skyline_GT

This is a simple script that will close all threads where the last post is 30 days or older

Edited script with KirbyDE's code

I got it this time ... and tested and works

Tnx

only 1 variable to edit here .... default is 30 days but you can change it to whatever you want

Please click Install

Supporters / CoAuthors

Show Your Support

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

Comments
  #22  
Old 05-18-2005, 07:02 PM
Marco van Herwaarden Marco van Herwaarden is offline
 
Join Date: Jul 2004
Posts: 25,415
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Looking at the instructions it seems to me that you can not select a forum.
Reply With Quote
  #23  
Old 05-29-2005, 08:12 AM
bryan09 bryan09 is offline
 
Join Date: May 2005
Posts: 22
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Paul M
Try this;
[sql]$DB_site->query("
UPDATE " . TABLE_PREFIX . "thread
SET open = 0
WHERE forumid IN (1,2,3) AND open = 1 AND sticky = 0 AND lastpost < " . intval(TIMENOW - (86400 * 30))
);
[/sql]
Where (1,2,3) is the list of forum id's you want it to work for, and 30 is the number of days
I got this problem when I inserted the above code ..

Code:
ERROR: Unknown Punctuation String @ 9
STR: ->
SQL: $DB_site->query("
	UPDATE " . TABLE_PREFIX . "thread
	SET open = 0
	WHERE forumid IN (36) AND open = 1 AND sticky = 0 AND lastpost < " . intval(TIMENOW - (86400 * 30))
)

SQL-query: 

$DB_site->query(" UPDATE " . TABLE_PREFIX . "thread SET open = 0 WHERE forumid IN (36) AND open = 1 AND sticky = 0 AND lastpost < " . intval(TIMENOW - (86400 * 30)) ) 
MySQL said:  

#1064 - You have an error in your SQL syntax near '$DB_site->query("
    UPDATE " . TABLE_PREFIX . "thread
    SET open = 0
    WHERE for' at line 1
Reply With Quote
  #24  
Old 06-06-2005, 11:14 PM
TCattitude's Avatar
TCattitude TCattitude is offline
 
Join Date: Oct 2004
Location: Chile
Posts: 195
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

This is a absurd question, but... i'm a newbie on php:

This cronjob close thread after X days since the creation of the thread, or after X days of inactivity?
(Are diferent things)

How to change that?
How to setup this cronjob to close old threads (based on "original post date") or to close inactive threads (based on "last post date")?

Thanks for all in advance
Reply With Quote
  #25  
Old 07-20-2005, 11:10 PM
korny's Avatar
korny korny is offline
 
Join Date: Jan 2004
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by bryan09
I got this problem when I inserted the above code ..

Code:
ERROR: Unknown Punctuation String @ 9
STR: ->
SQL: $DB_site->query("
	UPDATE " . TABLE_PREFIX . "thread
	SET open = 0
	WHERE forumid IN (36) AND open = 1 AND sticky = 0 AND lastpost < " . intval(TIMENOW - (86400 * 30))
)

SQL-query: 

$DB_site->query(" UPDATE " . TABLE_PREFIX . "thread SET open = 0 WHERE forumid IN (36) AND open = 1 AND sticky = 0 AND lastpost < " . intval(TIMENOW - (86400 * 30)) ) 
MySQL said:  

#1064 - You have an error in your SQL syntax near '$DB_site->query("
    UPDATE " . TABLE_PREFIX . "thread
    SET open = 0
    WHERE for' at line 1
I just got the same error.

Please let me know what I maybe doing wrong?
Reply With Quote
  #26  
Old 08-29-2005, 06:27 AM
korny's Avatar
korny korny is offline
 
Join Date: Jan 2004
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Anyone now a fix for my SQL query problem?
Reply With Quote
  #27  
Old 09-05-2005, 03:39 AM
MasJ MasJ is offline
 
Join Date: Jan 2005
Posts: 4
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thank you Trafix and KirbyDE, worked like a charm. Been looking for this for a very long time : ).
Reply With Quote
  #28  
Old 10-06-2005, 12:51 AM
Paul M's Avatar
Paul M Paul M is offline
 
Join Date: Sep 2004
Location: Nottingham, UK
Posts: 23,748
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by korny
I just got the same error.

Please let me know what I maybe doing wrong?
That is php code to insert in a vbulletin file and run, sounds/looks to me like you are trying to run it directly as an sql query.
Reply With Quote
  #29  
Old 10-06-2005, 01:51 AM
korny's Avatar
korny korny is offline
 
Join Date: Jan 2004
Posts: 81
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Opps, well it looked like it was a sql query, what you posted.

Got it now..thanks Paul!
Reply With Quote
  #30  
Old 09-06-2006, 07:27 AM
cunder's Avatar
cunder cunder is offline
 
Join Date: May 2005
Location: NL
Posts: 129
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

hello
Can these be made that he does it also on Vbulletin 3.6.0 please!!
thanks
Reply With Quote
  #31  
Old 09-16-2006, 04:04 PM
Simplicity Simplicity is offline
 
Join Date: Jun 2004
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I would also like this for 3.6
Reply With Quote
Reply


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 01:44 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.04645 seconds
  • Memory Usage 2,315KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_code
  • (3)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
  • (3)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