• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Phpfox_Request类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: get

 public function get($sCategory = null)
 {
     $sSelect = 'p.photo_id, p.server_id, p.destination, p.time_stamp, ' . Phpfox::getUserField();
     $aConds = array();
     $aConds[] = 'AND p.privacy = 0 AND p.allow_rate = 1';
     if ($sCategory !== null) {
         $sCategoryIds = Phpfox::getService('photo.category')->getAllCategories($sCategory);
         if (!empty($sCategoryIds)) {
             $aConds[] = ' AND pcd.category_id IN (' . $sCategoryIds . ')';
             $this->database()->innerJoin(Phpfox::getT('photo_category_data'), 'pcd', 'pcd.photo_id = p.photo_id');
         }
     }
     $aRows = $this->database()->select($sSelect)->from($this->_sTable, 'p')->join(Phpfox::getT('user'), 'u', 'u.user_id = p.user_id')->where($aConds)->order('RAND()')->limit(2)->execute('getSlaveRows');
     if (!count($aRows)) {
         return false;
     }
     if (count($aRows) < 2) {
         return false;
     }
     $sMode = Phpfox_Request::instance()->get('mode') == 'full' ? 'full' : '';
     $aPhotos = array();
     foreach ($aRows as $iKey => $aRow) {
         if ($iKey === 0) {
             $aRow['link'] = Phpfox_Url::instance()->makeUrl('photo.battle', array('w' => $aRow['photo_id'], 'l' => $aRows[1]['photo_id'], 'mode' => $sMode));
         } else {
             $aRow['link'] = Phpfox_Url::instance()->makeUrl('photo.battle', array('w' => $aRow['photo_id'], 'l' => $aRows[0]['photo_id'], 'mode' => $sMode));
         }
         $aPhotos[$iKey === 0 ? 'one' : 'two'] = $aRow;
     }
     return $aPhotos;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:31,代码来源:battle.class.php


示例2: setHash

 public function setHash($sCode)
 {
     if (Phpfox::getParam('core.store_only_users_in_session')) {
         $oRequest = Phpfox_Request::instance();
         $oSession = Phpfox::getLib('session');
         $sSessionHash = $oSession->get('sessionhash');
         $bCreate = true;
         if (!empty($sSessionHash)) {
             $bCreate = false;
             $aRow = $this->database()->select('*')->from(Phpfox::getT('log_session'))->where('session_hash = \'' . $this->database()->escape($sSessionHash) . '\'')->execute('getSlaveRow');
             if (isset($aRow['session_hash'])) {
                 $this->database()->update(Phpfox::getT('log_session'), array('captcha_hash' => $this->_getHash($sCode, $sSessionHash)), "session_hash = '" . $sSessionHash . "'");
             } else {
                 $bCreate = true;
             }
         }
         if ($bCreate) {
             $sSessionHash = $oRequest->getSessionHash();
             $this->database()->insert(Phpfox::getT('log_session'), array('session_hash' => $sSessionHash, 'id_hash' => $oRequest->getIdHash(), 'captcha_hash' => $this->_getHash($sCode, $sSessionHash), 'user_id' => Phpfox::getUserId(), 'last_activity' => PHPFOX_TIME, 'location' => '', 'is_forum' => '0', 'forum_id' => 0, 'im_hide' => 0, 'ip_address' => '', 'user_agent' => ''));
             $oSession->set('sessionhash', $sSessionHash);
         }
     } else {
         $iId = $this->_oSession->getSessionId();
         $this->database()->update(Phpfox::getT('log_session'), array('captcha_hash' => $this->_getHash($sCode, $iId)), "session_hash = '" . $iId . "'");
     }
 }
开发者ID:lev1976g,项目名称:core,代码行数:26,代码来源:captcha.class.php


示例3: getValue

 /**
  * Gets the $_POST form value based on the ID passed.
  *
  * @param string $iId ID of the <textarea> form
  * @return string Returns the value if we can find it, if not the value is blank.
  */
 public function getValue($iId, $sDefaultValue = null)
 {
     if (!($aParams = Phpfox_Request::instance()->getArray('val'))) {
         $aParams = Phpfox_Template::instance()->getVar('aForms');
     }
     return isset($aParams[$iId]) ? Phpfox::getLib('parse.output')->clean($aParams[$iId]) : ($sDefaultValue === null ? '' : $sDefaultValue);
 }
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:13,代码来源:editor.class.php


示例4: process

 /**
  * Controller
  */
 public function process()
 {
     if (!defined('PHPFOX_IS_USER_PROFILE') && !defined('PHPFOX_IS_PAGES_VIEW')) {
         return false;
     }
     if (defined('PHPFOX_IS_PAGES_VIEW')) {
         $aUser = $this->getParam('aPage');
         $aUser['user_image'] = $aUser['image_path'];
         $aUser['profile_page_id'] = $aUser['page_id'];
         $aUser['server_id'] = $aUser['image_server_id'];
     } else {
         $aUser = $this->getParam('aUser');
     }
     $aUserInfo = array('title' => $aUser['full_name'], 'path' => 'core.url_user', 'file' => $aUser['user_image'], 'suffix' => '_50_square', 'max_width' => 75, 'max_height' => 75, 'no_default' => Phpfox::getUserId() == $aUser['user_id'] ? false : true, 'thickbox' => true, 'class' => 'profile_user_image');
     if (defined('PHPFOX_IS_PAGES_VIEW')) {
         $sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => $aUser), $aUserInfo));
     } else {
         $sImage = Phpfox::getLib('image.helper')->display(array_merge(array('user' => Phpfox::getService('user')->getUserFields(true, $aUser)), $aUserInfo));
     }
     $bIsInfo = false;
     if (isset($aUser['landing_page']) && $aUser['landing_page'] == 'info' && Phpfox_Request::instance()->get('req2') != 'wall' || Phpfox_Request::instance()->get('req2') == 'info') {
         $bIsInfo = true;
     }
     if (defined('PHPFOX_IS_PAGES_VIEW') && empty($aUser['vanity_url'])) {
         if (isset($aUser['landing_page']) && $aUser['landing_page'] == 'info' && Phpfox_Request::instance()->get('req3') != 'wall' || Phpfox_Request::instance()->get('req3') == 'info') {
             $bIsInfo = true;
         }
     }
     $this->template()->assign(array('aUser' => $aUser, 'sProfileImage' => $sImage, 'bIsInfo' => $bIsInfo, 'bCanPoke' => Phpfox::isModule('poke') && Phpfox::getService('poke')->canSendPoke($aUser['user_id'])));
 }
开发者ID:lev1976g,项目名称:core,代码行数:33,代码来源:mobile.class.php


示例5: add

 public function add($sMethod, $sAction, $aExtra = array())
 {
     $aInsert = array('user_id' => Phpfox::getUserId(), 'type_id' => $this->_aActions[$sAction], 'call_name' => $sMethod, 'time_stamp' => PHPFOX_TIME, 'ip_address' => Phpfox_Request::instance()->getIp());
     if ($aExtra) {
         $aInsert['extra'] = serialize($aExtra);
     }
     $this->database()->insert($this->_sTable, $aInsert);
 }
开发者ID:lev1976g,项目名称:core,代码行数:8,代码来源:staff.class.php


示例6: add

 public function add($iReportId, $sType, $iItemId, $sFeedback = '')
 {
     if (empty($iReportId)) {
         return Phpfox_Error::set(Phpfox::getPhrase('report.provide_a_category_name'));
     }
     $this->database()->insert($this->_sTable, array('report_id' => (int) $iReportId, 'item_id' => $sType . '_' . (int) $iItemId, 'user_id' => Phpfox::getUserId(), 'added' => PHPFOX_TIME, 'ip_address' => Phpfox_Request::instance()->getServer('REMOTE_ADDR'), 'feedback' => $sFeedback != '' ? Phpfox::getLib('parse.input')->clean($sFeedback) : ''));
     return true;
 }
开发者ID:Goudarzi-hahram,项目名称:phpfox,代码行数:8,代码来源:process.class.php


示例7: add

 public function add($aVals)
 {
     $aVals = array_merge($aVals, array('server_id' => Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID')));
     $aInsert = array('category_id' => $aVals['category'], 'link_id' => isset($aVals['link_id']) ? (int) $aVals['link_id'] : 0, 'user_id' => Phpfox::getUserId(), 'time_stamp' => PHPFOX_TIME, 'file_name' => empty($aVals['file_name']) ? null : $aVals['file_name'], 'extension' => empty($aVals['extension']) ? null : $aVals['extension'], 'is_image' => isset($aVals['is_image']) && $aVals['is_image'] ? 1 : 0, 'server_id' => Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID'));
     $iId = $this->database()->insert(Phpfox::getT('attachment'), $aInsert);
     // Update user activity
     Phpfox::getService('user.activity')->update(Phpfox::getUserId(), 'attachment');
     ($sPlugin = Phpfox_Plugin::get('attachment.service_process_add')) ? eval($sPlugin) : false;
     return $iId;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:10,代码来源:process.class.php


示例8: add

 public function add()
 {
     /*
     @title
     @info Create a page. On success it will return information about the new page.
     @method POST
     @extra title=#{Title of the page|string|yes}&info=#{Information about the page|string|yes}&type_id=#{Parent category ID#. Use [action]page.categories[/action]|int|yes}&category_id=#{Sub-category ID#. Use [action]page.categories[/action]|int|yes}&image=#{Default avatar/logo for the page. Must be an HTTP path to an image|string|no}
     @return page_id=#{Page ID#|int}&profile_user_id=#{This is the profile user ID# for the page|int}&title=#{Title of the page|string}&likes=#{Total number of likes|int}&permalink=#{Link to the page|string}&info=#{Information about the page|string}&created_by=#{Person who created the page|string}&created_by_url=#{Profile link of the person who created the page|string}&photo_100px=#{Photo of the page. 100px|string}&photo_100px_square=#{Square photo of the page. 100px|string}
     */
     if ($this->_oApi->isAllowed('pages.add_page') == false) {
         return $this->_oApi->error('pages.add_page', 'Unable to create a page for this user.');
     }
     $aInsert = array('title' => $this->_oApi->get('title'), 'info' => $this->_oApi->get('info'), 'type_id' => $this->_oApi->get('type_id'), 'category_id' => $this->_oApi->get('category_id'));
     $iId = Phpfox::getService('pages.process')->add($aInsert);
     if (!$iId) {
         return $this->_oApi->error('pages.unable_to_add_page', implode('', Phpfox_Error::get()));
     }
     $aPages = $this->get($iId);
     if ($this->_oApi->get('image') != '') {
         $sType = $this->_oApi->get('image_type');
         $sImageContent = file_get_contents($this->_oApi->get('image'));
         $sImagePath = Phpfox::getParam('pages.dir_image') . $aPages[0]['page_id'] . '.' . $sType;
         $hFile = fopen($sImagePath, 'w');
         fwrite($hFile, $sImageContent);
         fclose($hFile);
         $_FILES['photo']['error'] = '';
         $_FILES['photo']['tmp_name'] = $sImagePath;
         $_FILES['photo']['name'] = $this->_oApi->get('photo_name');
         $oFile = Phpfox_File::instance();
         $oImage = Phpfox_Image::instance();
         $aImage = $oFile->load('photo', array('jpg', 'gif', 'png'), Phpfox::getUserParam('pages.max_upload_size_pages') === 0 ? null : Phpfox::getUserParam('pages.max_upload_size_pages') / 1024);
         $sFileName = $oFile->upload('photo', Phpfox::getParam('pages.dir_image'), $iId);
         $sPath = Phpfox::getParam('pages.dir_image');
         $iFileSizes = filesize(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, ''));
         $aUpdate['image_path'] = $sFileName;
         $aUpdate['image_server_id'] = Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID');
         $iSize = 50;
         $oImage->createThumbnail(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
         $iFileSizes += filesize(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize));
         $iSize = 120;
         $oImage->createThumbnail(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
         $iFileSizes += filesize(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize));
         $iSize = 200;
         $oImage->createThumbnail(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
         $iFileSizes += filesize(Phpfox::getParam('pages.dir_image') . sprintf($sFileName, '_' . $iSize));
         define('PHPFOX_PAGES_IS_IN_UPDATE', true);
         Phpfox::getService('user.process')->uploadImage($aPages[0]['profile_user_id'], true, Phpfox::getParam('pages.dir_image') . sprintf($sFileName, ''));
         // Update user space usage
         Phpfox::getService('user.space')->update(Phpfox::getUserId(), 'pages', $iFileSizes);
         $this->database()->update($this->_sTable, $aUpdate, 'page_id = ' . (int) $iId);
         $aPages = $this->get($iId);
     }
     return $aPages[0];
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:54,代码来源:api.class.php


示例9: check

 public function check($sActualTitle, $sReq = 'req3')
 {
     return;
     if (PHPFOX_IS_AJAX) {
         return;
     }
     $sTitle = urldecode(Phpfox_Request::instance()->get($sReq));
     if (empty($sTitle)) {
         $aParts = explode('/', trim(Phpfox_Request::instance()->get(PHPFOX_GET_METHOD), '/'));
         $iCnt = 0;
         foreach ($aParts as $sPart) {
             if (Phpfox::isMobile() && $sPart == 'mobile') {
                 continue;
             }
             $iCnt++;
             if ((int) str_replace('req', '', $sReq) == $iCnt) {
                 $sTitle = $sPart;
                 break;
             }
         }
     }
     $sActualTitle = Phpfox_Url::instance()->cleanTitle($sActualTitle);
     if (empty($sActualTitle)) {
         return;
     }
     if ($sTitle != $sActualTitle) {
         $sPath = '';
         $aRequests = (array) Phpfox_Request::instance()->getRequests();
         if (defined('PHPFOX_IS_AJAX_PAGE') && PHPFOX_IS_AJAX_PAGE) {
             $aSubRequests = explode('/', trim(Phpfox_Request::instance()->get(PHPFOX_GET_METHOD), '/'));
             $aRequests = array();
             foreach ($aSubRequests as $iKey => $sSubRequest) {
                 $sCurrentCnt = 'req' . ($iKey + 1);
                 $aRequests[$sCurrentCnt] = $sSubRequest;
             }
         }
         if (empty($sTitle)) {
             $aRequests[$sReq] = $sActualTitle;
         }
         foreach ($aRequests as $sKey => $sValue) {
             if ($sKey == PHPFOX_GET_METHOD) {
                 continue;
             }
             if ($sKey == $sReq) {
                 $sValue = $sActualTitle;
             }
             $sPath .= $sValue . '.';
         }
         $sPath = rtrim($sPath, '.');
         if (!empty($sActualTitle)) {
             Phpfox_Url::instance()->send($sPath, array(), null, 301);
         }
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:54,代码来源:redirect.class.php


示例10: send

 /**
  * Send a request to our API server.
  *
  * @param string $sCmd Command.
  * @param array $aVals POST values.
  * @return string Returns what our API server has returned for us.
  */
 public function send($sCmd, $aVals = array())
 {
     $aVals['domain'] = $this->_getDomain();
     $mReturn = Phpfox_Request::instance()->send(PHPFOX::PHPFOX_API, array('request' => base64_encode(serialize(array_merge(array('cmd' => $sCmd), $aVals)))), 'POST');
     $mReturn = unserialize($mReturn);
     $this->_sError = $mReturn['error'] == 'fatal' ? $mReturn['error_message'] : $mReturn['error'];
     if ($mReturn['error'] === 'fatal') {
         Phpfox_Error::set($mReturn['error_message']);
     }
     return $mReturn['return'];
 }
开发者ID:lev1976g,项目名称:core,代码行数:18,代码来源:api.class.php


示例11: add

 public function add($aVals, $iUpdateId = null)
 {
     $aForms = array('title' => array('message' => Phpfox::getPhrase('subscribe.provide_a_message_for_the_package'), 'type' => array('string:required')), 'description' => array('message' => Phpfox::getPhrase('subscribe.provide_a_description_for_the_package'), 'type' => 'string:required'), 'user_group_id' => array('message' => Phpfox::getPhrase('subscribe.provide_a_user_group_on_success'), 'type' => 'int:required'), 'fail_user_group' => array('message' => Phpfox::getPhrase('subscribe.provide_a_user_group_on_cancellation'), 'type' => 'int:required'), 'is_registration' => array('message' => Phpfox::getPhrase('subscribe.provide_if_the_package_should_be_added_to_the_registration_form'), 'type' => 'int:required'), 'is_active' => array('message' => Phpfox::getPhrase('subscribe.select_if_the_package_is_active_or_not'), 'type' => 'int:required'), 'cost' => array('message' => Phpfox::getPhrase('subscribe.provide_a_price_for_the_package'), 'type' => 'currency:required'), 'show_price' => array('type' => 'int:required'), 'background_color' => array('type' => 'string'));
     $bIsRecurring = false;
     if (isset($aVals['is_recurring']) && $aVals['is_recurring']) {
         $aForms['recurring_cost'] = array('message' => Phpfox::getPhrase('subscribe.provide_a_recurring_cost'), 'type' => 'currency:required');
         $aForms['recurring_period'] = array('message' => Phpfox::getPhrase('subscribe.provide_a_recurring_period'), 'type' => 'int:required');
         $bIsRecurring = true;
     }
     if ($iUpdateId !== null) {
         if (isset($aVals['is_recurring']) && !$aVals['is_recurring']) {
             $aCacheForm = $aVals;
         }
     }
     $aVals = $this->validator()->process($aForms, $aVals);
     if (!Phpfox_Error::isPassed()) {
         return false;
     }
     if ($iUpdateId !== null) {
         if (isset($aCacheForm['is_recurring']) && !$aCacheForm['is_recurring']) {
             $aVals['recurring_period'] = 0;
             $aVals['recurring_cost'] = null;
         }
     }
     $aVals['cost'] = serialize($aVals['cost']);
     if ($bIsRecurring) {
         $aVals['recurring_cost'] = serialize($aVals['recurring_cost']);
     }
     if (!empty($_FILES['image']['name'])) {
         $aImage = Phpfox_File::instance()->load('image', array('jpg', 'gif', 'png'));
         if ($aImage === false) {
             return false;
         }
     }
     $aVals['title'] = $this->preParse()->convert($aVals['title']);
     $aVals['description'] = $this->preParse()->convert($aVals['description']);
     $aVals['background_color'] = Phpfox::getLib('parse.input')->clean($aVals['background_color']);
     if ($iUpdateId !== null) {
         $iId = $iUpdateId;
         $this->database()->update($this->_sTable, $aVals, 'package_id = ' . (int) $iUpdateId);
     } else {
         $iLastOrderId = $this->database()->select('ordering')->from($this->_sTable)->order('ordering DESC')->execute('getSlaveField');
         $aVals['ordering'] = $iLastOrderId + 1;
         $iId = $this->database()->insert($this->_sTable, $aVals);
     }
     if (!empty($_FILES['image']['name']) && ($sFileName = Phpfox_File::instance()->upload('image', Phpfox::getParam('subscribe.dir_image'), $iId))) {
         $this->database()->update($this->_sTable, array('image_path' => $sFileName, 'server_id' => Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID')), 'package_id = ' . (int) $iId);
         Phpfox_Image::instance()->createThumbnail(Phpfox::getParam('subscribe.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('subscribe.dir_image') . sprintf($sFileName, '_120'), 120, 120);
         unlink(Phpfox::getParam('subscribe.dir_image') . sprintf($sFileName, ''));
     }
     return $iId;
 }
开发者ID:lev1976g,项目名称:core,代码行数:52,代码来源:process.class.php


示例12: add

 public function add()
 {
     /*
     @title
     @info 
     @method POST
     @extra title=#{Title of the listing|string|yes}&currency_id=#{Currency ID. Use [action]core.getCurrencies[/action] to get a list of valid currencies|string|yes}&price=#{Price|decimal|no}&country_iso=#{Country ISO ID. Use [action]core.getCurrencies[/action]|string|no}&country_child_id=#{State/Province ID#. Use [action]core.getCurrencies[/action]|int|no}&postal_code=#{Postal code|string|no}&city=#{City|string|no}&mini_description=#{Mini description|string|yes}&description=#{Description|string|yes}&category=#{Comma separated category ID#'s. Use [action]marketplace.categories[/action]|string|yes}&images=#{Comma separated URL to images|string|no}  
     @return id=#{Item ID#|int}&title=#{Title of the item|string}&description=#{Description of the item|string}&likes=#{Total number of likes|int}&permalink=#{Link to the item|string}&mini_description=#{Mini description of the listing|string}&currency_id=#{Currency ID|string}&price=#{Price|decimal}&country_iso=#{Country ISO|string}&postal_code=#{Postal code|string}&city=#{City|string}&images=#{Array of images|array}
     */
     $aCategories = array();
     if ($this->_oApi->get('category')) {
         $aCategories = explode(',', $this->_oApi->get('category'));
     }
     $aVals = array('title' => $this->_oApi->get('title'), 'currency_id' => $this->_oApi->get('currency_id'), 'price' => $this->_oApi->get('price'), 'country_iso' => $this->_oApi->get('country_iso'), 'country_child_id' => $this->_oApi->get('country_child_id'), 'postal_code' => $this->_oApi->get('postal_code'), 'city' => $this->_oApi->get('city'), 'mini_description' => $this->_oApi->get('mini_description'), 'description' => $this->_oApi->get('description'), 'category' => (array) $aCategories);
     if (($iId = Phpfox::getService('marketplace.process')->add($aVals)) !== false) {
         if ($this->_oApi->get('images') != '') {
             $oImage = Phpfox_Image::instance();
             $oFile = Phpfox_File::instance();
             $aSizes = array(50, 120, 200, 400);
             $iFileSizes = 0;
             foreach (explode(',', $this->_oApi->get('images')) as $sImage) {
                 $sType = $oFile->getFileExt($sImage);
                 $sImageContent = file_get_contents($sImage);
                 $sImagePath = Phpfox::getParam('marketplace.dir_image') . $iId . '.' . $sType;
                 $hFile = fopen($sImagePath, 'w');
                 fwrite($hFile, $sImageContent);
                 fclose($hFile);
                 $_FILES['photo']['error'] = '';
                 $_FILES['photo']['tmp_name'] = $sImagePath;
                 $_FILES['photo']['name'] = basename($sImagePath);
                 if ($aImage = $oFile->load('photo', array('jpg', 'gif', 'png'), Phpfox::getUserParam('marketplace.max_upload_size_listing') === 0 ? null : Phpfox::getUserParam('marketplace.max_upload_size_listing') / 1024)) {
                     $sFileName = Phpfox_File::instance()->upload('photo', Phpfox::getParam('marketplace.dir_image'), $iId);
                     $iFileSizes += filesize(Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, ''));
                     $this->database()->insert(Phpfox::getT('marketplace_image'), array('listing_id' => $iId, 'image_path' => $sFileName, 'server_id' => Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID')));
                     foreach ($aSizes as $iSize) {
                         $oImage->createThumbnail(Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, '_' . $iSize), $iSize, $iSize);
                         $oImage->createThumbnail(Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, ''), Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, '_' . $iSize . '_square'), $iSize, $iSize, false);
                         $iFileSizes += filesize(Phpfox::getParam('marketplace.dir_image') . sprintf($sFileName, '_' . $iSize));
                     }
                 }
             }
             if ($iFileSizes === 0) {
                 return false;
             }
             $this->database()->update($this->_sTable, array('image_path' => $sFileName, 'server_id' => Phpfox_Request::instance()->getServer('PHPFOX_SERVER_ID')), 'listing_id = ' . $iId);
             Phpfox::getService('user.space')->update(Phpfox::getUserId(), 'marketplace', $iFileSizes);
         }
         $aReturn = $this->get($iId);
         return $aReturn[0];
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:51,代码来源:api.class.php


示例13: process

    /**
     * Controller
     */
    public function process()
    {
        Phpfox::getUserParam('feed.can_view_feed', true);
        $sFeedDisplay = 'feed.display';
        ($sPlugin = Phpfox_Plugin::get('feed.component_controller_index_feeddisplay')) ? eval($sPlugin) : false;
        /* Load the picup files if needed*/
        if (Phpfox::isMobile() && (($sBrowser = Phpfox_Request::instance()->getBrowser()) && strpos($sBrowser, 'Safari') !== false)) {
            $sMethod = 'simple';
            $this->template()->setHeader(array('<script type="text/javascript">
						var flash_user_id = ' . Phpfox::getUserId() . ';
						var sHash = "' . Phpfox::getService('core')->getHashForUpload() . '";</script>', 'mobile.js' => 'module_photo'))->assign(array('bRawFileInput' => true));
        }
        $this->template()->setEditor()->setHeader('cache', array('feed.js' => 'module_feed', 'comment.css' => 'style_css', 'quick_edit.js' => 'static_script', 'jquery/plugin/jquery.highlightFade.js' => 'static_script'))->assign(array('sFeedDisplay' => $sFeedDisplay));
    }
开发者ID:lev1976g,项目名称:core,代码行数:17,代码来源:index.class.php


示例14: checkProductVersions

 public function checkProductVersions()
 {
     $aProduct = $this->database()->select('product_id, url_version_check')->from(Phpfox::getT('product'))->order('last_check ASC')->execute('getRow');
     $iVersion = null;
     if (!empty($aProduct['url_version_check'])) {
         $mData = Phpfox_Request::instance()->send($aProduct['url_version_check']);
         if (is_string($mData) && preg_match('/<phpfox>(.*?)<\\/phpfox>/is', $mData)) {
             $aXml = Phpfox::getLib('xml.parser')->parse($mData);
             if (isset($aXml['product_version'])) {
                 $iVersion = $aXml['product_version'];
             }
         }
     }
     $this->database()->update(Phpfox::getT('product'), array('last_check' => PHPFOX_TIME, 'latest_version' => $iVersion), 'product_id = \'' . $this->database()->escape($aProduct['product_id']) . '\'');
 }
开发者ID:lev1976g,项目名称:core,代码行数:15,代码来源:process.class.php


示例15: getList

 public function getList()
 {
     $sCacheId = $this->cache()->set('music_genre');
     if (!($aRows = $this->cache()->get($sCacheId))) {
         $aRows = $this->database()->select('genre_id, name, name_url')->from($this->_sTable)->order('name ASC')->execute('getRows');
         $this->cache()->save($sCacheId, $aRows);
     }
     foreach ($aRows as $iKey => $aRow) {
         if ($sView = Phpfox_Request::instance()->get('view')) {
             $aRows[$iKey]['link'] = Phpfox::permalink('music.genre', $aRow['genre_id'], $aRow['name'], false, null, array('view' => $sView));
         } else {
             $aRows[$iKey]['link'] = Phpfox::permalink('music.genre', $aRow['genre_id'], $aRow['name']);
         }
     }
     return $aRows;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:16,代码来源:genre.class.php


示例16: __construct

 public function __construct()
 {
     header('Cache-Control: no-cache');
     header('Pragma: no-cache');
     session_start();
     $this->_oTpl = Phpfox_Template::instance();
     $this->_oReq = Phpfox_Request::instance();
     $this->_oUrl = Phpfox_Url::instance();
     $this->_sTempDir = Phpfox_File::instance()->getTempDir();
     $this->_sPage = $this->_oReq->get('page');
     $this->_sUrl = $this->_oReq->get('req1') == 'upgrade' ? 'upgrade' : 'install';
     self::$_sSessionId = $this->_oReq->get('sessionid') ? $this->_oReq->get('sessionid') : uniqid();
     if (defined('PHPFOX_IS_UPGRADE')) {
         $this->_oTpl->assign('bIsUprade', true);
         $this->_bUpgrade = true;
         if (file_exists(PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php')) {
             $_CONF = [];
             require_once PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php';
             $this->_aOldConfig = $_CONF;
         }
     }
     if (!Phpfox_File::instance()->isWritable($this->_sTempDir)) {
         if (PHPFOX_SAFE_MODE) {
             $this->_sTempDir = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS;
             if (!Phpfox_File::instance()->isWritable($this->_sTempDir)) {
                 exit('Unable to write to temporary folder: ' . $this->_sTempDir);
             }
         } else {
             exit('Unable to write to temporary folder: ' . $this->_sTempDir);
         }
     }
     $this->_sSessionFile = $this->_sTempDir . 'installer_' . ($this->_bUpgrade ? 'upgrade_' : '') . '_' . self::$_sSessionId . '_' . 'phpfox.log';
     $this->_hFile = fopen($this->_sSessionFile, 'a');
     if ($this->_sUrl == 'install' && $this->_oReq->get('req2') == '') {
         if (file_exists(PHPFOX_DIR_SETTING . 'server.sett.php')) {
             require PHPFOX_DIR_SETTING . 'server.sett.php';
             if (isset($_CONF['core.is_installed']) && $_CONF['core.is_installed'] === true) {
                 $this->_oUrl->forward('../install/index.php?' . PHPFOX_GET_METHOD . '=/upgrade/');
             }
         }
         if (file_exists(PHPFOX_DIR . 'include' . PHPFOX_DS . 'settings' . PHPFOX_DS . 'server.sett.php')) {
             $this->_oUrl->forward('../install/index.php?' . PHPFOX_GET_METHOD . '=/upgrade/');
         }
     }
     // Define some needed params
     Phpfox::getLib('setting')->setParam(array('core.path' => self::getHostPath(), 'core.url_static_script' => self::getHostPath() . 'static/jscript/', 'core.url_static_css' => self::getHostPath() . 'static/style/', 'core.url_static_image' => self::getHostPath() . 'static/image/', 'sCookiePath' => '/', 'sCookieDomain' => '', 'sWysiwyg' => false, 'bAllowHtml' => false, 'core.url_rewrite' => '2'));
 }
开发者ID:lev1976g,项目名称:core,代码行数:47,代码来源:installer.class.php


示例17: make

 public function make()
 {
     $Request = new Request();
     if (!$Request->isPost()) {
         return false;
     }
     $return = \Phpfox_Request::instance()->get('val');
     if (!$return) {
         return false;
     }
     $gump = new Gump();
     $gump->validation_rules(Validator\Rules::get());
     if (!$gump->run($return)) {
         throw Error($gump->get_errors_array());
     }
     return true;
 }
开发者ID:lev1976g,项目名称:core,代码行数:17,代码来源:Validator.php


示例18: get

 public function get($sAction, $sUrl)
 {
     if (empty($_REQUEST['code'])) {
         return Phpfox_Error::trigger('Missing request code.', E_USER_ERROR);
     }
     $mReturn = Phpfox_Request::instance()->send('https://graph.facebook.com/oauth/access_token', array('client_id' => '' . Phpfox::getParam('facebook.facebook_app_id') . '', 'redirect_uri' => $sUrl, 'client_secret' => '' . Phpfox::getParam('facebook.facebook_secret') . '', 'code' => $_REQUEST['code']));
     $aParts = explode('access_token=', $mReturn);
     if (!isset($aParts[1])) {
         return Phpfox_Error::set('Unable to find security token.', E_USER_ERROR);
     }
     $aParts = explode('&expires', $aParts[1]);
     $this->_sToken = $aParts[0];
     $mReturn = file_get_contents('https://graph.facebook.com/' . $sAction . '?access_token=' . $this->_sToken);
     if (!function_exists('json_decode')) {
         return Phpfox_Error::set('Server is missing the PHP function json_decode().', E_USER_ERROR);
     }
     return json_decode($mReturn);
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:18,代码来源:facebook.class.php


示例19: processRows

 public function processRows(&$aRows)
 {
     $oReq = Phpfox_Request::instance();
     foreach ($aRows as $iKey => $aRow) {
         $aRows[$iKey]['link'] = Phpfox::permalink('photo', $aRow['photo_id'], $aRow['title']);
         if (Phpfox::getUserId() && defined('PHPFOX_IS_USER_PROFILE') || $oReq->get('req1') == 'photo' && $oReq->get('view') == 'my') {
             $aRows[$iKey]['link'] .= 'userid_' . $aRow['user_id'] . '/';
         }
         $aRows[$iKey]['destination'] = Phpfox::getService('photo')->getPhotoUrl($aRow);
         if (Phpfox_Request::instance()->get('mode') == 'edit') {
             $sCategoryList = '';
             $aCategories = (array) $this->database()->select('category_id')->from(Phpfox::getT('photo_category_data'))->where('photo_id = ' . (int) $aRow['photo_id'])->execute('getSlaveRows');
             foreach ($aCategories as $aCategory) {
                 $sCategoryList .= $aCategory['category_id'] . ',';
             }
             $aRows[$iKey]['category_list'] = rtrim($sCategoryList, ',');
         }
     }
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:19,代码来源:browse.class.php


示例20: getActivityFeed

 public function getActivityFeed($aFeed)
 {
     $aCore = Phpfox_Request::instance()->get('core');
     $bForceUser = false;
     if (defined('PHPFOX_CURRENT_USER_PROFILE') || isset($aCore['profile_user_id'])) {
         $aUser = (array) (isset($aCore['profile_user_id']) ? Phpfox::getService('user')->get($aCore['profile_user_id']) : Phpfox::getService('user')->getUserObject(PHPFOX_CURRENT_USER_PROFILE));
         if (isset($aUser['user_id'])) {
             if ($aUser['user_id'] == $aFeed['item_id']) {
                 $aFeed['item_id'] = $aFeed['user_id'];
                 $bForceUser = true;
             }
         }
     }
     // http://www.phpfox.com/tracker/view/14915/
     $iDestinationUserId = 0;
     if (isset($aUser['user_id']) && $aFeed['parent_user_id'] == $aUser['user_id']) {
         $iDestinationUserId = $aFeed['user_id'];
         // http://www.phpfox.com/tracker/view/15149/
         // http://www.phpfox.com/tracker/view/15311/
         $bForceUser = true;
     } else {
         $iDestinationUserId = $aFeed['parent_user_id'];
     }
     $aRow = $this->database()->select(Phpfox::getUserField())->from(Phpfox::getT('user'), 'u')->where('u.user_id = ' . (int) $iDestinationUserId)->execute('getSlaveRow');
     // http://www.phpfox.com/tracker/view/14671/
     $iTotalLikes = $this->database()->select('COUNT(*)')->from(Phpfox::getT('like'))->where('item_id = ' . $aFeed['item_id'] . " AND type_id = 'friend'")->execute('getSlaveField');
     // http://www.phpfox.com/tracker/view/14671/
     $iIsLiked = $this->database()->select('COUNT(*)')->from(Phpfox::getT('like'))->where('item_id = ' . $aFeed['item_id'] . ' AND user_id = ' . Phpfox::getUserId())->execute('getSlaveField');
     if (!isset($aRow['user_id'])) {
         return false;
     }
     $aParams = array('user' => $aRow, 'suffix' => '_50_square', 'max_width' => '50', 'max_height' => '50');
     $sImage = Phpfox::getLib('image.helper')->display($aParams);
     $aReturn = array('feed_title' => $aRow['full_name'], 'feed_title_sub' => $aRow['user_name'], 'feed_info' => Phpfox::getPhrase('feed.is_now_friends_with'), 'feed_link' => Phpfox_Url::instance()->makeUrl($aRow['user_name']), 'feed_icon' => Phpfox::getLib('image.helper')->display(array('theme' => 'misc/friend_added.png', 'return_url' => true)), 'feed_total_like' => $iTotalLikes, 'feed_is_liked' => (int) $iIsLiked > 0 ? true : false, 'time_stamp' => $aFeed['time_stamp'], 'enable_like' => false, 'feed_image' => $sImage);
     if ($bForceUser) {
         $aReturn['force_user'] = $aUser;
         $aReturn['gender'] = $aUser['gender'];
         // bug report 13368
     }
     ($sPlugin = Phpfox_Plugin::get('friend.component_service_callback_getactivityfeed__1')) ? eval($sPlugin) : false;
     return $aReturn;
 }
开发者ID:lev1976g,项目名称:core,代码行数:42,代码来源:callback.class.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Phpfox_Template类代码示例发布时间:2022-05-23
下一篇:
PHP Phpfox_Plugin类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap