Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Blinking notifier in welcome bar when receiving a new pm Details »»
Blinking notifier in welcome bar when receiving a new pm
Version: 1.2, by Fusion.nl Fusion.nl is offline
Developer Last Online: Nov 2007 Show Printable Version Email this Page

Version: 3.0.7 Rating:
Released: 05-24-2005 Last Update: 05-25-2005 Installs: 86
 
No support by the author.

Don't you just hate it sending a pm to someone and he/she never reads it untill some weeks later? Using the build in pop-up bar from vB that problem is easily solved, but has to be turned on by the user since it is not a default setting.

VB.org offered me two sollutions, but were both (sound on pm, or that ugly blinking red message that is used by this forum) a bit over the top. I then found JohnBee's cleaner version which did the trick in Internet Explorer, but didnt function when using Firefox. Plus there was a lot of code that needed to be added, so even though I had zero experience in Javascript, i started crafting one myself.

Now this version works both in Internet Explorer as in Firefox, they look exactly the same (as in speeds) plus only 17 lines of code are added to one single template style. You can change the blink color to any color you like and also change the speed of the blinking. (setInterval("doBlink()",500, where 500 is the speed in milliseconds)

installation
In AdminCP, in your navbar template, find
Code:
ht = document.getElementsByTagName("html");
	ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)";
	if (confirm('$vbphrase[sure_you_want_to_log_out]'))
	{
		return true;
	}
	else
	{
		ht[0].style.filter = "";
		return false;
	}
}
//-->
After add
Code:
<!-- [Fusion's `ing PM mod :: http://ut2004.titaninternet.co.uk] -->
function doBlink() {
  var blink = document.all.tags("blink")
  for (var i=0; i<blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

//fix by Piglet
function startBlink() {
	window.preblinkonload();
	setInterval("doBlink()",500)
}

if (document.all && ! window.preblinkonload){
	window.preblinkonload = window.onload;
	window.onload = startBlink;
}

//-->
In the same template, find
Code:
<if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
Replace with
Code:
<if condition="$show['pmstats']"><br />
			<if condition="$bbuserinfo['pmunread']">
			<phrase 1="<blink><font color=#ff0000>$vbphrase[unread_x_nav_compiled]</font></blink>" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase>
			<br />
			<else />
			<phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase><br /></if></if>
This gives you a red (#ff0000) blinking message when having a pm in your box, after which you are done.

---------------------------optional---------------------------

Alternatively, if you just want blinking text (so text with default font color blinking on and off) simply skip the last step and do this one in stead.

In the same template, find
Code:
<if condition="$show['pmstats']"><br /><phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase></if>
Replace with
Code:
<if condition="$show['pmstats']"><br />
			<if condition="$bbuserinfo['pmunread']">
			<phrase 1="<blink>$vbphrase[unread_x_nav_compiled]</blink>" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase>
			<br />
			<else />
			<phrase 1="$vbphrase[unread_x_nav_compiled]" 2="$vbphrase[total_x_nav_compiled]" 3="$session[sessionurl]">$vbphrase[private_messages_nav]</phrase><br /></if></if>
The end result should look like this, in your own board colors ofcourse.

Dont forget to press install if you like this little mod.

Update (26-5-2005): This mod had a conflict in IE with an other mod, namely a 2nd breadcrumb we've added at the bottom for easy scrolling, which caused us to have an overflow error in Internet Explorer. So basicly, this mod should have worked for other forums, it just gave us specificly a slight hickup cause of the nature of our board. Still, the code has been updated so that it works now for both us and other forums that may have messed with the onload command.

Show Your Support

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

Comments
  #12  
Old 05-26-2005, 06:55 AM
Fusion.nl's Avatar
Fusion.nl Fusion.nl is offline
 
Join Date: Apr 2005
Location: Netherlands
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I think he means several versions, probably those three I mentioned above.
Reply With Quote
  #13  
Old 05-26-2005, 08:11 AM
Piglet Piglet is offline
 
Join Date: Apr 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Argh! Fusion mate, you can't just override the "onload" event like that without disabling a large amount of other vbb functionality.

ie. the line window.onload = startBlink(); overrides the $onload variable which is used for a number of other functions such as the buttons on the reply editors.

I'll have a ponder later about how to fix the issue - but for now I'd recommend that you don't use this mini-hack until it's been fixed.

FYI, on the boards that Fusion and I admin I've just disabled the window.onload = startBlink(); line so that the functionality works OK in "blink" enabled browsers.
Reply With Quote
  #14  
Old 05-26-2005, 09:51 AM
Piglet Piglet is offline
 
Join Date: Apr 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok - here's the fix. The same technique can be used in other hacks on the same page to "chain up" the functions requiring window.onload:

Code:
<!-- [Fusion's `ing PM hack :: http://ut2004.titaninternet.co.uk] -->
function doBlink() {
  var blink = document.all.tags("blink")
  for (var i=0; i<blink.length; i++)
    blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : ""
}

//fix by Piglet
function startBlink() {
	window.preblinkonload();
	setInterval("doBlink()",500)
}

if (document.all && ! window.preblinkonload){
	window.preblinkonload = window.onload;
	window.onload = startBlink;
}

//-->
Reply With Quote
  #15  
Old 05-26-2005, 10:29 AM
Fusion.nl's Avatar
Fusion.nl Fusion.nl is offline
 
Join Date: Apr 2005
Location: Netherlands
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Thnx Piglet, owe you one. :up: I've updated the code.
Reply With Quote
  #16  
Old 05-26-2005, 10:45 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Please post a text file with the instructions so others can add it when they upgrade.
Reply With Quote
  #17  
Old 05-26-2005, 12:16 PM
angelicGrace angelicGrace is offline
 
Join Date: Jun 2004
Location: Up in the clouds
Posts: 100
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

graet easy mod. love it. *clicks install*
Reply With Quote
  #18  
Old 05-26-2005, 04:15 PM
Piglet Piglet is offline
 
Join Date: Apr 2005
Posts: 3
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok - I found the reason it wasn't working on our site - we have the breadcrumbs top and bottom - so the onload event was being triggered twice causing problems. Once that was spotted it was a trivial fix.

Fusion, if you re-update with the code as it's now shown in my previous posting (now edited) it will work however many times you have the breadcrumbs on the template.
Reply With Quote
  #19  
Old 05-26-2005, 07:01 PM
Brent H's Avatar
Brent H Brent H is offline
 
Join Date: Sep 2004
Location: Phoenix, AZ
Posts: 162
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Installed and working perfectly. Thanks for this!
Reply With Quote
  #20  
Old 05-26-2005, 07:42 PM
Fusion.nl's Avatar
Fusion.nl Fusion.nl is offline
 
Join Date: Apr 2005
Location: Netherlands
Posts: 37
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Piglet, I love you~
Reply With Quote
  #21  
Old 05-30-2005, 05:04 PM
Snake's Avatar
Snake Snake is offline
 
Join Date: Mar 2005
Location: Cleveland, OH
Posts: 3,832
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent hack. I was looking for this!
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 09:53 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.06894 seconds
  • Memory Usage 2,314KB
  • 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
  • (7)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
  • (3)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_onlinestatus
  • (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
  • postbit_imicons
  • 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