本文整理汇总了PHP中Func::GETPOST方法的典型用法代码示例。如果您正苦于以下问题:PHP Func::GETPOST方法的具体用法?PHP Func::GETPOST怎么用?PHP Func::GETPOST使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Func
的用法示例。
在下文中一共展示了Func::GETPOST方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: init
function init()
{
$errno = strip_tags(Func::GETPOST('errno'));
if ($errno) {
$this->set($errno);
$this->sm->assign('errno', $errno);
}
}
示例2: prepareOrder
function prepareOrder(&$orderBy, &$orderDirection, $defaultOrder = '', $allowedOrders = array(), $orderParamName = 'order')
{
$order = Func::GETPOST($orderParamName);
if (empty($order)) {
$order = $defaultOrder;
}
if (!empty($order)) {
@(list($orderBy, $orderDirection) = explode(',', $order));
if (!isset($orderDirection)) {
$orderDirection = 'asc';
}
if (!empty($allowedOrders) && !isset($allowedOrders[$orderBy])) {
@(list($orderBy, $orderDirection) = explode(',', $defaultOrder));
}
$orderDirectionNeeded = $orderDirection == 'asc' ? 'desc' : 'asc';
$this->tplAssign(array('order_by' => $orderBy, 'order_dir' => $orderDirection, 'order_dir_needed' => $orderDirectionNeeded));
return true;
}
return false;
}
示例3: user_ajax
function user_ajax()
{
if (!($nRecordID = $this->input->id('rec', 'gp'))) {
$this->ajaxResponse(Errors::IMPOSSIBLE);
}
if (func::isAjaxRequest(null)) {
switch (Func::GETPOST('action')) {
case 'avatar-delete':
if (!$this->haveAccessTo('users-edit')) {
$this->ajaxResponse(Errors::ACCESSDENIED);
}
$avatar = new CAvatar(TABLE_USERS, USERS_AVATAR_PATH, 'avatar', 'user_id');
$avatar->delete($nRecordID, true);
$this->ajaxResponse(Errors::SUCCESSFULL);
break;
case 'user-info':
$aData = $this->db->one_array('SELECT U.*, C.title as city, R.region_id, R.title as region
FROM ' . TABLE_USERS . ' U
LEFT JOIN ' . TABLE_CITY . ' C ON U.city_id=C.city_id
LEFT JOIN ' . TABLE_REGION . ' R ON C.region_id=R.region_id
WHERE U.user_id=' . $nRecordID . ' LIMIT 1');
$aData['tuid'] = $this->makeTUID($nRecordID);
$aData['sendmsg'] = 0;
//($this->security->isAdmin() || $aData['im_noreply'] == 0);
$this->tplAssignByRef('aData', $aData);
$this->adminCustomCenterArea();
$this->tplDisplay('admin.user.info.tpl');
exit;
break;
case 'user-block':
if (!$this->haveAccessTo('users-edit') || $this->security->isCurrentUser($nRecordID)) {
$this->ajaxResponse(Errors::ACCESSDENIED);
}
$sReason = mb_strcut(Func::POSTGET('blocked_reason', true), 0, 300);
$nBlocked = Func::POSTGET('blocked') ? 1 : 0;
$this->db->execute('UPDATE ' . TABLE_USERS . '
SET blocked_reason = ' . $this->db->str2sql($sReason) . ',
blocked = ' . $nBlocked . '
WHERE user_id = ' . $nRecordID);
$this->ajaxResponse(Errors::SUCCESSFULL);
break;
}
}
$this->ajaxResponse(Errors::IMPOSSIBLE);
}
示例4: showBanner
function showBanner()
{
if (!$this->haveAccessTo('listing')) {
return $this->showAccessDenied();
}
$nRecordID = Func::GETPOST('rec', false, true);
if ($nRecordID <= 0) {
$this->ajaxResponse('');
}
$aData = $this->db->one_array('SELECT * FROM ' . TABLE_BANNERS . ' WHERE id = ' . $nRecordID);
$aData['img_thumb'] = BANNERS_URL . '/' . $aData['id'] . '_work_' . $aData['banner'];
if (file_exists(BANNERS_PATH . $aData['id'] . '_work_' . $aData['banner'])) {
$aData['img_size'] = getimagesize(BANNERS_PATH . $aData['id'] . '_work_' . $aData['banner']);
$aData['img_size'] = $aData['img_size'][0];
} else {
$aData['img_size'] = 240;
}
$aData['flash'] = unserialize($aData['flash']);
$this->tplAssign('aData', $aData);
$this->ajaxResponse($this->tplFetch('admin.banner.show.tpl'));
}