PDA

View Full Version : New PM's in Header (blinking text or image)


TECK
04-13-2002, 10:00 PM
Since I don't really like the the PM window notification alert built in VB, I wanted to have a little link in the header that blinks and tell me (no matter what page i view at the moment) that I have a new PM from one of the users.

The link is invisible by default. When you get a message, it starts to blink.

The good part about this hack is that you don't have to edit the database and also that you can customise it through the VB template system. The Java script that makes the link to blink doesn't insert any onLoad(); in <body>, so it will work independently from any other Java scripts you inserted in your pages.
This hack will work in both, IE and Netscrape.

ESTIMATED INSTALL TIME: 3 minutes
TESTED IN VERSION: 2.2.5

NOTE: As a thank you for using my hack, please click on the INSTALL button. You will receive updates in your email, whenever I add new features to it and it will let me evaluate better the quality of my hacks.
Also post a reply with your comments. Your oppinion is important to me.

HACK UPDATES
Version 1.1 Released
-------------------------------------------
Added the choice between 'blinking text' or 'blinking image'

To download the latest version of this hack, click below:

TECK
04-14-2002, 07:49 PM
a demo... ;)

DjSap
04-14-2002, 07:52 PM
very nice man

John
04-14-2002, 08:15 PM
Sweet! Easy to install, and it really works! Hard to ignore a flashing link at the top of the page.

Good work nakkid, keep em coming :D

TECK
04-14-2002, 08:23 PM
i'm glad you like it. thanks alot.

-=dm=-
04-14-2002, 08:41 PM
cool!!
Thanx nakkid

btw nice design(screenshot) :)

wooolF[RM]
04-14-2002, 09:04 PM
][ installed | clicked install | voted ]

:D

Velocd
04-14-2002, 10:23 PM
Installed, very nice :p
Hey that is a sweet forum in that attachment picture, is that yours Nakkid? No links? ^-^'

TECK
04-14-2002, 10:25 PM
is my new skin.. for my site. ;)
soon to be online.

trainer
04-14-2002, 10:49 PM
great hack!

concern - mine is flashing whenever i have a new PM but i woudl prefer to have it flash when i have an unread PM. right now it is flashing away yet i have read all the PM's

any way to change this?

TECK
04-14-2002, 10:53 PM
you did something wrong? is working perfectly.. what version you installed? the text?
post a link i wanna see...

trainer
04-14-2002, 10:56 PM
version 2.2.4 - text

wooolF[RM]
04-14-2002, 10:58 PM
works great here... recheck it again... u may made a mistake somewhere... be sure to use IE5.x and up...

TECK
04-14-2002, 10:58 PM
it should work fine in this version also.. but i didnt test it. anyone else have problems? i doubt it.. but let me know please.. i'm not perfect.. :)

TECK
04-14-2002, 10:59 PM
Originally posted by wooolF[RM]
works great here... recheck it again... u may made a mistake somewhere... be sure to use IE5.x and up... actually it works for 4+ :)
netscrape or microcrap, both.

-=dm=-
04-14-2002, 10:59 PM
nakkid, I have already the Blink on PM hack installed (by FireFly)
so is it possible to add $headerpms variable in another place, like in postbit, under the avatar?
thanx

TECK
04-14-2002, 11:00 PM
you can add it anywhere you want.

wooolF[RM]
04-14-2002, 11:07 PM
]even in my XXX ? ;)

-=dm=-
04-14-2002, 11:48 PM
cool!!
installed :D

but it didnt work for me in the postbit.

TECK
04-14-2002, 11:50 PM
hmm i just put it in the forum home.. it works anywhere.

wooolF[RM]
04-15-2002, 07:22 AM
]Originally posted by -=dm=-
cool!!
installed :D

but it didnt work for me in the postbit.
neither for me... but I got it to wotk in header...

Erwin
04-15-2002, 08:11 PM
The headinclude script does slow down the loading of my pages quite a bit for some reason. Also, the PM text is blinking even after you have read your message - it blinks when you have new messages since your last visit, not when you have unread messages (unlike Firefly's PM bar blink hack).

Unknown553
04-15-2002, 08:12 PM
Great hack and all, but in the install file it says that you've been having trouble with the div tags. You don't even need the div tag, the A tag has the id attribute too (oh yeah, and there is no title attribute in the A tag either), so you can change

<div id="pm"><a href="private.php?s=$session[sessionhash]" title="Private Messages"><smallfont>$headpm[messages] New PM(s)</smallfont></a></div>
<script language="javascript">
blink('pm');
</script>
to
<a href="private.php?s=$session[sessionhash]" id="pm"><smallfont>$headpm[messages] New PM(s)</smallfont></a>
<script language="javascript">
blink('pm');
</script>

And it works fine, with no concern for HTML errors. :)

TECK
04-15-2002, 11:07 PM
cool.. thanks alot for the tip.. you see?? i get help from everyone..
i will mod this.. but before can anyone else try it? i guess is done this way for netscape..

can anyone with netscape test it? thanks.

TECK
04-15-2002, 11:12 PM
Originally posted by Erwin
The headinclude script does slow down the loading of my pages quite a bit for some reason. Also, the PM text is blinking even after you have read your message - it blinks when you have new messages since your last visit, not when you have unread messages (unlike Firefly's PM bar blink hack). hmm it should not slow you down at all.. there are few people who test it on their servers, no probs at all.

and this is not a hack inspired from firefly's. ;)

wooolF[RM]
04-15-2002, 11:15 PM
]1) I can assure u, that it doesn't slow down your forums at all... :)
2) works just great at mine forums, no errors, no blinking after u have read all messages
3) Firefly's hack and this one is two different things... :p

wooolF[RM]
04-15-2002, 11:21 PM
]works fine, thanx :)

Originally posted by Unknown553
Great hack and all, but in the install file it says that you've been having trouble with the div tags. You don't even need the div tag, the A tag has the id attribute too (oh yeah, and there is no title attribute in the A tag either), so you can change

<div id="pm"><a href="private.php?s=$session[sessionhash]" title="Private Messages"><smallfont>$headpm[messages] New PM(s)</smallfont></a></div>
<script language="javascript">
blink('pm');
</script>
to
<a href="private.php?s=$session[sessionhash]" id="pm"><smallfont>$headpm[messages] New PM(s)</smallfont></a>
<script language="javascript">
blink('pm');
</script>

And it works fine, with no concern for HTML errors. :)

trainer
04-16-2002, 03:03 AM
Originally posted by Erwin
The headinclude script does slow down the loading of my pages quite a bit for some reason. Also, the PM text is blinking even after you have read your message - it blinks when you have new messages since your last visit, not when you have unread messages (unlike Firefly's PM bar blink hack).

i had the same problem, it still flashs when i have already read the PM. i would rather it only flash when there is unread PM's, i uninstalled it because of this issue. great hack that i think should be added to vb3 instead of the pop-up

TECK
04-16-2002, 03:11 AM
this is wierd. i get 2 comments. one that is working perfect and the other that it slows down the server and it doesnt blink only on new pm's.

well, it does blink only in new pm's. and it doesnt slow down my server. so far i got 3 people telling me on messenger that it works perfect (blinks the right way, server ok) and 2 here, that it doesnt.

can you be more specific? what browser do you use?
is all related to browser.

Unknown553
04-16-2002, 04:02 AM
Works fine for me, blinks with new messages (read and unread) and server is seeing no increase whatsoever. Using IE 6.

TECK
04-16-2002, 04:06 AM
but does becomes invisible right after you checked the messages?
once you clicked on the link, it should dissapear.

Unknown553
04-16-2002, 08:36 PM
No, it doesn't. vB still classifies it as "new" even after I read it, it still blinks in the header and still says I have one new message on the forum home too (in the PM section).

TECK
04-16-2002, 08:45 PM
that explains why it still blinks. the script grabs the status of your new messages. when your message is not considered "new" (in pm section), your link will stop blinking.

Erwin
04-16-2002, 10:52 PM
Originally posted by nakkid
this is wierd. i get 2 comments. one that is working perfect and the other that it slows down the server and it doesnt blink only on new pm's.

It doesn't slow down the server, it only slows down the loading up of pages because of the javascript added to each page, that's all. If it works for people, great. Don't get me wrong, the text does blink with new PMs - I was hoping for something more similar to Firefly's which blink only for new UNREAD PMs, not new READ PMs.

It's a great hack, well done. :) Keep up with the great hacks. Sorry if I came across as though I was complaining - I was just pointing out what I found, that's all.

TECK
04-16-2002, 11:22 PM
for unread pm's replace:$headpm=$DB_site->query_first("SELECT count(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");with:$headpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");

Unknown553
04-17-2002, 03:54 AM
That's in the global.php too, for those that are wondering. Back to the slow loading times, I don't see a difference as I am on a cable modem, but I bet dial up users will feel some lagging. Any way to add the extra javascript to only the new posting pages?

TECK
04-17-2002, 03:57 AM
"That's in the global.php too"?? what do you mean?
you only change the code in global.php.

Unknown553
04-17-2002, 04:02 AM
I know, but in your post you didn't mention it, so I had to load up the install file again and checked the file, instead of just editing it through vBengine like I do with most other hack updates :)

TECK
04-17-2002, 04:07 AM
there is no need to mention it.. the changes are done only in global.php (where the $headpm variable appears).
in the install file is marked clearly that you mod forum/global.php, not other files.

Unknown553
04-17-2002, 04:25 AM
Yes, but again, I don't have your hack/install file memorized, so a simple "In global.php" would have been nice, so I wouldn't have had to open up the file again. I've installed many hacks, I don't remember which hacks edit which files.

TECK
04-17-2002, 04:31 AM
is better to read the hack readme before you install it, or do any changes. i do this all the time with any hacks i reedit, so i have it fresh in my head the procedure.

as i said before, we are talking about this hack, not another. so it reffers only to global.php file.

Unknown553
04-17-2002, 04:38 AM
Ok, but I just cleared it up in case someone was wondering what file that was from, is that so wrong?

TECK
04-17-2002, 04:48 AM
no. :) thanks.
alot of people get confused (at least me :D) when other users post lines in hack threads... like:
"That's in the global.php too".

just wanted to make sure is all clear. that's all.

Entourage
04-23-2002, 10:23 AM
very very very cool !!! Tnx mate !

Sweet Evil
06-28-2002, 06:26 PM
after checking pm's it is still flashing "5 New PM(s)" :ermm:

nice Hack anyhow...

TECK
06-28-2002, 08:32 PM
ya. it does, until you read them all.

Sweet Evil
06-28-2002, 09:22 PM
But i already read them...

I am not having the same problem with the "[vB v2.2.3] Blink PM bar on new PM!": https://vborg.vbsupport.ru/showthread.php?s=&threadid=32299

With that one after I read them and go back to the main forum it stops blinking.. but yours is still blinking "5 New Pm(s)" (as if I did not read them)


You know what I mean?

Kars10
11-23-2002, 03:09 PM
That Hack is cool!!
Thankx Teck.
* Minifreunde klicks install. :)

Dribbles
06-01-2003, 05:17 AM
Any way to do this with unread PM's instead of new PM's? thnx

Gutspiller
07-04-2003, 07:39 PM
04-16-02 at 06:22 PM TECK said this in Post #35 (https://vborg.vbsupport.ru/showthread.php?postid=241467#post241467)
for unread pm's replace:$headpm=$DB_site->query_first("SELECT count(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND dateline>$bbuserinfo[lastvisit] AND folderid=0 $ignoreusers");with:$headpm=$DB_site->query_first("SELECT COUNT(*) AS messages FROM privatemessage WHERE userid=$bbuserinfo[userid] AND messageread=0 AND folderid=0 $ignoreusers");

Just for clarification for anybody that is trying to get this hack to work, these line changes fixed my problem. However I still had the entire PM Line to click to enter your private message CP disappearing when there was no new PMs, but I fixed that myself. I like this. It seems to work better than that blinking PMbox hack that doesn't always give you a popup even though you have a PM waiting for you.

MaxScript
10-26-2003, 02:37 AM
any luck on vb3 b7 ?

digital vettes
10-26-2003, 05:41 PM
Works fine for me, blinks with new messages (read and unread) and server is seeing no increase whatsoever. Using IE 6.
Very nice hack. Worked well! Thank you.

www.digitalcorvettes.com

sgtmaj
02-04-2004, 05:15 PM
ya. it does, until you read them all.

for some reason this isn't working for me. Could it possibly be due to the fact that I use a backgound image, instead of background color for my table headers??? :rolleyes:

Emmy2
04-19-2004, 03:14 PM
Very nice hack, thank you!

DenzoForums
04-30-2004, 12:11 AM
Very nice hack, thank you!
anybody know where i can get this or something like it for vb 3.0.1?

Thomas P
07-29-2004, 12:48 PM
@Teck: Nice, but do you have a current js script for the blink part?

visibility: show/hide for firefox i.e.?

Does work perfect in IE but not in Gecko

Thanks,
-Tom


/edit: Got one

Update JS code to this (delete old, add the following):

<script type="text/javascript">
<!--
// interval length (in seconds)
var intervalLength = .7;
function emulateBlink() {
objs = document.getElementsByTagName("span");
for(x = 0; x < objs.length; x++) {
if(objs[x].className == "blink") {
if(objs[x].style.visibility == "hidden") {
objs[x].style.visibility = "visible";
}

else {
objs[x].style.visibility = "hidden";
}
}
}
window.setTimeout("emulateBlink();",(intervalLength * 1000));
}
if(document.getElementsByTagName) {
emulateBlink();
}
-->
</script>


and then change the new pm link in the template header_pm to look like this:

<span class="blink">something</span>

Great! :)