PDA

View Full Version : Online/Offline Status with Avatar Opacity


Grendel602
25 Dec 2002, 19:50
This is our first hack, but it works very nicely. :)

This hack changes the way a user is displayed as online or offline when viewing a thread. It serves three purposes. One, it cuts down on a cluttered postbit. Two, it makes it very easy to distinguish who’s online and who’s not when viewing a thread. Three, it’s kinda cool.

If a user is offline his/her avatar’s opacity will be set to 20 (This is the setting we are using, you can change this number by editing the “postbit_avataroffline” template, which is included in the attached zip file). A low image opacity gives an image a washed out sort of look. If a user is Online his/her avatar’s opacity is 100 of course.

See a live demo at our forums:

http://forums.otllive.com

This hack is fairly easy to install. You’ll have to edit three php files, add a new template, edit your “Head Insert” under Styles, upload a small Javascript file, and make a small change to your postbit, announcement, and privmsg templates.

Included in the zip file is an install.txt document and one javascript file.

Creativity by Grendel
Coding by Nomb

BTW, This is the Official Merry Christmas Hack! :D

Don't forget to click install if you use this hack.

Merry Christmas.

**EDIT** (12/25/02 6:00 pm EST)

I've updated the install file. Users that don't have avatars will stay that way. Also, the coding is integrated into whether or not users select the option to "show" avatars or not.

Final release! :D

I will be adding something else to this hack in the future. For now, it works with no weird stuff.

Grendel602
25 Dec 2002, 19:58
Great job Nomb, BTW could someone tell me how to give the username Nomb priviliges here at vbulletin.org since he is an official staff member of my licensed vbulletin community?

Hope you all enjoy this!

:)

The Ghost
25 Dec 2002, 20:17
cool hack but I don't need it. thx for share!

Chris M
25 Dec 2002, 20:23
@Grendel602 - Goto this (http://www.vbulletin.com/members/forums.php) page and enter your friend's email address;)

Nice hack - Will get back to you with any queries;)

Satan

Courage
25 Dec 2002, 20:37
Nice !!!

See exemple here:

http://www.softnews.ro/forum/showthread.php?s=&postid=61968#post61968

No registration needed !

BUG found

if the user has no avatar selected.. it apears like the avatar is missing :(.. 404 eror !

Grendel602
25 Dec 2002, 20:42
So does the entire page give a 404 error? We have people without avatars and have not experienced this.

We are looking into this and have thought about people without avatars.

As far as people not having avatars you can look at it 2 ways:

1) Who cares
2) Install our hack that sets up guest avatars which we are currently working on :).

Grendel602
25 Dec 2002, 20:43
Originally posted by Courage
Nice !!!

See exemple here:

http://www.softnews.ro/forum/showthread.php?s=&postid=61968#post61968

No registration needed !

BUG found

if the user has no avatar selected.. it apears like the avatar is missing :(.. 404 eror !

It isn't a bug, it's more of a design decesion.

I will be releasing an updated version soon that will fix this issue as well as address what to do when there is no avatar (A method I've come up with). This hack was designed for those sites that use avatars. What's more, most members use them. At first I thought I wasn't going to do anything about it but soon I will.

Thanks

Nomb :D

Courage
25 Dec 2002, 20:49
Some (few) members does not use an avatar...

It is a problem..
I will remove this hack until a fix will come up ! :)

Also.. i use opacity=75

Velocd
25 Dec 2002, 20:51
I use to do this with my forums for about 1 or 2 months: making a users avatar opacity lower when they are offline (hence the idea for my improved-buddy list hack), but after awhile it just made things look gloomy on the forums and in threads, because so many avatars were always faded :'(

Chris M
25 Dec 2002, 20:54
Couldn't you just modify the code a little bit to check to see if the user has an avatar?

Satan

Grendel602
25 Dec 2002, 21:17
We are working on that aspect right now hellsatan.

:)

Thanks for the input.

Grendel602
25 Dec 2002, 22:12
Done.

New updated Zip file is attached with updated install file.

Now users that do not have avatars will stay that way. In addition, if a user chooses not to view avatars he/she will not see them.

Before, the coding was not nested in that particular if/else.

- Nomb

:D

Chris M
25 Dec 2002, 22:17
Cool:)

Satan

alkatraz
26 Dec 2002, 06:50
Cool idea!

Nomb
26 Dec 2002, 14:22
Originally posted by alkatraz
Cool idea!

Thanks. It's worked out quite well for us. The other thing you could do, I might, is make a default avatar (Something to do with your site, your logo maybe) and have vB assign it to new members until they choose one of their own. This way, you'd know if they were online or not.

:D

Kars10
26 Dec 2002, 15:18
If you want you can show the online/offline-status by hovering over the avatars:

In postbit_avataroffline

replace all with...

<img src="$avatarurl" border="0" alt="$post[ username] is offline!" style="filter:alpha(opacity=50)">

and in postbit_avatar

replace all with...

<img src="$avatarurl" border="0" alt="$post[ username] is online!">

Note: delete the empty space between [ and username!

Brad
26 Dec 2002, 20:23
Originally posted by Nomb


Thanks. It's worked out quite well for us. The other thing you could do, I might, is make a default avatar (Something to do with your site, your logo maybe) and have vB assign it to new members until they choose one of their own. This way, you'd know if they were online or not.

:D

http://www.vbulletintemplates.com/mods/showthread.php?s=&threadid=1707&highlight=avatar

Nomb
26 Dec 2002, 20:37
Originally posted by Anime-loo


http://www.vbulletintemplates.com/mods/showthread.php?s=&threadid=1707&highlight=avatar

Yea, I already implemented something similar at our boards. We are just using the noavatar.gif.

Here's a snippit of the code for admin/functions.php, although, you should edit private.php and announcement.php as well.


if ($post[avatarid]!=0) {
$avatarurl=$post[avatarpath];
} else {
if ($post[hascustomavatar] and $avatarenabled) {
$avatarurl="avatar.php?userid=$post[userid]&dateline=$post[avatardateline]";
} else {
$avatarurl="images/avatars/noavatar.gif";
}
}
if ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars])) {
$post[avatar]="";
} else {
if ($post['lastactivity'] > $datecut and !$post['invisible'] and $post['lastvisit'] != $post['lastactivity']) {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avataroffline")."\";");
}
}


Using this your members will have a "no avatar selected" avatar if they haven't used a custom avatar and it will still function like the others (Online/Offline low opacity status).

I'll probably update the hack later but I don't have time right now. :P

Here's the noavatar.gif file which should be placed in images/avatars/

Brad
26 Dec 2002, 20:47
i prefer editing the templates for something like that but whatever suits your fancy :p

Nomb
26 Dec 2002, 20:50
Originally posted by Anime-loo
i prefer editing the templates for something like that but whatever suits your fancy :p

The whole point of this is to show Online/Offline Status via Avatar opacity. That, you cannot do in a template. It has to be coded in php.

Brad
26 Dec 2002, 20:59
I know that :-p. im talking about the default avatar if none selected.

Sebastian
26 Dec 2002, 22:18
very interesting hack :)

Grendel602
26 Dec 2002, 23:40
Originally posted by Sebastian
very interesting hack :)

You guys are making us blush.

:banana:

We are working on another hack for gaming oriented clan sites.


Don't forget to click the install button if you use our hack.

:o

mli
27 Dec 2002, 17:49
Originally posted by Courage
Nice !!!

See exemple here:

http://www.softnews.ro/forum/showthread.php?s=&postid=61968#post61968

No registration needed !

BUG found

if the user has no avatar selected.. it apears like the avatar is missing :(.. 404 eror !
This is way off topic, but you've got a ROMANIAN FORUM!!! Crazy. I was born in Romania and lived there for 10 years. Where do you live?

ladyfyre
27 Dec 2002, 18:08
i don't really want our avatars to go transparent if people are not online....but i think there is still a pretty cool way to use this.....

what if instead of setting the avatar to opaque if the user is OFFLINE, you put a border around the image using the { categorybackcolor } replacement?

That would highlight those who are ONLINE, while leaving offline members as is.

partang2
28 Dec 2002, 17:12
Great hack! Works great on 2.2.9

*Clicks install*

Grendel602
29 Dec 2002, 05:19
Glad you all like it. Leave some links of how you all are using the hack.

:)

DFX
30 Dec 2002, 01:50
Ran into a little problem. I had to edit some of the lines for a different hack.

if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}

Is instead

if ($avatarurl=="" or ($bbuserinfo[userid]>0 and !($bbuserinfo[showavatars]))) {
$post[avatar]="";
} elseif ($post[usergroupid]== 103) {
eval("\$post[avatar] = \"".gettemplate("postbit_blur_avatar")."\";");
} else {
eval("\$post[avatar] = \"".gettemplate("postbit_avatar")."\";");
}

Is there anyway for me to use this hack?

Nomb
30 Dec 2002, 16:04
Do you want to discontinue using the hack you have in place now? Can you post the contents of the "postbit_blur_avatar" template.

Thanks ( :

nymyth
30 Dec 2002, 16:16
sup...this is kinda unrelated....but on your website u have this thing where under 'NOMB' u have text taht reads invisible flag man.....i was wondering how u put this there.....(and im talking a bout under thread starter, not the custom name).....thanx

Peace

Nomb
30 Dec 2002, 16:20
It's just the custom user text. I believe you are referring to the announcement I posted there. When you post an announcement from the admin CP it displays both your name and your custom user text for the thread starter. That is a vB default.

nymyth
30 Dec 2002, 16:33
oh yeah duh...now i know what u talkin about.....but do u know of a hack that will allow me to put something next to their names (an admin option), under thread starter.....cuz i have a lot of artists and performers on my site....and i wanna distinguish them from other members.....thanx

Peace

DFX
30 Dec 2002, 22:17
Template name: postbit_blur_avatar
___________________________________

<img src="images/ban.gif" border="0" alt="">

DFX
30 Dec 2002, 22:19
I guess it's not that big of a deal, The other hack isn't working out on my forum as well as I would have liked it to. I'll just use this one ;)

Grendel602
31 Dec 2002, 21:28
If you would like some thorough help with this hack feel free to stop by our fourms and we will send you in the right direction.

Nomb
25 Feb 2003, 07:33
Originally posted by nymyth
oh yeah duh...now i know what u talkin about.....but do u know of a hack that will allow me to put something next to their names (an admin option), under thread starter.....cuz i have a lot of artists and performers on my site....and i wanna distinguish them from other members.....thanx

Peace

You could just put their user text under their user name in the the forumdisplaybit.

Vb-Hispano
08 Mar 2003, 16:13
is cool :D

Mathiau
03 Apr 2003, 05:05
give this baby a try!

RetroDreams
22 May 2003, 17:42
Sometimes when loading a page, some of the user's avatars do not show up until I click refresh.

Do you know why this is?

Nomb
22 May 2003, 22:21
No idea, could have to do with the current version of java on your machine?

lasto
25 Aug 2003, 20:39
done every check possible and no what opacity aint working

is working if i do a test post with an img and set opacity that way but the avatars are still shwoin 100% even if the user is offline

Anyone else had probs or can cast any info on this.

Im on vb2.3.0