|
|
|
|
![]() ![]() |
Jul 10 2008, 09:03 PM
Post
#1
|
|
|
Newbie [Level 1] ![]() Group: [HOSTED] Posts: 11 Joined: 10-July 08 Member No.: 64,866 |
Do you find it annoying when you are on your invisionfree forum, and you get a new message, and it ends up taking you 5 minutes to notice? This code makes the inbox link flash bold red saying how many messages you have. In version 1 the word inbox stays the same, and doesnt change at all (for Example this is flashing: Inbox (2)
In version 2 (the second code) the word inbox changes to messages (constantly, so that if you have none, it says messages (0) instead of inbox (0). It still flashes Red Put the following In the Header and Body Section (Admin Cp>>>Skinning and Styles>>>Board Wrapppers>>Header and Body): Version 1: CODE <script>//New PM Flasher - By miikerocks userLinks=document.getElementById('userlinks'); if(userLinks.innerHTML.match("Inbox")) { newMsg=false; a=userLinks.getElementsByTagName("A"); for(i=0;i<a.length;i++)if(a[i].innerHTML.match(/Inbox\s\([0-9]+\)/)&&a[i].innerHTML.match(/[0-9]+/)>0)newMsg=i; if(newMsg) { inbox=a[newMsg]; inbox.style.fontWeight="Bold"; inbox.style.color="red"; flash(); } } function flash() { if(inbox.style.visibility=="hidden")inbox.style.visibility="visible"; else inbox.style.visibility="hidden"; setTimeout("flash()",500) } </script> <script type='text/javascript'> <!-- // Change the Inbox text at the user links // code by miikerocks // http://z11.invisionfree.com/FreeLoads e = document.getElementById('userlinks') a = e.getElementsByTagName('A') for (i =0; i < a.length; i++) { if (a[i].href.indexOf('act=Msg&CODE=01') != -1) { s = a[i].innerHTML a[i].innerHTML = s.replace(/Inbox/, 'Inbox') break }} // --> </script> <% NAVIGATION %> If you have anything else in the Header and Body section that is above the <% NAVIGATION %> tag, then highlight the <% NAVIGATION %> Tag AS YOU PASTE THE CODE INTO YOUR FORUM. [b]If you wish to have the inbox link on your forum changed to messages, use this code I made. (AKA version 2) CODE <script>//New PM Flasher - By miikerocks userLinks=document.getElementById('userlinks'); if(userLinks.innerHTML.match("Messages")) { newMsg=false; a=userLinks.getElementsByTagName("A"); for(i=0;i<a.length;i++)if(a[i].innerHTML.match(/Inbox\s\([0-9]+\)/)&&a[i].innerHTML.match(/[0-9]+/)>0)newMsg=i; if(newMsg) { inbox=a[newMsg]; inbox.style.fontWeight="Bold"; inbox.style.color="red"; flash(); } } function flash() { if(inbox.style.visibility=="hidden")inbox.style.visibility="visible"; else inbox.style.visibility="hidden"; setTimeout("flash()",500) } </script> <script type='text/javascript'> <!-- // Change the Inbox text at the user links // code by miikerocks // http://z11.invisionfree.com/FreeLoads e = document.getElementById('userlinks') a = e.getElementsByTagName('A') for (i =0; i < a.length; i++) { if (a[i].href.indexOf('act=Msg&CODE=01') != -1) { s = a[i].innerHTML a[i].innerHTML = s.replace(/Inbox/, 'Messages') break }} // --> </script> <% NAVIGATION %> If you want it to flash a different color, or if you have problems/need help, Post below. ---miikerocks--- |
|
|
|
Aug 22 2008, 06:26 AM
Post
#2
|
|
|
Hail Caesar! ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: Members Posts: 5,876 Joined: 21-September 07 Member No.: 50,369 |
Great Code! Except...
Add Flashing Inbox To Invisionfree Forum I love this script! It works just as it should, except I have a problem. On my forums, ALL links are bolded red font. I don't know too much javascript, but I could change the font color to white. Now I'd like to make it italicized instead of bolded. Is that possible? If so, please email me, as I am on a public computer and cannot bookmark this page. Thanks! M Mazur -reply by M Mazur |
|
|
|
Sep 6 2008, 09:02 AM
Post
#3
|
|
|
Privileged Member ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() ![]() Group: [HOSTED] Posts: 504 Joined: 14-November 05 From: Britannia! Member No.: 14,287 |
My friend runs an Invisionfree Forum of which I am a member, and both of us are forever failing to notice when we have new PMs. So, thanks for this code - I think we'll both find it useful. Hey, this code should be a default function of Invision Forums!
|
|
|
|
![]() ![]() |
Similar Topics
|
Lo-Fi Version | Time is now: 13th October 2008 - 03:20 AM |