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


PHP func::POSTGET方法代码示例

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


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

示例1: sessionStart

 function sessionStart($key, $restart = false)
 {
     $name = $this->sessionNameByKey($key);
     if ($restart) {
         if ($sess_id = func::POSTGET('sessid')) {
             session_id($sess_id);
             session_start();
         } else {
             if (isset($_COOKIE[$name])) {
                 session_name($name);
                 session_start();
             }
         }
     } else {
         //стартуем сессию если еще не стартовали
         $cur_session_id = session_id();
         if (empty($cur_session_id)) {
             if ($sess_id = func::POSTGET('sessid')) {
                 session_id($sess_id);
             } else {
                 session_name($name);
             }
             session_start();
         }
     }
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:26,代码来源:security.php

示例2: show

 function show($nPageID = null)
 {
     $nRecordID = !isset($nPageID) ? func::POSTGET('page') : (int) $nPageID;
     $aData = $this->db->one_array('SELECT title, mkeywords, mdescription, filename 
                               FROM ' . TABLE_PAGES . ' 
                               WHERE filename = ' . $this->db->str2sql($nRecordID) . ' 
                               LIMIT 1');
     if (empty($aData)) {
         Errors::httpError(404);
     }
     //get page content
     $aData['content'] = CDir::getFileContent(PAGES_PATH . $aData['filename'] . PAGES_EXTENSION);
     config::set(array('title' => $aData['title'] . ' | ' . config::get('title', ''), 'mkeywords' => $aData['mkeywords'], 'mdescription' => $aData['mdescription']));
     if ($aData['content'] === false) {
         Errors::httpError(404);
     }
     $aData['menu'] = bff::i()->Sitemap_getmenu('info', 'all-sub');
     // echo '<pre>', print_r($aData['menu'], true), '</pre>'; exit;
     $this->tplAssign('aData', $aData);
     return $this->tplFetch('page.tpl');
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:21,代码来源:pages.class.php

示例3: ajax

 function ajax()
 {
     if (!$this->haveAccessTo('read')) {
         $this->ajaxResponse(Errors::ACCESSDENIED);
     }
     if (bff::$isAjax) {
         $nUserID = $this->security->getUserID();
         switch (func::POSTGET('action')) {
             case 'recipients':
                 $sQ = func::POST('q', true);
                 //получаем список подходящих по логину собеседников, исключая
                 //- текущего пользователя
                 //- администраторов, запретивших им писать (im_noreply=1)
                 //- заблокированных пользователей
                 //- добавивших текущего пользователя в ignore-папку
                 $aResult = $this->db->select('SELECT U.user_id, U.login FROM ' . TABLE_USERS . ' U 
                                 LEFT JOIN ' . TABLE_INTERNALMAIL_FOLDERS_USERS . ' IMFU ON 
                                     U.user_id=IMFU.user_id AND IMFU.interlocutor_id = ' . $nUserID . ' AND IMFU.folder_id = ' . INTERNALMAIL_FOLDER_IGNORE . '
                               WHERE U.login LIKE (' . $this->db->str2sql("{$sQ}%") . ') AND U.user_id!=' . $nUserID . ' 
                                 AND U.im_noreply=0 AND U.blocked=0 AND IMFU.folder_id IS NULL
                               ORDER BY U.login');
                 $aUsers = array();
                 foreach ($aResult as $u) {
                     $aUsers[$u['user_id']] = $u['login'];
                 }
                 unset($aResult);
                 $this->ajaxResponse($aUsers);
                 break;
             case 'history':
                 if (!($nInterlocutorID = func::POSTGET('iid', false, true))) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $aData = array('uid' => $nUserID, 'ulogin' => $this->security->getUserLogin());
                 $aData['il'] = $this->db->one_array('SELECT user_id, login FROM ' . TABLE_USERS . ' WHERE id=' . $nInterlocutorID . ' LIMIT 1');
                 if (!$aData['il']) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 //получаем переписку с собеседником
                 $sQuery = 'SELECT id, author, message, status, created
                            FROM ' . TABLE_INTERNALMAIL . '              
                            WHERE ((author=' . $nInterlocutorID . ' AND recipient=' . $nUserID . ' AND (status & ' . INTERNALMAIL_STATUS_DELRECIPIENT . ')=0 ) 
                                    OR (author=' . $nUserID . ' AND recipient=' . $nInterlocutorID . ' AND (status & ' . INTERNALMAIL_STATUS_DELAUTHOR . ')=0 )
                                  )
                            ORDER BY created DESC';
                 $aData['messages'] = $this->db->select($sQuery);
                 $this->tplAssignByRef('aData', $aData);
                 $this->ajaxResponse(array('history' => $this->tplFetch('admin.history.ajax.tpl')));
                 break;
             case 'delete-conv':
                 if (($nInterlocutorID = func::POSTGET('iid', false, true)) <= 0) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $nDeleted = $this->deleteConversation($nUserID, $nInterlocutorID) ? 1 : 0;
                 $this->ajaxResponse($nDeleted);
                 break;
             case 'move2folder':
                 if (($nInterlocutorID = func::POSTGET('iid', false, true)) <= 0) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 if (($nFolderID = func::POSTGET('fid', false, true)) <= 0) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $aResponse['added'] = $this->moveUser2Folder($nUserID, $nInterlocutorID, $nFolderID);
                 $this->ajaxResponse($aResponse);
                 break;
             case 'delete-msg':
                 $nMessageID = func::POSTGET('rec', false, true);
                 if (!$nMessageID) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $this->deleteMessage($nMessageID, $nUserID);
                 $this->ajaxResponse(Errors::SUCCESSFULL);
                 break;
             case 'recover-msg':
                 $nMessageID = func::POSTGET('rec', false, true);
                 if (!$nMessageID) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $this->recoverMessage($nMessageID, $nUserID);
                 $this->ajaxResponse(Errors::SUCCESSFULL);
                 break;
             case 'send-msg':
                 if (($nInterlocutorID = func::POSTGET('iid', false, true)) <= 0) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $aData['message'] = $this->cleanMessage(func::POST('message'));
                 if (!$aData['message']) {
                     $this->ajaxResponse(Errors::IMPOSSIBLE);
                 }
                 $this->sendMessage($nUserID, $nInterlocutorID, nl2br($aData['message']), $this->uploadAttachment(), $this->db->getNOW());
                 $this->ajaxResponse(Errors::SUCCESSFULL);
                 break;
         }
     }
     $this->ajaxResponse(Errors::IMPOSSIBLE);
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:96,代码来源:internalmail.adm.class.php

示例4: subscriber_delete

 function subscriber_delete()
 {
     if (!$this->haveAccessTo('subscribers-edit')) {
         return $this->showAccessDenied();
     }
     $nRecordID = func::POSTGET('rec', false, true);
     if (!$nRecordID) {
         $this->adminRedirect(Errors::IMPOSSIBLE, 'subscriber_listing');
     }
     $this->db->execute('DELETE FROM ' . DB_PREFIX . 'subscribers WHERE id=' . $nRecordID);
     $this->adminRedirect(Errors::SUCCESSFULL, 'subscriber_listing');
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:12,代码来源:sendmail.adm.class.php

示例5: ajax

 function ajax()
 {
     if (!bff::$isAjax || !$this->security->haveAccessToAdminPanel()) {
         $this->ajaxResponse(Errors::ACCESSDENIED);
     }
     switch (func::GET('act')) {
         case 'city-list':
             $sPos = func::GETPOST('pos');
             $aExtra = array('expand' => true);
             $sEmptyTitle = func::GETPOST('empty_title');
             if (!empty($sEmptyTitle)) {
                 $aExtra['empty_title'] = $sEmptyTitle;
             }
             $this->ajaxResponse($this->geoCityOptions(0, $sPos, $aExtra));
             break;
         case 'city-regions':
             $nCityID = $this->input->id('city', 'p');
             if (!$nCityID) {
                 $this->ajaxResponse(Errors::UNKNOWNRECORD);
             }
             $bGetYData = func::GET('ydata') == 1;
             $sEmptyTitle = func::GETPOST('empty_title');
             $sEmptyTitle = !empty($sEmptyTitle) ? $sEmptyTitle : 'не указан';
             $aResponse = $this->geoRegionOptions($nCityID, 0, true, $sEmptyTitle, $bGetYData);
             if (!$bGetYData) {
                 unset($aResponse['regdata']);
             }
             $this->ajaxResponse($aResponse);
             break;
         case 'unsubscribe':
             if (($nRecordID = func::POSTGET('rec', false, true)) <= 0) {
                 $this->ajaxResponse(Errors::IMPOSSIBLE);
             }
             $this->db->execute('DELETE FROM ' . TABLE_SUBSCRIBES . ' WHERE id = ' . $nRecordID);
             $this->ajaxResponse(Errors::SUCCESS);
             break;
     }
     $this->ajaxResponse(Errors::IMPOSSIBLE);
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:39,代码来源:sites.adm.class.php

示例6: settings

 function settings()
 {
     if (!$this->haveAccessTo('settings')) {
         return $this->showAccessDenied();
     }
     $configPrefix = $this->module_name . '_';
     $sCurrentTab = func::POSTGET('tab');
     if (empty($sCurrentTab)) {
         $sCurrentTab = 'general';
     }
     if (bff::$isPost && func::POST('save') == 1) {
         $confTmp = func::POST('config', false);
         $this->input->clean_array($confTmp, array('items_perpage' => TYPE_UINT, 'items_freepubl_category_limit' => TYPE_UINT, 'items_freepubl_category_limit_reg' => TYPE_UINT, 'adtxt_limit' => TYPE_UINT, 'svc_up_price' => TYPE_NUM, 'svc_mark_price' => TYPE_NUM, 'svc_premium_price' => TYPE_NUM, 'svc_press_price' => TYPE_NUM, 'svc_up_desc' => TYPE_STR, 'svc_mark_desc' => TYPE_STR, 'svc_premium_desc' => TYPE_STR, 'svc_press_desc' => TYPE_STR, 'images_limit' => TYPE_UINT, 'images_limit_reg' => TYPE_UINT, 'add_instruct1' => TYPE_STR, 'add_instruct2' => TYPE_STR, 'add_instruct3' => TYPE_STR, 'add_instruct4' => TYPE_STR));
         $conf = array();
         foreach ($confTmp as $k => $v) {
             $conf[$configPrefix . $k] = $v;
         }
         bff::i()->Sites_saveConfig($conf, false);
         //в БД
         $configAll = config::getAll();
         bff::i()->Sites_saveConfig(array_merge($configAll, $conf), true);
         //в файл
         $this->adminRedirect(Errors::SUCCESS, 'settings&tab=' . $sCurrentTab);
     }
     $aConfig = config::getWithPrefix($this->module_name . '_');
     $aConfig = array_map('stripslashes', $aConfig);
     $aConfig['options'] = array();
     $aConfig['options']['limit10'] = array(1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5, 6 => 6, 7 => 7, 8 => 8, 9 => 9, 10 => 10, 11 => 11, 12 => 12, 13 => 13, 14 => 14, 15 => 15);
     $aData = $aConfig;
     $aData['tabs'] = array('general' => array('t' => 'Общие настройки', 'a' => 0), 'files' => array('t' => 'Загрузка файлов', 'a' => 0), 'add_instruction' => array('t' => 'Инструкция при добавлении', 'a' => 0));
     $aData['tabs'][$sCurrentTab]['a'] = 1;
     $this->tplAssign('tab', $sCurrentTab);
     $this->tplAssignByRef('aData', $aData);
     $this->adminCustomCenterArea();
     $this->includeJS('wysiwyg');
     return $this->tplFetch('admin.settings.tpl');
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:37,代码来源:bbs.adm.class.php

示例7: action

 function action()
 {
     if (!$this->haveAccessTo('edit')) {
         return $this->showAccessDenied();
     }
     $nRecordID = func::POSTGET('rec', false, true);
     if ($nRecordID <= 0) {
         $this->adminRedirect(Errors::IMPOSSIBLE, 'listing');
     }
     $sAction = func::POSTGET('type');
     switch ($sAction) {
         case 'delete':
             //delete page file
             $aData = $this->db->one_array('SELECT filename, issystem FROM ' . TABLE_PAGES . ' WHERE id=' . $nRecordID . ' LIMIT 1');
             if (!empty($aData) && !$aData['issystem']) {
                 @unlink(PAGES_PATH . $aData['filename'] . PAGES_EXTENSION);
                 $this->db->execute('DELETE FROM ' . TABLE_PAGES . ' WHERE id=' . $nRecordID);
             } else {
                 $this->adminRedirect(Errors::ACCESSDENIED, 'listing');
             }
             break;
     }
     $this->adminRedirect(Errors::SUCCESSFULL, 'listing');
 }
开发者ID:Sywooch,项目名称:dobox,代码行数:24,代码来源:pages.adm.class.php


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