vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=111)
-   -   private message pop-up (https://vborg.vbsupport.ru/showthread.php?t=72725)

Slapyo 12-10-2004 02:18 PM

private message pop-up
 
On my homepage I have it display how many new private messages there are and how many total private messages they have. It works perfectly and displays the proper information. However, if you have pop-up notification turned on and then you visit the message board, there is no pop-up to notify you of the new private messages. I have included a few files such as global.php and wonder if the code for determining if it should pop-up or not is in one of those files.

Anyone know how I can get the pop-up to display on my homepage if the user has pop-ups turned on? Which files I need to include and the code.

Thanks.

Slapyo 12-10-2004 03:11 PM

So far i have this:

Code:

        chdir("./forums/");
        require_once("./global.php");
        chdir("../");

        if (($bbuserinfo['pmpopup']) && ($bbuserinfo['pmunread'] > 0)) {
                echo "<script type=\"text/javascript\">";
                echo "        confirm(\"You have a new PM from $newpm[username] ... it's called $newpm[title]\");";
                echo "</script>";
        }

The pop up works if you have a new PM, but it doesn't display the username and title of the PM. Is there a variable that stores this information? I am currently looking through the different portals to see what they have and haven't figured it out.

Slapyo 12-10-2004 05:59 PM

Well I have it down to this now. I found the variables are all in global.php.

Code:

        if ($shownewpm && $bbuserinfo['userid'] == 1) {
                $pmpopupurl = "http://www.veteransresources.org/forums/private.php?$session[sessionurl_js]do=showpm&pmid=$newpm[pmid]";
                echo "                                        <script type=\"text/javascript\">\n";
                echo "                                        <!--\n";
                echo "                                        // script to show new private message popup\n\n";
                echo "                                        if (confirm(\"You have a new private message.\n\nSender: $newpm[username]\nTitle: '$newpm[title]'\n\nClick OK to view it, or cancel to hide this prompt.\"))\n";
                echo "                                        {\n";
                echo "                                                // Output when OK is clicked\n";
                echo "                                                if (confirm(\"Open the message in a new window?\n\n(Press cancel to open in the current window.)\"))\n";
                echo "                                                {\n";
                echo "                                                        var winobj = window.open(\"$pmpopupurl\", \"pmnew\", \"menubar=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,resizable=yes,top=50,left=50\");\n";
                echo "                                                        if (winobj == null)\n";
                echo "                                                        {\n";
                echo "                                                                alert(\"Unable to open a new browser window,\n This might be due to a 'popup blocker'\");\n";
                echo "                                                        }\n";
                echo "                                                }\n";
                echo "                                                else\n";
                echo "                                                {\n";
                echo "                                                        window.location = \"$pmpopupurl\";\n";
                echo "                                                }\n";
                echo "                                        }\n\n";
                echo "                                        // end pm popup script\n";
                echo "                                        //-->\n";
                echo "                                        </script>\n";
        }

The bbuserinfo == 1 is so that I only see it and my users can't till I can get it figured out.


All times are GMT. The time now is 04:24 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.01614 seconds
  • Memory Usage 1,734KB
  • 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)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)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
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete