PDA

View Full Version : Blinking notifier in welcome bar when receiving a new pm


Fusion.nl
05-24-2005, 10:00 PM
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 (https://vborg.vbsupport.ru/showthread.php?t=73060) 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
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=1)";
if (confirm('$vbphrase[sure_you_want_to_log_out]'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}
//-->

After add
<!-- [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
<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
<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
<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
<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. ;)
https://vborg.vbsupport.ru/
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. :)

Jolten
05-25-2005, 10:37 PM
This has been released several times already.

kall
05-25-2005, 10:52 PM
And it's not a hack.

It does look nice and clean though. Good stuff. :)

(Man, am I going to be embarassed if I post this and find the merger has been done).

KTBleeding
05-25-2005, 11:09 PM
This has been released several times already.
But he explained in the original post that his works with multiple browsers where as the others only worked in IE or simply did not suit his needs.

Thanks for the "template mod" Fusion.

JohnBee
05-25-2005, 11:15 PM
Good job Fusion.nl
thanks for including me in the credits :)

Fusion.nl
05-25-2005, 11:44 PM
Thnx lads. There was one more welcome bar pm notifier that I forgot to mention. The one that lits up the whole table cell block on and off, but I read that some people had problems if they also used the vBadvanced hack.

And...well...we plan to install that portal hack too. ;)

Good job Fusion.nl
thanks for including me in the credits :)

No problem mate. :D

jugo
05-26-2005, 01:58 AM
Dude...finally, one that /me likes!!!

Paul M
05-26-2005, 02:36 AM
Are template "hacks/mods/whatever" allowed now (just curious) ?

We have the one that flashes the whole 'welcome block' - but each to their own. :)

Marco van Herwaarden
05-26-2005, 05:22 AM
Are template "hacks/mods/whatever" allowed now (just curious) ?

We have the one that flashes the whole 'welcome block' - but each to their own. :)No Template Mods are still not allowed here. They should be posted at vBulletinTemplates.

BarHopper
05-26-2005, 06:42 AM
This has been released several times already.

Where?

I've never seen it before.

Fusion.nl
05-26-2005, 06:55 AM
I think he means several versions, probably those three I mentioned above.

Piglet
05-26-2005, 08:11 AM
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.

Piglet
05-26-2005, 09:51 AM
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:


<!-- [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;
}

//-->

Fusion.nl
05-26-2005, 10:29 AM
Thnx Piglet, owe you one. :up: I've updated the code.

Boofo
05-26-2005, 10:45 AM
Please post a text file with the instructions so others can add it when they upgrade. ;)

angelicGrace
05-26-2005, 12:16 PM
graet easy mod. love it. :) *clicks install*

Piglet
05-26-2005, 04:15 PM
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.

Brent H
05-26-2005, 07:01 PM
Installed and working perfectly. Thanks for this!

Fusion.nl
05-26-2005, 07:42 PM
Piglet, I love you~ ;)

Snake
05-30-2005, 05:04 PM
Excellent hack. I was looking for this! :)

Nuckolsc.com
05-31-2005, 05:15 PM
Nice one man. Just used it on my 2 forums! Thanks

Clayton
06-02-2005, 04:37 PM
nice going ... installed

nice to see a community work together

Rickie3
06-04-2005, 09:46 AM
thankyou
*clicks install*

Strike3ForumsMH
06-21-2005, 11:36 AM
I was looking for something like that as well. Thanks!

jeanne
06-29-2005, 12:03 PM
I am attempting this hack but when I get to step two look for

<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>

my coding is

<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php?$session[sessionurl]">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>


How do I modify? this doesn't seem right...

ccplim
07-04-2005, 01:47 AM
I am attempting this hack but when I get to step two look for

<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>

my coding is

<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a href="subscription.php?$session[sessionurl]">$vbphrase[subscribed_threads]</a></td></tr>
<tr><td class="vbmenu_option"><a href="member.php?$session[sessionurl]u=$bbuserinfo[userid]">$vbphrase[my_profile]</a></td></tr>


How do I modify? this doesn't seem right...

Try searching further down. I remember encountering a similar case while I was trying out (can't really remember clearly as I was working on a few hacks at that point of time).

unnetboardguy
07-15-2005, 04:43 AM
Thank you kindly. install clicked

our users thank you too
Michael
-unnet.net

atxhorn
07-15-2005, 01:03 PM
nice mod..thanks m8...click installed

mkdevo
07-17-2005, 03:03 AM
excellent, quick, and subtle! thanks!

fyi, i've ported this to vBPortal, giving you full credit:

http://www.phpportals.com/forums/showthread.php?p=84095#post84095

the vBP navbar is a little different and required some other changes, which i added.

thanks again!

Dr.Jeckyl
07-24-2005, 07:33 AM
way cool! installed.

MThornback
07-25-2005, 03:33 AM
*Installed* but it doesn't blink when pop-ups are enabled on PMs....not until the pop-up is actioned anyway...after that...works like a dream :)

Peace_Hope
08-09-2005, 01:54 PM
I get an error saying: stack overflow on line 368

Anyone know what is going on?

Peace_Hope
08-09-2005, 01:56 PM
Ok, it is fixed. I accidently had the onload function in there twice.

kregger
08-13-2005, 05:42 PM
Didn't realize I needed this until here recently. hehe Thanks! *clicks Install*

Craig

kregger
08-13-2005, 05:47 PM
How can I make the part that's flashing clickable? The first thing people will do is try to click on the flashing part. Or I did anyway. hehe

MRGTB
09-05-2005, 04:15 AM
Very cool, works with both IE and Firefox. And also works across my whole site on the vBGallery and vBadvanced CMPS 2 RC2 pages becuase it only requires navbar hack.

Installed clicked

o0Hubba0o
09-05-2005, 03:07 PM
How can I make the part that's flashing clickable? The first thing people will do is try to click on the flashing part. Or I did anyway. hehe
Lol I did that too, even though I've used it thousands of times before this hack, I still tried clicking the pretty flashing words first lol. Though it's not that big of deal for me, people will figure it out heh.

Snake
09-05-2005, 04:46 PM
I'm wondering if this hack will work just fine on 3.5 RC2?

MRGTB
09-05-2005, 04:59 PM
if the code is the same that you search, but check the code is exactly the same word for word. I don't see why not.

You aways backup templates etc anyway with notepad for restoring back if it doesn't work.

Fusion.nl
09-05-2005, 05:55 PM
Once we got 3.5 installed, ill install this again anyway. Maybe even make an installer once I figure out how to do it. :)

xtreme-mobile
09-05-2005, 06:06 PM
works great

brvheart
09-08-2005, 01:21 PM
a little help please...I can not find the "navbar" template in the stylemanager...please dont yell...I might just be over looking it. can someone point me in the right direction? Is it the same as Navigation / Breadcrums Templates?

EDIT: Found it, but can not find in both my Styles, I can only find it in one of them :

<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>


This is my code can someone tell me if I missed it?
<script type="text/javascript">
<!--
function log_out()
{
ht = document.getElementsByTagName("html");
ht[0].style.filter = "progid:DXImageTransform.Microsoft.BasicImage(grays cale=1)";
if (confirm('$vbphrase[sure_you_want_to_log_out]'))
{
return true;
}
else
{
ht[0].style.filter = "";
return false;
}
}
//-->
</script>

<br />

<!-- breadcrumb, login, pm info -->
<table class="tborder" cellpadding="$stylevar[cellpadding]" cellspacing="$stylevar[cellspacing]" border="0" width="100%" align="center">
<tr>
<td class="alt1" width="100%">
<if condition="is_array($navbits)">
<table cellpadding="0" cellspacing="0" border="0">
<tr valign="bottom">
<td><a href="#" onclick="history.back(1)"><img src="$stylevar[imgdir_misc]/navbits_start.gif" alt="$vbphrase[go_back]" border="0" /></a></td>
<td>&nbsp;</td>
<td width="100%"><span class="navbar"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1">$vboptions[bbtitle]</a></span> $navbits[breadcrumb]</td>
</tr>
<tr>
<td class="navbar" style="font-size:10pt; padding-top:1px" colspan="3"><a href="$scriptpath"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_finallink.gif" alt="$vbphrase[reload_this_page]" border="0" /></a> <strong>$navbits[lastelement]</strong></td>
</tr>
</table>
<else />
<div class="navbar" style="font-size:10pt"><a href="$vboptions[forumhome].php?$session[sessionurl]" accesskey="1"><img class="inlineimg" src="$stylevar[imgdir_misc]/navbits_start.gif" alt="" border="0" /></a> <strong>$vboptions[bbtitle]</strong></div>
</if>
</td>


</tr>
</table>
<!-- / breadcrumb, login, pm info -->

<br>

MRGTB
09-08-2005, 02:22 PM
Look in the Breadcrumbs template set, it there! :)

brvheart
09-08-2005, 02:30 PM
Look in the Breadcrumbs template set, it there! :)


I must be completely blind...been looking for a while now. I can find it in my other templates, but not the one listed above....

brvheart
09-09-2005, 11:14 AM
ok, well it is not in there, can anyone tell me how to get this thing working without that particular code being in the template?

stangger5
09-09-2005, 11:37 AM
If its not in the Navigation / Breadcrumb Templates,,
look in the header template...

brvheart
09-09-2005, 11:45 AM
If its not in the Navigation / Breadcrumb Templates,,
look in the header template...

ok, thnaks, I will look right now ;)

brvheart
09-09-2005, 12:01 PM
this is the code that I found in the Header Template:

<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>
<tr><td class="vbmenu_option"><a


if I replace this will it work?

brvheart
09-12-2005, 04:04 PM
bump

MRGTB
09-12-2005, 04:53 PM
what version of vbulletin are you using?

brvheart
09-12-2005, 05:20 PM
3.0.7

MRGTB
09-13-2005, 02:59 AM
well if you using vb 3.0.7 your Navbar template is here.

Go into your: AdminCP

1: Styles & Templates -> Style Manager
2: Then double click he "<< >>" arrows in the right window to expand your templates
3: Then double click "Navigation/Breadcrumbs Templates
4: Now you will see the Navbar template there.

I was running on 3.0.7 before I upgraded to 3.0.8, so I know for a fact it's there.

brvheart
09-13-2005, 12:04 PM
I never said it was not there, I said the code within the navbar template is not as it should be with the style I am using, I gave the code that is there, and asked if anyone could help me get it to work in that style. I got it working in 1 of my 2 styles, but the code is not as it reads for the hack.

Please read all my post before saying something like this:

by: Gary Bolton I was running on 3.0.7 before I upgraded to 3.0.8, so I know for a fact it's there.

MRGTB
09-13-2005, 12:07 PM
OK, so your using a new style. Well that totally different then. God knows then, you gonna have to ask the person who created the style for advice I sugest then.

brvheart
09-13-2005, 12:53 PM
OK, so your using a new style. Well that totally different then. God knows then, you gonna have to ask the person who created the style for advice I sugest then.


ok, thanks, I appreciate you trying to help me. guess I will have to find a more complete style to use ;)

stan111
09-14-2005, 06:19 AM
can't find this code in navbar

<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>

here is wat i found in my navbar of 3.0.7
<if condition="$show['pmstats']"><br /><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a>: $vbphrase[unread_nav] <if condition="$bbuserinfo['pmunread']"><strong>$bbuserinfo[pmunread]</strong><else />$bbuserinfo[pmunread]</if>, $vbphrase[total] $bbuserinfo[pmtotal].</if>

and this is the second one that i found in mine that had ['pmstats']
<if condition="$show['pmstats']"><tr><td class="vbmenu_option"><a href="private.php?$session[sessionurl]">$vbphrase[private_messages]</a></td></tr></if>

stan111
09-15-2005, 08:05 PM
anyone know wat happen ?

XJeepguy
09-17-2005, 09:09 PM
Excellent , thx :nervous:

XJ

PJSkiboy
09-29-2005, 10:54 AM
great addition.

MRGTB
09-29-2005, 01:53 PM
yeh, this is a good hack because it works fine both in IE and Firefox

c0d3x
09-30-2005, 08:37 PM
is there somethin similar to this for vb 3.5 ?

Snake
10-01-2005, 03:38 PM
It works just fine for 3.5.0. :)

Nathan2006
03-10-2006, 07:08 PM
Thank you great idea

Installed

Scootro
03-14-2006, 03:37 PM
Very handy. Thanks.

xlegends
03-14-2006, 08:08 PM
works great 3.5.4

Treak
03-16-2006, 05:56 AM
hmm mine worked fine on 3.5.0 but now that i upgraded.. i cannoot get it to work..

it will not blink and the error on the page keep saying
this

line:40
char:1
error: object doesn't support this property or method
code:0
my url link here.

any ideas what that could be and how i can get this mod to work now? that i have upgraded?

dcpaq2xx
03-22-2006, 11:16 AM
Has anyone done this as a plugin or plugin product yet for VB 3.5.x ?

Doug

brvheart
03-22-2006, 11:38 AM
Not that I know of, but it works as is.

RS_Jelle
03-22-2006, 02:26 PM
Has anyone done this as a plugin or plugin product yet for VB 3.5.x ?

Doug
Plugins are for placing PHP code in vBulletin files with hooks. There isn't any PHP code needed for this hack.
You can only add new templates and overwrite templates with a product.

These are only template modifications, so there's no need for a product. You need to do these template modifications yourself ;)

dcpaq2xx
03-22-2006, 04:22 PM
So what your saying is that there is no way to create a plugin to accomplish this without me having to manually edit the code??? I was trying to get a plugin or plugin product so that editing the code wasnt neccessary.

*** #1 Reason.... And I didnt have to worry about VB upgrades wiping out my changes.

Doug

Plugins are for placing PHP code in vBulletin files with hooks. There isn't any PHP code needed for this hack.
You can only add new templates and overwrite templates with a product.

These are only template modifications, so there's no need for a product. You need to do these template modifications yourself ;)

paulfletcher
04-04-2006, 01:14 AM
Is there any way to get this working in Safari?

Thanks,
Paul

--> Great hack though, I installed it!

brvheart
08-25-2006, 03:27 PM
working in 3.6

Snake
08-25-2006, 06:03 PM
Thanks for your info! :)

Tigur
04-03-2007, 08:11 AM
Though it is simple enough in 3.6 - it is slightly different wording - mind updating it for future reference? :)