Current time: 04-29-2024, 11:40 AM Hello There, Guest! (LoginRegister)


Announcement
We have the biggest collection of MyBB Plugins here on the Net. We have currently 175+ MyBB Exclusive Plugins, 80+ MyBB Compatible MyCodes and 16+ MyBB 1.4.x Themes (Some are still under construction...) Thus, we provide you the largest MyBB Stuff on the net including tutorials. Stay with us, you will find out some more to come.
Now you can easily create your own buttons set for MyBB! Click here to have a look...
*** You cannot do your registration behind any Proxies anymore! ***
Welcome Guest[3.145.60.29], connected from
Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
There is anything like this?
12-10-2009, 06:19 PM
Post: #1
There is anything like this?
When someone gets a new PM one popup will display a message with the ok button them another popup will be displayed with a "To open in another window click ok. Click cancel to open in another tab but in the same window".

There is anything like this?

skiilz's signature
[Image: signature.php]
Find all posts by this user
Quote this message in a reply
12-10-2009, 06:40 PM
Post: #2
RE: There is anything like this?
(12-10-2009 06:19 PM)Light33 Wrote:  When someone gets a new PM one popup will display a message with the ok button them another popup will be displayed with a "To open in another window click ok. Click cancel to open in another tab but in the same window".

There is anything like this?

Try this. Go to the Ungrouped templates and choose the headerinclude. Put the following code all the way to the top, before anything else. I will have to go now but let me know how it will go.

<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=ye​s,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>

babjusi's signature
Find all posts by this user
Quote this message in a reply
12-10-2009, 06:46 PM
Post: #3
RE: There is anything like this?
(12-10-2009 06:40 PM)babjusi Wrote:  [quote='Light33' pid='382' dateline='1260483578']
When someone gets a new PM one popup will display a message with the ok button them another popup will be displayed with a "To open in another window click ok. Click cancel to open in another tab but in the same window".

There is anything like this?

If you want a simple popup check this out:

http://www.forumsecurity.eu/showthread.php?tid=35


Otherwise, try this. Go to the Ungrouped templates and choose the headerinclude. Put the following code all the way to the top, before anything else. I will have to go now but let me know how it will work out for you.

<script type="text/javascript">
<!--
//Show the pm in a pop up way

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=ye​s,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});
//-->
</script>

babjusi's signature
Find all posts by this user
Quote this message in a reply
12-10-2009, 07:31 PM (This post was last modified: 12-10-2009 07:31 PM by skiilz.)
Post: #4
RE: There is anything like this?
Didn't work..
My headerinclude template:
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1400"></script>
{$stylesheets}<link type="text/css" rel="stylesheet" href="{$mybb->settings['bburl']}/css/regbar.css" />
<script type="text/javascript">
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>
<script type="text/javascript">
<!--
//Show the pm in a pop up way
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=ye​
​s,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});
//-->
</script>

                            
<script type="text/javascript" src="jscripts/thx.js?ver=1400"></script>
{$newpmmsg}
<script type="text/javascript">
function selectCode(a)
{
   var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
   if (window.getSelection)
   {
      var s = window.getSelection();
       if (s.setBaseAndExtent)
      {
         s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
      }
      else
      {
         var r = document.createRange();
         r.selectNodeContents(e);
         s.removeAllRanges();
         s.addRange(r);
      }
   }
   else if (document.getSelection)
   {
      var s = document.getSelection();
      var r = document.createRange();
      r.selectNodeContents(e);
      s.removeAllRanges();
      s.addRange(r);
   }
   else if (document.selection)
   {
      var r = document.body.createTextRange();
      r.moveToElementText(e);
      r.select();
   }
}
</script>

skiilz's signature
[Image: signature.php]
Find all posts by this user
Quote this message in a reply
12-10-2009, 08:22 PM
Post: #5
RE: There is anything like this?
It works cos I have tested it. Replace all your header include with this code.

<script type="text/javascript">
<!--
//Show the pm in a pop up way

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=ye​ ​s,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});
//-->
</script>
<link rel="alternate" type="application/rss+xml" title="{$lang->latest_threads} (RSS 2.0)" href="{$mybb->settings['bburl']}/syndication.php" />
<link rel="alternate" type="application/atom+xml" title="{$lang->latest_threads} (Atom 1.0)" href="{$mybb->settings['bburl']}/syndication.php?type=atom1.0" />
<meta http-equiv="Content-Type" content="text/html; charset={$charset}" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/prototype.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/general.js?ver=1400"></script>
<script type="text/javascript" src="{$mybb->settings['bburl']}/jscripts/popup_menu.js?ver=1400"></script>
{$stylesheets}<link type="text/css" rel="stylesheet" href="{$mybb->settings['bburl']}/css/regbar.css" />
<script type="text/javascript">
<!--
    var cookieDomain = "{$mybb->settings['cookiedomain']}";
    var cookiePath = "{$mybb->settings['cookiepath']}";
    var cookiePrefix = "{$mybb->settings['cookieprefix']}";
    var deleteevent_confirm = "{$lang->deleteevent_confirm}";
    var removeattach_confirm = "{$lang->removeattach_confirm}";
    var loading_text = '{$lang->ajax_loading}';
    var saving_changes = '{$lang->saving_changes}';
    var use_xmlhttprequest = "{$mybb->settings['use_xmlhttprequest']}";
    var my_post_key = "{$mybb->post_code}";
    var imagepath = "{$theme['imgdir']}";
// -->
</script>
<script type="text/javascript">
<!--
//Show the pm in a pop up way
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=ye​​
​s,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});
//-->
</script>

                            
<script type="text/javascript" src="jscripts/thx.js?ver=1400"></script>
{$newpmmsg}
<script type="text/javascript">
function selectCode(a)
{
   var e = a.parentNode.parentNode.getElementsByTagName('CODE')[0];
   if (window.getSelection)
   {
      var s = window.getSelection();
       if (s.setBaseAndExtent)
      {
         s.setBaseAndExtent(e, 0, e, e.innerText.length - 1);
      }
      else
      {
         var r = document.createRange();
         r.selectNodeContents(e);
         s.removeAllRanges();
         s.addRange(r);
      }
   }
   else if (document.getSelection)
   {
      var s = document.getSelection();
      var r = document.createRange();
      r.selectNodeContents(e);
      s.removeAllRanges();
      s.addRange(r);
   }
   else if (document.selection)
   {
      var r = document.body.createTextRange();
      r.moveToElementText(e);
      r.select();
   }
}
</script>

babjusi's signature
Find all posts by this user
Quote this message in a reply
12-10-2009, 08:38 PM
Post: #6
RE: There is anything like this?
It works well here. I have this at my Smf forum and I wanted to have it for my Mybb forum. You saved me some time with this request Big Grin
Find all posts by this user
Quote this message in a reply
12-10-2009, 09:05 PM
Post: #7
RE: There is anything like this?
Ohh.. I didn't put the script in the top of all codes!
Thank you.

skiilz's signature
[Image: signature.php]
Find all posts by this user
Quote this message in a reply
12-11-2009, 11:22 AM
Post: #8
RE: There is anything like this?
Glad to have been of help, enjoy it Smile

babjusi's signature
Find all posts by this user
Quote this message in a reply
12-11-2009, 04:01 PM (This post was last modified: 12-11-2009 04:13 PM by skiilz.)
Post: #9
RE: There is anything like this?
I have added the code to the TOP but now always when I enter in the forum I get a popup... And I don't have PM to be displayed in the popup...
I get this message all the time I enter in the forums.

skiilz's signature
[Image: signature.php]
Find all posts by this user
Quote this message in a reply
12-11-2009, 04:27 PM
Post: #10
RE: There is anything like this?
(12-11-2009 04:01 PM)Light33 Wrote:  I have added the code to the TOP but now always when I enter in the forum I get a popup... And I don't have PM to be displayed in the popup...
I get this message all the time I enter in the forums.

Sorry about that. I meant it at the global_pm_alert template. The pm is not displayed in the template only the notification that you have a new pm along with the title and where to read it, in a new window or not. Just like you asked at your topic.

babjusi's signature
Find all posts by this user
Quote this message in a reply
0 member(s) viewed this thread in the last 365 days :
Post Reply 


Was This Thread Useful ?
Please Link To Us
URL
BBCode
HTML

Forum Jump:

 
New To Site ?
Some Useful Links
  • Help

  • You Might Need To Register

  • Forum Statistics

  • Mark All Forums Read

  • Forum Staff

  • Log Out
  • Contact Us

  • Mybbcodes

  • Return to Top

  • Return to Content

  • Lite (Archive) Mode

  • RSS Syndication
  • Powered By MyBB, © 2002-2024 MyBB Group.
    Golden Crown - Designed and Published by ghazal & exdiogene of MyBBCodes.
    Hosting provided by WWWHostingServer.com