![]() |
What's it do?
Simple: it checks to see how many new PMs a user has. If they've only got one (which is usually the case...I don't think many people get tons of new PMs), the popup JavaScript alert displayed to them will let them know who sent them the message, what it's title is, and, rather than take them to the Inbox, it'll take them directly to the message. If there's more than one, it'll display a more vague message, letting them know just how many new messages they have, and redirecting them to their Inbox (which is where the current popup directs you). Anyway, here's the hack: Open global.php. Around line 266 you should see the following: Code:
$newpmmsg=1; Code:
$latest_pm = $DB_site->query("SELECT p.privatemessageid AS pm_popup_id, p.title AS pm_popup_title, u.username AS pm_popup_username FROM privatemessage p, user u WHERE messageread = 0 AND p.userid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC"); After that, edit your head_newpm template to make use of the new variables. Here's my use of it (highly suggested): Code:
<script language="JavaScript"> |
Here's an image of what the single-PM popup looks like:
https://vborg.vbsupport.ru/attachmen...414&fullpage=1 |
you could have moved the thread from the beta forum to the full releases forum you know :P cause you have permission to do that.
anyway i've installed something like this, but it shows you how many unread messages you have and the last time and username |
Actually, I contacted FireFly via PM and asked him how I should go about this, and he advised me to create a new thread and close the old one; so I did. :) I also sent an update to the old users informing them of the new thread.
Quote:
|
This is a cool hack, i've just installed it, thank you.
One question, and as always, I could be wrong, but should this line not be removed from the file? PHP Code:
|
From what file -- global.php? No! That's the part that processes the finished template and makes it available globally. :) Absolutely essential.
|
ah ok, my bad :)
|
No problem: thanks for installing it. I'm glad you like it. :) I get a real kick out of anyone who finds this stuff useful.
|
a good hack!!but it seems can't work for me!!i think maybe i do something wrong??see the below code what i change to
PHP Code:
|
Hmmm -- did you install the templates, too?
|
All times are GMT. The time now is 01:46 PM. |
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:
|