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
Widget - Users Online Details »»
Widget - Users Online
Version: 1.4, by Lynne Lynne is offline
Developer Last Online: Oct 2022 Show Printable Version Email this Page

Category: vBulletin CMS Widgets - Version: 4.1.8 Rating:
Released: 12-17-2009 Last Update: 11-26-2011 Installs: 686
Uses Plugins Template Edits
Re-useable Code Translations  
No support by the author.

This is a widget for your CMS pages to show the Current Users Online.



You will need to Create a new Template (vbcms_widget_execphp_activeusers), Cache the template, Create a new Widget (Users Online), Configure the Widget, and then finally add the Widget to your Layout (I am not including instructions for that, you should know how to add Widgets to Layouts).

1.0 2009-12-17: initial release by Lynne at vbulletin.org (pre 4.0)
1.- 2010-01-07 - French translation included thanks to albibak (version 1.0)
1.1 2010-05-30: Added in Most users ever online.
1.2 2010-10-22: Fixed template to use new classes and widget code to use new online users query/method. (4.0.8)
1.3 2011-11-17: Fixed template and widget code for use in 4.1.8.
1.4 2011-11-27: Quick fix in template to show link to online.php page. (4.1.8)

Installation instructions for 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 widget code and the template code are different depending on the version you are running. Read them carefully!!!

Download Now

File Type: txt widget- users online_FR.txt (7.1 KB, 272 views)
File Type: txt widget-users online 1.1.txt (7.3 KB, 250 views)
File Type: txt widget-users online 1.2.txt (7.7 KB, 430 views)
File Type: txt widget-users online 1.4.txt (15.2 KB, 1551 views)

Screenshots

File Type: png widget-users online 1.1.png (21.8 KB, 0 views)

Show Your Support

  • This modification may not be copied, reproduced or published elsewhere without author's permission.
5 благодарности(ей) от:
doctorsexy, GONUMBER6, livenetc, misericorde, romaszek

Comments
  #72  
Old 12-27-2009, 05:00 AM
bennzy bennzy is offline
 
Join Date: May 2008
Posts: 30
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Ok i added the widget to my site and it came up with no style and just a date inside, ive removed it all and tried it again yet still get the same thing.

Please tell me what i am doing wrong or is there something wrong with the coding?

im using vb 4.0 'gold'
Attached Images
File Type: jpg onlineuser_widget.jpg (5.2 KB, 0 views)
Reply With Quote
  #73  
Old 12-27-2009, 01:54 PM
Doctor Death Doctor Death is offline
 
Join Date: Dec 2005
Posts: 449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
If you can't save anything in your widgets configuration, then you should post for help over on vbulletin.com. First try a search over there and see if the issue has come up before.
Lynne;

Thanks for suggesstion, I did exactly that and have received no help.

To be quite honest, I saw you were the pro from dover on widgets and was hoping you would be able to identify this issue in Gold 4.0... Notice I am not the only one with this challenge.

Thanks much anyway... Any suggestions would be appreciated.
Reply With Quote
  #74  
Old 12-27-2009, 02:25 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 bennzy View Post
Ok i added the widget to my site and it came up with no style and just a date inside, ive removed it all and tried it again yet still get the same thing.

Please tell me what i am doing wrong or is there something wrong with the coding?

im using vb 4.0 'gold'
Did you click on the Configure link next to the widget and then add the code in there? Oh, and did you change the name of the template in the Configure panel? My widget won't output a date because it doesn't use $output for the output like a normal widget template does.

Quote:
Originally Posted by Doctor Death View Post
Lynne;

Thanks for suggesstion, I did exactly that and have received no help.

To be quite honest, I saw you were the pro from dover on widgets and was hoping you would be able to identify this issue in Gold 4.0... Notice I am not the only one with this challenge.

Thanks much anyway... Any suggestions would be appreciated.
The only time something like this happened to me, I had not uploaded all the files correctly. Once I reuploaded all the files, it worked fine. So, try that. Or, you may want to put in a Support Ticket cuz I really don't know what else to suggest. Also, as I mentioned above, did you change the name of the template in the Configure panel? My widget won't output a date because it doesn't use $output for the output like a normal widget template does.
Reply With Quote
  #75  
Old 12-28-2009, 12:31 PM
UrGonnaDie UrGonnaDie is offline
 
Join Date: Dec 2009
Posts: 29
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

great job works perfect.
Reply With Quote
  #76  
Old 12-28-2009, 03:45 PM
steve1966 steve1966 is offline
 
Join Date: Dec 2007
Posts: 504
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

thanks
Reply With Quote
  #77  
Old 12-31-2009, 09:27 AM
Hasanudin's Avatar
Hasanudin Hasanudin is offline
 
Join Date: Jun 2003
Location: Indonesia
Posts: 41
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

running well..... thx u
Reply With Quote
  #78  
Old 01-01-2010, 04:51 PM
Doctor Death Doctor Death is offline
 
Join Date: Dec 2005
Posts: 449
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Derekclarke View Post
I have found what i was Doing Wrong, and am no longer getting this Error.

However when i try to configure the Wigit, I Paste the code
PHP Code:
require_once(DIR '/includes/functions_bigthree.php'); 

$activeusers '';
if ((
vB::$vbulletin->options['displayloggedin'] == OR vB::$vbulletin->options['displayloggedin'] == OR (vB::$vbulletin->options['displayloggedin'] > AND vB::$vbulletin->userinfo['userid'])) AND !$show['search_engine'])
{
    
$datecut TIMENOW vB::$vbulletin->options['cookietimeout'];
    
$numbervisible 0;
    
$numberregistered 0;
    
$numberguest 0;

    
$forumusers vB::$db->query_read_slave("
        SELECT
            user.username, (user.options & " 
vB::$vbulletin->bf_misc_useroptions['invisible'] . ") AS invisible, user.usergroupid, user.lastvisit,
            session.userid, session.inforum, session.lastactivity, session.badlocation,
            IF(displaygroupid=0, user.usergroupid, displaygroupid) AS displaygroupid, infractiongroupid
            
$hook_query_fields
        FROM " 
TABLE_PREFIX "session AS session
        LEFT JOIN " 
TABLE_PREFIX "user AS user ON(user.userid = session.userid)
        
$hook_query_joins
        WHERE session.lastactivity > 
$datecut
            
$hook_query_where
        " 
iif(vB::$vbulletin->options['displayloggedin'] == OR vB::$vbulletin->options['displayloggedin'] == 3"ORDER BY username ASC") . "
    "
);

    if (
vB::$vbulletin->userinfo['userid'])
    {
        
// fakes the user being online for an initial page view of index.php
        
vB::$vbulletin->userinfo['joingroupid'] = iif(vB::$vbulletin->userinfo['displaygroupid'], vB::$vbulletin->userinfo['displaygroupid'], vB::$vbulletin->userinfo['usergroupid']);
        
$userinfos = array
        (
            
vB::$vbulletin->userinfo['userid'] => array
            (
                
'userid'            =>& vB::$vbulletin->userinfo['userid'],
                
'username'          =>& vB::$vbulletin->userinfo['username'],
                
'invisible'         =>& vB::$vbulletin->userinfo['invisible'],
                
'inforum'           => 0,
                
'lastactivity'      => TIMENOW,
                
'lastvisit'         =>& vB::$vbulletin->userinfo['lastvisit'],
                
'usergroupid'       =>& vB::$vbulletin->userinfo['usergroupid'],
                
'displaygroupid'    =>& vB::$vbulletin->userinfo['displaygroupid'],
                
'infractiongroupid' =>& vB::$vbulletin->userinfo['infractiongroupid'],
            )
        );
    }
    else
    {
        
$userinfos = array();
    }
    
$inforum = array();

    while (
$loggedin vB::$db->fetch_array($forumusers))
    {
        
$userid $loggedin['userid'];
        if (!
$userid)
        {    
// Guest
            
$numberguest++;
            if (!isset(
$inforum["$loggedin[inforum]"]))
            {
                
$inforum["$loggedin[inforum]"] = 0;
            }
            if (!
$loggedin['badlocation'])
            {
                
$inforum["$loggedin[inforum]"]++;
            }
        }
        else if (empty(
$userinfos["$userid"]) OR ($userinfos["$userid"]['lastactivity'] < $loggedin['lastactivity']))
        {
            
$userinfos["$userid"] = $loggedin;
        }
    }

    if (!
vB::$vbulletin->userinfo['userid'] AND $numberguest == 0)
    {
        
$numberguest++;
    }

    foreach (
$userinfos AS $userid => $loggedin)
    {
        
$numberregistered++;
        if (
$userid != vB::$vbulletin->userinfo['userid'] AND !$loggedin['badlocation'])
        {
            if (!isset(
$inforum["$loggedin[inforum]"]))
            {
                
$inforum["$loggedin[inforum]"] = 0;
            }
            
$inforum["$loggedin[inforum]"]++;
        }
        
fetch_musername($loggedin);

        if (
fetch_online_status($loggedin))
        {
            
$numbervisible++;
            
$show['comma_leader'] = ($activeusers != '');
            
$templater vB_Template::create('forumhome_loggedinuser');
                
$templater->register('loggedin'$loggedin);
            
$activeusers .= $templater->render();
            
vB_Template::preRegister('vbcms_widget_execphp_activeusers', array('activeusers' => $activeusers)); 
        }
    }

    
// memory saving
    
unset($userinfos$loggedin);

    
vB::$db->free_result($forumusers);

    
$totalonline $numberregistered $numberguest;
    
$numberinvisible $numberregistered $numbervisible;

    
$show['loggedinusers'] = true;
    
    
$statsarray = array('onlinestats' => $onlinestats,
    
'totalonline' => $totalonline,
    
'numberregistered' => $numberregistered,
    
'numberguest' => $numberguest,
    
'show'    => $show,
    );
    
    
vB_Template::preRegister('vbcms_widget_execphp_activeusers'$statsarray); 

Into the Top Section of the Popup Box, and change the template name to
PHP Code:
vbcms_widget_execphp_activeusers 
as Instructed and Save.

However it does NOT change the code in the main box, and all i get displayed it the Time.
I get this exact error that you are getting.

When originally configuring this widget it contains

Quote:
$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";
I have implemented other widgets (Direct HTML exeuction), however when I edit this widet's configuration to put in the code, it never saves it.

When I try to put in the proper code and click SAVE, it always defaults back to this contents

Quote:
$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";
Would be happy to let Lynne (or anyone else) examine it if she cares to. Message me if so.
Reply With Quote
  #79  
Old 01-02-2010, 02:04 AM
THE__DRIFTER THE__DRIFTER is offline
 
Join Date: Feb 2009
Posts: 65
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I did everything stated in this post but it will not show on the frontpage. Suggestions?
Reply With Quote
  #80  
Old 01-02-2010, 03:10 AM
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 THE__DRIFTER View Post
I did everything stated in this post but it will not show on the frontpage. Suggestions?
Did you add it to the layout you use on the front page?
Reply With Quote
  #81  
Old 01-02-2010, 06:49 AM
gator777's Avatar
gator777 gator777 is offline
 
Join Date: Feb 2005
Posts: 205
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Lynne, the block displays empty when the user does not have access to the content. Can you make it so the block will not display if the user is not allowed to see the content?
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 08:28 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.05505 seconds
  • Memory Usage 2,412KB
  • 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
  • (5)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
  • (6)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