MyBB Community Forums

Full Version: PM pop-up like I.P. Board
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Greetings,

I would be great to have PM pop-up like IP.Board.
no, please no

the PM alert at the top of the page is so far superior
I agree, plus you can have email notification for new PM's.
I very easily overlook the PM notification at the top of the page, so I... "borrowed" the code from a vBulletin install (shortly before I convinced them to convert to MyBB Toungue) and modified it to work with MyBB.

To a mod or some official-type person: Is it okay if I post the code here?
Sure go ahead, you can attach the zip file too.
1.2x used a popup...the new method is imho much better.
doesn't everyone use pop-up blockers?
(2008-11-29, 06:53 AM)Bey Brad Wrote: [ -> ]doesn't everyone use pop-up blockers?

Most people at least, so even if there is a PM pop-up most people will block it. I used to hate the pop-up and agree that the new bar is miles better.
Just add this to, say, the end of the 'headerinclude' template or something.

<script type="text/javascript">
<!--
// script to show new private message popup

if (confirm("You have {$mybb->user['pms_unread']} unread private messages.\n\nFrom: {$pm['fromusername']}\nTitle: {$pm['subject']}"))
{
	// Output when OK is clicked
	if (confirm("Open message in a new window?"))
	{
		var winobj = window.open("{$mybb->settings['bburl']}/private.php?action=read&pmid={$pm['pmid']}", "pmnew", "statusbar=yes,menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50");
		if (winobj == null)
		{
			if(confirm("Could not open a new window. Open PM in current window instead?"))
			{
				window.location = "{$mybb->settings['bburl']}/private.php?action=read&pmid={$pm['pmid']}";
			}
		}
	}
	else
	{
		window.location = "{$mybb->settings['bburl']}/private.php?action=read&pmid={$pm['pmid']}";
	}
}

new Ajax.Request('private.php?action=dismiss_notice', {method: 'post', postBody: 'ajax=1&my_post_key='+my_post_key});

// end pm popup script
//-->
</script>

It's worked okay on my forum, and by not replacing the 'global_pm_alert' template (like I did) you could probably have that easy to miss PM notice bar at the top too.
(2008-11-29, 06:53 AM)Bey Brad Wrote: [ -> ]doesn't everyone use pop-up blockers?

You guys have ever seen a pop-up pf IP.Board? I guess not. I think I have to post a screenshot of it.
Pages: 1 2