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 move threads to archive forum after x days (https://vborg.vbsupport.ru/showthread.php?t=74772)

trafix 01-31-2005 09:08 AM

nice work :)

catocom2 01-31-2005 08:54 PM

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.

Moncha 03-04-2005 09:00 PM

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?

Kruppa 04-15-2005 01:45 PM

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

Kruppa 04-26-2005 04:36 PM

Nobody? :(

KevinL 05-05-2005 05:06 PM

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?

Kruppa 05-23-2005 01:31 AM

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.

Marco van Herwaarden 05-23-2005 10:07 AM

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?

Kruppa 05-24-2005 01:40 PM

Quote:

Originally Posted by MarcoH64
This all code you edited?

No it was only a sample. Here's the full file I uploaded:

Marco van Herwaarden 05-24-2005 08:06 PM

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)


All times are GMT. The time now is 01:46 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.01110 seconds
  • Memory Usage 1,750KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)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