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

PHP Phpfox_Database类代码示例

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

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



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

示例1: process

 /**
  * Controller
  */
 public function process()
 {
     if ($iId = $this->request()->getInt('delete')) {
         if (Phpfox::getService('ad.process')->deleteInvoice($iId)) {
             $this->url()->send('admincp.ad.invoice', null, Phpfox::getPhrase('ad.invoice_successfully_deleted'));
         }
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(5, 10, 15, 20);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('time_stamp' => Phpfox::getPhrase('ad.recently_added'));
     $aFilters = array('status' => array('type' => 'select', 'options' => array('1' => Phpfox::getPhrase('ad.paid'), '2' => Phpfox::getPhrase('ad.pending_payment'), '3' => Phpfox::getPhrase('ad.cancelled')), 'add_any' => true), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '10'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'ad_id'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'invoices', 'filters' => $aFilters, 'search' => 'search'));
     $sStatus = $oSearch->get('status');
     switch ($sStatus) {
         case '1':
             $oSearch->setCondition('ai.status = \'completed\'');
             break;
         case '2':
             $oSearch->setCondition('(ai.status = \'pending\' OR ' . Phpfox_Database::instance()->isNull('ai.status') . ')');
             break;
         case '3':
             $oSearch->setCondition('ai.status = \'cancel\'');
             break;
         default:
             break;
     }
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aInvoices) = Ad_Service_Ad::instance()->getInvoices($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     $this->template()->setTitle(Phpfox::getPhrase('ad.ad_invoices'))->setBreadcrumb(Phpfox::getPhrase('ad.invoices'))->assign(array('aInvoices' => $aInvoices));
 }
开发者ID:lev1976g,项目名称:core,代码行数:37,代码来源:invoice.class.php


示例2: process

 /**
  * Controller
  */
 public function process()
 {
     if ($this->request()->get('update')) {
         $aModules = Phpfox::massCallback('getSqlTitleField');
         $aParseTables = array();
         if (is_array($aModules) && count($aModules)) {
             foreach ($aModules as $aModule) {
                 if (isset($aModule['table'])) {
                     $aModule = array($aModule);
                 }
                 foreach ($aModule as $aInfo) {
                     $aParseTables[] = $aInfo;
                 }
             }
         }
         $oDb = Phpfox_Database::instance();
         foreach ($aParseTables as $aParseTable) {
             if (isset($aParseTable['has_index'])) {
                 $aIndexes = Phpfox::getLib('database.support')->getIndexes(Phpfox::getT($aParseTable['table']), null, $oDb, true);
                 foreach ($aIndexes as $aIndex) {
                     if ($aIndex['Column_name'] == $aParseTable['has_index']) {
                         $oDb->query('ALTER TABLE ' . Phpfox::getT($aParseTable['table']) . ' DROP INDEX ' . $aIndex['Key_name']);
                     }
                 }
             }
             Phpfox_Database::instance()->query('ALTER TABLE ' . Phpfox::getT($aParseTable['table']) . ' CHANGE ' . $aParseTable['field'] . ' ' . $aParseTable['field'] . ' text');
         }
         $this->url()->send('admincp.sql.title', null, Phpfox::getPhrase('admincp.database_tables_updated'));
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.alter_title_fields'))->setBreadcrumb(Phpfox::getPhrase('admincp.alter_title_fields'))->assign(array());
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:34,代码来源:title.class.php


示例3: process

 /**
  * Controller
  */
 public function process()
 {
     $aCond = array();
     $iPage = $this->request()->getInt('page');
     $iPageSize = 10;
     $bIsSentbox = $this->request()->get('req2') == 'sent' ? true : false;
     $bIsSearch = false;
     if ($bIsSentbox) {
         $aCond[] = 'm.owner_user_id = ' . Phpfox::getUserId() . ' AND m.owner_type_id = 0';
     } else {
         $aCond[] = 'm.viewer_folder_id = 0 AND m.viewer_user_id = ' . Phpfox::getUserId() . ' AND m.viewer_type_id = 0';
     }
     if (($sSearch = $this->request()->get('search')) || $this->request()->get('search-query')) {
         if ($this->request()->get('search-query')) {
             $sSearch = Phpfox::getLib('session')->get('mfsearch');
         }
         $bIsSearch = true;
         $aCond[] = "AND (m.subject LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%' OR m.preview LIKE '%" . Phpfox_Database::instance()->escape($sSearch) . "%')";
         $this->url()->setParam('search-query', 'true');
         Phpfox::getLib('session')->set('mfsearch', $sSearch);
     }
     if ($bIsSearch == false) {
         Phpfox::getLib('session')->remove('mfsearch');
     }
     list($iCnt, $aMessages, $aInputs) = Mail_Service_Mail::instance()->get($aCond, 'm.time_updated DESC', $iPage, $iPageSize, $bIsSentbox);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->assign(array('bMobileInboxIsActive' => true, 'aMessages' => $aMessages, 'bIsSearch' => $bIsSearch, 'bIsSentbox' => $bIsSentbox, 'aMobileSubMenus' => array($this->url()->makeUrl('mail') => Phpfox::getPhrase('mail.mobile_messages'), $this->url()->makeUrl('mail', 'sent') => Phpfox::getPhrase('mail.sent'), $this->url()->makeUrl('mail', 'compose') => Phpfox::getPhrase('mail.compose')), 'sActiveMobileSubMenu' => $this->url()->makeUrl('mail', $this->request()->get('req2') == '' ? null : $this->request()->get('req2'))));
 }
开发者ID:lev1976g,项目名称:core,代码行数:31,代码来源:index-mobile.class.php


示例4: process

 /**
  * Controller
  */
 public function process()
 {
     if ($aTables = $this->request()->getArray('tables')) {
         if ($this->request()->get('optimize')) {
             foreach ($aTables as $sTable) {
                 Phpfox_Database::instance()->optimizeTable($sTable);
             }
             $this->url()->send('admincp.sql', null, Phpfox::getPhrase('admincp.table_s_successfully_optimized'));
         } elseif ($this->request()->get('repair')) {
             foreach ($aTables as $sTable) {
                 Phpfox_Database::instance()->repairTable($sTable);
             }
             $this->url()->send('admincp.sql', null, Phpfox::getPhrase('admincp.table_s_successfully_repaired'));
         }
     }
     $aItems = Phpfox_Database::instance()->getTableStatus();
     $iSize = 0;
     $iOverhead = 0;
     foreach ($aItems as $iKey => $aItem) {
         $iSize += $aItem['Data_length'];
         $iOverhead += $aItem['Data_free'];
         $aItems[$iKey]['Name'] = $aItems[$iKey]['Name'];
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.sql_maintenance_title'))->setBreadcrumb(Phpfox::getPhrase('admincp.sql_maintenance_title'), $this->url()->makeUrl('admincp.sql'))->assign(array('aItems' => $aItems, 'iSize' => $iSize, 'iOverhead' => $iOverhead, 'iCnt' => count($aItems)));
 }
开发者ID:lev1976g,项目名称:core,代码行数:28,代码来源:index.class.php


示例5: process

 /**
  * Controller
  */
 public function process()
 {
     list($aGroups, $aModules, $aProductGroups) = Phpfox::getService('admincp.setting.group')->get();
     $aCond = array();
     $aUrl = array();
     $sSettingTitle = '';
     if ($sSettingId = $this->request()->get('setting-id')) {
         $aCond[] = " AND setting.setting_id = " . (int) $sSettingId;
         $aUrl = array('setting', 'edit', 'setting-id' => $sSettingId);
     }
     if ($sGroupId = $this->request()->get('group-id')) {
         $aCond[] = " AND setting.group_id = '" . Phpfox_Database::instance()->escape($sGroupId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'group-id' => $sGroupId);
         foreach ($aGroups as $aGroup) {
             if ($aGroup['group_id'] == $sGroupId) {
                 $sSettingTitle = $aGroup['var_name'];
                 break;
             }
         }
     }
     if ($iModuleId = $this->request()->get('module-id')) {
         $aCond[] = " AND setting.module_id = '" . Phpfox_Database::instance()->escape($iModuleId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'module-id' => $iModuleId);
         foreach ($aModules as $aModule) {
             if ($aModule['module_id'] == $iModuleId) {
                 $sSettingTitle = $aModule['module_id'];
                 break;
             }
         }
     }
     if ($sProductId = $this->request()->get('product-id')) {
         $aCond[] = " AND setting.product_id = '" . Phpfox_Database::instance()->escape($sProductId) . "' AND setting.is_hidden = 0 ";
         $aUrl = array('setting', 'edit', 'product-id' => $sProductId);
         foreach ($aProductGroups as $aProduct) {
             if ($aProduct['product_id'] == $sProductId) {
                 $sSettingTitle = $aProduct['var_name'];
                 break;
             }
         }
     }
     $aSettings = Phpfox::getService('admincp.setting')->get($aCond);
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getService('admincp.setting.process')->update($aVals)) {
             // $this->url()->send('admincp', $aUrl, Phpfox::getPhrase('admincp.updated'));
             return ['updated' => true];
         }
     }
     $sWatermarkImage = Phpfox::getParam('core.url_watermark') . sprintf(Phpfox::getParam('core.watermark_image'), '') . '?v=' . uniqid();
     if (!file_exists(Phpfox::getParam('core.dir_watermark') . sprintf(Phpfox::getParam('core.watermark_image'), '')) && Phpfox::getParam('core.allow_cdn')) {
         $sWatermarkImage = Phpfox::getLib('cdn')->getUrl(str_replace(PHPFOX_DIR, '', $sWatermarkImage));
     }
     if (Phpfox::isModule($sSettingTitle)) {
         $sSettingTitle = Phpfox_Locale::instance()->translate($sSettingTitle, 'module');
     }
     $this->template()->setSectionTitle($sSettingTitle);
     $this->template()->setBreadCrumb(Phpfox::getPhrase('admincp.manage_settings'), $this->url()->makeUrl('admincp.setting'))->setBreadCrumb(Phpfox::getPhraseT($sSettingTitle, 'module'), null, true)->setTitle(Phpfox::getPhrase('admincp.manage_settings'))->assign(array('aGroups' => $aGroups, 'aModules' => $aModules, 'aProductGroups' => $aProductGroups, 'aSettings' => $aSettings, 'sSettingTitle' => $sSettingTitle, 'sWatermarkImage' => $sWatermarkImage));
     ($sPlugin = Phpfox_Plugin::get('admincp.component_controller_setting_edit_process')) ? eval($sPlugin) : false;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:61,代码来源:edit.class.php


示例6: process

 /**
  * Controller
  */
 public function process()
 {
     $bCanBackup = Phpfox_Database::instance()->canBackup();
     $sDefaultPath = PHPFOX_DIR_FILE . 'log' . PHPFOX_DS;
     if (($sPath = $this->request()->get('path')) && $bCanBackup) {
         if ($sBackupPath = Phpfox_Database::instance()->backup($sPath)) {
             $this->url()->send('admincp.sql.backup', null, Phpfox::getPhrase('admincp.sql_backup_successfully_created_and_can_be_downloaded_here_path', array('path' => $sBackupPath)));
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.sql_maintenance_title'))->setBreadcrumb(Phpfox::getPhrase('admincp.sql_maintenance_title'), $this->url()->makeUrl('admincp.sql'))->setBreadcrumb(Phpfox::getPhrase('admincp.backup'), null, true)->assign(array('bCanBackup' => $bCanBackup, 'sDefaultPath' => $sDefaultPath));
 }
开发者ID:lev1976g,项目名称:core,代码行数:14,代码来源:backup.class.php


示例7: process

 /**
  * Controller
  */
 public function process()
 {
     $iPage = $this->getParam('page', 0);
     $iPageSize = 9;
     $oDb = Phpfox_Database::instance();
     $aConditions = array();
     if ($sFind = $this->getParam('find')) {
         $aConditions[] = 'AND (u.user_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.full_name LIKE \'%' . $oDb->escape($sFind) . '%\' OR u.email LIKE \'%' . $oDb->escape($sFind) . '%\')';
     }
     list($iCnt, $aUsers) = Phpfox::getService('user.browse')->conditions($aConditions)->page($iPage)->limit($iPageSize)->sort('u.last_login DESC')->get();
     Phpfox_Pager::instance()->set(array('ajax' => 'user.browseAjax', 'page' => $iPage, 'size' => $iPageSize, 'count' => $iCnt));
     $this->template()->assign(array('aUsers' => $aUsers, 'sPrivacyInputName' => $this->getParam('input'), 'bIsAjaxSearch' => $this->getParam('is_search', false)));
 }
开发者ID:lev1976g,项目名称:core,代码行数:16,代码来源:browse.class.php


示例8: process

 /**
  * Controller
  */
 public function process()
 {
     if ($aVals = $this->request()->getArray('val')) {
         if (Phpfox::getLib('phpfox.api')->send('clientVerification', $aVals)) {
             if (Phpfox::getLib('phpfox.api')->send('brandingRemoval', array('domain' => Phpfox::getParam('core.path')))) {
                 Phpfox_Database::instance()->update(Phpfox::getT('setting'), array('value_actual' => '1'), "var_name = 'branding'");
                 Phpfox::getLib('cache')->remove();
                 $this->url()->send('admincp', null, Phpfox::getPhrase('admincp.phpfox_branding_removal_successfully_installed'));
             } else {
                 Phpfox_Error::set('We are unable to find a branding removal assigned to this license.');
             }
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.phpfox_branding_removal'))->setBreadcrumb(Phpfox::getPhrase('admincp.phpfox_branding_removal'))->assign(array());
 }
开发者ID:lev1976g,项目名称:core,代码行数:18,代码来源:branding.class.php


示例9: isSpam

 /**
  * Checks to see if the content being passed is considered as SPAM.
  *
  * @return bool TRUE if it is spam, FALSE if it isn't spam.
  */
 public function isSpam()
 {
     if (empty($this->_aParams['content'])) {
         Phpfox_Error::set(Phpfox::getPhrase('core.content_is_empty'));
         return true;
     }
     $this->_aParams['content'] = md5(str_replace(array("\n", "\r", "\t", " ", "\\o", "\\xOB"), '', $this->_aParams['content']));
     $sCount = $this->_oDb->select('COUNT(*)')->from(Phpfox::getT($this->_aParams['table']))->where('user_id = ' . Phpfox::getUserId() . ' AND item_hash = \'' . $this->_oDb->escape($this->_aParams['content']) . '\' AND time_stamp >= \'' . (PHPFOX_TIME - $this->_aParams['time'] * 60) . '\'')->limit($this->_aParams['total'])->order('time_stamp DESC')->execute('getSlaveField');
     if ((int) $sCount > 0) {
         Phpfox_Database::instance()->updateCounter('user', 'total_spam', 'user_id', Phpfox::getUserId());
         Phpfox_Error::set(Phpfox::getPhrase('core.the_content_of_this_item_is_identical_to_something_you_have_added_before_please_try_again'));
         return true;
     }
     $this->_oDb->insert(Phpfox::getT($this->_aParams['table']), array('user_id' => Phpfox::getUserId(), 'item_hash' => $this->_aParams['content'], 'time_stamp' => PHPFOX_TIME));
     return false;
 }
开发者ID:lev1976g,项目名称:core,代码行数:21,代码来源:hash.class.php


示例10: process

 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('user.can_add_user_group_setting', true);
     $aGroups = Phpfox::getService('user.group')->get('user_group.is_special = 1');
     $aForms = array();
     if (($iSetting = $this->request()->getInt('id')) && ($aForms = Phpfox::getService('user.group.setting')->getSetting($iSetting)) && isset($aForms['setting_id'])) {
         foreach ($aGroups as $iKey => $aGroup) {
             if ($aGroup['user_group_id'] == '1') {
                 $aGroups[$iKey]['value'] = $aForms['default_admin'];
             } elseif ($aGroup['user_group_id'] == '3') {
                 $aGroups[$iKey]['value'] = $aForms['default_guest'];
             } elseif ($aGroup['user_group_id'] == '4') {
                 $aGroups[$iKey]['value'] = $aForms['default_staff'];
             } else {
                 $aGroups[$iKey]['value'] = $aForms['default_user'];
             }
         }
     }
     if (!$this->request()->getInt('id')) {
         $this->url()->send('admincp');
     }
     $aValidation = array('name' => Phpfox::getPhrase('user.select_varname'));
     $oValid = Phpfox_Validator::instance()->set(array('sFormName' => 'js_form', 'aParams' => $aValidation));
     if ($aVals = $this->request()->getArray('val')) {
         // Check that all the fields are valid
         if ($oValid->isValid($aVals)) {
             if (isset($aForms['setting_id'])) {
                 if (Phpfox::getService('user.group.setting.process')->updateSetting(array_merge($aVals, array('setting_id' => $aForms['setting_id'])))) {
                     $this->url()->send('admincp', array('user', 'group', 'add', 'id' => $this->request()->getInt('gid'), '#setting' . $aForms['setting_id']), Phpfox::getPhrase('user.setting_successfully_updated'));
                 }
             } else {
                 if (Phpfox::getService('user.group.setting.process')->addSetting($aVals)) {
                     $this->url()->send('admincp', array('user', 'group', 'setting'), Phpfox::getPhrase('user.setting_successfully_added'));
                 }
             }
         }
     }
     if ($sCacheSetting = Phpfox::getLib('session')->get('cache_new_user_setting')) {
         Phpfox::getLib('session')->remove('cache_new_user_setting');
     }
     if (isset($aForms['name'])) {
         Phpfox_Database::instance()->select('language_phrase.text, ')->leftJoin(Phpfox::getT('language_phrase'), 'language_phrase', "language_phrase.language_id = l.language_id AND language_phrase.var_name = 'user_setting_{$aForms['name']}'");
     }
     $aLanguages = Phpfox::getService('language')->get();
     $this->template()->setBreadcrumb(Phpfox::getPhrase('user.user_groups'), $this->url()->makeUrl('admincp.user.group'))->setBreadcrumb(Phpfox::getPhrase('user.manage_user_groups'), $this->url()->makeUrl('admincp.user.group'))->setBreadcrumb(Phpfox::getPhrase('user.add_user_group_setting'), null, true)->setTitle(Phpfox::getPhrase('user.add_user_group_setting'))->assign(array('aProducts' => Admincp_Service_Product_Product::instance()->get(), 'aModules' => Phpfox::getService('admincp.module')->getModules(), 'aLanguages' => $aLanguages, 'sCreateJs' => $oValid->createJS(), 'sGetJsForm' => $oValid->getJsForm(), 'aTypes' => array('boolean', 'integer', 'string', 'array'), 'aUserGroups' => $aGroups, 'sCacheSetting' => $sCacheSetting, 'aForms' => $aForms, 'iGroupId' => $this->request()->getInt('gid')));
     ($sPlugin = Phpfox_Plugin::get('user.component_controller_admincp_group_setting_process')) ? eval($sPlugin) : false;
 }
开发者ID:noikiy,项目名称:phpfox-dist,代码行数:50,代码来源:setting.class.php


示例11: process

 /**
  * Controller
  */
 public function process()
 {
     $iId = (int) $this->getParam('iItemId');
     $sType = $this->getParam('sType');
     $aRows = $this->getParam('attachments', null);
     $bIsAttachmentEdit = (bool) $this->getParam('attachment_edit', false);
     $bIsAttachmentNoHeader = (bool) $this->getParam('attachment_no_header', false);
     if ($bIsAttachmentEdit) {
         list($iCnt, $aRows) = Phpfox::getService('attachment')->get('attachment.attachment_id IN(' . rtrim($this->getParam('sIds'), ',') . ')', 'attachment.time_stamp ASC', 0, 500, false);
     } else {
         if (!is_array($aRows)) {
             list($iCnt, $aRows) = Phpfox::getService('attachment')->get("attachment.item_id = {$iId} AND attachment.view_id = 0 AND attachment.category_id = '" . Phpfox_Database::instance()->escape($sType) . "' " . ($bIsAttachmentNoHeader ? '' : 'AND attachment.is_inline = 0'), 'attachment.attachment_id DESC', '', '', false);
         }
     }
     $this->template()->assign(array('aAttachments' => $aRows, 'sUrlPath' => Phpfox::getParam('core.url_attachment'), 'sUsage' => Phpfox::getUserBy('space_attachment'), 'bIsAttachmentNoHeader' => $bIsAttachmentNoHeader, 'bIsAttachmentEdit' => $bIsAttachmentEdit));
     ($sPlugin = Phpfox_Plugin::get('attachment.component_block_list_process')) ? eval($sPlugin) : false;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:20,代码来源:list.class.php


示例12: process

 /**
  * Controller
  */
 public function process()
 {
     $sCategoryId = PHPFOX_IS_AJAX ? $this->request()->get('category_id') : $this->getParam('sCategoryId');
     $sCached = $this->getParam('sAttachments');
     $iUserId = Phpfox::getUserId();
     $aRows1 = array();
     $aRows2 = array();
     if ($sCategoryId == 'page') {
         if (Phpfox::getUserParam('page.can_manage_custom_pages')) {
             $iUserId = false;
         }
     }
     if ($iItemId = $this->getParam('iItemId')) {
         list($iCnt, $aRows1) = Phpfox::getService('attachment')->get(array("AND attachment.item_id = " . (int) $iItemId . " AND attachment.category_id = '" . Phpfox_Database::instance()->escape($sCategoryId) . "'" . ($iUserId !== false ? " AND attachment.user_id = " . $iUserId . "" : "") . ""));
     }
     if (!empty($sCached)) {
         $sCacheQuery = '';
         $aParts = explode(',', $sCached);
         foreach ($aParts as $iPart) {
             $iPart = trim($iPart);
             if (!is_numeric($iPart)) {
                 continue;
             }
             $sCacheQuery .= $iPart . ',';
         }
         $sCachedQuery = rtrim($sCacheQuery, ',');
         if (!empty($sCachedQuery)) {
             list($iCnt, $aRows2) = Phpfox::getService('attachment')->get(array("AND attachment.attachment_id IN(" . $sCachedQuery . ") AND attachment.category_id = '" . Phpfox_Database::instance()->escape($sCategoryId) . "'" . ($iUserId !== false ? " AND attachment.user_id = " . $iUserId . "" : "") . ""));
         }
     }
     $aRows = array_merge($aRows1, $aRows2);
     if (isset($aRows)) {
         $sAttachments = '';
         foreach ($aRows as $aRow) {
             $sAttachments .= $aRow['attachment_id'] . ',';
         }
     }
     if (!empty($sAttachments)) {
         $this->template()->assign(array('sAttachments' => rtrim($sAttachments, ',')));
     }
     if ($this->getParam('bFixToken')) {
         $this->template()->assign(array('bFixToken' => true));
     }
     $this->template()->assign(array('sCategoryId' => $sCategoryId, 'sAttachmentInput' => $this->request()->get('input'), 'sCustomAttachment' => $this->request()->get('attachment_custom')));
 }
开发者ID:lev1976g,项目名称:core,代码行数:48,代码来源:add.class.php


示例13: process

 /**
  * Controller
  */
 public function process()
 {
     Phpfox::getUserParam('admincp.can_clear_site_cache', true);
     if ($this->request()->get('unlock')) {
         Phpfox::getLib('cache')->unlock();
         $this->url()->send('admincp.maintain.cache', null, Phpfox::getPhrase('admincp.cache_system_unlocked'));
     }
     if ($this->request()->get('all')) {
         Phpfox_Database::instance()->update(Phpfox::getT('setting'), array('value_actual' => (int) Phpfox::getParam('core.css_edit_id') + 1), 'var_name = \'css_edit_id\'');
         Phpfox::getLib('cache')->remove();
         Phpfox::getLib('template.cache')->remove();
         Phpfox::getLib('cache')->removeStatic();
         $aParams = array('maintain', 'cache', 'clear' => 'done');
         if ($sPlugin = Phpfox_Plugin::get('admincp.component_controller_maintain_1')) {
             eval($sPlugin);
         }
         // $this->url()->send('admincp', $aParams, Phpfox::getPhrase('admincp.cached_cleared'));
         return ['content' => Phpfox::getPhrase('admincp.cached_cleared')];
     }
     if ($aIds = $this->request()->getArray('id')) {
         foreach ($aIds as $sKey => $aItems) {
             foreach ($aItems as $sId) {
                 Phpfox::getLib('cache')->remove($sId, 'path');
             }
         }
         $this->url()->send('admincp', array('maintain', 'cache'), Phpfox::getPhrase('admincp.cached_cleared'));
     }
     $iPage = $this->request()->getInt('page');
     $aPages = array(20, 30, 40, 50);
     $aDisplays = array();
     foreach ($aPages as $iPageCnt) {
         $aDisplays[$iPageCnt] = Phpfox::getPhrase('core.per_page', array('total' => $iPageCnt));
     }
     $aSorts = array('time_stamp' => Phpfox::getPhrase('admincp.timestamp'), 'file_name' => Phpfox::getPhrase('admincp.cache_name'), 'data_size' => Phpfox::getPhrase('admincp.data_size'));
     $aFilters = array('search' => array('type' => 'input:text', 'search' => "AND file_name LIKE '%[VALUE]%'"), 'display' => array('type' => 'select', 'options' => $aDisplays, 'default' => '20'), 'sort' => array('type' => 'select', 'options' => $aSorts, 'default' => 'time_stamp'), 'sort_by' => array('type' => 'select', 'options' => array('DESC' => Phpfox::getPhrase('core.descending'), 'ASC' => Phpfox::getPhrase('core.ascending')), 'default' => 'DESC'));
     $oSearch = Phpfox_Search::instance()->set(array('type' => 'cache', 'filters' => $aFilters, 'search' => 'search'));
     $iLimit = $oSearch->getDisplay();
     list($iCnt, $aCaches) = Phpfox::getLib('cache')->getCachedFiles($oSearch->getConditions(), $oSearch->getSort(), $oSearch->getPage(), $iLimit);
     Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $oSearch->getSearchTotal($iCnt)));
     if ($this->request()->get('clear')) {
         $aCaches = array();
         $iCnt = 0;
     }
     $this->template()->setTitle('Cache Manager')->setSectionTitle('Cache Manager')->setActionMenu(['Clear Cache' => ['url' => $this->url()->makeUrl('admincp.maintain.cache', ['all' => true]), 'class' => 'popup']])->assign(array('iCacheCnt' => $iCnt, 'aCaches' => $aCaches, 'aStats' => Phpfox::getLib('cache')->getStats(), 'bCacheLocked' => file_exists(PHPFOX_DIR_CACHE . 'cache.lock') ? true : false, 'sUnlockCache' => $this->url()->makeUrl('admincp.maintain.cache', array('unlock' => 'true'))));
 }
开发者ID:lev1976g,项目名称:core,代码行数:48,代码来源:cache.class.php


示例14: process

 /**
  * Controller
  */
 public function process()
 {
     if ($sVar = $this->request()->get('var')) {
         if (preg_match('/(.*)\\.(.*)/i', $sVar, $aMatches) && isset($aMatches[2])) {
             $sVar = $aMatches[2];
             $aResults = Phpfox::getService('admincp.setting')->search("setting.module_id = '" . Phpfox_Database::instance()->escape($aMatches[1]) . "' AND setting.var_name = '" . Phpfox_Database::instance()->escape($sVar) . "'");
         } else {
             $aResults = Phpfox::getService('admincp.setting')->search("setting.var_name = '" . Phpfox_Database::instance()->escape($sVar) . "'");
         }
         if (isset($aResults[0]['var_name'])) {
             $iId = $aResults[0]['module_id'];
             $sUrl = $this->url()->makeUrl('admincp.setting.edit') . 'module-id_' . $iId . '/#' . $aResults[0]['var_name'];
             $this->url()->send($sUrl);
         } else {
             $this->template()->assign(array('sMessage' => Phpfox::getPhrase('admincp.your_search_did_not_return_any_results')));
         }
     }
 }
开发者ID:lev1976g,项目名称:core,代码行数:21,代码来源:search.class.php


示例15: process

 /**
  * Controller
  */
 public function process()
 {
     $aModules = Phpfox::massCallback('reparserList');
     foreach ($aModules as $iKey => $aModule) {
         if (!isset($aModule['name'])) {
             unset($aModules[$iKey]);
             $iCnt = 0;
             foreach ($aModule as $iModuleKey => $aCacheModule) {
                 $iCnt++;
                 $aModules = array_merge($aModules, array('custom' . $iCnt => $aCacheModule));
             }
         }
     }
     foreach ($aModules as $iKey => $aModule) {
         if (!isset($aModule['name'])) {
             foreach ($aModule as $iSubKey => $aSub) {
                 $aModules[$iKey . '_' . $iSubKey] = $aSub;
             }
             unset($aModules[$iKey]);
         }
         if (is_array($aModule['table'])) {
             $aModule['table'] = $aModule['table'][0];
         }
         $aModules[$iKey]['total_record'] = Phpfox_Database::instance()->select('COUNT(*)')->from(Phpfox::getT($aModule['table']))->execute('getSlaveField');
         if ($aModules[$iKey]['total_record'] == 0) {
             unset($aModules[$iKey]);
         }
     }
     $iPage = $this->request()->get('page');
     $iLimit = 200;
     if (($sModule = $this->request()->get('module')) && isset($aModules[$sModule])) {
         $iCnt = Phpfox::getService('admincp.maintain')->reParseText($aModules[$sModule], $iPage, $iLimit);
         Phpfox_Pager::instance()->set(array('page' => $iPage, 'size' => $iLimit, 'count' => $iCnt));
         $iTotalPages = (int) Phpfox_Pager::instance()->getTotalPages();
         $iCurrentPage = (int) Phpfox_Pager::instance()->getCurrentPage();
         $iPage = (int) Phpfox_Pager::instance()->getNextPage();
         if ($iTotalPages === $iCurrentPage || $iTotalPages === 0) {
             $this->url()->send('admincp.maintain.reparser', null, Phpfox::getPhrase('admincp.parsing_completed'));
         } else {
             $this->template()->assign(array('bInProcess' => true, 'iCurrentPage' => $iCurrentPage, 'iTotalPages' => $iTotalPages))->setHeader(array('<meta http-equiv="refresh" content="2;url=' . Phpfox_Url::instance()->makeUrl('admincp.maintain.reparser', array('module' => $sModule, 'page' => $iPage)) . '" />'));
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('admincp.text_reparser'))->setSectionTitle('Content Re-Parser')->assign(array('aReparserLists' => $aModules));
 }
开发者ID:lev1976g,项目名称:core,代码行数:47,代码来源:reparser.class.php


示例16: get

 public function get()
 {
     $oFile = Phpfox_File::instance();
     $bSlaveEnabled = Phpfox::getParam(array('db', 'slave'));
     $sDriver = Phpfox::getParam(array('db', 'driver'));
     $aStats = array(Phpfox::getPhrase('admincp.phpfox_version') => PhpFox::getVersion() . '<i>(build ' . Phpfox::getBuild() . ')</i>', Phpfox::getPhrase('admincp.php_version') => '<a href="' . Phpfox_Url::instance()->makeUrl('admincp.core.phpinfo') . '">' . PHP_VERSION . '</a>', Phpfox::getPhrase('admincp.php_sapi') => php_sapi_name(), Phpfox::getPhrase('admincp.php_safe_mode') => PHPFOX_SAFE_MODE ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false'), Phpfox::getPhrase('admincp.php_open_basedir') => PHPFOX_OPEN_BASE_DIR ? Phpfox::getPhrase('admincp.true') : Phpfox::getPhrase('admincp.false'), Phpfox::getPhrase('admincp.php_disabled_functions') => @ini_get('disable_functions') ? str_replace(",", ", ", @ini_get('disable_functions')) : Phpfox::getPhrase('admincp.none'), Phpfox::getPhrase('admincp.php_loaded_extensions') => implode(' ', get_loaded_extensions()), Phpfox::getPhrase('admincp.operating_system') => PHP_OS, Phpfox::getPhrase('admincp.server_time_stamp') => date('F j, Y, g:i a', PHPFOX_TIME) . ' (GMT)', Phpfox::getPhrase('admincp.gzip') => Phpfox::getParam('core.use_gzip') ? Phpfox::getPhrase('admincp.enabled') : Phpfox::getPhrase('admincp.disabled'), Phpfox::getPhrase('admincp.sql_driver_version') => $sDriver == 'DATABASE_DRIVER' ? Phpfox::getPhrase('admincp.n_a') : Phpfox_Database::instance()->getServerInfo(), Phpfox::getPhrase('admincp.sql_slave_enabled') => $bSlaveEnabled ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no'), Phpfox::getPhrase('admincp.sql_total_slaves') => $bSlaveEnabled ? count(Phpfox::getParam(array('db', 'slave_servers'))) : Phpfox::getPhrase('admincp.n_a'), Phpfox::getPhrase('admincp.sql_slave_server') => $bSlaveEnabled ? Phpfox_Database::instance()->sSlaveServer : Phpfox::getPhrase('admincp.n_a'), Phpfox::getPhrase('admincp.memory_limit') => $oFile->filesize($this->_getUsableMemory()) . ' (' . @ini_get('memory_limit') . ')', Phpfox::getPhrase('admincp.load_balancing_enabled') => Phpfox::getParam(array('balancer', 'enabled')) ? Phpfox::getPhrase('admincp.yes') : Phpfox::getPhrase('admincp.no'));
     if (strpos(strtolower(PHP_OS), 'win') === 0 || PHPFOX_SAFE_MODE || PHPFOX_OPEN_BASE_DIR) {
     } else {
         if (function_exists('shell_exec')) {
             $sMemory = @shell_exec("free -m");
             $aMemory = explode("\n", str_replace("\r", "", $sMemory));
             if (is_array($aMemory)) {
                 $aMemory = array_slice($aMemory, 1, 1);
                 if (isset($aMemory[0])) {
                     $aMemory = preg_split("#\\s+#", $aMemory[0]);
                     $aStats[Phpfox::getPhrase('admincp.total_server_memory')] = isset($aMemory[1]) ? $aMemory[1] . ' MB' : '--';
                     $aStats[Phpfox::getPhrase('admincp.available_server_memory')] = isset($aMemory[3]) ? $aMemory[3] . ' MB' : '--';
                 }
             }
         } else {
             if (stristr(PHP_OS, "win") === false) {
                 $sMemory = file_get_contents('/proc/meminfo');
                 $aMemoryStats = explode("n", $sMemory);
                 // escape the "new line"
                 $aMem = null;
                 foreach ($aMemoryStats as $iKey => $sMemoryStat) {
                     $aMemoryStats[$iKey] = preg_replace('/s+/', ' ', $sMemoryStat);
                     if (preg_match('/[0-9]+/', $sMemoryStat, $aMem)) {
                         $aMemoryStats[$iKey] = $aMem[0] / 1024;
                     }
                 }
                 $aStats[Phpfox::getPhrase('admincp.total_server_memory')] = (int) $aMemoryStats[0] . ' MB';
                 $aStats[Phpfox::getPhrase('admincp.available_server_memory')] = (int) $aMemoryStats[1] . ' MB';
             }
         }
     }
     if (!PHPFOX_OPEN_BASE_DIR && ($sLoad = Phpfox::getService('core.load')->get()) !== null) {
         $aStats[Phpfox::getPhrase('admincp.current_server_load')] = $sLoad;
     }
     return $aStats;
 }
开发者ID:nima7r,项目名称:phpfox-dist,代码行数:41,代码来源:system.class.php


示例17: import

 /**
  * Import XML data.
  *
  * @param array $aVals ARRAY of XML data.
  * @param bool $bMissingOnly TRUE to import only missing data.
  * @return bool Always returns TRUE.
  */
 public function import($aVals, $bMissingOnly = false)
 {
     $aCache = array();
     if ($bMissingOnly) {
         $aRows = Phpfox_Database::instance()->select('version_id')->from(Phpfox::getT('version'))->execute('getRows', array('free_result' => true));
         foreach ($aRows as $aRow) {
             $aCache[$aRow['version_id']] = $aRow['version_id'];
         }
     }
     $aSql = array();
     foreach ($aVals['version'] as $aVal) {
         if ($bMissingOnly && isset($aCache[$aVal['version_id']])) {
             continue;
         }
         $aSql[] = array($aVal['version_id'], $aVal['ordering']);
     }
     if ($aSql) {
         Phpfox_Database::instance()->multiInsert(Phpfox::getT('version'), array('version_id', 'ordering'), $aSql);
     }
     return true;
 }
开发者ID:lev1976g,项目名称:core,代码行数:28,代码来源:process.class.php


示例18: __construct

 /**
  * Class constructor is used to build the current URL and all the custom rewrite rules.
  *
  */
 public function __construct()
 {
     if (!defined('PHPFOX_INSTALLER')) {
         $oCache = Phpfox::getLib('cache');
         $iCacheId = $oCache->set('rewrite');
         $iReverseCacheId = $oCache->set('rewrite_reverse');
         if (!($this->aRewrite = $oCache->get($iCacheId)) || !($this->aReverseRewrite = $oCache->get($iReverseCacheId))) {
             $aRows = Phpfox_Database::instance()->select('r.url, r.replacement')->from(Phpfox::getT('rewrite'), 'r')->execute('getRows');
             foreach ($aRows as $aRow) {
                 $aParts = explode('/', $aRow['url']);
                 /*$this->aRewrite[rtrim($aRow['replacement'], '/')] = array(
                 		'module' => $aParts[0], 
                 		'component' => ((isset($aParts[1]) && !empty($aParts[1])) ? $aParts[1] : 'index'));*/
                 $this->aRewrite[$aRow['url']] = $aRow['replacement'];
                 $this->aReverseRewrite[rtrim($aRow['replacement'], '/')] = $aRow['url'];
             }
             $oCache->save($iCacheId, $this->aRewrite);
             $oCache->save($iReverseCacheId, $this->aReverseRewrite);
         }
     }
     $this->_setParams();
 }
开发者ID:Chriscxa,项目名称:phpfox,代码行数:26,代码来源:url.class.php


示例19: process

 /**
  * Controller
  */
 public function process()
 {
     Phpfox::isUser(true);
     if (!Phpfox::getUserParam('user.can_delete_own_account')) {
         Phpfox_Url::instance()->send('');
     }
     if (Phpfox::isModule('friend')) {
         list($iCnt, $aShowFriends) = Friend_Service_Friend::instance()->get('friend.is_page = 0 AND friend.user_id = ' . Phpfox::getUserId() . ' AND ' . Phpfox_Database::instance()->isNotNull('user_image'), 'RAND()', 0, 3);
         $this->template()->assign(array('aFriends' => $aShowFriends, 'aReasons' => Phpfox::getService('user')->getReasons()));
     }
     // is not confirming
     if ($this->request()->get('req3') == 'confirm') {
         if ($aVals = $this->request()->getArray('val')) {
             // user inputted password, no turning back now...
             if (User_Service_Cancellations_Process::instance()->cancelAccount($aVals)) {
                 // redirect is in the cancelAccoutn because of the logout
             } else {
                 // an error occured (??)
             }
         }
     }
     $this->template()->setTitle(Phpfox::getPhrase('user.cancel_account'))->setBreadcrumb(Phpfox::getPhrase('user.cancel_account'));
 }
开发者ID:noikiy,项目名称:phpfox-dist,代码行数:26,代码

鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP Phpfox_Error类代码示例发布时间:2022-05-23
下一篇:
PHP Phpfox类代码示例发布时间: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