View Full Version : Online/Offline Status with Avatar Opacity
Grendel602
12-24-2002, 10:00 PM
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
12-25-2002, 06:58 PM
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
12-25-2002, 07:17 PM
cool hack but I don't need it. thx for share!
Chris M
12-25-2002, 07:23 PM
@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
12-25-2002, 07:37 PM
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
12-25-2002, 07:42 PM
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
12-25-2002, 07:43 PM
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
12-25-2002, 07:49 PM
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
12-25-2002, 07:51 PM
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
12-25-2002, 07:54 PM
Couldn't you just modify the code a little bit to check to see if the user has an avatar?
Satan
Grendel602
12-25-2002, 08:17 PM
We are working on that aspect right now hellsatan.
:)
Thanks for the input.
Grendel602
12-25-2002, 09:12 PM
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
12-25-2002, 09:17 PM
Cool:)
Satan
alkatraz
12-26-2002, 05:50 AM
Cool idea!
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
12-26-2002, 02:18 PM
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!
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
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/
i prefer editing the templates for something like that but whatever suits your fancy :p
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.
I know that :-p. im talking about the default avatar if none selected.
Sebastian
12-26-2002, 09:18 PM
very interesting hack :)
Grendel602
12-26-2002, 10:40 PM
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
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
12-27-2002, 05:08 PM
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
12-28-2002, 04:12 PM
Great hack! Works great on 2.2.9
*Clicks install*
Grendel602
12-29-2002, 04:19 AM
Glad you all like it. Leave some links of how you all are using the hack.
:)
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?
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
12-30-2002, 03:16 PM
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
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
12-30-2002, 03:33 PM
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
Template name: postbit_blur_avatar
___________________________________
<img src="images/ban.gif" border="0" alt="">
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
12-31-2002, 08:28 PM
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.
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
03-08-2003, 03:13 PM
is cool :D
Mathiau
04-03-2003, 04:05 AM
give this baby a try!
RetroDreams
05-22-2003, 04:42 PM
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?
No idea, could have to do with the current version of java on your machine?
lasto
08-25-2003, 07:39 PM
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
vBulletin® v3.8.12 by vBS, Copyright ©2000-2025, vBulletin Solutions Inc.