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
  #322  
Old 03-21-2011, 11:56 PM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

un-installed

Trying to better optimize my community.

Anyone know how to delete a template? vbcms_widget_execphp_activeusers
Reply With Quote
  #323  
Old 03-22-2011, 12:04 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 OldSchoolDSL View Post
Anyone know how to delete a template? vbcms_widget_execphp_activeusers
Click revert in the style you created the template.
Reply With Quote
  #324  
Old 03-22-2011, 12:11 AM
OldSchoolDSL OldSchoolDSL is offline
 
Join Date: Oct 2010
Posts: 1,196
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Quote:
Originally Posted by Lynne View Post
Click revert in the style you created the template.
Thank you very much. I never knew that would also remove a template within a style.
Reply With Quote
  #325  
Old 03-23-2011, 02:16 PM
CLSSY56 CLSSY56 is offline
 
Join Date: May 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have this error, any ideas?

Parse error: syntax error, unexpected $end in /home/horizon/public_html/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 150
Reply With Quote
  #326  
Old 03-23-2011, 03:46 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 CLSSY56 View Post
I have this error, any ideas?

Parse error: syntax error, unexpected $end in /home/horizon/public_html/forums/packages/vbcms/widget/execphp.php(191) : eval()'d code on line 150
Unexpected $end means you haven't uploaded a file completely/correctly.
Reply With Quote
  #327  
Old 03-23-2011, 03:53 PM
CLSSY56 CLSSY56 is offline
 
Join Date: May 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I wonder what that could be... It was working before. I thought I would try my hand in adding a revolver map to show on that widget as well. When I did that it gave me the error, so I deleted that code. The error was still there so I copy and pasted your code back in there and the error is still there.
Reply With Quote
  #328  
Old 03-23-2011, 04:30 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Some code has unexpectantly ended. So, maybe you forgot a } somewhere.
Reply With Quote
  #329  
Old 03-23-2011, 05:07 PM
CLSSY56 CLSSY56 is offline
 
Join Date: May 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I have no clue... I know nothing about php.

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;
    
    
$hook_query_fields $hook_query_joins $hook_query_where '';
    (
$hook vBulletinHook::fetch_hook('forumhome_loggedinuser_query')) ? eval($hook) : false;

    
$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++;
    }

    
$skipgroups = array(3,4);
    foreach (
$userinfos AS $userid => $loggedin)
    {
        if (
in_array($loggedin['usergroupid'], $skipgroups))
        {
            
$numberguest++;
        }
        else
        {
            
$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);

            (
$hook vBulletinHook::fetch_hook('forumhome_loggedinuser')) ? eval($hook) : false;

            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;
     
    
vB::$vbulletin->datastore->fetch(array('maxloggedin'));
    if (
vB::$vbulletin->maxloggedin === NULL)
    {
        
vB::$vbulletin->maxloggedin = array();
    }
    if (
intval(vB::$vbulletin->maxloggedin['maxonline']) <= $totalonline)
    {
        
vB::$vbulletin->maxloggedin['maxonline'] = $totalonline;
        
vB::$vbulletin->maxloggedin['maxonlinedate'] = TIMENOW;
        
build_datastore('maxloggedin'serialize(vB::$vbulletin->maxloggedin), 1);
    }

    
$recordusers vb_number_format(vB::$vbulletin->maxloggedin['maxonline']);
    
$recorddate vbdate(vB::$vbulletin->options['dateformat'], vB::$vbulletin->maxloggedin['maxonlinedate'], true);
    
$recordtime vbdate(vB::$vbulletin->options['timeformat'], vB::$vbulletin->maxloggedin['maxonlinedate']);

    
$show['loggedinusers'] = true;
    
    
$statsarray = array('onlinestats' => $onlinestats,
    
'totalonline' => $totalonline,
    
'numberregistered' => $numberregistered,
    
'numberguest' => $numberguest,
    
'show'    => $show,
    
'recordusers'  => $recordusers,
    
'recorddate'  => $recorddate,
    
'recordtime'  => $recordtime,
    );
    
    
vB_Template::preRegister('vbcms_widget_execphp_activeusers'$statsarray); 
Reply With Quote
  #330  
Old 03-23-2011, 05:13 PM
Lynne's Avatar
Lynne Lynne is offline
 
Join Date: Sep 2004
Location: California/Idaho
Posts: 41,180
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

I don't need to see the php code as it is in the first post in this thread. I will tell you that you are missing a } in it though. You did not copy it correctly.
Reply With Quote
  #331  
Old 03-23-2011, 05:17 PM
CLSSY56 CLSSY56 is offline
 
Join Date: May 2009
Posts: 39
Благодарил(а): 0 раз(а)
Поблагодарили: 0 раз(а) в 0 сообщениях
Default

Yep your right, } was not at the very end. Thanks!
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 03:52 AM.


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.08227 seconds
  • Memory Usage 2,431KB
  • 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
  • (1)bbcode_php
  • (3)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
  • (2)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
  • (5)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