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)

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 05:50 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.01594 seconds
  • Memory Usage 1,812KB
  • 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
  • (2)bbcode_php_printable
  • (7)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)pagenav_pagelinkrel
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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