public static function getAChars($acc) { $chars = Character::model()->findAll(array('select' => 'Name', 'condition' => 'AccountID=:memb___id', 'params' => array(':memb___id' => $acc))); foreach ($chars as $key => $char) { if ($key + 1 != sizeof($chars)) { echo CHtml::link($char->Name, array('char', 'id' => $char->Name), array('class' => 'char-link', 'title' => $char->Name)) . ', '; } else { echo CHtml::link($char->Name, array('char', 'id' => $char->Name), array('class' => 'char-link', 'title' => $char->Name)); } } }
public function getMagicList($name) { if ($this->getFConfig('db_driver') == 'sqlsrv') { $query = "DECLARE @list varbinary(max);SET @list = (SELECT MagicList FROM Character WHERE Name='{$name}');Select @list"; $getL = Yii::app()->db->createCommand($query)->queryScalar(); $getList = $getL; } else { $getL = Character::model()->find(array('select' => 'MagicList', 'condition' => 'Name=:Name', 'params' => array(':Name' => $name))); $getList = strtoupper(bin2hex($getL->MagicList)); } $i = -1; while ($i < 60) { $i++; $skill = substr($getList, $i * 6, 6); if (substr($skill, 0, 2) == 'FF' || substr($skill, 0, 2) >= '43' && substr($skill, 0, 2) <= '48') { } else { if (strlen($skill) != '6' || !preg_match("/[A-Za-z0-9]/", $skill) || $skill == 'FF0000') { } else { $id[] = hexdec(substr($skill, 0, 2)); } } } return $id; }
public function loadModel($name) { $this->_model = Character::model()->with('honor', 'stats')->find('name = ?', array($name)); if ($this->_model === null) { throw new CHttpException(404, 'The requested page does not exist.'); } // Hide GM characters $account = Account::model()->find('id = ?', array($this->_model->account)); if ($account !== null && !$account->isPlayer()) { throw new CHttpException(404, 'The requested page does not exist.'); } return $this->_model; }
public function getFinderCharacters($acc) { $characters = Character::model()->getFinderAccCharacters($acc); $this->renderPartial('block/finder/characters', array('model' => $characters)); }
protected function getSCharInfo() { return Character::model()->find(array('select' => 'cLevel,' . $this->getFConfig('reset_col') . ',' . $this->getFConfig('greset_col') . ',Class,Money,LevelUpPoint,Strength,Dexterity,Energy,Leadership', 'condition' => 'AccountID=:AccountID AND Name=:Name', 'params' => array(':AccountID' => Yii::app()->user->username, ':Name' => Yii::app()->user->char))); }
</span> <span class="value <?php echo Character::model()->getIntToTxt(Character::model()->getOInfo($model->AccountID, $model->Name)); ?> "><?php echo ucfirst(Character::model()->getIntToTxt(Character::model()->getOInfo($model->AccountID, $model->Name))); ?> </span> </li> <li class="tip"> <span class="label"><?php echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Guild'); ?> </span> <span class="value"><?php echo Character::model()->getCGuild($model->Name); ?> </span> </li> <li class="tip"> <span class="label"><?php echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Level'); ?> </span> <span class="value"><?php echo $model->cLevel; ?> </span> </li> <li class="tip"> <span class="label"><?php
<div class="i-line char-class"> <?php echo Character::model()->getCClass($model->Class, 0); ?> </div> <div class="i-line char-online"> <span class="<?php echo Character::model()->getIntToTxt(Character::model()->getOInfo(Yii::app()->user->username, $model->Name)); ?> "> <?php echo ucfirst(Character::model()->getIntToTxt(Character::model()->getOInfo(Yii::app()->user->username, $model->Name))); ?> </span> </div> <div class="i-line char-greset"> <span><?php echo Yii::t('' . Yii::app()->request->cookies['language']->value . '', 'Grand reset'); ?> :</span> <span class="r-entity"><?php $greset = $this->getFConfig('greset_col'); echo $model->{$greset}; ?> </span> <div class="clear"></div> </div> <div class="i-line char-reset">