vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Full Releases (https://vborg.vbsupport.ru/forumdisplay.php?f=33)
-   -   Blinking notifier in welcome bar when receiving a new pm (https://vborg.vbsupport.ru/showthread.php?t=82037)

Fusion.nl 05-24-2005 10:00 PM

Blinking notifier in welcome bar when receiving a new 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 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. ;)
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

Quote:

Originally Posted by Jolten
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. ;)

Quote:

Originally Posted by JohnBee
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

Quote:

Originally Posted by Paul M
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

Quote:

Originally Posted by Jolten
This has been released several times already.

Where?

I've never seen it before.


All times are GMT. The time now is 08:22 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.01161 seconds
  • Memory Usage 1,752KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (4)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete