vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Requests/Questions (Unpaid) (https://vborg.vbsupport.ru/forumdisplay.php?f=112)
-   -   Cronjob: remove redirects after X days (https://vborg.vbsupport.ru/showthread.php?t=77603)

Boothby 03-06-2005 03:59 PM

Cronjob: remove redirects after X days
 
I'm looking for a cronjob, which removes redirects to moved threads after X days. I hope you can help me.

Thx.

sabret00the 03-06-2005 04:04 PM

isn't this a default vB action?

Paul M 03-06-2005 04:15 PM

It's not a default part of vB.

Personally I just put this in the includes/cron/cleanup2.php, at the top, before the "delete stale sessions" code.

PHP Code:

//    Auto delete re-directs.
$DB_site->query("
    DELETE FROM " 
TABLE_PREFIX "thread 
    WHERE open = 10 AND dateline < "
intval(TIMENOW - (60 60 24 *5))
); 

It removes them after 5 days.

memobug 03-06-2005 06:21 PM

This would be a nice feature.

Regards,

Matt

Boothby 03-06-2005 06:28 PM

Thank you Paul. :)

Boothby 04-21-2005 04:38 PM

Now I need 2 more cronjobs.

First, one which deletes "Deleted Posts / Threads" finally.

Secondly I would like to set a profile field, in which users can insert a number of days, after which their PMs are deleted. And the cronjob I am looking for should do the delete.

Stargesicht 10-08-2005 10:50 AM

wrong Post from me!!!
Sorry..

Boothby 10-08-2005 06:06 PM

And I hoped that someone could help me with my last post I did in April. :(

makaiguy 07-26-2006 12:06 AM

Just discovered this.

Quote:

Originally Posted by Paul M
It's not a default part of vB.

Personally I just put this in the includes/cron/cleanup2.php, at the top, before the "delete stale sessions" code.

PHP Code:

//    Auto delete re-directs.
$DB_site->query("
    DELETE FROM " 
TABLE_PREFIX "thread 
    WHERE open = 10 AND dateline < "
intval(TIMENOW - (60 60 24 *5))
); 

It removes them after 5 days.

For vB 3.5, it's:
PHP Code:

$vbulletin->db->query_write("
    DELETE FROM " 
TABLE_PREFIX "thread 
    WHERE open = 10 AND dateline < "
intval(TIMENOW - (60 60 24 5)) 

Thanks, Paul. Very handy. *installs*


All times are GMT. The time now is 08:22 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.01093 seconds
  • Memory Usage 1,734KB
  • 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
  • (3)bbcode_php_printable
  • (1)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (9)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