本文整理汇总了PHP中WebUtils::u方法的典型用法代码示例。如果您正苦于以下问题:PHP WebUtils::u方法的具体用法?PHP WebUtils::u怎么用?PHP WebUtils::u使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WebUtils
的用法示例。
在下文中一共展示了WebUtils::u方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionLogin
public function actionLogin()
{
if (UserUtils::isInAppbymeAdminGroup()) {
$this->redirect(Yii::app()->createAbsoluteUrl('admin/index'));
}
if (!empty($_POST)) {
$username = isset($_POST['username']) ? $_POST['username'] : '';
$password = isset($_POST['password']) ? $_POST['password'] : '';
$result = UserUtils::login($username, $password);
$errorMsg = '';
if ($result['errcode']) {
$errorMsg = WebUtils::u($result['message']);
} else {
if (UserUtils::isInAppbymeAdminGroup()) {
$this->redirect(Yii::app()->createAbsoluteUrl('admin/index'));
} else {
$errorMsg = '用户不是管理员,也不在允许登录的范围内!';
}
}
}
$this->renderPartial('login', array('errorMsg' => $errorMsg, 'username' => $username));
}
示例2:
?>
/admin.php" target="_blank">Discuz!管理中心</a></li>
<li><a href="<?php
echo $this->dzRootUrl;
?>
/plugin.php?id=appbyme_app:download" target="_blank">应用下载</a></li>
<li><a href="<?php
echo $this->dzRootUrl;
?>
/mobcent/requirements/index.php" target="_blank">配置需求</a></li>
<li><a href="http://bbs.appbyme.com/forum-57-2.html" target="_blank">帮助文档</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
<a href="." class="dropdown-toggle" data-toggle="dropdown"><?php
echo WebUtils::u($_G['username']);
?>
<span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="<?php
echo Yii::app()->createAbsoluteUrl('admin/index/logout');
?>
">退出</a></li>
</ul>
</li>
</ul>
</div>
</div>
</nav>
</body>
示例3: _adminTopic
private function _adminTopic($fid, $tid, $pid, $act, $type)
{
global $_G;
$errorMsg = '';
$_GET['topiclist'] = array($_GET['pid']);
// 在DISCUZ_ROOT/source/module/forum/forum_topicadmin.php基础上进行二次开发
$_GET['topiclist'] = !empty($_GET['topiclist']) ? is_array($_GET['topiclist']) ? array_unique($_GET['topiclist']) : $_GET['topiclist'] : array();
loadcache(array('modreasons', 'stamptypeid', 'threadtableids'));
require_once libfile('function/post');
require_once libfile('function/misc');
$modpostsnum = 0;
$resultarray = $thread = array();
if ($_G['group']['reasonpm'] == 2 || $_G['group']['reasonpm'] == 3 || !empty($_GET['sendreasonpm'])) {
$forumname = strip_tags($_G['forum']['name']);
$sendreasonpm = 1;
} else {
$sendreasonpm = 0;
}
if ($type == 'topic') {
if ($act == 'band') {
$resultarray = $this->_topicAdmin_band($fid, $tid, $pid, $act, $type, array('sendreasonpm' => $sendreasonpm, 'thread' => $_G['forum_thread']));
} else {
// 在DISCUZ_ROOT/source/include/topicadmin/topicadmin_moderate.php基础上进行二次开发
$thread = $_G['forum_thread'];
$thread['dblastpost'] = $thread['lastpost'];
$threadlist[$thread['tid']] = $thread;
$modpostsnum = count($threadlist);
$stickcheck = $closecheck = $digestcheck = array('', '', '', '', '');
empty($threadlist[$_G['tid']]['displayorder']) ? $stickcheck[0] = 'selected="selected"' : ($stickcheck[$threadlist[$_G['tid']]['displayorder']] = 'selected="selected"');
empty($threadlist[$_G['tid']]['digest']) ? $digestcheck[0] = 'selected="selected"' : ($digestcheck[$threadlist[$_G['tid']]['digest']] = 'selected="selected"');
empty($threadlist[$_G['tid']]['closed']) ? $closecheck[0] = 'checked="checked"' : ($closecheck[1] = 'checked="checked"');
if (!empty($_POST)) {
$tidsarr = array_keys($threadlist);
$moderatetids = dimplode($tidsarr);
$reason = checkreasonpm();
$stampstatus = 0;
$stampaction = 'SPA';
$operationMap = array('top' => 'stick', 'marrow' => 'digest', 'delete' => 'delete');
$operation = $operationMap[$act];
$updatemodlog = TRUE;
switch ($act) {
case 'top':
$sticklevel = intval($_GET['sticklevel']);
if ($sticklevel < 0 || $sticklevel > 3 || $sticklevel > $_G['group']['allowstickthread']) {
// showmessage('no_privilege_stickthread');
$this->_exitWithHtmlAlert('no_privilege_stickthread');
}
$expiration = checkexpiration($_GET['expirationstick'], $operation);
$expirationstick = $sticklevel ? $_GET['expirationstick'] : 0;
$forumstickthreads = $_G['setting']['forumstickthreads'];
$forumstickthreads = isset($forumstickthreads) ? dunserialize($forumstickthreads) : array();
C::t('forum_thread')->update($tidsarr, array('displayorder' => $sticklevel, 'moderated' => 1), true);
$delkeys = array_keys($threadlist);
foreach ($delkeys as $k) {
unset($forumstickthreads[$k]);
}
C::t('common_setting')->update('forumstickthreads', $forumstickthreads);
$stickmodify = 0;
foreach ($threadlist as $thread) {
$stickmodify = (in_array($thread['displayorder'], array(2, 3)) || in_array($sticklevel, array(2, 3))) && $sticklevel != $thread['displayorder'] ? 1 : $stickmodify;
}
if ($_G['setting']['globalstick'] && $stickmodify) {
require_once libfile('function/cache');
updatecache('globalstick');
}
$modaction = $sticklevel ? $expiration ? 'EST' : 'STK' : 'UST';
C::t('forum_threadmod')->update_by_tid_action($tidsarr, array('STK', 'UST', 'EST', 'UES'), array('status' => 0));
if (!$sticklevel) {
$stampaction = 'SPD';
}
$stampstatus = 1;
break;
case 'marrow':
$digestlevel = intval($_GET['digestlevel']);
if ($digestlevel < 0 || $digestlevel > 3 || $digestlevel > $_G['group']['allowdigestthread']) {
// showmessage('no_privilege_digestthread');
$this->_exitWithHtmlAlert('no_privilege_digestthread');
}
$expiration = checkexpiration($_GET['expirationdigest'], $operation);
$expirationdigest = $digestlevel ? $expirationdigest : 0;
C::t('forum_thread')->update($tidsarr, array('digest' => $digestlevel, 'moderated' => 1), true);
foreach ($threadlist as $thread) {
if ($thread['digest'] != $digestlevel) {
if ($digestlevel == $thread['digest']) {
continue;
}
$extsql = array();
if ($digestlevel > 0 && $thread['digest'] == 0) {
$extsql = array('digestposts' => 1);
}
if ($digestlevel == 0 && $thread['digest'] > 0) {
$extsql = array('digestposts' => -1);
}
if ($digestlevel == 0) {
$stampaction = 'SPD';
}
updatecreditbyaction('digest', $thread['authorid'], $extsql, '', $digestlevel - $thread['digest']);
}
}
$modaction = $digestlevel ? $expiration ? 'EDI' : 'DIG' : 'UDG';
//.........这里部分代码省略.........
示例4: foreach
<div id="component-view-fastpost-<%= id %>" class="component-view-item <%= type == COMPONENT_TYPE_FASTTEXT || type == COMPONENT_TYPE_FASTIMAGE || type == COMPONENT_TYPE_FASTCAMERA || type == COMPONENT_TYPE_FASTAUDIO ? '' : 'hidden' %>">
<div class="form-group">
<label class="col-sm-2 control-label">发表板块: </label>
<div class="col-sm-10">
<select class="input-sm form-control" name="fastpostForumIds[]" multiple>
<?php
foreach ($forumList as $fid => $title) {
?>
<option value="<?php
echo $fid;
?>
" <%= extParams.fastpostForumIds.indexOf(<?php
echo $fid;
?>
) != -1 ? 'selected' : '' %>><?php
echo WebUtils::u($title);
?>
</option>
<?php
}
?>
</select>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<label class="checkbox-inline">
<input type="checkbox" name="isShowTopicTitle[]" <%= extParams.isShowTopicTitle ? 'checked' : '' %>> 勾选则需用户填写标题
</label>
<!--
<label class="checkbox-inline">
示例5: foreach
}
?>
</table>
</div>
<div id="rate_category">
<span>可选评分理由:</span>
<select id="reasonSelect">
<?php
foreach ($selectreason as $value) {
?>
<option value="<?php
echo WebUtils::u($value);
?>
"><?php
echo WebUtils::u($value);
?>
</option>
<?php
}
?>
<option value="0">自定义</option>
</select>
<p><textarea id="reason" name="reason" class="pt" rows="2"></textarea></p>
<p class="o pns">
<label for="sendreasonpm">
<input type="checkbox" name="sendreasonpm" id="sendreasonpm" class="pc" style="margin-right:5px;">通知作者
</label>
</p>
<p style="text-align:center">
<button type="submit" name="modsubmit" id="modsubmit" class="btu" value="确定" ><span>确定</span>
示例6: getModules
public static function getModules($isTemp = false)
{
$data = DbUtils::getDzDbUtils(true)->queryScalar('
SELECT cvalue
FROM %t
WHERE ckey = %s
', array('appbyme_config', $isTemp ? self::MODULE_KEY_TEMP : self::MODULE_KEY));
return $data ? (array) unserialize(WebUtils::u($data)) : array();
}
示例7: isset
echo $inviteInfo['exchange_type'] == 'virtual' ? selected : '';
?>
>论坛虚拟货币</option>
<option value="mobile" <?php
echo $inviteInfo['exchange_type'] == 'mobile' ? selected : '';
?>
>手机话费</option>
</select>
</div>
</div> -->
<div class="form-group ">
<label for="" class="col-sm-2 control-label">兑换虚拟货币名称:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="virtualName" autocomplete="off" value="<?php
echo isset($inviteInfo['virtual_name']) ? WebUtils::u($inviteInfo['virtual_name']) : '';
?>
">
<span id="helpBlock" class="help-block">
参与活动得到的奖励能兑换那种论坛虚拟币,比如金币、威望或者是其他自定义的货币名称
</span>
</div>
</div>
<div class="form-group">
<label for="" class="col-sm-2 control-label">兑换虚拟货币比例:</label>
<div class="col-sm-10">
<input type="text" class="form-control" name="exchangeRatio" autocomplete="off" value="<?php
echo isset($inviteInfo['exchange_ratio']) ? $inviteInfo['exchange_ratio'] : '';
?>
">
示例8:
?>
<option value="2" <?php
echo $stickcheck['2'];
?>
><?php
echo WebUtils::u($_G['setting']['threadsticky']['1']);
?>
</option>
<?php
if ($_G['group']['allowstickthread'] == 3) {
?>
<option value="3" <?php
echo $stickcheck['3'];
?>
><?php
echo WebUtils::u($_G['setting']['threadsticky']['0']);
?>
</option>
<?php
}
}
} else {
?>
<option value="0">否 </option>
<option value="1" <?php
echo $stickcheck['1'];
?>
>是 </option>
<?php
}
?>
示例9:
echo $key;
?>
">
<th colspan="2" align="left" id="th_<?php
echo $key;
?>
">
<?php
if ($value['required']) {
?>
<span class="rq" title="必填">*</span><?php
}
echo WebUtils::u($value['title']);
?>
<?php
echo WebUtils::u($htmls[$key]);
?>
</th>
</tr>
<?php
}
}
}
}
?>
</table>
</tr>
<tr>
<th>
<p style="text-align:center">
<input type="hidden" name="profilesubmit" value="true">
示例10: sprintf
$optionsHtml .= sprintf('<option value="%s" %s>%s</option>', WebUtils::u($element['value']), $selected, WebUtils::u($element['label']));
}
$html .= sprintf('
<div class="inp_aa">
<select name="%s" id="%s" class="ps" tabindex="1">
%s
</div>
', $option['name'], $option['name'], $optionsHtml);
}
break;
case 'textarea':
$html .= sprintf('
<div class="inp_aa">
<textarea name="%s" id="%s" class="pt" rows="3" cols="40" tabindex="1">%s</textarea>
</div>
', $option['name'], $option['name'], WebUtils::u($option['value']));
break;
default:
break;
}
$html .= sprintf('
</td>
</tr>
', $option['name']);
}
echo $html;
?>
<tr>
<td colspan="2" style="text-align:center">
<input type="submit" value="<?php
echo '提交';
示例11: _filterComponent
private function _filterComponent($component)
{
loadcache('forums');
global $_G;
$forums = $_G['cache']['forums'];
$tempComponent = $component;
// 转换fastpostForumIds结构
$tempFastpostForumIds = array();
foreach ($component['extParams']['fastpostForumIds'] as $fid) {
$tempFastpostForumIds[] = array('fid' => $fid, 'title' => WebUtils::u($forums[$fid]['name']));
}
$tempComponent['extParams']['fastpostForumIds'] = $tempFastpostForumIds;
// 转换componentList结构
$tempComponentList = array();
foreach ($component['componentList'] as $subComponent) {
if (!$subComponent['extParams']['isHidden']) {
$tempComponentList[] = $this->_filterComponent($subComponent);
}
}
$tempComponent['componentList'] = $tempComponentList;
return $tempComponent;
}
示例12: foreach
<?php
foreach ($searchList as $list) {
?>
<tr class="<?php
echo $list['exchange_status'] ? success : warning;
?>
row-<?php
echo $list['uid'];
?>
">
<td><?php
echo $num++;
?>
</td>
<td><?php
echo WebUtils::u($list['username']);
?>
</td>
<td><?php
echo $list['invite_count'];
?>
</td>
<td class="reward-sum-<?php
echo $list['uid'];
?>
"><?php
echo $list['reward_sum'];
?>
</td>
<td class="available-<?php
echo $list['uid'];