![]() |
Alright, this is pretty straightforward. Using this, your users will be redirected right to their most recent PM, rather than just their Inbox. Furthermore, you'll be able to use the username and title of the message in the popup. Only known downside: if they have more than one PM, it just takes them to the most recent one. I might work on this later to let them know that they've got a few waiting for them, but I've found that this is a very minor problem that rarely comes up.
This is in the Beta forum for one simple reason: I had trouble putting it together, and strongly suspect there's an easier way to do this. I figured I'd take a chance and post it anyway. Started off just for my own board, but I found it so useful I thought I'd post it. Here's how it's done: Open global.php in your main forums directory. Find this: Code:
$newpmmsg=1; Code:
$latest_pm = $DB_site->query_first("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 readtime = '0' AND touserid = '$bbuserinfo[userid]' AND p.fromuserid = u.userid ORDER BY dateline DESC LIMIT 1"); I'm sure you can all figure out for yourselves from then on how to get it to redirect and all that. Here's the template I'm using: Code:
<script language="JavaScript"> |
This only shows the last pm though you could have had multiple, anyway as your onyl selecting one use query_first instead of query and then fetch array.
PHP Code:
PHP Code:
|
Ah, I see. Well, I'm glad no larger problems exist. Is it particularly faster either way? I've edited the original post anyway.
And yeah, I'm aware of it taking you to the latest one. Hence this, from my post. Maybe you missed it. :) Quote:
|
Thanks, I thought about this a while back, but I didn't think it was possible.
|
Naw, 'tis very possible. I've been trying to have it detect whether there's more than one, and display the typical message and all that...but it's giving me a hard time, even though it seems like it ought to work. If I get it working, I'll be sure to post it as a hack. :)
|
All times are GMT. The time now is 12:27 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:
|