Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Template Modifications
Members online status Details »»
Members online status
Version: 1.00, by Replicant Replicant is offline
Developer Last Online: Jun 2022 Show Printable Version Email this Page

Category: Forum Home Enhancements - Version: 4.2.2 Rating:
Released: 02-11-2015 Last Update: Never Installs: 6
Template Edits
Re-useable Code  
No support by the author.

This template edit will show if any members are logged in or not by displaying the online status in red for offline or green for online.





Edit the phrase "currently_active_users" and change to "[Your Forum Name] Members"

Create new phrases "online_now" value="ONLINE NOW!"
and "offline_now" value= "OFFLINE"
or whatever you want displayed

Find and change in template FORUMHOME :
Code:
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" />
To:
Code:
<span class="blocksubhead">{vb:rawphrase currently_active_users}  -</span>
    <vb:if condition="$numberregistered > 0">
        <span class=members_online>{vb:phrase online_now}</span>
    <vb:else />
        <span class=members_offline>{vb:phrase offline_now}</span>
    </vb:if>
and in additional.css

Code:
.members_online {
color: lime;
font-style: italic;
font-weight: bolder;
}
.members_offline {
color: red;
font-style: italic;
font-weight: bolder;
}

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
3 благодарности(ей) от:
Dragonsys, HM666, puertoblack2003

Comments
  #2  
Old 09-07-2016, 07:46 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Can this be used to display if any members of a specific usergroup are online?
Reply With Quote
  #3  
Old 09-07-2016, 11:02 PM
Replicant's Avatar
Replicant Replicant is offline
 
Join Date: Sep 2014
Location: Phoenix, Az. USA
Posts: 485
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I imagine it could. I don't have a vb4 install anymore to work with so I couldn't tell you how to do it. I'm sure one of the vb4 devs on here could help you out with that. I only work on vb5 mods now.
Reply With Quote
  #4  
Old 09-08-2016, 01:02 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Replicant View Post
I imagine it could. I don't have a vb4 install anymore to work with so I couldn't tell you how to do it. I'm sure one of the vb4 devs on here could help you out with that. I only work on vb5 mods now.
I had thought about using is_member_of (and someone PM'd me about it as well), I'm just not sure if it would actually check anyone logged in, or if it just pulls from the person viewing the page. I will play with it and post up here if I find a solution which works.
Reply With Quote
  #5  
Old 09-08-2016, 02:42 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

When you use the is_member_of() function, you typically need to pass 2 arrays as parameters, the first should contain the usergroup information of the user in question, and the second array is a list of usergroupids you are checking for.

So, for example suppose you have the userid of the user in question (in $userid), what you could then use as a condition is:

is_member_of(fetch_userinfo($userid), array(X, Y, Z))

which will return true if the user with $userid as their userid is a member of any of the usergroups with usergroupid X, Y, or Z.
Reply With Quote
  #6  
Old 09-08-2016, 03:05 PM
Dragonsys's Avatar
Dragonsys Dragonsys is offline
 
Join Date: Jan 2008
Location: DFW, Texas
Posts: 743
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by MarkFL View Post
When you use the is_member_of() function, you typically need to pass 2 arrays as parameters, the first should contain the usergroup information of the user in question, and the second array is a list of usergroupids you are checking for.

So, for example suppose you have the userid of the user in question (in $userid), what you could then use as a condition is:

is_member_of(fetch_userinfo($userid), array(X, Y, Z))

which will return true if the user with $userid as their userid is a member of any of the usergroups with usergroupid X, Y, or Z.
Right, which is why I don't think it would work for this situation, as it will pull the info for a specific user, not any user currently online. Unless i loop through all online users, which I do not want to do, as that would cause some bad load times if there are a lot of users.
Reply With Quote
  #7  
Old 09-08-2016, 04:03 PM
MarkFL's Avatar
MarkFL MarkFL is offline
 
Join Date: Feb 2014
Location: St. Augustine, FL
Posts: 3,853
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I believe BOP5 has a product that will show staff online in the sidebar, which could suit your needs.
Reply With Quote
Благодарность от:
Dragonsys
  #8  
Old 06-18-2017, 02:47 PM
Gavo34 Gavo34 is offline
 
Join Date: Feb 2013
Posts: 8
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Works for vB 4.2.5

Find and change in template FORUMHOME :
(Only partial code was given above)


Code:
<h3 class="blocksubhead"><img src="{vb:stylevar imgdir_misc}/users_online.png" alt="{vb:rawphrase currently_active_users}" />{vb:rawphrase currently_active_users}</h3>

Change to:
Code:
<span class="blocksubhead">{vb:rawphrase currently_active_users}  -</span>
    <vb:if condition="$numberregistered > 0">
        <span class=members_online>{vb:phrase online_now}</span>
    <vb:else />
        <span class=members_offline>{vb:phrase offline_now}</span>
    </vb:if>
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 11:01 AM.


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.05661 seconds
  • Memory Usage 2,290KB
  • Queries Executed 22 (?)
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
  • (5)bbcode_code
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (8)post_thanks_box
  • (4)post_thanks_box_bit
  • (8)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (2)post_thanks_postbit
  • (8)post_thanks_postbit_info
  • (7)postbit
  • (8)postbit_onlinestatus
  • (8)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
  • fetch_musername
  • post_thanks_function_fetch_thanks_end
  • post_thanks_function_thanked_already_start
  • post_thanks_function_thanked_already_end
  • post_thanks_function_fetch_thanks_bit_start
  • post_thanks_function_show_thanks_date_start
  • post_thanks_function_show_thanks_date_end
  • post_thanks_function_fetch_thanks_bit_end
  • post_thanks_function_fetch_post_thanks_template_start
  • post_thanks_function_fetch_post_thanks_template_end
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete