I have used usercounter extension from http://www.yiiframework.com/extension/usercounter
I have create widget Counter.php in protected/component like this
<?php
Yii::import('application.extensions.UserCounter');
class Counter extends CWidget
{
public function init()
{
parent::init();
}
public function run()
{
parent::run();
Yii::app()->counter->refresh();
'<br>';
echo 'online :'.Yii::app()->counter->getOnline().'<br/>';
echo 'today :'.Yii::app()->counter->getToday().'<br/>';
//echo 'yesterday :'.Yii::app()->counter->getYesterday().'<br/>';
//echo 'total :'.Yii::app()->counter->getTotal().'<br/>';
}
}
?>
and i called this extension in my index page
<?php $this->widget('Counter'); ?>
Yesterday this extension was working well
But, the day when i try to access my site, i have error
Bellow is error message
<h1>PHP Error [8]</h1>
<p>Undefined index: [color="#FF00FF"]max_time[/color] (/opt/lampp/htdocs/akademi/protected/extensions/UserCounter.php:205)</p>
<pre>#0 /opt/lampp/htdocs/akademi/protected/extensions/UserCounter.php(205): CWebApplication->handleError()
#1 /opt/lampp/htdocs/akademi/protected/components/Counter.php(13): UserCounter->refresh()
#2 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CBaseController.php(174): Counter->run()
#3 /opt/lampp/htdocs/akademi/themes/defaultTheme/views/site/index.php(64): SiteController->widget()
#4 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CBaseController.php(127): require()
#5 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CBaseController.php(96): SiteController->renderInternal()
#6 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CController.php(870): SiteController->renderFile()
#7 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CController.php(783): SiteController->renderPartial()
#8 /opt/lampp/htdocs/akademi/protected/controllers/SiteController.php(138): SiteController->render()
#9 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/actions/CInlineAction.php(50): SiteController->actionIndex()
#10 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CController.php(309): CInlineAction->runWithParams()
#11 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CController.php(287): SiteController->runAction()
#12 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CController.php(266): SiteController->runActionWithFilters()
#13 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CWebApplication.php(276): SiteController->run()
#14 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/web/CWebApplication.php(135): CWebApplication->runController()
#15 /opt/lampp/htdocs/yii-1.1.10.r3566/framework/base/CApplication.php(162): CWebApplication->processRequest()
#16 /opt/lampp/htdocs/akademi/index.php(13): CWebApplication->run()
</pre>