Problem: Private messages do not get deleted when a table prefix is used for the database.
Solution: The code has been updated to include this data. I have performed this update without permission, so w-elbalad.com can do whatever he wants with it. Update the code in your XML file or download my new one.
Code:
<?xml version="1.0" encoding="ISO-8859-1"?>
<product productid="pm" active="1">
<title>Empty PMs and VMs</title>
<description>Empty PMs and VMs by installing. Original w-elbalad.com. 1.1 bugfix by Windows7Forums.com</description>
<version>1.1</version>
<codes>
<code version="1">
<installcode><![CDATA[$db->hide_errors();
$db->query_write("TRUNCATE " . TABLE_PREFIX . "pm;");
$db->query_write("TRUNCATE " . TABLE_PREFIX . "pmreceipt;");
$db->query_write("TRUNCATE " . TABLE_PREFIX . "pmtext;");
$db->query_write("TRUNCATE " . TABLE_PREFIX . "visitormessage;");
$db->query_write("TRUNCATE " . TABLE_PREFIX . "visitormessage_hash;");
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET pmtotal = '0', pmunread = '0';");
$db->query_write("UPDATE " . TABLE_PREFIX . "user SET vmunreadcount = '0', vmmoderatedcount = '0';");
$db->errno = 0;]]></installcode>
<uninstallcode />
</code>
</codes>
<templates>
</templates>
<plugins>
</plugins>
<phrases>
</phrases>
<options>
</options>
</product>
Problem: I'd like to run it as a SQL Query from AdminCP
Solution:
Run each line separately. Remember, you can only run one line queries from AdminCP SQL. Replace prefix_ with your database prefix, or nothing at all, depending on if you are using one.
TRUNCATE `prefix_pm`;
TRUNCATE `prefix_pmtext`;
TRUNCATE `prefix_pmreceipt`;
TRUNCATE `prefix_visitormessage_hash`;
TRUNCATE `prefix_visitormessage`;
UPDATE `prefix_user` SET `pmtotal` = 0, `pmunread` = 0;
UPDATE `prefix_user` SET `vmunreadcount` = 0, `vmmoderatedcount` = 0;
Consider using phpMyAdmin or Navicat for Windows as it is much easier and you can run them all from there.
This is
Mike Fara from
Windows 7 Forums. I hope that this has resolved the issue for someone other than myself using a forum database prefix

Take care, and thanks for the excellent script.