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 close thread after x days. (https://vborg.vbsupport.ru/showthread.php?t=74764)

Marco van Herwaarden 05-18-2005 07:02 PM

Looking at the instructions it seems to me that you can not select a forum.

bryan09 05-29-2005 08:12 AM

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


TCattitude 06-06-2005 11:14 PM

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 ;)

korny 07-20-2005 11:10 PM

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?

korny 08-29-2005 06:27 AM

Anyone now a fix for my SQL query problem?

MasJ 09-05-2005 03:39 AM

Thank you Trafix and KirbyDE, worked like a charm. Been looking for this for a very long time : ).

Paul M 10-06-2005 12:51 AM

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.

korny 10-06-2005 01:51 AM

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

Got it now..thanks Paul!

cunder 09-06-2006 07:27 AM

hello
Can these be made that he does it also on Vbulletin 3.6.0 please!!
thanks

Simplicity 09-16-2006 04:04 PM

I would also like this for 3.6


All times are GMT. The time now is 03:15 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.01102 seconds
  • Memory Usage 1,739KB
  • 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_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete