public function actionOnline() { $i = 0; $onlineArray = MEMBSTAT::model()->findAll(array('select' => 'memb___id', 'condition' => 'ConnectStat=:ConnectStat', 'params' => array(':ConnectStat' => '1'))); $model = new Character(); $this->pageTitle = Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Total online') . ' / ' . $this->getFConfig('serverName'); $this->breadcrumbs = array(Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Total online')); $this->pageH1 = Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Total online'); Yii::app()->clientScript->registerMetaTag($this->getFConfig('metaDescDown'), 'description'); Yii::app()->clientScript->registerMetaTag($this->getFConfig('metaKeyDown'), 'keywords'); $this->render('online', array('onlineArray' => $onlineArray, 'i' => $i, 'model' => $model)); }
<div class="nextUpdate"> <?php if ($this->beginCache('servBackend', array('varyByExpression' => Yii::app()->request->cookies['language']->value, 'duration' => $this->getFConfig('serverCache') - 120, 'varyByRoute' => false))) { ?> <ul> <li><?php echo $this->getFConfig('serverName'); ?> </li> <li><?php echo MEMBSTAT::getOnline() + $this->getFConfig('serverFOnline'); ?> </li> </ul> <div class="pWrapper"><div class="progress<?php echo StaticController::getSOnline(); ?> " style="width: 100%;"></div></div> <?php $this->endCache(); } ?> </div>
public function getOInfo($acc, $char) { $online = MEMBSTAT::model()->find(array('select' => 'ConnectStat', 'condition' => 'memb___id=:memb___id', 'params' => array(':memb___id' => $acc))); $model = AccountCharacter::model()->find(array('select' => 'GameIDC', 'condition' => 'Id=:Id', 'params' => array(':Id' => $acc))); if ($model->GameIDC == $char && $online->ConnectStat == 1) { return 1; } else { if ($model->GameIDC == $char && $online->ConnectStat == 0) { return 0; } else { return 0; } } }
private function checkOnline() { $model = MEMBSTAT::model()->find(array('select' => 'ConnectStat', 'condition' => 'memb___id=:memb___id', 'params' => array(':memb___id' => Yii::app()->user->username))); return $model->ConnectStat; }