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)
-   -   Forum Home Enhancements - Site Life Status for vB 4 (https://vborg.vbsupport.ru/showthread.php?t=243731)

Boofo 03-30-2012 10:00 AM

Quote:

Originally Posted by olalaaa (Post 2314971)
Is there a way to make it only viewable for admins?

You would need to wrap the code in a conditional.

Hippy 03-30-2012 10:36 AM

Quote:

Originally Posted by olalaaa (Post 2314971)
Is there a way to make it only viewable for admins?

add
Code:

if ($vbulletin->userinfo['usergroupid'] == 6)
{
======================================
Life Status Count Number Format                             
                        forumhome_complete plugin here
between the brackets
======================================
}

If I remember correctly ife Status Count Number Format plugin

Code:

if ($vbulletin->userinfo['usergroupid'] == 6)
{
if ($vbulletin->options['site_lifestatus_enable'] AND THIS_SCRIPT == 'index')
{
        $pagehits_counter = $vbulletin->boofocounter;
        $starttime = (TIMENOW - strtotime($vbulletin->options['site_lifestatus_startupdate']));

        $starthour = $starttime / 3600;
        $pagehits_hourly = vb_number_format($pagehits_counter / $starthour, 2);

        $startday = $starttime / 86400;
        $pagehits_daily = vb_number_format($pagehits_counter / $startday, 2);

        $startweek = $starttime / 604800;
        $pagehits_weekly = vb_number_format($pagehits_counter / $startweek, 2);

        $startmonth = $starttime / 2628000;
        $pagehits_monthly = vb_number_format($pagehits_counter / $startmonth, 2);

        $startyear = $starttime / 31536000;
        $pagehits_yearly = vb_number_format($pagehits_counter / $startyear, 2);

        $pagehits_counter = vb_number_format($pagehits_counter);

        if ($vbulletin->options['site_lifestatus_setlocale'])
        {
                setlocale(LC_TIME, $vbulletin->options['site_lifestatus_setlocale']);
        }
        else
        {
                setlocale(LC_TIME, 'en_US.utf8');
        }

        if ($vbulletin->options['site_lifestatus_datedisplay'])
        {
                $startdate = strftime($vbulletin->options['site_lifestatus_datedisplay'], strtotime($vbulletin->options['site_lifestatus_startupdate']));
        }
        else
        {
                $startdate = strftime('%A, %B %e, %Y at %l:%M %P', strtotime($vbulletin->options['site_lifestatus_startupdate']));
        }

        setlocale(LC_TIME, '');

        $boofo_status = vB_Template::create('boofo_site_lifestatus');
            $boofo_status->register('pagehits_counter', $pagehits_counter);
            $boofo_status->register('pagehits_hourly', $pagehits_hourly);
            $boofo_status->register('pagehits_daily', $pagehits_daily);
            $boofo_status->register('pagehits_weekly', $pagehits_weekly);
            $boofo_status->register('pagehits_monthly', $pagehits_monthly);
            $boofo_status->register('pagehits_yearly', $pagehits_yearly);
            $boofo_status->register('startdate', $startdate);
        $template_hook['forumhome_wgo_pos3'] .= $boofo_status->render();
}
}

*warning I have not had my morning coffee

cause I'm thinking maybe the template needs the condition...
anyway the condition is correct ,, just got to add it to the right code ,,

Boofo 03-30-2012 10:45 AM

Or:

Code:

if ($vbulletin->userinfo['usergroupid'] == 6)
{
        $boofo_status = vB_Template::create('boofo_site_lifestatus');
            $boofo_status->register('pagehits_counter', $pagehits_counter);
            $boofo_status->register('pagehits_hourly', $pagehits_hourly);
            $boofo_status->register('pagehits_daily', $pagehits_daily);
            $boofo_status->register('pagehits_weekly', $pagehits_weekly);
            $boofo_status->register('pagehits_monthly', $pagehits_monthly);
            $boofo_status->register('pagehits_yearly', $pagehits_yearly);
            $boofo_status->register('startdate', $startdate);
        $template_hook['forumhome_wgo_pos3'] .= $boofo_status->render();
}


I rewrote it and added a setting for what users/usergroups can view it for my site. Since it is a total rewrite, I won't be releasing it here.

EasyEazy 05-29-2012 07:53 PM

Installed and working great

Thanks for this mod

Lord Singo 05-30-2012 09:43 AM

Any chance of a widget to add to the CMS?

Boofo 05-30-2012 11:31 AM

Since I don't use the CMS, there are 2 chances for this to happen: slim and none. ;)

Pure Dope 07-28-2012 10:42 PM

its saying the site is only 2 years old. its MUCH older than that.

Alibass 07-28-2012 11:11 PM

Are you using single digits in your date like April 1, 1930 if you are change it to April 01, 1930

Pure Dope 07-29-2012 12:15 AM

i dont think i set a date anywhere.

Alibass 07-29-2012 12:28 AM

Mate you need to go into your admincp/options/site life status and setup your site status if you expect it to work... :rolleyes:


All times are GMT. The time now is 01:09 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.01325 seconds
  • Memory Usage 1,745KB
  • 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
  • (3)bbcode_code_printable
  • (2)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