vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Cron Job Script to Delete Redirect Threads (https://vborg.vbsupport.ru/showthread.php?t=45966)

LancerForums 11-21-2002 06:36 PM

Cron Job Script to Delete Redirect Threads
 
Hi,

I'd like to write a script that will run everynight and delete x old threads that are redirects.

I want to make sure that I get this right, since I don't know exactly how the moved w/ redirect feature works, though.

Would this script do the job correctly without deleting the real thread?

//
// Delete all redirects that are older then $numdays
//
$numdays=3;
$datecut=time()-($numdays*86400);
mysql_query("DELETE FROM thread WHERE open='10' AND lastpost<=$datecut");

Thanks,

Mark

Logician 11-22-2002 09:12 AM

yes Mark, your code looks correct. But you may want to test it for a while in your test board if you like.

Btw. I'm sure you know you need to add MYSQL_connect command and choose db beforehand.

LancerForums 11-22-2002 01:04 PM

ok, I'll try testing it on my test forum for a little while before using it on the real forums.

Thanks,

Mark


All times are GMT. The time now is 12:32 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.01075 seconds
  • Memory Usage 1,705KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete