Quote:
Originally Posted by Boofo
If I had to make a choice, yours will stay. 
|
Well.. jokes away, this is something bad. If you have both hacks installed and use quick reply it would cause all attachments, not only the ones in that private message to belong to the new pm. That is a really really bad thing.
I was relying on the posthash for the attachments, the quick reply has no posthash (an empty one) so the code just assumes that all attachments with an empty posthash are for that message (ie - all other attachments in the forum).
I made a patch so this hack will work cooperative with the quick reply, I'll pm Erwin and see if he wants to update his hack also, either hack can be patched but I can only modify mine of course.
find this:
Code:
$attachcount = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "attachment
WHERE posthash = '" . addslashes($_POST['posthash']) . "'
AND userid = $bbuserinfo[userid]
");
$totalattachments = $attachcount['count'];
if ($totalattachments)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "attachment
SET private = $pmtextid, posthash = ''
WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
userid = $bbuserinfo[userid]
");
}
replace it with this:
Code:
if ($_POST['posthash']) {
$attachcount = $DB_site->query_first("
SELECT COUNT(*) AS count
FROM " . TABLE_PREFIX . "attachment
WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND posthash<>''
AND userid = $bbuserinfo[userid]
");
$totalattachments = $attachcount['count'];
if ($totalattachments)
{
$DB_site->query("UPDATE " . TABLE_PREFIX . "pmtext SET attach='$totalattachments' WHERE pmtextid='$pmtextid'");
$DB_site->query("
UPDATE " . TABLE_PREFIX . "attachment
SET private = $pmtextid, posthash = ''
WHERE posthash = '" . addslashes($_POST['posthash']) . "' AND
userid = $bbuserinfo[userid]
");
}
}
TXT is updated also