View Single Post
  #20  
Old 08-09-2000, 02:32 AM
Guest
 
Posts: n/a
Default

This will provide a pop up when you have a new private message. You need to have the Private Messages Hack by Ed Sullivan installed for it to work.

In index.php look for in the private messages hack:

Code:
  	if ($newpmcount == 0) { 
		$lightbulb = 'images/off.gif';
	} else { 
		$lightbulb = 'images/on.gif'; 
	}
and replace this with:

Code:
        if ($newpmcount == 0) { 
		$lightbulb = 'images/off.gif';
	} else { 
		$lightbulb = 'images/on.gif'; 
               eval("\$popupinfo .=\"".gettemplate("popupscript")."\";");
	}
Then in your forumhome template look for:

Code:
{htmldoctype}
<HTML>
<HEAD><TITLE>$bbtitle - powered by vBulletin</title>
$cssinclude
</head>
and replace this with:

Code:
{htmldoctype}
<HTML>
<HEAD><TITLE>$bbtitle - powered by vBulletin</title>
$cssinclude
$popupinfo
</head>
then create a new template called:

popupscript

and put in:

Code:
<SCRIPT LANGUAGE="JavaScript">

<!--
browser = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 2 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 2 )));
browser4 = (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 4 )) || ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )));
if (browser4) {
    if (!self.url) {
       self.url = '';
    }
    if (parent.name != 'test') {
       test = window.open("http://www.yoururl.com/forum/instantprivate.html", "test", "resizable=yes,width=320,height=80");
    }
} else if (browser) {
    if (!self.url) {
       self.url = '';
    }
    if (parent.name != 'test') {
       test = window.open("http://www.yoururl.com/forum/instantprivate.html", "test", "resizable=yes,width=328,height=100");
    }
}

//-->

</SCRIPT>
if you want it to work you read a post:

open showthread.php and look for:

Code:
    if ($userinfo[receivepm]=="1") {
    	$pmlink = "<a href=\"private.php?action=newmessage&toid=$userinfo[userid]\"><img src=\"images/pm.gif\" border=0></a>&nbsp;";
    } else {
    	$pmlink = "";
    }
    //END PM Hack
and replace this with:

Code:
    if ($userinfo[receivepm]=="1") {
    	$pmlink = "<a href=\"private.php?action=newmessage&toid=$userinfo[userid]\"><img src=\"images/pm.gif\" border=0 alt=\"Send $userinfo[username] a Private Message\"></a>&nbsp;";
    } else {
    	$pmlink = "";
    }
  	$pmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$userid");
  	$pmcount = $pmcounta[msgid];
        $newpmcounta = $DB_site->query_first("SELECT COUNT(msgid) AS msgid FROM privatercvd WHERE toid=$userid AND UNIX_TIMESTAMP(datetime)>$bblastvisit");
               $newpmcount = $newpmcounta[msgid];
	if ($newpmcount == 0) { 
		$lightbulb = "";
	} else { 
		$lightbulb = "<a href=\"private.php\"><img src=\"images/pmon.gif\" border=0 alt=\"You have a private message. Click here to read it.\"></a>"; 
               eval("\$popupinfo .=\"".gettemplate("popupscript")."\";");
	}
    //END PM Hack
then open your showthread template and look for:

Code:
{htmldoctype}
<HTML>
<HEAD><TITLE>$bbtitle - $threadtitle</title>
$cssinclude
<script language="javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,width=175,height=275,resizeable=yes,status=no")
// -->
}
</script>
</head>
and replace this with:

Code:
{htmldoctype}
<HTML>
<HEAD><TITLE>$bbtitle - $threadtitle</title>
$cssinclude
$popupinfo
<script language="javascript">
<!--
function aimwindow(aimid) {
window.open("member.php?action=aimmessage&aim="+aimid,"_blank","toolbar=no,location=no,menubar=no,scrollbars=no,width=175,height=275,resizeable=yes,status=no")
// -->
}
</script>
</head>
and in the postbit template look for:

&nbsp;&nbsp;$pmlink

and add after $pmlink:

&nbsp;$lightbulb


Then after all of that create an .html file called
instantprivate.html

and put in:

Code:
<html>
<head>
	<title>Private Message Popup</title>
</head>

<body>
<table>
<tr bgcolor="yellow">
<td align="center">
You have new private message(s).<P>
[ <a href="private.php" target="_new">Read them!</a> ]</td>
</tr>
</table>

</body>
</html>
and upload this to your forum directory. In the popupscript template that you created you will need to change the path to point to the location of this html file.

Change the .html to read or give you the layout that you want.

This will give you a pop up window, with the private message hack installed, that will tell your members when they have a new message when they first get on the board and if they read a post and they have a new message. They can then go to the private message from the pop up or they will be given a new message icon in their posts. You will need to upload an image file for whatever you have the $lightbulb in the showthread.php file pointing to.

You will also need to go into your admin options area and change the default time for the cookietimeout section. It is set to 14,400 and you may want to reduce this time so that your members won't be getting a pop up window each time they go to the forum.

Give this a shot and let me know how it works.

Parker
Reply With Quote
 
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.02154 seconds
  • Memory Usage 1,792KB
  • Queries Executed 11 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD_SHOWPOST
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (10)bbcode_code
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_box
  • (1)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit_info
  • (1)postbit
  • (1)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • reputationlevel
  • showthread
Included Files:
  • ./showpost.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
  • showpost_start
  • bbcode_fetch_tags
  • bbcode_create
  • postbit_factory
  • showpost_post
  • 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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • showpost_complete