vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   query to remove all PMs older than X days? (https://vborg.vbsupport.ru/showthread.php?t=233598)

z0diac 01-20-2010 04:09 AM

query to remove all PMs older than X days?
 
Does anyone know if it's possible to remove all PMs that are older than 'X' days via an sql query ? I can run the 'update counters' thing after.. I just want to remove msgs that a spammer sent to my entire memberlist.

bebo2004 01-21-2010 03:34 AM

if u want to delete all Pms to all u memberlist

run query

PHP Code:

TRUNCATE `pm`; 

then

PHP Code:

TRUNCATE `pmreceipt`; 

then

PHP Code:

TRUNCATE `pmtext`; 


then

PHP Code:

UPDATE `userSET `pmtotal` = 0, `pmunread` = 0

but u must be to close ur forum befor run the query
take care

z0diac 01-21-2010 04:31 AM

Thank you! I'll forward your msg to the person coding it for me. It would have been nice to have vB build this into their releases the same way they have public post pruning. :o

CarlitoBrigante 01-21-2010 04:55 AM

Be careful, those queries will delete all PMs!

If I remember correctly, using the pmtext.dateline field should be enough to get the date of the PM. Build a query on that, and run the cronjob frequently enough to avoid a too intensive process.


All times are GMT. The time now is 06:41 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.01045 seconds
  • Memory Usage 1,714KB
  • 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
  • (4)bbcode_php_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (4)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