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


PHP Phpfox_Database::instance方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: 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

示例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


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