Go Back   vb.org Archive > vBulletin Modifications > vBulletin 4.x Modifications > vBulletin 4.x Add-ons
FAQ Community Calendar Today's Posts Search

Reply
 
Thread Tools
Block - Users Online Details »»
Block - Users Online
Version: 1.4, by Lynne Lynne is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: vBulletin Forum Sideblocks - Version: 4.2.0 Rating:
Released: 01-22-2010 Last Update: 06-04-2012 Installs: 161
Uses Plugins Template Edits
Re-useable Code  
No support by the author.

This is a block for your forum sideblocks to show the Current Users Online.



You will need to Create a new Template (block_users_online), Cache the template, Create a new Block (Users Online), and then, optionally, remove the Currently Active Users list from the bottom of the page.

1.1 2010-06-12: Added in Most users ever online. Updated for 4.0.3.
1.2 2010-06-23: Updated to work for 4.0.4.
1.3 2011-11-17: Fixed template and block code for use in 4.1.8.
1.4 2012-06-05: Fixed template for use in 4.2.0.

Installation instructions for 4.2.0, 4.1.8 and pre-4.1.8 are included in the 1.4 download. Please make sure you use the correct Installation Instructions as both the block code and the template code are different depending on the version you are running. Read them carefully!!!

Download Now

File Type: zip Block - Users Online 1.4.zip (26.6 KB, 552 views)

Screenshots

File Type: png block-users online.png (21.5 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
Благодарность от:
BCP Hung

Comments
  #202  
Old 10-19-2012, 11:37 AM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne,

I'm on 4.2.0, I've followed every instruction twice, disabled all hooks and still can't get this to show. All I see is "Array". Any more ideas? Can I PM you my site details?
Reply With Quote
  #203  
Old 10-19-2012, 04:18 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Big-K View Post
Lynne,

I'm on 4.2.0, I've followed every instruction twice, disabled all hooks and still can't get this to show. All I see is "Array". Any more ideas? Can I PM you my site details?
Did you follow the instructions for 4.2.0? I just reinstalled it on my 4.2.0 install using the instructions in the text file and it shows up just fine.
Reply With Quote
  #204  
Old 10-20-2012, 07:12 AM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Did you follow the instructions for 4.2.0? I just reinstalled it on my 4.2.0 install using the instructions in the text file and it shows up just fine.
I just took all the steps again, no progress. I'll PM you my details please
Reply With Quote
  #205  
Old 10-20-2012, 03:34 PM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Update:

Thank you, Lynne The Great

In case anyone has issues, make sure to put in the name of the custom template in the block configuration page (Template To Use). That's the part I missed - Think that should be added to the instructions.

Does anyone know how to make this into Avatars?
Reply With Quote
  #206  
Old 10-20-2012, 04:32 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Big-K View Post
Update:

Thank you, Lynne The Great

In case anyone has issues, make sure to put in the name of the custom template in the block configuration page (Template To Use). That's the part I missed - Think that should be added to the instructions.
It is in the instructions:

Quote:
3) Configure the Block
Now go to forums & Moderators > Forum Block Manager > Add Block
Select Block Type - Custom HTML/PHP
CONTINUE
Title - Users Online
Cache Time (in minutes) - 1 (default is 60 minutes)
Active - Yes
Content Type - PHP
Template to Use - block_users_online
Content -

if (THIS_SCRIPT != 'index') {
require_once(DIR . '/includes/functions_bigthree.php');
rest of code removed....
Reply With Quote
  #207  
Old 10-20-2012, 07:57 PM
oldz442 oldz442 is offline
 
Join Date: May 2012
Location: Canada
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by oldz442 View Post
Can I add a fetch_avatar_url($userid) to the block code somewhere? I want to display a clickable mini avatar, 4 per row similar to below. I am using file based avatars. thx
bump
Attached Images
File Type: jpg wgo_sideblock.jpg (19.9 KB, 0 views)
Reply With Quote
  #208  
Old 10-20-2012, 08:06 PM
Mark.B Mark.B is offline
Senior Member
 
Join Date: Feb 2004
Posts: 1,354
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by oldz442 View Post
Can I add a fetch_avatar_url($userid) to the block code somewhere? I want to display a clickable mini avatar, 4 per row similar to below. I am using file based avatars. thx
In the block code you would add this:

PHP Code:
// AVATAR

require_once(DIR '/includes/functions_user.php');
 
$loggedin['avatarurl'] = fetch_avatar_url($loggedin['userid']);
     if (!
$loggedin['avatarurl']) {
                    
$loggedin['avatarurl'] = 'images/misc/unknown.png';
                  } else {
                    
$loggedin['avatarurl'] = $loggedin['avatarurl'][0];
                  }


// AVATAR 
Then you can call it with {vb:raw loggedin.avatarurl}.

However you'll need to account for the fact as it stands you'll just get a long line of avatars; you need something in the template code to make them wrap after 4 avatars.

Also bear in mind this adds 1 query per avatar.
Reply With Quote
  #209  
Old 10-20-2012, 09:42 PM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Mark.B View Post
In the block code you would add this:

PHP Code:
// AVATAR

require_once(DIR '/includes/functions_user.php');
 
$loggedin['avatarurl'] = fetch_avatar_url($loggedin['userid']);
     if (!
$loggedin['avatarurl']) {
                    
$loggedin['avatarurl'] = 'images/misc/unknown.png';
                  } else {
                    
$loggedin['avatarurl'] = $loggedin['avatarurl'][0];
                  }


// AVATAR 
Then you can call it with {vb:raw loggedin.avatarurl}.
Mark, Where exactly do you add this in the block code and how do you call it?
Reply With Quote
  #210  
Old 10-20-2012, 11:38 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

You could rewrite the query that gets the users online and JOIN with the avatar table and get the avatar that way and then you don't get an extra query per user for the avatar. (Check the query for the post user since that query grabs and avatar for the user.)
Reply With Quote
  #211  
Old 10-23-2012, 11:31 AM
Big-K Big-K is offline
 
Join Date: Feb 2005
Posts: 139
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne - Is it possible for you to help create a code for those who want Avatars like Mark.B's?
Reply With Quote
Reply


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 01:38 PM.


Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.05075 seconds
  • Memory Usage 2,360KB
  • Queries Executed 26 (?)
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
  • (2)bbcode_php
  • (7)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)modsystem_post
  • (1)navbar
  • (4)navbar_link
  • (120)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (11)post_thanks_box
  • (1)post_thanks_box_bit
  • (11)post_thanks_button
  • (1)post_thanks_javascript
  • (1)post_thanks_navbar_search
  • (1)post_thanks_postbit
  • (11)post_thanks_postbit_info
  • (10)postbit
  • (3)postbit_attachment
  • (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
  • 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_attachment
  • postbit_display_complete
  • post_thanks_function_can_thank_this_post_start
  • pagenav_page
  • pagenav_complete
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • showthread_complete