The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
Avatar's opacity according to user's status (online/offline) Details »» | |||||||||||||||||||||||||||
Avatar's opacity according to user's status (online/offline)
Developer Last Online: Dec 2021
Avatar's opacity according to user's status (online/offline)
Total hack's description : http://www.vbulletindev.net/forums/h...hack&hackid=72 http://www.vbulletindev.net Please click if you like this hack Requested here, some people said it could be found on vBT, but it requires code modification to work, it was requested on our forum too, that's why I created it and release it here With this small hack, in postbit, if the user is connected, his avatar will be displayed normally, else it will be less visible New modifications : - Avaible in memberlist too - Browser detection (mozilla) SC (still can't attach them) Show Your Support
|
Comments |
#52
|
|||
|
|||
I installed this twice and it doesn't work, the only thing I can think of is that I am running vB 3.0.1 and this is for Gold. Any reason other than that what the avatars wouldn't reduce opacity on either IE6 or Firefox?
|
#53
|
|||
|
|||
Never mind, I realized you have to set the forums to use the legacy settings. Problem solved.
|
#54
|
|||
|
|||
If user chooses to be hidden, it still shows opacity 100%.
Basically pointless until this is fixed. |
#55
|
||||
|
||||
Quote:
EDIT: // Works ok on mine ? maybe I have some other mods included ? |
#56
|
|||
|
|||
Quote:
This is only mod installed for showthread, and I'm taking it down. |
#57
|
||||
|
||||
Quote:
|
#58
|
|||
|
|||
Quote:
|
#59
|
||||
|
||||
awesome! looks great on my forum!
thanks! *hits install! |
#60
|
|||
|
|||
installed on vb 3.0.0 and vb 3.0.3 and working great on both.
|
#61
|
|||
|
|||
I hope no-one minds, but I wanted to highlight another way of doing this which requires less processing (fractionally) and is a little more elegant.
I should note that I'm not using avatars in the memberlist, so this isn't for that. But this does the showthread and private messaging ones In includes/functions_bigthree.php there is already a function that finds out someones online status. Within that file find: PHP Code:
PHP Code:
$user['IsOnline'] indicates that the user is online or not... or rather, should appear online to the current user... it takes into account invisibility and permissions, as the code above this already does all of this. So we have less processing as none of this needs to be run: Code:
//avatar opacity grog6 - vbulletindev.net $datecut = TIMENOW - $vboptions['cookietimeout']; if (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) $style_avatar="style=\"-moz-opacity:0.3\""; else $style_avatar= "style=\"filter:alpha(opacity=30)\""; if ($post['lastactivity'] > $datecut AND $post['lastvisit'] != $post['lastactivity']) if (($permissions['genericpermissions'] & CANSEEHIDDEN) OR $post['userid'] == $bbuserinfo['userid']) { // user is online and invisible BUT bbuser can see them if (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) $style_avatar="style=\"-moz-opacity:1.0\""; else $style_avatar= "style=\"filter:alpha(opacity=100)\""; } else { // user is online and visible if (!ereg("MSIE", $_SERVER["HTTP_USER_AGENT"])) $style_avatar="style=\"-moz-opacity:1.0\""; else $style_avatar= "style=\"filter:alpha(opacity=100)\""; Now, all we have to do is find the avatar line in the postbit template and add a conditional to it: Code:
<if condition="$post[IsOnline] == true"> <br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a> <else /> <br /><a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$avatarurl" alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" style="filter:alpha(opacity=30);-moz-opacity:0.3;opacity: 0.3;" /></a> </if> Secondly I apply both the IE and Mozilla and Opera opacity switches at the same time. Yes, I said Opera... Opera is currently using the CSS3 recommendation of 'opacity'... which is the best thing to do as that is also what Mozilla will be using in the future. Styles set like this are ignored if not applicable... so it breaks nothing. Anyhow... more elegant because of the simplicity of the code modification and the fact that we keep all of the presentation logic in templates rather than in code. It shouldn't be hard for those who want to use this for the memberlist or memberprofile to add a call to the fetch_online_status() function in functions_bigthree.php and to add a conditional to their template. But yeah... a different way of doing the same thing. Better? Hard to say... but I think a little more elegant. Cheers David K |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|