vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 4.x Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=245)
-   -   vBulletin CMS Widgets - Widget - Users Online (https://vborg.vbsupport.ru/showthread.php?t=230428)

Derekclarke 12-22-2009 01:02 AM

Thanks.. I so wanted this

*Click's Install*

When I Input the Code for Wigit, I receive an Internal Server Error. This is on VB4.0.0 Gold

XXXT0 12-22-2009 05:19 AM

Nice!! Thank You!

hendri 12-22-2009 10:08 AM

thanks bro !

wacodep 12-22-2009 11:50 AM

Nice. Should have been a standard widget.

Lynne 12-22-2009 02:31 PM

Quote:

Originally Posted by Derekclarke (Post 1935061)
Thanks.. I so wanted this

*Click's Install*

When I Input the Code for Wigit, I receive an Internal Server Error. This is on VB4.0.0 Gold

Double-check that you did everything correctly and only copy/pasted exactly what I have posted (no extra stuff got in).

iguano 12-22-2009 04:41 PM

Installed
Thanks :)

bullet07 12-22-2009 05:13 PM

Nice job installed.

Derekclarke 12-22-2009 08:17 PM

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.

Lynne 12-22-2009 08:45 PM

What do you mean all you get displayed is the time? There is no time in this widget. Also, ask discussed previously, you must have this turned on for your forums page or you will not see it in your cms. You must also add it to your layout, as I stated in the instructions.

teamshultz 12-23-2009 04:10 AM

1 Attachment(s)
Thanks so much for this great widget!

Is there a way to remove the comma after the last user? See attachment.

Attachment 107976

Lynne 12-23-2009 04:15 AM

Quote:

Originally Posted by teamshultz (Post 1936054)
Thanks so much for this great widget!

Is there a way to remove the comma after the last user? See attachment.

Attachment 107976

You must have changed some css on your page because it doesn't do that using the default css.

Derekclarke 12-23-2009 11:57 AM

The time is the Default code in the configure Box.

I am not sure why but it is Not Saving when i Click save. And it's not just this Mod. Found the same with another.

However if i clear the existing code and save it saves Blank.

So i am totally Confused

Forum Lover 12-23-2009 01:27 PM

Installed
Thanks

Lynne 12-23-2009 03:53 PM

Quote:

Originally Posted by Derekclarke (Post 1936287)
The time is the Default code in the configure Box.

I am not sure why but it is Not Saving when i Click save. And it's not just this Mod. Found the same with another.

However if i clear the existing code and save it saves Blank.

So i am totally Confused

I would go post on vb.com for help. It sounds like an issue with your widgets. Perhaps you didn't upload all the files correctly? You can look in your error_logs (if you don't know where they are, ask your host) and see if anything shows up there.

Gleedo 12-23-2009 03:58 PM

Very nice little widget - thanks very much :)

JamesGunner 12-24-2009 08:15 AM

Im having abit trouble with this widget. I already re-did everything but it wont show on my front page. It shows fine on every other layout and page other than the front page. So if I add it to the News Layout it displays it but as soon as I add it to the main page layout it doesnt display on the main page.

I also checked the permissions like you messed on page 3. I have that enabled as well.

//edit:

The new CMS seems to be very tricky. I didnt notice that the front page was running on the vb4 default theme. Im using a custom theme that is set too default so I assumed that the CMS is automatically set to the default theme. I edited the Section to my custom theme and now its showing up.

kendo 12-25-2009 02:17 AM

Is it possible to show the number of search spiders on as well as the number of guests and users? I'm sure I've seen this on a board somewhere, should have saved the link.

Lynne 12-25-2009 03:10 AM

That is a modification. I'm not sure if the developer updated it for vB4. You may take the code and apply it to this mod, but I cannot go take the code to put it in this mod since it isn't code I wrote.

kendo 12-25-2009 04:16 AM

OK, thanks!

Sophocles 12-25-2009 09:52 AM

Thanks! Plugin worked perfectly and even those of us who are code/PhP challenged could understand it. I just finished my forum update and I learned a lot from this single experience.

rbc 12-25-2009 10:42 AM

works very well , Thanks

and merry x-mas

4thstar 12-26-2009 09:43 AM

Hello everyone, i hope christmas went well.

I have a question please, is it possible to remove admin and mods from the active users list?

i.e. can we set it so unregistered members only see standard users?
and registered logged in members can see all but not the admin?

Kind Regards
Carl

Weetabix 12-26-2009 10:47 AM

Damn, that's excellent. Clear instructions too :)

Thankyou.

ChronosX 12-26-2009 11:23 AM

thx - nice work and intruction

ngcoders 12-26-2009 05:58 PM

Works greats , thanks a lot.

Lynne 12-26-2009 06:16 PM

Quote:

Originally Posted by 4thstar (Post 1938499)
Hello everyone, i hope christmas went well.

I have a question please, is it possible to remove admin and mods from the active users list?

i.e. can we set it so unregistered members only see standard users?
and registered logged in members can see all but not the admin?

Kind Regards
Carl

There is no option in this basic widget to do that - you'd have to modify the query to not show admins or mods. I don't know what you mean by only have unregistered users see 'standard' members - I have no idea what standard members are.

TheSupportForum 12-26-2009 08:10 PM

fantastic mod - please can you request this to be implented into the next version of vBulletin Please

tazattitude 12-26-2009 09:00 PM

Very Cool Lynne!
Thanks!
Voted and marked installed

Doctor Death 12-27-2009 12:51 AM

I followed instructions (several times) exactly.... Am having an issue I hope you can identify.

When I get to step of configuring widget and pasting all that code in there... the widget will always contain "$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";
"

Even after I paste the correct code in and save it, if I go back it revers to the above almost as if it is read only. The widget (and any others that I create) only output the date!!! (Because they dont retain their code).

Any ideas why the widgets wouldnt retain the configuration that are assigned?

Thanks much

Lynne 12-27-2009 02:04 AM

Quote:

Originally Posted by Doctor Death (Post 1939053)
I followed instructions (several times) exactly.... Am having an issue I hope you can identify.

When I get to step of configuring widget and pasting all that code in there... the widget will always contain "$output = date(vB::$vbulletin->options['dateformat']) . "<br />\n";
"

Even after I paste the correct code in and save it, if I go back it revers to the above almost as if it is read only. The widget (and any others that I create) only output the date!!! (Because they dont retain their code).

Any ideas why the widgets wouldnt retain the configuration that are assigned?

Thanks much

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.

bennzy 12-27-2009 05:00 AM

1 Attachment(s)
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'

Doctor Death 12-27-2009 01:54 PM

Quote:

Originally Posted by Lynne (Post 1939090)
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.

Lynne 12-27-2009 02:25 PM

Quote:

Originally Posted by bennzy (Post 1939163)
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 (Post 1939415)
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.

UrGonnaDie 12-28-2009 12:31 PM

great job works perfect.

steve1966 12-28-2009 03:45 PM

thanks

Hasanudin 12-31-2009 09:27 AM

running well..... thx u :)

Doctor Death 01-01-2010 04:51 PM

Quote:

Originally Posted by Derekclarke (Post 1935753)
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.

THE__DRIFTER 01-02-2010 02:04 AM

I did everything stated in this post but it will not show on the frontpage. Suggestions?
:confused:

Lynne 01-02-2010 03:10 AM

Quote:

Originally Posted by THE__DRIFTER (Post 1944571)
I did everything stated in this post but it will not show on the frontpage. Suggestions?
:confused:

Did you add it to the layout you use on the front page?

gator777 01-02-2010 06:49 AM

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?


All times are GMT. The time now is 06:40 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.01852 seconds
  • Memory Usage 1,964KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (4)bbcode_php_printable
  • (12)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (3)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (40)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.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/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.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
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete