![]() |
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): Code:
$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)"); Code:
$the_pm_id = $DB_site->insert_id(); Code:
$touserinfo[username], |
Thanks :pleased:
|
thanks
|
Thanks.. will install this one later tonight
Ciao |
So anyone figureo ut what's up with the funky code? Is it something we should worry about or will this feature work?
|
Oh, you mean the mysql_insert_id() function? It'll be fine. I think it's only mucked up on me once or twice in maybe 100 emails or so. And it hasn't happened in weeks. I may have imagined it. :D
|
I've installed this and it seemed to work okay but now I've gotten a bunch of e-mails notifying me of PM's that didn't have the privatemessageid number in the URL so leads to an error page when you click it.
Also, myself and some others on the board have been reporting that they've been getting e-mails advising them of a new PM but when they access their PM section there's nothing there! Any ideas? |
Can you take me through the steps you've gone through to install this? I can't imagine how it could be much of a problem...one line of code (that needs to be RIGHT after that query), and a minor template change.
|
Quote:
|
I'm wondering if it's got something to do with your installation of PHP, then. I do know the function is a tad shaky, but if it completely fails to work, EVER, then there might be some switch missing. Do you know which version you're running, offhand?
|
You sure you didn't add it after the query inside if ($savecopy) { }? The queries do look very similar at the beginning
If your users do not elect to save copies of their private messages, then this hack would not work, if that's where you added them. You have to add them in the query that is right after this line: // enhanced - added $receipt to insert Thanks for the great hack, Commish! :D |
This is GREAT! Thank you!
|
No problem -- I'm glad you like it. :) I find it highly useful...so I figured others would as well. BTW: this could be modified slightly to include, say, the title and time sent along with the username and link. Wouldn't be too tough, I don't think.
|
Wonderful. Thank you!
:) Jennie |
Quote:
|
Cheers Chris. Running on 2.3.0. :)
|
TWTCommish. how did you get the Date, To, Subject and From part in your message? Would you be willing to share the code for that? :)
|
That's just part of the email. :)
|
I believe that I saw on the PHP changelog that the mysql_insert_id() function problems were fixed in 4.3.0 :)
|
Can someone update this for 3.0.7? It doesn't seem to have the same code.
Thanks! |
Quote:
|
Yeah, I know...thats why I asked if someone could update it.
Who's stating the obvious now? ;) |
All times are GMT. The time now is 09:18 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 | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|