vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.0 Template Modifications (https://vborg.vbsupport.ru/forumdisplay.php?f=134)
-   -   Blink the Welcome Bar when receiving a new PM! (https://vborg.vbsupport.ru/showthread.php?t=88474)

Gary W 02-14-2004 10:00 PM

Blink the Welcome Bar when receiving a new PM!
 
Some tiny bits and pieces of this hack was adapted from Chen's vB 2 version of this hack, so kudos to him



What this hack does is it makes the 'Welcome, $username' box in the navbar blink by changing colors whenever a user has a new PM, so that it will catch their attention and they won't miss the PM



You can view the hack in action by viewing the attached screenshot to this post! (Meaning that it will blink like it's supposed to )



Anyways, here are the instructions:



Open up the navbar template and find:
HTML Code:

        <td class="alt2" valign="top" nowrap="nowrap">
Replace with
HTML Code:

        <td valign="top" nowrap="nowrap" <if condition="$bbuserinfo['pmunread']">id="pmBox"<else />class="alt2"</if>>
Find:
HTML Code:

    <else />

 

        <td class="alt2" nowrap="nowrap" style="padding:0px">

Above, add
HTML Code:

        <if condition="$bbuserinfo['pmunread']">
        <script type="text/javascript">
<!--
<!-- blink navbar on new pms -->

pmBox.bgColor='$stylevar[thead_bgcolor]';
setInterval("Timer()", 500);
x=1;
function Timer()
{
        set=1;
        if (x==0 && set==1)
        {
                pmBox.bgColor='$stylevar[tcat_bgcolor]';
                x=1;
                set=0;
        }
        if (x==1 && set==1)
        {
                pmBox.bgColor='$stylevar[thead_bgcolor]';
                x=0;
                set=0;
        }
}
-->
</script></if>



All done! You can view the hack in action by viewing the attached screenshot! (Meaning that it will blink like it's supposed to )

AN-net 02-15-2004 02:21 AM

nice hack, also plz format hack into a text file(forum rules):D

Gary W 02-15-2004 12:11 PM

Okay I will right now, sorry about that this is my first mod released here :p

Gary W 02-15-2004 12:16 PM

I also added the cool new screenshot I made :p

Azhrialilu 02-15-2004 02:41 PM

I get a debug error everytime I install this hack... says pmuser isn't specified? really odd lol

Gary W 02-15-2004 02:44 PM

Strange it's not like that for me, could you give me a screenshot?

Azhrialilu 02-15-2004 03:23 PM

Sure.. I'll reinstall it and grab a snapshot for you :)

btekcan 02-16-2004 08:18 AM

Yes same problem here......something is wrong...

rms10 02-17-2004 02:19 PM

I like this idea but will wait until the above issue is resolved :)

imported_badpacket 02-17-2004 03:21 PM

Same here.. I'd like to apply this when its working :)

rms10 02-18-2004 06:08 PM

I went ahead and installed the mod. Works like a charm :) Thanks:)

Gary W 02-18-2004 06:59 PM

Sorry about that guys, problem fixed ;)

btekcan 02-18-2004 07:16 PM

Yesss,great now works...

Thanks

sabret00the 02-24-2004 09:54 AM

very nice :)

Natch 02-24-2004 10:32 AM

Cos the original one had some bugs, I went away and did this in a slightly different way GaryW - I used the same script that I had for my onmouseover thread/forum bgcolor changer from this thread - and I extended the effect to make the pmBox and the breadcrumb box alternate colours when a new pm is there ...

Major props for the idea - I love the effect and have sent myself numerous PM's just to test and re-test it :) :) :D

[high]* Natch clicks install cos u gave me the idea :)[/high]

rms10 02-24-2004 11:32 AM

Gary is it possible for you to also add some effect to this when the PM's box gets full?

Thanks :)

Natch 02-24-2004 11:57 AM

It could flash faster in that case witha simple conditional around the timer statement ...

Boofo 03-06-2004 03:21 PM

Quote:

Originally Posted by Natch
Cos the original one had some bugs, I went away and did this in a slightly different way GaryW - I used the same script that I had for my onmouseover thread/forum bgcolor changer from http://www.vbulletintemplates.com/mo...97]this thread - and I extended the effect to make the pmBox and the breadcrumb box alternate colours when a new pm is there ...

Major props for the idea - I love the effect and have sent myself numerous PM's just to test and re-test it :) :) :D

[high]* Natch clicks install cos u gave me the idea :)[/high]

Can we see yours?

rebelsrock06 03-06-2004 04:54 PM

i cant get mine to work ? ?

i replaced

<td class="alt2" valign="top" nowrap="nowrap">

with

<td valign="top" nowrap="nowrap" <if condition="$bbuserinfo['pmunread']">id="pmBox"<else />class="alt2"</if>>

but the last instruction doesnt make much sense.

i found

<else />



<td class="alt2" nowrap="nowrap" style="padding:0px">

and then i put the other tags Where ? ? ? ??

rebelsrock06 03-06-2004 04:56 PM

heheheh never mins, i had 2 colors thae same so i could see the blinking :lol:

Gary W 03-06-2004 05:34 PM

Okay then you can just change the colour variables to a specified colour by replacing them with colour codes :)

Alzeimer 03-09-2004 08:11 AM

Great, Installed and working, thanks!!!

Natch 03-10-2004 05:24 AM

Quote:

Originally Posted by Boofo
Can we see yours?

I'll try to mate - my gif animation skillz are a bit rusty ;)

BBL with it hopefully :) :)

Grab the JS file - the chgclass.js file - upload it to forumhome/clientscript and load that in your headinclude template.

Code:

<script type="text/javascript" src="$vboptions[bburl]/clientscript/vbulletin_chgclass.js"></script>
Then in the navbar template, make the following alterations ...

Find the first instance of:
PHP Code:

<script type="text/javascript">
<!-- 

ADD AFTER:
PHP Code:

<if condition="$bbuserinfo['pmunread']">
setInterval("Timer()"1000);
x=1;
function 
Timer()
{
    
set=1;
    if (
x==&& set==1)
    {
        
changeSty('alt1','pmBox');
        
changeSty('alt2','breadBox');
        
x=1;
        
set=0;
    }
    if (
x==&& set==1)
    {
        
changeSty('alt2','pmBox');
        
changeSty('alt1','breadBox');
        
x=0;
        
set=0;
    }
}
</if> 

Example:
http://www.mobileforces.org/pm-bar-blink.gif

It works with whatever colours you have in your style for alt1 and alt2, so translates across your board without trouble :)

Mr. Brian 03-18-2004 09:43 PM

I don't think it works for gamma.

imported_Diana Notacat 03-25-2004 08:11 AM

As spectacularly awesome as this is, it doesn't seem work in Mozilla or Netscape! It's only working on my IE. Anyway to spiff it up to work on other browsers?

wolfgang3 04-10-2004 04:20 PM

nice add on! thx

Gary W 04-10-2004 05:43 PM

Doesn't work for Netscape/Mozilla type browsers; I think the browsers are like that, they don't like the scripting that makes this work.

Natch 04-10-2004 10:28 PM

<a href="http://www.vbulletintemplates.com/mods/showpost.php?p=47441&postcount=23" target="_blank">This one</a> (post #23 in this thread) does work in Mozilla / Netscrape .... the animation was recorded on Firebird ...

Props to Gary for the concept...

Jolten 04-11-2004 05:19 PM

Works like a charm. I had to add an extra id to accomodate an extra table cell in my suctom header, but it works fabulously. Thanks Gary.

Skaterscafe.com 04-15-2004 04:46 AM

Works great for me also, thanks!

My site is in black & white, is there a easy way to change the blink color to red or yellow?

RichieBoy67 04-21-2004 11:20 PM

Awesome!!!!

You are the man Gary!!!

Thanks!!

Skaterscafe.com 04-22-2004 05:52 AM

Quote:

Originally Posted by Skaterscafe.com
Works great for me also, thanks!

My site is in black & white, is there a easy way to change the blink color to red or yellow?

Anyone?

Jolten 04-22-2004 04:47 PM

Skater.. jsut set up a new custom style in the Main CSS. Then change the The script to use yoru new style in this line

Code:

                pmBox.bgColor='$stylevar[thead_bgcolor]';
Instead of thead_bgcolor insert your new style.

Onkel_Tom 06-17-2004 08:31 AM

thanks for this hack, works great !

imported_350Chevy 06-17-2004 03:41 PM

Quote:

Originally Posted by ScottW
Skater.. jsut set up a new custom style in the Main CSS. Then change the The script to use yoru new style in this line

Code:

                pmBox.bgColor='$stylevar[thead_bgcolor]';
Instead of thead_bgcolor insert your new style.

or..

Code:

                pmBox.bgColor='red';
Or whatever color of your choice.. ;)

imported_zahco 06-18-2004 09:15 AM

dir Gary W
Thanks a lot for this hack and i have istaled it and it working Great .

And i thanks a lot to Dir / 350Chevy
who showed me this thread

best regards
zahco

Onkel_Tom 06-20-2004 10:22 PM

Hi, a small problem with this hack if the access to the PN system is not allowed by the admin for a special usergroup like "awaiting confirmation" and having the "New user welcome PN" Hack installed.
The user get's the blinking PN area but can't read the mail unless he confirms his registration and an admin has activated his account.

Solution:

find in template navbar:
PHP Code:

<if condition="$bbuserinfo['pmunread']">
    <
script type="text/javascript">
<!-- 
<!-- 
blink navbar on new pms -->
pmBox.bgColor='$stylevar[thead_bgcolor]';
setInterval("Timer()"500);
x=1;
function 
Timer()
{
    
set=1;
    if (
x==&& set==1)
    {
        
pmBox.bgColor='$stylevar[tcat_bgcolor]';
        
x=1;
        
set=0;
    }
    if (
x==&& set==1)
    {
        
pmBox.bgColor='$stylevar[thead_bgcolor]';
        
x=0;
        
set=0;
    }
}
-->
</
script></if> 

replace it with:
PHP Code:

<if condition="$show['pmstats']"><if condition="$bbuserinfo['pmunread']">
    <
script type="text/javascript">
<!-- 
<!-- 
blink navbar on new pms -->
pmBox.bgColor='$stylevar[thead_bgcolor]';
setInterval("Timer()"500);
x=1;
function 
Timer()
{
    
set=1;
    if (
x==&& set==1)
    {
        
pmBox.bgColor='$stylevar[tcat_bgcolor]';
        
x=1;
        
set=0;
    }
    if (
x==&& set==1)
    {
        
pmBox.bgColor='$stylevar[thead_bgcolor]';
        
x=0;
        
set=0;
    }
}
-->
</
script></if></if> 

With this change vB first check if the PN system is activated and then let blink the PN area. Otherwise no blinking will be done.

Bounce 06-23-2004 06:20 PM

brilliant stuff gary :)

installed and working treat :D

imported_Infopro 06-24-2004 01:35 PM

Very nice, thank you. :)

Baptizer 07-02-2004 03:39 PM

Got it. Installed it. Customized it. Loving it. Thanks.


All times are GMT. The time now is 03: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.01389 seconds
  • Memory Usage 1,844KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_html_printable
  • (4)bbcode_php_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
  • (40)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