Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > General > Member Archives

Reply
 
Thread Tools
Details »»

Version: , by (Guest)
Developer Last Online: Jan 1970 Show Printable Version Email this Page

Version: Unknown Rating:
Released: 08-03-2000 Last Update: Never Installs: 0
 
No support by the author.

This may be impossible to do, but it has been requested by my girls on the UBB (which hopefully will be on Vb when I get my new server which is why I'm posting this here).

They want to be able to see someone "online" and be able to send them an instant message. Example, I see Martin on the "currently online" section on the front page. I click on his profile, and there is a link that says "send him an instant message" where I can fill out a form and it sends it to him. Martin instantly gets some type of notification, maybe a popup, or some noticable way that appears on any page he is on. He clicks on it, and then he can send an instant message back to me.

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #12  
Old 08-03-2000, 07:18 PM
Guest
 
Posts: n/a
Default

Actually, I would only add it to the major templates like show/newthread, show/newreply, forumdisplay, memberlist etc.

After the time I spent on my test board creating my templates, what's a few more minutes! LOL

What would I put in the template - $pminfo or something else?

[Edited by Me2Be on 08-03-2000 at 04:19 PM]
Reply With Quote
  #13  
Old 08-03-2000, 08:39 PM
Guest
 
Posts: n/a
Default

yeah - or you could just add below all the code I told you to paste in the header, this:

$header = $pminfo;
Reply With Quote
  #14  
Old 08-04-2000, 02:55 PM
Guest
 
Posts: n/a
Default

I thought I saw a hack like this for the UBB. Here's how it was basically done:
It was very similar to a PM, except it checked for an instant message every time a user loaded a page. If there was a new IM, it used javascript to pop open a new window with the message in it.
Not exactly instant - you have to reload or change pages to get it - but pretty close.
I'd love to see someone try to implement this in a graceful manner. It has potential to be great, but could also be very ugly if not done well.
Reply With Quote
  #15  
Old 08-04-2000, 03:57 PM
Guest
 
Posts: n/a
Default

I love the pop-up idea - that would be excellent!
Reply With Quote
  #16  
Old 08-04-2000, 09:26 PM
Guest
 
Posts: n/a
Default

Yeah, this was something that I suggested awhile back where when someone has a new message and they get on the forum it gives you a pop up that tells you you have a new message and gives you the ability to either read it there or go to the private message page.

Parker
Reply With Quote
  #17  
Old 08-05-2000, 02:03 AM
Guest
 
Posts: n/a
Default

That would be great. I am sure you can do it Ed.
Reply With Quote
  #18  
Old 08-07-2000, 06:35 PM
Guest
 
Posts: n/a
Default

I tried coping all the info you mentioned above into my header, but I'm getting parsing errors.

Is there another, simpler way to have the PM notification appear on the forumdisplay and showthreads page?
Reply With Quote
  #19  
Old 08-08-2000, 03:36 PM
Guest
 
Posts: n/a
Default

I'd think that the only way to have truly "instant" messages is to run a Java applet in the pages which keeps querying the DB on a regular basis looking for new IMs -- and if you get one it can pop a window saying "Here is your new message: blah blah blah". I’ve worked with Java before and it wouldn't be too hard to do if you have Java on your server -- however it would cause a huge server load if you had a lot of people online continually pegging the DB for their entire session.
Reply With Quote
  #20  
Old 08-09-2000, 03: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
  #21  
Old 08-09-2000, 06:45 PM
Guest
 
Posts: n/a
Default

Nice work Parker. Do you have this installed anywhere for us to check out?

That sounds like its getting close to what we are looking for.

One way I can think of to improve it would be to put the contents of the private message in the window itself. Also, include a reply button so a user can send an reply without having to stop what they are doing on the board. After they respond, the window can automatically close. That way, its almost just like an instant message.

Of course, at this point, its probably best to make it a seperate hack (instant message as opposed to private message). Give it its own set of templates with minimal interface.

With these small changes it sounds like we've almost got a decent IM tool!
Reply With Quote
Reply

Thread Tools

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 05:18 PM.


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.07015 seconds
  • Memory Usage 2,276KB
  • Queries Executed 25 (?)
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
  • (10)bbcode_code
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)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_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
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete