To fix the deny receipt problem, we have to actually specify the receipt SQL part, so do this:
Find:
PHP Code:
$DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."' $receiptSQL WHERE privatemessageid=$the_pm_id");
Change to:
PHP Code:
$DB_site->query("UPDATE privatemessage SET messageread=1, readtime='".time()."', receipt=2 WHERE privatemessageid=$the_pm_id");
That should fix it.