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


PHP Phpfox_Request::instance方法代码示例

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


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


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