vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 2.x Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=4)
-   -   Mass Delete Old Private messages (https://vborg.vbsupport.ru/showthread.php?t=27421)

amykhar 09-04-2001 10:00 PM

Here is a simple script that I just hacked up that will delete all private messages older than 60 days old. Just copy the code to a new file, put in your forum root directory, and run it.




PHP Code:


<?php

require ("global.php");
$time time() - (60 24 60 60);

$a $DB_site->query("DELETE FROM privatemessage WHERE dateline < $time");

?>


Gutspiller 01-23-2002 06:22 PM

What do you mean put in "a" file? a php file? Another question, are you saying I would have to run this file everytime I wanted it to delete the messages or do I just have to run it once? If so is there a way to get it to automatically do this instead of needing to be manually ran?

Thanks for any info you can provide. :tu:

TWTCommish 01-23-2002 06:40 PM

It would need to be executed...every time it would delete ALL PMs (for all users) older than 60 days. If you wanted it run regularly without your intervention, you'd need to ask your webhost about setting up a crontab.

PhotoGenie 01-27-2002 01:13 PM

What version is this for?

TWTCommish 01-27-2002 01:17 PM

It's simple enough that I think it'll work for any version that supports the PM system.

PhotoGenie 01-27-2002 01:20 PM

TY!! TWT :)

LuBi 02-03-2002 03:58 AM

Can we get something like this that does it automatically?

amykhar 03-02-2002 04:08 PM

Lubi, just create a cron job for the script.

Amy

alexi 06-29-2002 11:34 AM

Which numbers would I change if I wanted a figure other than 60 days? Say 6 months? (180 days)

alexi 07-08-2002 10:49 PM

anyone have any idea on which number to change? The last 60?


All times are GMT. The time now is 02:51 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.01305 seconds
  • Memory Usage 1,723KB
  • 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_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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