vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   New PM Popup Replacement (https://vborg.vbsupport.ru/showthread.php?t=92895)

rossco_2005 07-25-2005 10:00 PM

New PM Popup Replacement
 
[high]PLEASE CLICK INSTALL IF YOU INSTALL THIS[/high]

This mod changes the default New PM Popup to open a nice looking, closeable html popup within the page.

It tells you who sent the latest message as well as what the title is.

The window then gives you the option of viewing the message (in which case it opens another window and closes itself), viewing your inbox (again it will close the popup), or to just ignore the new message and close the New PM popup.

A screenshot is attached to show you what the popup will look like. :)

To install all you need to do is make 1 template edit to each of your skins, upload 1 XML plugin file, and upload 1 file with your ftp client.

[high]Installation[/high]

First go to your pm_popup_script template and replace it with this code:

HTML Code:

<script type="text/javascript" src="clientscript/fixed_position_ie.js"></script>
<script type='text/javascript'>
    var agtbrw=navigator.userAgent.toLowerCase();
    var operaaa=(agtbrw.indexOf('opera')!=-1);
    var head="display:''";
    var folder='';
    function expandit(curobj)
    {
        if(document.getElementById(curobj))
        {
            folder=document.getElementById(curobj).style;
        }
        else
        {
            if(ns6==1||operaaa==true)
            {
                folder=curobj.nextSibling.nextSibling.style;
            }
            else
            {
                folder=document.all[curobj.sourceIndex+1].style;
            }
        }
        if (folder.display=="none")
        {
            folder.display="";
        }
        else
        {
            folder.display="none";
        }
    }
</script>
<style type="text/css">
#pm_popup {
    position:fixed;
    top:250px;
    border:1px solid;
    width:64%;
    margin-right:18%;
    margin-left:18%;
}

</style>
<div id="pm_popup">
    <table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%">
        <tr>
            <td class="tcat">
                <span class="smallfont" style="float:$stylevar[right]">
                    <a href="#" onclick="expandit('pm_popup');">Close</a>
                </span>
                $vbphrase[new_private_msg]
            </td>
        </tr>
        <tr>
            <td class="panelsurround" align="center">
                <div class="panel">
                    <div align="center">
                        <table cellpadding="0" cellspacing="$stylevar[formspacer]" border="0">
                            <tr>
                                <td>
                                    $vbphrase[newest_pm_from] <b>$newpm[fromusername]</b>, $vbphrase[titled]<b>'$newpm[title]'</b>
                                    <br />
                                </td>
                            </tr>
                            <if condition="$shownewpmpreview">
                            <tr>
                                <td class="smallfont" style="padding-top:20px;">
                                    $newpm[message]
                                </td>
                            </tr>
                            </if>
                            <tr>
                                <td align="center" style="padding-top:20px;">
                                    <a href="$vboptions[bburl]/private.php?do=showpm&pmid=$newpm[pmid]">$vbphrase[read_message]</a>
                                    (<a href="$vboptions[bburl]/private.php?do=showpm&pmid=$newpm[pmid]" target="_blank">
                                        <span class="smallfont">$vbphrase[open_new_window]</span>
                                    </a>)
                                    <br /><br />
                                    <a href="$vboptions[bburl]/private.php">$vbphrase[go_to_inbox]</a>
                                </td>
                            </tr>
                        </table>
                    </div>
                </div>
                <div style="margin-top:$stylevar[cellpadding]px">
                    <form>
                        <input type="button" class="button" value="$vbphrase[close_popup]" onclick="expandit('pm_popup');" />
                    </form>
                </div>
            </td>
        </tr>
    </table>
</div>

The above step will need to be done for each of your skins.

Next, go to the plugin manager:
Go to your admincp -> Expand Plugin System in the nav -> Click Manage Products -> Scroll to the bottom of the page and click Add/Import -> Browse to the xml file included in the zip -> upload

Now access your FTP and upload the attached 'fixed_position_ie.js' file to your clientscript/ folder. This js allows Internet Explorer to do fixed positioning meaning that the popup stays in place as you scroll the screen.

That's it, enjoy. :)

[high]How To Enable Preview[/high]
To enable the preview in the popup (view the screenshot to see what it looks like), just edit the plugin called "New PM Popup Window Preview" with the following instructions:
Go to your admincp -> Expand Plugin System in the nav -> Click Plugin Manager -> Click edit next to the "New PM Popup Window Preview" plugin

Now find, right at the top, this line:
$newpmoption['showpreview'] = false;

Change to:
$newpmoption['showpreview'] = true;


The preview is now enabled. To change how many characters are shown in the preview, go back to editing the plugin and change this line (near the top):
$newpmoption['maxcharacters'] = 100;


[high]To uninstall this hack just revert the pm_popup_script template then delete the uploaded file (/clientscript/fixed_position_ie.js) and the plugin.[/high]


Thanks to COBRAws for adding phrases. :)

Tested and works fully in the vB3.5 series (vb 3.5.0 ("Gold") up to 3.5.4).
Should work in vb3.6, the variables look to be the same.

This will probably work in vb3.0 series too but I don't remember if I've tested. I'm not promising.
If anyone wants to confirm that it fully works please PM me or post here.

mholtum 07-26-2005 02:28 AM

what happened to placing all needed files in a zip? ;)

rossco_2005 07-26-2005 02:36 AM

Quote:

Originally Posted by mholtum
what happened to placing all needed files in a zip? ;)

Done. ;)

rossco_2005 07-27-2005 04:17 AM

Should work in RC1 as well.

mholtum 07-27-2005 04:31 AM

Quote:

Originally Posted by rossco_2005
Should work in RC1 as well.

Nope. No errors, but no popup either.. :(

rossco_2005 07-27-2005 04:33 AM

You sure?
It's just a simple javascript to open the new window, so either you forgot to make the change to pm_popup_script, or your browser has popups blocked?

axi 07-27-2005 02:22 PM

no errors and no popups for me either

axi 07-27-2005 02:46 PM

oh ++++ forgot this is the 3.5 forums. i installed it on the 3.0.7 lol.

still no errors tho, gona revert back to other templates

rossco_2005 07-27-2005 03:17 PM

Quote:

Originally Posted by axi
oh ++++ forgot this is the 3.5 forums. i installed it on the 3.0.7 lol.

still no errors tho, gona revert back to other templates

:laugh:

So mholtum did you figure out what's wrong?

mholtum 07-28-2005 05:14 AM

Quote:

Originally Posted by rossco_2005
:laugh:

So mholtum did you figure out what's wrong?

Nope. Should work..

Wayne Luke 08-19-2005 04:53 PM

I get a popup but it is blank. Anyone else get this problem? Also is there anyway to auto-center the window in the middle of the user's screen?

70age 09-13-2005 03:08 AM

No errors, but no popup either ,3.5RC2 IE 6

UltraVR 09-13-2005 05:44 AM

No Popup for me. vb3.5 RC3. It worked on my RC1. Any thoughts?

rossco_2005 09-19-2005 06:14 PM

Sorry for no response in all this time guys.
I haven't had a chance to look at this problem with RC2 (not tested in rc3), it worked for me so I don't get what is wrong.
I can tell you that, at latest, a working version will be released shortly after vb3.5 GOLD.

klinsek 10-12-2005 10:45 AM

Any updates for a Gold release? Interested in using this. :)

Thanks for your efforts!

davew 10-14-2005 08:19 AM

Doesn't work at all under gold :(

rossco_2005 10-14-2005 09:34 AM

Soon, if i have time this weekend maybe.

zahrani 10-14-2005 12:23 PM

It's working with vb3.5 GOLD

Thanks alot

chairman miaow 10-14-2005 01:03 PM

Same here ! Very nice - cheers !

rossco_2005 10-15-2005 12:09 AM

OK done, it now works in 3.5.0 fully. :)
Let me know if anyone finds any bugs and I will fix them right away. ;)

Lizard King 10-15-2005 12:34 AM

Code:

<script type="text/javascript">
        <!--
        //pm popup script
        var winobj = window.open("private.php?do=pmpopup", "pmnew", "menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=  50,left=50,height=275,width=410");
        if (winobj == null)
        {
                alert("$vbphrase[window_open_failed_blocker]");
        }
        // /pm popup script
        //-->
</script>

You may want to change the first template to this one ;) everybody installs in a different directory ;)

Keyser S?ze 10-15-2005 04:00 AM

see i dont get this, cuz the default PM popup works fine if u have a popup blocker running, but this does not, how come?

Aeolian_X 10-15-2005 04:45 AM

Had to use Lizard Kings script above to get it to work, but it still doesn't show the PM sender's name for some reason.

Lizard King 10-15-2005 08:36 AM

Quote:

Originally Posted by Aeolian_X
Had to use Lizard Kings script above to get it to work, but it still doesn't show the PM sender's name for some reason.

There are couple bugs with it.
1. is as you mentioned senders username is not visible
2. if you have unread pm and you receive a new one , it doesn't give any warning
3. ıf you receive more then 1 pm it only shows 1 pm received.

P.S : It is not my script , there was a error and i just figured it out.

rossco_2005 10-15-2005 03:20 PM

Quote:

Originally Posted by Lizard King
Code:

<script type="text/javascript">
        <!--
        //pm popup script
        var winobj = window.open("private.php?do=pmpopup", "pmnew", "menubar=no,scrollbars=no,toolbar=no,location=no,directories=no,resizable=no,top=  50,left=50,height=275,width=410");
        if (winobj == null)
        {
                alert("$vbphrase[window_open_failed_blocker]");
        }
        // /pm popup script
        //-->
</script>

You may want to change the first template to this one ;) everybody installs in a different directory ;)

Sorry that is what i meant to put, i just copied from the wrong style. :disappointed:

rossco_2005 10-15-2005 03:28 PM

Quote:

Originally Posted by Lizard King
There are couple bugs with it.
1. is as you mentioned senders username is not visible
2. if you have unread pm and you receive a new one , it doesn't give any warning
3. ıf you receive more then 1 pm it only shows 1 pm received.

P.S : It is not my script , there was a error and i just figured it out.

Just fixed number 1, in the template pm_pmpopup '$newpm['username']' should have been '$newpm['fromusername']'...I have no idea how that got changed, i guess i (again) copied from the wrong style. :rolleyes:

Number 2 i dont understand, are you saying if you have more than 1 PM the popup doesnt come up at all, or that it doesn't come up for each of the PMs? :blink:

And number 3 is how it's supposed to work, it only tells you the latest PM, not all of them.

weaver 10-15-2005 04:36 PM

Works fine for me. :)

weaver 10-16-2005 02:20 PM

Actually this morning I noticed that something about it is not working correctly. Yesterday when I tested it, I clicked on go to inbox and that worked fine. This morning when I clicked 'read this message' I received an error message:

Quote:

Invalid Private Message specified. If you followed a valid link, please notify the administrator.
This is the link it tried going to:

/private.php?do=showpm&pmid=

For some reason it's not adding the id number at the end of the link.

rossco_2005 10-16-2005 02:41 PM

Quote:

Originally Posted by weaver
Actually this morning I noticed that something about it is not working correctly. Yesterday when I tested it, I clicked on go to inbox and that worked fine. This morning when I clicked 'read this message' I received an error message:



This is the link it tried going to:

/private.php?do=showpm&pmid=

For some reason it's not adding the id number at the end of the link.

Thanks, in pm_pmpopup, $newpm[id] should be $newpm[pmid]

akanevsky 10-16-2005 02:58 PM

Come on, this is 3.5 and it has AJAX.
Why don't you make it AJAX based instead, rather than a popup that often won't work (after being cut off by firewall)

Lizard King 10-16-2005 03:02 PM

Quote:

Originally Posted by Dark Visor
Come on, this is 3.5 and it has AJAX.
Why don't you make it AJAX based instead, rather than a popup that often won't work (after being cut off by firewall)

Can you make something something similar

weaver 10-16-2005 03:10 PM

Quote:

Originally Posted by rossco_2005
Thanks, in pm_pmpopup, $newpm[id] should be $newpm[pmid]

Thanks :)

LeeWicKeD 10-16-2005 04:58 PM

Quote:

Originally Posted by rossco_2005
Thanks, in pm_pmpopup, $newpm[id] should be $newpm[pmid]


You should post that in your first post, it helped me to fix this "bug" ;)

Edit: ok you've already done..when i installed the hack, it was the wrong code :)

rossco_2005 10-16-2005 05:05 PM

Quote:

Originally Posted by Dark Visor
Come on, this is 3.5 and it has AJAX.
Why don't you make it AJAX based instead, rather than a popup that often won't work (after being cut off by firewall)

Because I don't know how to use ajax yet? :rolleyes:

If I figure out how AJAX works, maybe it would be a good idea to make this ajax based. :ermm:

akanevsky 10-16-2005 05:39 PM

Quote:

Because I don't know how to use ajax yet?
Don't worry, me neither :P

rossco_2005 11-06-2005 02:40 PM

I just updated this mod.

It's now a popup within the current window instead of opening a new window. Check out the new screenshot to see. :)

akanevsky 11-06-2005 04:10 PM

Ah, great. Just like I wanted. Good job man!

rossco_2005 11-06-2005 04:34 PM

Quote:

Originally Posted by Dark Visor
Ah, great. Just like I wanted. Good job man!

Thanks, and i got the idea from you. :)

Didn't even have to learn ajax either. :01:

Altho one day I might try to learn how it works so that we can have an auto check every minute or 2 to see if there's a new PM. :)

akanevsky 11-06-2005 04:53 PM

Quote:

Altho one day I might try to learn how it works so that we can have an auto check every minute or 2 to see if there's a new PM.
lol... that'd be good for board with long threads and slow users ;)

rossco_2005 11-06-2005 05:29 PM

Quote:

Originally Posted by Dark Visor
lol... that'd be good for board with long threads and slow users ;)

Yup exactly what I was thinking, or if you're waiting for someone to PM you you dont have to keep refreshing just leave the window open and do whatever else you want to do until you see the popup. :)


All times are GMT. The time now is 05:49 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01697 seconds
  • Memory Usage 1,858KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (2)bbcode_code_printable
  • (1)bbcode_html_printable
  • (17)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete