Go Back   vb.org Archive > vBulletin 3 Discussion > vB3 General Discussions
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools Display Modes
  #1  
Old 12-10-2004, 02:18 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default 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.
Reply With Quote
  #2  
Old 12-10-2004, 03:11 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
  #3  
Old 12-10-2004, 05:59 PM
Slapyo Slapyo is offline
 
Join Date: Feb 2004
Location: Rancho Cucamonga
Posts: 370
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

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.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 08:46 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.03945 seconds
  • Memory Usage 2,182KB
  • Queries Executed 13 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (1)ad_showthread_firstpost
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (2)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)navbar
  • (3)navbar_link
  • (120)option
  • (3)post_thanks_box
  • (3)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (3)post_thanks_postbit_info
  • (3)postbit
  • (3)postbit_onlinestatus
  • (3)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.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/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete