TWTCommish
01-21-2002, 10:00 PM
Ok, I realize this is TINY. Sorry. :) I figured it'd be worth posting anyway, though, because this tiny little hack has been extremely useful to me.
What's it do?
Short, and sweet: instead of a link to the Inbox in the new PM notification email, it displays a link directly to the message itself.
Known bugs
From what I understand, the mysql_insert_id() function is a little bit on the funky side...so it seems that, every few dozen emails I receive, just one doesn't work. This is a real rarity, though. 99% of the time it hums along without a hitch.
Ok, this hack is VERY simple. Here goes:
in private.php in your main forums directory, find the code below (around line 625 or so):
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,showsignature,iconid,messageread ,folderid,receipt) VALUES (NULL,$touserinfo[userid],$touserinfo[userid],$bbuserinfo[userid],'".addslashes(htmlspecialchars($title))."','".addslashes($message)."',".time().",'$signature','$iconid',0,0,$receipt)");
RIGHT after it, place this:
$the_pm_id = $DB_site->insert_id();
Save and upload. Yep, that's it for code editing! :) Then, open the email_pmreceived, and use the $the_pm_id variable as you please. Here's how I used it:
$touserinfo[username],
You have received a new private message at $bbtitle from $bbuserinfo[username]. Please click here to log in and read it:
$bburl/private.php?action=show&privatemessageid=$the_pm_id
Thanks,
$bbtitle
Attached is a quick screenshot of what the email looks like when I receive it. Works well for me. If anyone's got any suggestions, feel free to let me know. I hope this is useful. :)
What's it do?
Short, and sweet: instead of a link to the Inbox in the new PM notification email, it displays a link directly to the message itself.
Known bugs
From what I understand, the mysql_insert_id() function is a little bit on the funky side...so it seems that, every few dozen emails I receive, just one doesn't work. This is a real rarity, though. 99% of the time it hums along without a hitch.
Ok, this hack is VERY simple. Here goes:
in private.php in your main forums directory, find the code below (around line 625 or so):
$DB_site->query("INSERT INTO privatemessage (privatemessageid,userid,touserid,fromuserid,title ,message,dateline,showsignature,iconid,messageread ,folderid,receipt) VALUES (NULL,$touserinfo[userid],$touserinfo[userid],$bbuserinfo[userid],'".addslashes(htmlspecialchars($title))."','".addslashes($message)."',".time().",'$signature','$iconid',0,0,$receipt)");
RIGHT after it, place this:
$the_pm_id = $DB_site->insert_id();
Save and upload. Yep, that's it for code editing! :) Then, open the email_pmreceived, and use the $the_pm_id variable as you please. Here's how I used it:
$touserinfo[username],
You have received a new private message at $bbtitle from $bbuserinfo[username]. Please click here to log in and read it:
$bburl/private.php?action=show&privatemessageid=$the_pm_id
Thanks,
$bbtitle
Attached is a quick screenshot of what the email looks like when I receive it. Works well for me. If anyone's got any suggestions, feel free to let me know. I hope this is useful. :)