The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Blinking notifier in welcome bar when receiving a new pm Details »» | |||||||||||||||||||||||||||
Blinking notifier in welcome bar when receiving a new pm
Developer Last Online: Nov 2007
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; } } //--> 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; } //--> 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> 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> ---------------------------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> 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> 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
|
Comments |
#12
|
||||
|
||||
I think he means several versions, probably those three I mentioned above.
|
#13
|
|||
|
|||
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. |
#14
|
|||
|
|||
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; } //--> |
#15
|
||||
|
||||
Thnx Piglet, owe you one. :up: I've updated the code.
|
#16
|
||||
|
||||
Please post a text file with the instructions so others can add it when they upgrade.
|
#17
|
|||
|
|||
graet easy mod. love it. *clicks install*
|
#18
|
|||
|
|||
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. |
#19
|
||||
|
||||
Installed and working perfectly. Thanks for this!
|
#20
|
||||
|
||||
Piglet, I love you~
|
#21
|
||||
|
||||
Excellent hack. I was looking for this!
|
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|