vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   Modification Graveyard (https://vborg.vbsupport.ru/forumdisplay.php?f=224)
-   -   Administrative and Maintenance Tools - Prune Private Messages - Age Based (https://vborg.vbsupport.ru/showthread.php?t=142308)

djbaxter 06-01-2007 01:19 AM

Quote:

Originally Posted by PossumX (Post 1258656)
I am guessing that this has "died on the vine"

No, not quite. I just haven't been able to move it back to the top of my priority list yet. But I haven't given up on it.

As stated above, though, if anyone with more time would like to have a look at it, I'd welcome the assistance. I have two versions - the published one which works with some limitations, and a subsequent version which gives me MySQL errors.

blogtorank 08-10-2007 04:01 PM

Quote:

Originally Posted by coinwash (Post 1314517)
No one to pick this ball up?

Does anyone have a better way??

Thanks

Looks like the coder is updating the code for this per his message in green up top of the hack:

Quote:

WARNING: I have discovered that, at present, the individual PM counts (user.pmtotal and user.pmunread) are not updated by this script and therefore running the script will leave members with inaccurate PM counts. I am currently seeking a way to fix this.


In another words if he supports it, I think he'll fix what you are reporting....

blogtorank 08-10-2007 04:11 PM

Quote:

Originally Posted by coinwash (Post 1310542)
I have tryed this hack and it's not working.
I'm getting

PHP Fatal error: Call to a member function on a non-object in /chroot/home/coinwash/coinwash.com/html/mb/killpms.php on line 6

Is there anyone out there who knows the Fix---Please

Thank you

Sorry for the double post, on this hack how come you are referencing a killpms.php when the hack's file name is only prunepms.php and shouldn't have nothing to do with a "killpms.php" Because only one file is for download here which is prunepms.php...

PHP Code:

<?php 
// ######################################################################
// # Prune Private Messages (based on age) version 1.0                  #
// # by djbaxter http://forum.psychlinks.ca March 2007                  #
// #                                                                    #
// # Adapted for vBulletin 3.6x (tested on vBulletin 3.65)              #
// # from amykhar's Mass Delete Old Private Messages for vBulletin 2.2x #
// # (see https://vborg.vbsupport.ru/showthread.php?t=27421)        #
// #                                                                    #
// # Thanks to Jacqueline at the http://www.vbulletin.org forum,        #
// # and Sarah and Jorrit787 at the http://www.theadminzone.com forum   #
// # for assistance with the MySQL queries                              #
// ######################################################################

error_reporting(E_ALL & ~E_NOTICE);

define("THIS_SCRIPT""Prune Private Messages");

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

 print (
"Pruning old private messages... <br/>");
 
$query "DELETE " TABLE_PREFIX "pmtext . * , " TABLE_PREFIX "pm . * FROM " TABLE_PREFIX "pmtext, " TABLE_PREFIX "pm  WHERE " TABLE_PREFIX "pm.pmtextid = " TABLE_PREFIX "pmtext.pmtextid AND " TABLE_PREFIX "pmtext.dateline < $time";
 
mysql_query($query);

 print(
"Records deleted: ");
 print (
mysql_affected_rows());
 print (
"<br/>");

 print (
"Pruning private message receipts... <br/>");
 
$query "DELETE " TABLE_PREFIX "pmreceipt . * FROM " TABLE_PREFIX "pmreceipt WHERE " TABLE_PREFIX "pmreceipt.pmid > 0";
 
mysql_query($query);

 print(
"Records deleted: ");
 print (
mysql_affected_rows());
 print (
"<br/>");
 
?>


djbaxter 09-07-2007 05:57 PM

Quote:

Originally Posted by coinwash (Post 1334381)
Still not working?

Is this hack working for anyone???

Prune Private Messages

It works (to a degree). It's just not complete.

It will:

1. prune private messages over a certain age if run manually, which you can do from the ACP

It won't:

1. run successfully as a cron job/scheduled task, or at least it doesn't work for all configurations

2. correctly recount stored PMs for members after delteing old PMs

I apologize. I've had a series of issues - medical issues, then a death in the family, then surgery with home recovery and complications. It's still on my to-do list. I just haven't been able to get to it yet.

If anyone would like to take this and make it work the way it should, please feel free. Alternatively, feel free to make suggestions on altering the code.

PoetJA-1975 11-18-2007 01:32 AM

Quote:

WARNING: I have discovered that, at present, the individual PM counts (user.pmtotal and user.pmunread) are not updated by this script and therefore running the script will leave members with inaccurate PM counts. I am currently seeking a way to fix this.

WORKAROUND: Update the counts from your Admin CP, especially thread and post counts. This seems to fix the PM counts as well.
Does this workaround work correctly and leave Members with accurate PM counts?
Thanx,

Jacquii.

djbaxter 11-18-2007 01:47 AM

Quote:

Originally Posted by PoetJA-1975 (Post 1384727)
Does this workaround work correctly and leave Members with accurate PM counts?
Thanx,

Jacquii.

Unfortunately, no.

The first time a member manually deletes a PM, the count is correctly updated. I haven't yet found a way to do it successfully from the Admin CP.

I try to work on a new version periodically as I get time but between work, family, and 4 and a half months recovering from three bouts of surgery this year I haven't yet got to a version which doesn't create some errors.

What's required is that the script correctly updates three variables: one for the PM, one for the PM text, and one for the count decrement.

I have said more than once that if there's anyone out there with more time to devote to the issue, I'll willingly turn over all credit and the current versions I have so far to them.


All times are GMT. The time now is 02:59 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.01256 seconds
  • Memory Usage 1,756KB
  • 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
  • (7)bbcode_quote_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
  • (6)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