Go Back   vb.org Archive > vBulletin Modifications > Archive > vB.org Archives > vBulletin 3.0 > vBulletin 3.0 Full Releases

Reply
 
Thread Tools
Avatar's opacity according to user's status (online/offline) Details »»
Avatar's opacity according to user's status (online/offline)
Version: 1.00, by VBDev VBDev is offline
Developer Last Online: Dec 2021 Show Printable Version Email this Page

Version: 3.0.0 Rating:
Released: 04-30-2004 Last Update: Never Installs: 97
 
No support by the author.

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

  • This modification may not be copied, reproduced or published elsewhere without author's permission.

Comments
  #82  
Old 03-25-2005, 02:27 PM
Polo's Avatar
Polo Polo is offline
 
Join Date: Jun 2004
Posts: 893
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Excellent mod, i installed it in less than a minute and it works great... thank you vbdev
Reply With Quote
  #83  
Old 08-03-2005, 01:49 AM
VPREATR VPREATR is offline
 
Join Date: Feb 2003
Posts: 31
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a notable performance impact when showing threads with this hack?

Thanks!
Reply With Quote
  #84  
Old 08-03-2005, 03:54 AM
Pseudomizer's Avatar
Pseudomizer Pseudomizer is offline
 
Join Date: Mar 2002
Location: Germany
Posts: 614
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by VPREATR
Is there a notable performance impact when showing threads with this hack?

Thanks!
No, there is no impact because you do the "is online" check anyway and the opacity is just an additional statement for the graphics.

Cheers,
Reply With Quote
  #85  
Old 09-23-2005, 12:51 AM
Omega Prime's Avatar
Omega Prime Omega Prime is offline
 
Join Date: Sep 2002
Location: ::Infinity::
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Hopefully, someone can port this to 3.5 (or perhaps figure out a different means of doing this)
Reply With Quote
  #86  
Old 09-23-2005, 01:51 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I already did it for my site for 3.5 RC 3 but it involved a small file edit.
Reply With Quote
  #87  
Old 09-29-2005, 04:50 AM
Omega Prime's Avatar
Omega Prime Omega Prime is offline
 
Join Date: Sep 2002
Location: ::Infinity::
Posts: 169
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Boofo
I already did it for my site for 3.5 RC 3 but it involved a small file edit.
Care to explain how you did it?
Reply With Quote
  #88  
Old 09-29-2005, 06:31 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Sure.

https://vborg.vbsupport.ru/showpost....2&postcount=60
Reply With Quote
  #89  
Old 04-21-2006, 01:09 AM
obmob obmob is offline
 
Join Date: Nov 2001
Posts: 580
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Well, changed a couple of phrases for vb 3.5.4, working fine, thanks Boofo.
Quote:
In includes/functions_bigthree.php there is already a function that finds out someones online status.

Within that file find:

PHP Code:
if ($setstatusimage
  { 
    eval(
'$user[\'onlinestatus\'] = "' fetch_template('postbit_onlinestatus') . '";'); 
  } 

BEFORE that, put:

PHP Code:
// HACK : START : STATUS ACCESS 
  
switch ($onlinestatus) { 
    case 
0
      
$user['IsOnline'] = false
      break; 
    case 
1
      
$user['IsOnline'] = true
      break; 
    case 
2
      
$user['IsOnline'] = true
      break; 
    default: 
      
$user['IsOnline'] = false
      break; 
  } 
  
// HACK : END : STATUS ACCESS 
Now the $user object has an additional property in its array:

$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.

Now, all we have to do is find the avatar line in the postbit template and add a conditional to it:

PHP Code:
          <if condition="$post[IsOnline] == true">
                      <
a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[avatarurl]alt="<phrase 1="$post[username]">$vbphrase[xs_avatar]</phrase>" border="0" /></a>
                      <else />
                      <
a href="member.php?$session[sessionurl]u=$post[userid]"><img src="$post[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> 
Notice that if it's online, it doesn't even have the style added... which is a good thing as why apply opacity when it's not required?

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.
Reply With Quote
  #90  
Old 04-21-2006, 02:44 AM
Boofo's Avatar
Boofo Boofo is offline
 
Join Date: Mar 2002
Location: Des Moines, IA (USA)
Posts: 15,776
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by obmob
Well, changed a couple of phrases for vb 3.5.4, working fine, thanks Boofo.
What phrases did you change and what did you change them to?
Reply With Quote
  #91  
Old 05-19-2006, 10:57 PM
Casperddc Casperddc is offline
 
Join Date: Jun 2004
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Is there a version for this for 3.5.4 via hook / plugin yet?
Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT. The time now is 05:04 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.09022 seconds
  • Memory Usage 2,320KB
  • Queries Executed 25 (?)
More Information
Template Usage:
  • (1)SHOWTHREAD
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)ad_showthread_beforeqr
  • (3)bbcode_php
  • (4)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (6)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (11)post_thanks_box
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (11)postbit_onlinestatus
  • (11)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available:
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files:
  • ./showthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_post_thanks.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • forumjump
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • post_thanks_function_post_thanks_off_start
  • post_thanks_function_post_thanks_off_end
  • post_thanks_function_fetch_thanks_start
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • fetch_musername
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete