The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Ajax notification of a new personal message Details »» | |||||||||||||||||||||||||||
Ajax notification of a new personal message
Developer Last Online: Nov 2013
A small mod that puts a flashing envelope in the top right corner of your screen when you get a new personal message, even if youre sitting idle. You dont have to open / reload any pages to see the notification
My default, it checks once per minute but its configurable in the javascript PLEASE - Read the instructions, anything in there that is asked here will be ignored or simply a RTFM reply. Ive tried it with FF2 / IE6 and Opera 9.21. Ive tried it on two forums running 3.6.5 but it should work on 3.6.0-3.6.7 Edit footer template, add this to the very bottom HTML Code:
<if condition="$bbuserinfo[userid] > 0"> <if condition="$vboptions['ajaxchecknewpmactive']"> <script> sessionurl = '$session[sessionurl]'; checkNewPM() </script> <if condition="$vboptions[ajaxchecknewpm_position]=='F'"> <div id="ajaxnewpmdiv" style=" position:absolute; display:none; width:32px;height:32px;left:0px;top:0px; padding:0px;background:transparent; border:0px solid #ffffff"><a href="private.php?$session[sessionurl_q]"><img src="images/newpm.gif" alt="You have a new PM" border="0"></a></div> <script type="text/javascript"><!-- /* Script by: www.jtricks.com * Version: 20060303 * Latest version: * www.jtricks.com/javascript/navigation/floating.html */ var target_x = -60; var target_y = 12; var has_inner = typeof(window.innerWidth) == 'number'; var has_element = document.documentElement && document.documentElement.clientWidth; var fm_id='ajaxnewpmdiv'; var floating_menu = document.getElementById ? document.getElementById(fm_id) : document.all ? document.all[fm_id] : document.layers[fm_id]; var fm_shift_x, fm_shift_y, fm_next_x, fm_next_y; function move_menu() { if (document.layers) { floating_menu.left = fm_next_x; floating_menu.top = fm_next_y; } else { floating_menu.style.left = fm_next_x + 'px'; floating_menu.style.top = fm_next_y + 'px'; } } function compute_shifts() { fm_shift_x = has_inner ? pageXOffset : has_element ? document.documentElement.scrollLeft : document.body.scrollLeft; if (target_x < 0) fm_shift_x += has_inner ? window.innerWidth : has_element ? document.documentElement.clientWidth : document.body.clientWidth; fm_shift_y = has_inner ? pageYOffset : has_element ? document.documentElement.scrollTop : document.body.scrollTop; if (target_y < 0) fm_shift_y += has_inner ? window.innerHeight : has_element ? document.documentElement.clientHeight : document.body.clientHeight; } function float_menu() { var step_x, step_y; compute_shifts(); step_x = (fm_shift_x + target_x - fm_next_x) ; if (Math.abs(step_x) < .5) step_x = fm_shift_x + target_x - fm_next_x; step_y = (fm_shift_y + target_y - fm_next_y) ; if (Math.abs(step_y) < .5) step_y = fm_shift_y + target_y - fm_next_y; if (Math.abs(step_x) > 0 || Math.abs(step_y) > 0) { fm_next_x += step_x; fm_next_y += step_y; move_menu(); } setTimeout('float_menu()', 20); }; compute_shifts(); if (document.layers) { // Netscape 4 cannot perform init move // when the page loads. fm_next_x = 0; fm_next_y = 0; } else { fm_next_x = fm_shift_x + target_x; fm_next_y = fm_shift_y + target_y; move_menu(); } float_menu(); //--></script> </if> </if> </if> HTML Code:
<script type="text/javascript" src="clientscript/vbulletin_ajax_checknewpm.js"></script> Find this HTML Code:
<strong><phrase 1="$vbphrase[pmpercent_nav_compiled]">$vbphrase[your_pm_box_is_x_full]</phrase></strong></if> </div> </td> HTML Code:
<if condition="$vboptions[ajaxchecknewpm_position]=='N'"> <td class="alt2" valign="top" nowrap="nowrap"><div id="ajaxnewpmdiv" style=" display:none; width:32px;height:32px;left:0px;top:0px; padding:0px;background:transparent; border:0px solid #ffffff"><a href="private.php?$session[sessionurl_q]"><img src="images/newpm.gif" alt="You have a new PM" border="0"></a></div></td> </if> HTML Code:
<if condition="$bbuserinfo['pmunread']"> <td class="alt2" valign="top" nowrap="nowrap"> <a href="/forum/private.php?$session[sessionurl]"><img src="$stylevar[imgdir_misc]/newpm.gif" alt="You have a new PM" border="0"></a> </td> </if> HTML Code:
setTimeout("checkNewPM()", checkdelay); Upload 1 GIF file Upload 1 Javascript file Import 1 XML product Makes 1 plugin hook into misc.php (adds ajaxchecknewpm function) History 19 July 2007 Version 1.1
if you have 1.0 installed, youll need to upload the Jaavscript file again, uninstall / reinstall the XML product and make the template changes to footer (not headerinc) and add 1 to navbar Show Your Support
|
Comments |
#2
|
|||
|
|||
First post reserved
|
#3
|
||||
|
||||
now this seems really usefull.. I'm going to try it out
great hack! |
#4
|
|||
|
|||
I shall test this out!
Thanks mate! |
#5
|
|||
|
|||
Cool, something similar to what vb.org has but ajax ^^ i like
|
#6
|
||||
|
||||
as i read the instruction , it check the pm box each X min ( we can change it ) . is there anyway that JUST when we get a new pm it works and it inform us that we get new pm ? i think it s better for load the server in each X min or ..
Thanks |
#7
|
||||
|
||||
Now this seems nice! Question though - I've already installed New PM Notification - would love to implement the ajax feature... Anyway - that I could have the blinking notification of your hack appear in the navbar like the New PM Notification mod?
Thanx, Jacquii. |
#8
|
||||
|
||||
Good work
|
#9
|
|||
|
|||
You can put the hack anywhere you like. most of the template change is to have it float but will I was working on the code, it did actually start in the navbar
Ill give people a couple of options, floating or in the navbar, you can pick in the options for it. Poet - Ill do that but it looks a bit strange "You have no new PMs" and then a flashing envelope I did find a bug this morning though, after posting this of course If youre a guest, it still asks the server for your PM count. As youre a guest, you get permission denied that causes two things. Firstly, IE borks on it if you have Microsoft Script Debugger installed (go figure, IE sucks) and it ups your bandwidth bill. Ill upload v1.1 tonight that will fix all that. If you dont want it to hit the server but still want the flashing floating icon, set the timer to 5 million or something insane. It still checks everytime the page is loaded. |
#10
|
|||
|
|||
As promised, 1.1 attached.
|
Thread Tools | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|