PDA

View Full Version : Improved PM Popup JavaScript


TWTCommish
01-21-2002, 10:00 PM
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:

$newpmmsg=1;
RIGHT below it, place this (REPLACE your current code for this hack with the code below, if you happen to be one of the few people who actually intalled this originally from the Beta Hacks forum. :))


$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");
$hack_pm_total = $DB_site->num_rows($latest_pm);

if ($hack_pm_total > 1) {
eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url_multiple')."\";");
} else {
extract($DB_site->fetch_array($latest_pm));
eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url')."\";");
}


Now, create the four new templates. I've attached a file to this post containing the names of the four templates, and the text I've used to populate them -- which will probably be the same text and such you'll want to use. Don't be intimidated...they're all very small. :)

After that, edit your head_newpm template to make use of the new variables. Here's my use of it (highly suggested):


<script language="JavaScript">
<!--
function confirm_newpm() {
input_box = confirm("$pm_popup_text");
if (input_box == true) { // Output when OK is clicked
second_box = confirm("Open in new window?\n\n(Press cancel to open your $inboxname in the current window.)");
if (second_box == true) {
window.open('$pm_popup_url','pmnew','width=600,hei ght=500,menubar=yes,scrollbars=yes,toolbar=yes,loc ation=yes,directories=yes,resizable=yes,top=50,lef t=50');
} else {
window.location = "$pm_popup_url";
}
} else {
// Output when Cancel is clicked
}
}
-->
</script>



Enjoy.

TWTCommish
01-22-2002, 12:52 PM
Here's an image of what the single-PM popup looks like:
https://vborg.vbsupport.ru/attachment.php?postid=213414&fullpage=1

Scott MacVicar
01-22-2002, 02:11 PM
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

TWTCommish
01-22-2002, 02:16 PM
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.

anyway i've installed something like this, but it shows you how many unread messages you have and the last time and username
I'm afraid I don't understand. :confused: My hack does the same thing, doesn't it? If you have more than one, it tells you how many you have waiting and takes you to the Inbox. If you have only one, it gives you the title, the sender's username, and takes you right to the message itself. Perhaps you're thinking of the functionality of this hack when I released it in the Beta forum, rather than it's functionality now.

Ninth Dimension
01-22-2002, 06:57 PM
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? eval("\$headnewpm = \"".gettemplate('head_newpm')."\";"); Thanx

TWTCommish
01-22-2002, 07:22 PM
From what file -- global.php? No! That's the part that processes the finished template and makes it available globally. :) Absolutely essential.

Ninth Dimension
01-22-2002, 07:28 PM
ah ok, my bad :)

TWTCommish
01-22-2002, 07:29 PM
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.

squawell
01-23-2002, 10:13 AM
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

$newpmmsg=1;
$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 touserid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC");
$hack_pm_total = $DB_site->num_rows($latest_pm);

if ($hack_pm_total > 1) {
eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url_multiple')."\";");
} else {
extract($DB_site->fetch_array($latest_pm));
eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url')."\";");
}

eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}


am i do something wrong??

TWTCommish
01-23-2002, 12:09 PM
Hmmm -- did you install the templates, too?

TheComputerGuy
01-23-2002, 12:51 PM
I installed it, its just what the dr. ordered!!

I want to know whats it about prior to reading it!

TWTCommish
01-23-2002, 12:59 PM
Glad you like it. Thanks very much. :) People saying they like it, and using it, is very rewarding!

squawell
01-23-2002, 02:02 PM
Originally posted by TWTCommish
Hmmm -- did you install the templates, too?
i'm sure i have created those templates~~

Lionel
01-23-2002, 02:20 PM
but the pm are coming in normally like before...

Lionel
01-23-2002, 02:23 PM
maybe my mistake. I just discovered a mistake in template name. By accident I had cut the full line.

Lionel
01-23-2002, 11:15 PM
I can't get this hack to work. I am going to try by removing _txt in intructions

eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."

TWTCommish
01-23-2002, 11:18 PM
Removing what? I've got no idea what you're talking about. :)

Lionel
01-23-2002, 11:24 PM
shouldn't that:

eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."

be:

eval("\$pm_popup_multiple = \"".gettemplate('pm_popup_multiple')."

TWTCommish
01-23-2002, 11:27 PM
No. That won't work. :) The value of $pm_popup_text is what goes in the head_pm template. The value is either from the one template, or the other. There are two variables that need to be filled before the head_pm template is called...the var names, therefore, are identical in the if() half, and the else half.

Maybe I can help: what's gone wrong? Have you gone over the steps again to make sure you did them all correctly?

Lionel
01-23-2002, 11:30 PM
well this a fairly simple hack... I placed in global as instructed and cipy and pasted the four templates. double and triple check templates and did cut and paste for global.

TWTCommish
01-23-2002, 11:35 PM
Can you post that block of code you have (the code around it, too) in global.php? If you don't want to, that's okay...just wanna help. :) You're right, it is a simple hack, by most hack standards.

TWTCommish
01-23-2002, 11:39 PM
Originally posted by squawell
i'm sure i have created those templates~~
Any progress? I'd be glad to help if I can. Are you sure you've tried it with any new PMs? Sometimes the vBulletin PM popups don't popup, for no apparent reason. You might want to try it more than once.

Lionel
01-23-2002, 11:40 PM
$newpmmsg=0;
$headnewpm='';
if ($checknewpm and $bbuserinfo['userid']!=0 and $bbuserinfo['pmpopup']==2) {
if ($noshutdownfunc) {
$DB_site->query("UPDATE user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]");
} else {
$shutdownqueries[]="UPDATE LOW_PRIORITY user SET pmpopup=1 WHERE userid=$bbuserinfo[userid]";
}
$newpmmsg=1;

$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 touserid = $bbuserinfo[userid] AND p.fromuserid = u.userid ORDER BY dateline DESC");
$hack_pm_total = $DB_site->num_rows($latest_pm);

if ($hack_pm_total > 1) {
eval("\$pm_popup_text = \"".gettemplate('pm_popup_multiple')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url_multiple')."\";");
} else {
extract($DB_site->fetch_array($latest_pm));
eval("\$pm_popup_text = \"".gettemplate('pm_popup')."\";");
eval("\$pm_popup_url = \"".gettemplate('pm_popup_url')."\";");
}

eval("\$headnewpm = \"".gettemplate('head_newpm')."\";");
}

TWTCommish
01-23-2002, 11:43 PM
You should use the code tags next time -- the lack of formatting really hurts the legibility. :)

Anyway, the code looks good. Are you positive the templates are right? Do you get any JS errors? What I did to debug this the first time around was, if it didn't show up, I'd check the HTML on the page to see if the JS was actually there or not. If it's not, that means it hasn't detected a new PM at all. You might need to try it more than once to make sure it's not just a fluke, as it is now and then with vB's JS popup, it seems.

Lionel
01-23-2002, 11:46 PM
no errors. It pops up normal like before. But does not tell me the details

TWTCommish
01-23-2002, 11:51 PM
Oh! I'm so very, very stupid. I forget the template change. Go back to the first post...I'll edit it as soon as I post this to include the last change needed.

Lionel
01-23-2002, 11:57 PM
I put the new part in head_pm. Should I remove old? cause I just got one with no details.

TWTCommish
01-23-2002, 11:59 PM
Yes, you're replacing your entire head_newpm template. That should do the trick.

Lionel
01-24-2002, 12:03 AM
ok, I just did and awaiting for nex pm... i'll let you know... thanks..

TWTCommish
01-24-2002, 12:06 AM
Well, if you want to know sooner, you can just send one to yourself. :) How do you think I tested it? I sure as heck didn't wait for someone to send me one each time. :D Anyway, I hope you like it.

Lionel
01-24-2002, 12:13 AM
on the forum index page but I have to wait for one to test it on site index page, cause when I log in it takes me straight into forum index. Usually they popup when I get on site.

Lionel
01-24-2002, 12:13 AM
thanks for help

Ninth Dimension
01-24-2002, 12:35 AM
Ah good, an update, i'll be sure to change that :)

Ninth Dimension
01-24-2002, 12:45 AM
Hi, eeerrrmmm, i'm not getting any pop-ups, come to think of it, I did not get any before either, any ideas?

Ninth Dimension
01-24-2002, 12:48 AM
I've just checked, and the script is being called into the page when I get a new message, but it's not doing anything, here is the script:<!-- BEGIN TEMPLATE: head_newpm -->
<script language="JavaScript">
<!--
function confirm_newpm() {
input_box = confirm("<!-- BEGIN TEMPLATE: pm_popup -->
You have a new private message from ofDan entitled \"Re: test.\"\nClick OK to view it, or cancel to hide this prompt.
<!-- END TEMPLATE: pm_popup -->");
if (input_box == true) { // Output when OK is clicked
second_box = confirm("Open in new window?\n\n(Press cancel to open your Inbox in the current window.)");
if (second_box == true) {
window.open('<!-- BEGIN TEMPLATE: pm_popup_url -->
private.php?action=show&privatemessageid=674
<!-- END TEMPLATE: pm_popup_url -->','pmnew','width=600,height=500,menubar=yes,scroll bars=yes,toolbar=yes,location=yes,directories=yes, resizable=yes,top=50,left=50');
} else {
window.location = "<!-- BEGIN TEMPLATE: pm_popup_url -->
private.php?action=show&privatemessageid=674
<!-- END TEMPLATE: pm_popup_url -->";
}
} else {
// Output when Cancel is clicked
}
}
-->
</script>

<!-- END TEMPLATE: head_newpm -->

Ninth Dimension
01-24-2002, 12:51 AM
I just saw a problem, I had my template tags turned on, which I believed might have been the cause of the problem, so I tuned them off, and it's still not working<script language="JavaScript">
<!--
function confirm_newpm() {
input_box = confirm("You have a new private message from ofDan entitled \"Re: test.\"\nClick OK to view it, or cancel to hide this prompt.");
if (input_box == true) { // Output when OK is clicked
second_box = confirm("Open in new window?\n\n(Press cancel to open your Inbox in the current window.)");
if (second_box == true) {
window.open('private.php?action=show&privatemessageid=676','pmnew','width=600,height=50 0,menubar=yes,scrollbars=yes,toolbar=yes,location= yes,directories=yes,resizable=yes,top=50,left=50') ;
} else {
window.location = "private.php?action=show&privatemessageid=676";
}
} else {
// Output when Cancel is clicked
}
}
-->
</script>

squawell
01-24-2002, 01:12 AM
Originally posted by TWTCommish

Any progress? I'd be glad to help if I can. Are you sure you've tried it with any new PMs? Sometimes the vBulletin PM popups don't popup, for no apparent reason. You might want to try it more than once.
it have the popup window but still the old one!! :dead:

now i change the head_pm template like ur first post say

but no popup window??any idea??

Lionel
01-24-2002, 01:16 AM
go back to the first post for the fix (new template)

Lionel
01-24-2002, 01:19 AM
If I get more than one PM, the popup says you have an email from (blank) entitled (blank) but that is not the problem... It gets confused an open me a page that says the message cannot be found... maybe we should redirect to PM box?

TWTCommish
01-24-2002, 01:30 AM
Are you sure? You have more than one new PM, and yet it only acts as if there's one? Keep in mind that if you have 2 new PMs and get a popup, and then send yourself another, the popup will only "see" one. That's the way the system works.

Daniel: that looks like it should work. Does your <body> tag on that same page at the same time have an onload="" attribute calling the confirm_newpm() function?

squawell: as Lionel said, please replace your head_newpm template with the one now listed in the first post of this thread. :)

Ninth Dimension
01-24-2002, 01:33 AM
Originally posted by TWTCommish
Daniel: that looks like it should work. Does your <body> tag on that same page at the same time have an onload="" attribute calling the confirm_newpm() function?No, i've attached the html as a txt file so you can see for yourself.

squawell
01-24-2002, 01:40 AM
thankz all of u~~ :D

now it works~~~

TWTCommish
01-24-2002, 12:54 PM
Originally posted by danielhollands
No, i've attached the html as a txt file so you can see for yourself.
Hmmm. no onload attribute. Not that is odd...because that attribute should be there regardless of my hack if you have a new PM. Were your popups working fine before?

Ninth Dimension
01-24-2002, 01:00 PM
oh yes, the pop-up was running fine before.

there is a small update to this, late last night it actually worked, completly out of a blue one of my members sent me a message, and low and behold I got it.

It was just strange that when I was testing it myself it did not work :?:

TWTCommish
01-24-2002, 01:04 PM
Hmmmm. Perhaps the problem is your method of testing, then: I test it by having one window, like the Who's Online page, or the main forum page, open, and alongside it, a window to send myself a message with. The thing is that you have to close the window, or hit the back button, before it takes you back to your PM list after sending it...remember. the private.php doesn't pop those messages up. :)

Ninth Dimension
01-24-2002, 01:25 PM
in that case I think you have solved the problem.

thank you very much for helping out, and for developing the hack, it's really cool :)

TWTCommish
01-24-2002, 01:26 PM
If you have any problems, please let me know. And no, thank YOU for installing the hack. :) I'm just glad some people have found it to be useful.

Kumaro
01-24-2002, 04:19 PM
I installed the hack and I now get this message at the top of everypage of my board.

Warning: extract() expects first argument to be an array in /usr/local/psa/home/vhosts/forums.411hype.com/httpdocs/global.php on line 274

???

Kumaro
01-24-2002, 04:24 PM
sorry, got it fixed. ignore last message.

great hack

Lionel
01-24-2002, 06:20 PM
I sill have a problem when receiving multiple pm. It is reading from single template (with blank name and subject) and is opening an error page about cannot find message. I checked the routine in global.php, it seems fine, exactly as posted.

Stretchr
01-24-2002, 07:26 PM
Excellent hack, TWTCommish. Thank you!

TWTCommish
01-24-2002, 08:46 PM
Lionel: can you PM me some of the full files and such? I'd be more than glad to go through them and try to figure things out. :)

Kumaro
01-24-2002, 11:05 PM
TWTCommish, the following error occors when I am logged in. It just appears at the top of the page. when I log-out it goes away.

error: Warning: extract() expects first argument to be an array in /usr/local/psa/home/vhosts/forums.411hype.com/httpdocs/global.php on line 274

What's the problem?

TWTCommish
01-24-2002, 11:10 PM
That's a very odd error. I think it implies that, for some reason, it's finding a PM without a matching username that it came from. You can email or PM me some specific code if you'd like me to try and debug it for you.

dimava
01-25-2002, 07:35 PM
i'm still having problems, the box doens't popup when i get a new pm, and yes i do have it enabled in the user cp

please help

thanks,

Dimava

TWTCommish
01-25-2002, 08:50 PM
A few things to check:

Make sure that, when you send the PM to yourself, you CLOSE the window before it finishes redirectin...otherwise it won't work...that's just the way the vB Popup is. Furthermore, make sure you set it up right...get rid of any unread messages and make sure it's all "clean" beforehand. It's a pain to test, but it's the only way.

dimava
01-25-2002, 09:10 PM
o ok, thanks works great

Keta
02-14-2002, 01:47 PM
i have double checked and trouble checked. the templated are right. the edit to global php is right but i am getting this error i attached. and nothing pops up

TWTCommish
02-14-2002, 01:50 PM
Can you look at your HTML at line 88 and see what block of JS, specifically, is giving you problems? If I could take a look at the HTML output, I might be able to help.

Keta
02-14-2002, 01:55 PM
this is what is around 88

<!-- BEGIN TEMPLATE: head_newpm -->
<script language="JavaScript">
<!--
function confirm_newpm() {
input_box = confirm("<!-- BEGIN TEMPLATE: pm_popup -->
You have a new private message from Keta entitled \"hjkk.\"\nClick OK to view it, or cancel to hide this prompt.
<!-- END TEMPLATE: pm_popup -->");
if (input_box == true) { // Output when OK is clicked
second_box = confirm("Open in new window?\n\n(Press cancel to open your Inbox in the current window.)");
if (second_box == true) {
window.open('<!-- BEGIN TEMPLATE: pm_popup_url -->
private.php?s=&action=show&privatemessageid=888
<!-- END TEMPLATE: pm_popup_url -->','pmnew','width=600,height=500,menubar=yes,scroll bars=yes,toolbar=yes,location =yes,directories=yes,resizable=yes,top=50,left=50' );
} else {
window.location = "<!-- BEGIN TEMPLATE: pm_popup_url -->
private.php?s=&action=show&privatemessageid=888
<!-- END TEMPLATE: pm_popup_url -->";
}
} else {
// Output when Cancel is clicked
}
}
-->
</script>

<!-- END TEMPLATE: head_newpm -->
<!-- END TEMPLATE: headinclude -->
</head>
<body onload="Javascript:confirm_newpm()" background="images/apple/foot_bg.gif" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!-- BEGIN TEMPLATE: header -->

TWTCommish
02-14-2002, 01:58 PM
I think the problem is the fact that you've chosen to add the template beginning/ending comments. Try turning them off...that might fix the problem.

Keta
02-14-2002, 02:01 PM
and how do you turn that off?

edit: nvm i got it. it works! thanks !

TWTCommish
02-14-2002, 02:04 PM
Under your vBulletin Options screen, click on Templates -- there's only one option, I believe, under that section. Set it to "no" instead of "yes," and you're there. :)

Kohhal
02-21-2002, 07:37 PM
Just installed, took me a while to get rid of the errors but it's working now :D Cheers!

Note: I'm new to these hacks so for any other newbs : make sure when you copy text, especially javascript that each piece of code is on the correct line, otherwise you'll get all sorts of errors. Also, make sure to delete any extra lines(CRs) at the end of the .php files :)

ice!~neko
03-07-2002, 06:46 PM
i dont realy have time to look through the whole thread to see if this has already been said but i'm having a problem...

everytime i add that code to the PHP file this error comes up...

Parse error: parse error in /home/virtual/site71/fst/var/www/html/forums/global.php on line 275

Fatal error: Call to undefined function: getpermissions() in /home/virtual/site71/fst/var/www/html/forums/index.php on line 10

TWTCommish
03-07-2002, 06:50 PM
Can you post lines 270-280 here, then? That's a really odd error.

ice!~neko
03-07-2002, 06:54 PM
its okay, i sorted it out... i think i made to many lines between the codes, to try and seperate the hack from the rest of it so i dont get confused =\

ice!~neko <--- is a newbie to vBB and hacking

TWTCommish
03-07-2002, 06:59 PM
Okay then. :) I hope you like it.

Overgrow
03-10-2002, 01:31 PM
Great hack.. it was an improvement over what I was doing already because it has the multiple pm option. One problem though, the query as posted runs very slow on my site (166k PMs stored). I've never understood the duplicate fields in the PM table, but changing around the WHERE clause helps alot:


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


That uses the indexed p.userid field instead of the unindexed p.touserid. It seems to work the same and is no longer a PITA query. Thanks for the hack.

TWTCommish
03-10-2002, 01:38 PM
Thanks for pointing that out; I'll make the change shortly and update the instructions/file/etc. I appreciate it...and I'm honored that you'd find use for this. I'm a big admirer of your hacking, and the way you've put together your forums.

CeleronXL
05-11-2002, 01:36 AM
I don't know if anyone's done this yet, but I need to keep tabs on all the hacks I install. The only directions in the directions file itself were the new templates, so I made this set of instructions that were included in the first post. If anyone else wants them to keep tabs on the whole thing, here's the entire set of instructions.

akowacko
06-06-2002, 07:35 PM
i have the welcome panel hack. no i added your hack and the PM box is gone. i revert to my original files and the pm is still gone. can't see a thing. please help.

akowacko
06-06-2002, 07:36 PM
i'm having trouble looking for the original head_newpm template. can someone check if this is the original one?

<script language="JavaScript">
<!--
function confirm_newpm() {
input_box=confirm("You have a new private message. Click OK to view it, or cancel to hide this prompt.");
if (input_box==true) { // Output when OK is clicked
second_box=confirm("Open in new window?\n\n(Press cancel to open your $inboxname in the current window.)");
if (second_box==true) {
window.open('private.php?s=$session[sessionhash]','pmnew','width=600,height=500,menubar=yes,scroll bars=yes,toolbar=yes,location= yes,directories=yes,resizable=yes,top=50,left=50') ;
} else {
window.location="private.php?s=$session[sessionhash]";
}
} else {
// Output when Cancel is clicked
}
}
// -->
</script>

thanks!

TWTCommish
06-06-2002, 07:51 PM
I don't think we're allowed to post entire templates.

Boofo
06-06-2002, 09:56 PM
I tried installing this hack and all I could get where script errors. (Line 79). I realluy wanted it, but it doesn't look like it wants to work with my setup. If anybody has any updates that might make it work for me, I'm willing to try them. :)

TWTCommish
06-06-2002, 10:08 PM
Check your vBulletin Options to make sure you do NOT have each template beginning and ending with an HTML comment. If you do, the hack won't work.

Boofo
06-06-2002, 11:07 PM
I already checked that when you mentioned it in the other post. :) I reverted back to the standard popup and everything works like it should now. I'd like to get this one going if you can think of anything. :)

TWTCommish
06-06-2002, 11:25 PM
Hmmm. What error do you get? I'm wondering if the title of the PM or the username of the person who sent it might be interfering...

Boofo
06-06-2002, 11:42 PM
The title was Test and the name of the sender was Brandon. Normal stuff. :) It was the same kind of error that other user got at around line 88, only mine was 79. An object expected error, or something like that.

69-FLy-gUy
07-06-2002, 12:57 PM
hmm. I am having a little problem.. the PM box won't Pop up....

when i view the source.. the js is there. and says the info, but it won't pop up.

69-FLy-gUy
07-06-2002, 01:13 PM
there is a script error also.. line 69

santeematt
07-17-2002, 03:59 PM
w00t

thanks

:)

Brianna
08-02-2002, 01:40 AM
edit: NEVERMIND! I hope you aren't trying to figure it out right at this moment, cos it was just a very stoopid mistake on my behalf... :S

great hack! ^_^

Dave-ahfb
09-17-2002, 04:02 PM
I have been working on this hack this morning, everything works fine if it is a single pm. When there is multiple pms I get a JS error I have narrowed it down to the following line of output
input_box = confirm("You have 9 new private messages.\n Click OK to view your Inbox, or cancel to hide this prompt.
");

I am not a JS expert and cannot figure out what is making the "); go to a new line.

any suggestions?

Dave

Dave-ahfb
09-17-2002, 04:28 PM
got it, had a space in the pm_popup_multiple template

Thanks for the hack ;)

Dave

MarkL
04-25-2003, 05:03 AM
Okay, having a question. Now that I have done this hack, a Pop-Up Message won't show. Anyone know what could be wrong? :$

RetroDreams
05-12-2003, 01:23 AM
Installed flawlessly AFTER I cleaned out my inbox. =)

Anjie
05-23-2003, 09:12 PM
I cleaned out my inbox, set the templates to no HTML, and now there is no pop up at all. Any advice?
Forgot to add, added all templates, and replace all coding exactly as suggested. Does appear in source code. Using version 2.3.0

tkeil69575
07-07-2003, 09:06 AM
i have a slight improvement to this hack because of the following problem. when you have a user in your ignore list and he has sent you a pm (which wont show in your private messages, because you are ignoring him) the pop-up will say when getting a new pm that you have 2 new pms, although your only seeing one.

thats because the sql is not ignoring the useres in your ignore list.

here the modification I made (which seems to work):

above twtcommisch hack add:
if (trim($bbuserinfo['ignorelist'])!="") {
$ignoreusers='AND fromuserid<>'.implode(' AND
fromuserid<>',explode(' ', trim($bbuserinfo['ignorelist'])));
}

then change the sql to:
$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 $ignoreusers ORDER BY dateline DESC");

tina

Bison
08-08-2003, 04:25 AM
installed and working with vb 2.30