当前位置: 首页>>代码示例>>PHP>>正文


PHP Prefs::steam_convert方法代码示例

本文整理汇总了PHP中Prefs::steam_convert方法的典型用法代码示例。如果您正苦于以下问题:PHP Prefs::steam_convert方法的具体用法?PHP Prefs::steam_convert怎么用?PHP Prefs::steam_convert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Prefs的用法示例。


在下文中一共展示了Prefs::steam_convert方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionView

 /**
  * Детали админа.
  */
 public function actionView($id = NULL)
 {
     if (!Yii::app()->request->isAjaxRequest && $id !== NULL) {
         // Проверка прав
         if (!Webadmins::checkAccess('amxadmins_edit')) {
             throw new CHttpException(403, "У Вас недостаточно прав");
         }
         $model = $this->loadmodel($id);
         $this->render('view', array('model' => $model));
         Yii::app()->end();
     }
     $model = Amxadmins::model()->with('servers')->findByPk($_POST['aid']);
     if ($model === null) {
         Yii::app()->end("alert('Ошибка!')");
     }
     $steam = '';
     // Если стимайди админа проходит проверку на валидность, получаем инфу об админе с вальве
     if (Prefs::validate_value($model->steamid)) {
         if ($url = @file_get_contents(Prefs::steam_convert($model->steamid, false, true))) {
             $xmlres = simplexml_load_string($url);
             $steam = CHtml::image($xmlres->avatarIcon) . " " . CHtml::link($xmlres->steamID, "http://steamcommunity.com/profiles/" . $xmlres->steamID64, array("target" => "_blank", "rel" => "tooltip", "title" => "Просмотреть профиль"));
         }
     }
     $servers = '';
     // Если есть сервера у админа, выводим сервера
     if ($model->servers) {
         foreach ($model->servers as $server) {
             if (!$server->hostname) {
                 continue;
             }
             $servers .= CHtml::link($server->hostname, Yii::app()->createUrl('/serverinfo/view', array('id' => intval($server->id))), array('target' => '_blank')) . "<br>";
         }
     }
     // Формируем таблицу с инфой об админе
     $info = "<table class=\"table table-bordered\">";
     $info .= "<tr>";
     $info .= "<td><b>Ник</b></td>";
     $info .= "<td>" . CHtml::encode($model->nickname) . "</td>";
     $info .= "</tr><tr>";
     $info .= "<td><b>Контакты</b></td>";
     $info .= "<td>" . ($model->icq ? CHtml::image("//icq-rus.com/icq/3/" . $model->icq . ".gif") . " " . $model->icq : 'Не задан') . "</td>";
     $info .= "</tr><tr>";
     $info .= "<td><b>Доступ</b></td>";
     $info .= "<td>" . $model->access . "</td>";
     $info .= "</tr><tr>";
     $info .= "<td><b>Добавлен</b></td>";
     $info .= "<td>" . date("d.m.Y - H:i:s", $model->created) . "</td>";
     $info .= "</tr><tr>";
     $info .= "<td><b>Истекает</b></td>";
     $info .= "<td>" . ($model->expired != 0 ? date("d.m.Y - H:i:s", $model->expired) : "Никогда") . "</td>";
     $info .= "</tr>";
     $info .= "</table>";
     $js = "\$('#adminInfo').html('" . $info . "');";
     $js .= "\$('#adminSteam').html('" . ($steam ? $steam : '<i>Информация отсутствует</i>') . "');";
     $js .= "\$('#adminServers').html('" . ($model->servers ? $servers : '<i>Информация отсутствует</i>') . "');";
     $js .= "\$('#loading').hide();";
     $js .= "\$('#adminDetail').modal('show');";
     // Выводим инфу
     Yii::app()->end($js);
 }
开发者ID:urichalex,项目名称:CS-Bans,代码行数:63,代码来源:AmxadminsController.php

示例2: actionBandetail

 /**
  * Вывод данных о бане в модальке
  */
 public function actionBandetail()
 {
     if (is_numeric($_POST['bid'])) {
         $model = Bans::model()->with('admin')->findByPk($_POST['bid']);
         if ($model === null) {
             Yii::app()->end('alert("Ошибка!")');
         }
         $js = "\$('#bandetail-nick').html('" . CHtml::encode($model->player_nick) . "');";
         $js .= "\$('#bandetail-steam').html('" . $model->player_id . "');";
         $js .= "\$('#bandetail-steamcommynity').html('" . Prefs::steam_convert($model->player_id, true) . "');";
         $js .= "\$('#bandetail-ip').html('" . (Webadmins::checkAccess('ip_view') ? $model->player_ip : 'Cкрыт') . "');";
         $js .= "\$('#bandetail-type').html('" . Prefs::getBanType($model->ban_type) . "');";
         $js .= "\$('#bandetail-reason').html('" . $model->ban_reason . "');";
         $js .= "\$('#bandetail-datetime').html('" . date('d.m.y - H:i:s', $model->ban_created) . "');";
         $js .= "\$('#bandetail-expired').html('" . ($model->ban_length == '-1' ? 'Разбанен' : Prefs::date2word($model->ban_length) . ($model->expired == 1 ? ' (истек)' : '')) . "');";
         $js .= "\$('#bandetail-admin').html('" . $model->adminName . "');";
         $js .= "\$('#bandetail-server').html('" . CHtml::encode($model->server_name) . "');";
         $js .= "\$('#bandetail-kicks').html('" . $model->ban_kicks . "');";
         $js .= "\$('#loading').hide();";
         $js .= "\$('#viewban').attr({'href': '" . Yii::app()->urlManager->createUrl('/bans/view', array('id' => $_POST['bid'])) . "'});";
         $js .= "\$('#BanDetail').modal('show');";
         echo $js;
     }
     Yii::app()->end();
 }
开发者ID:BroneKot,项目名称:CS-Bans,代码行数:28,代码来源:BansController.php

示例3: array

<div style="float: right">
	<?php 
if (Webadmins::checkAccess('bans_edit', $model->admin_nick)) {
    echo CHtml::link('<i class="icon-edit"></i>', $this->createUrl('/bans/update', array('id' => $model->bhid)), array('rel' => 'tooltip', 'title' => 'Редактировать'));
}
?>
	&nbsp;
	<?php 
if (Webadmins::checkAccess('bans_delete', $model->admin_nick)) {
    echo CHtml::ajaxLink('<i class="icon-trash"></i>', $this->createUrl('/bans/delete', array('id' => $model->bhid, 'ajax' => 1)), array('type' => 'post', 'beforeSend' => 'function() {if(!confirm("Удалить бан?")) {return false;} }', 'success' => 'function() {alert("Бан удален"); document.location.href="' . $this->createUrl('/bans/index') . '"}'), array('rel' => 'tooltip', 'title' => 'Удалить бан'));
}
?>
</div>

<?php 
$this->widget('bootstrap.widgets.TbDetailView', array('data' => $model, 'type' => array('condensed', 'bordered'), 'htmlOptions' => array('style' => 'text-align: left'), 'attributes' => array('player_nick', array('name' => 'player_id', 'type' => 'raw', 'value' => Prefs::steam_convert($model->player_id, TRUE) ? CHtml::link($model->player_id, 'http://steamcommunity.com/profiles/' . Prefs::steam_convert($model->player_id), array('target' => '_blank')) : $model->player_id), array('name' => 'player_ip', 'type' => 'raw', 'value' => $geo['city'] ? CHtml::link($model->player_ip, '#', array('onclick' => '$("#modal-map").modal("show");', 'rel' => 'tooltip', 'title' => 'Подробности IP адреса')) : $model->player_ip, 'visible' => $ipaccess), array('name' => 'ban_created', 'value' => date('d.m.Y - H:i:s', $model->ban_created)), array('name' => 'ban_length', 'type' => 'raw', 'value' => $length), 'map_name', 'ban_reason', 'admin_nick', 'server_name')));
?>

<hr>
<p class="text-success">
	<i class="icon-calendar"></i>
	История банов
</p>
<?php 
$this->widget('bootstrap.widgets.TbGridView', array('type' => 'bordered stripped', 'id' => 'ban-history-grid', 'dataProvider' => $history, 'enableSorting' => FALSE, 'template' => '{items} {pager}', 'columns' => array(array('name' => 'ban_created', 'value' => 'date("d.m.Y", $data->ban_created)'), array('name' => 'player_nick', 'type' => 'html', 'value' => 'Chtml::link($data->player_nick, Yii::app()->createUrl("/history/view", array("id" => $data->bhid)))'), 'ban_reason', array('name' => 'ban_length', 'type' => 'raw', 'value' => 'Prefs::date2word($data->ban_length)'), array('name' => 'unban_admin_nick', 'value' => '$data->unban_admin_nick == "amxbans" ? "Срок бана истек" : $data->unban_admin_nick'))));
?>

<?php 
if ($ipaccess) {
    $this->beginWidget('bootstrap.widgets.TbModal', array('id' => 'modal-map'));
    ?>
开发者ID:DmitriyS,项目名称:CS-Bans,代码行数:31,代码来源:view.php


注:本文中的Prefs::steam_convert方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。