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)

Jawelin 07-10-2002 03:25 PM

Quote:

Originally posted by amykhar
$time = time() - (60 * 24 * 60 * 60);
Php time() function is expressed in seconds.
So, 60*60*24 means a day... :)

Any further problem ?
:bunny:

P.S.: the multiplier operator has the commutative property... :p

grace819 09-29-2002 12:25 AM

can anyone confirm if this hack does what its suppose to do? Meaning does the above code guarantee to delete PMs longer than 60 days?

alexi 09-29-2002 01:37 AM

works fine for me

eoc_Jason 09-30-2002 04:37 AM

If you don't think it will work (or just want to get a number) you can comment out the delete line and use these to see the total rows that will be deleted:

PHP Code:

$a $DB_site->query_first("SELECT COUNT(*) AS oldpms FROM privatemessage WHERE dateline < $time");
print 
"Total PMs To Be Deleted: $a[oldpms]"


[email protected] vbmenu_register("postmenu_308716", true); 10-11-2002 07:32 PM

Works pretty good. Thanks

Bison 10-12-2002 02:14 PM

This would be cool is you can add this into the Admin cp ...

Night Owl 07-24-2003 12:35 AM

Does this work on version 2.3.0?

Does it empty out all the folders?

How can I make it delete the PMs older than one month?

Thank you!

morey 01-15-2004 04:00 PM

Amy,

I took your script and made an option in the Admin CP to run it. It seemed to work, but when I ran it all I got was a blank screen. I was wondering if there is a way to add something to the end of the script so that when it is finished running it would return you to say the PM stats query? I am not that versed in php, to do the coding myself .

Thanks

chrisvonc 01-16-2004 01:03 PM

Quote:

Originally Posted by DJ5A
Hello:
I would also like to know if it works with version 2.3.0 & which 60 is the 60 days because I would like to change it to 30 Days!

If you are still interested to change the days, I modifed the first 60 and it seemed to work on my v2.3.2 test forum. So your code for 30 day limit would look like this:

PHP Code:

$time time() - (30 24 60 60); 


djbaxter 02-24-2007 02:04 PM

I'd like to adapt this to work with version 3.60.

The existing version shows:

Code:

<?php

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

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

?>

In 3.60, I see three variables for private messages:
  • pm
  • pmreceipt
  • pmtext

Can I just duplicate the a$ query above to prune each of those variables? Or is that unnecessary or redundant?


All times are GMT. The time now is 08:38 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.01100 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
  • (1)bbcode_code_printable
  • (2)bbcode_php_printable
  • (2)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