本文整理汇总了PHP中C::Get方法的典型用法代码示例。如果您正苦于以下问题:PHP C::Get方法的具体用法?PHP C::Get怎么用?PHP C::Get使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类C
的用法示例。
在下文中一共展示了C::Get方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getTopicsForSitemap
/**
* Список опубликованых топиков в открытых блогах (с кешированием)
*
* @param int $iPage
*
* @return array
*/
public function getTopicsForSitemap($iPage = 0)
{
$sCacheKey = "sitemap_topics_{$iPage}_" . C::Get('plugin.sitemap.items_per_page');
if (false === ($aData = E::ModuleCache()->Get($sCacheKey))) {
$aFilter = $this->GetNamedFilter('sitemap');
$aTopics = E::ModuleTopic()->GetTopicsByFilter($aFilter, $iPage, C::Get('plugin.sitemap.items_per_page'), array('blog' => array('owner' => array())));
$aData = array();
$iIndex = 0;
$aPriority = F::Array_Str2Array(C::Get('plugin.sitemap.type.topics.priority'));
$nPriority = sizeof($aPriority) ? reset($aPriority) : null;
$aChangeFreq = F::Array_Str2Array(C::Get('plugin.sitemap.type.topics.changefreq'));
$sChangeFreq = sizeof($aChangeFreq) ? reset($aChangeFreq) : null;
/** @var ModuleTopic_EntityTopic $oTopic */
foreach ($aTopics['collection'] as $oTopic) {
if ($aPriority) {
if (isset($aPriority[$iIndex])) {
$nPriority = $aPriority[$iIndex];
}
}
if ($aChangeFreq) {
if (isset($aChangeFreq[$iIndex])) {
$sChangeFreq = $aChangeFreq[$iIndex];
}
}
$aData[] = E::ModuleSitemap()->GetDataForSitemapRow($oTopic->getLink(), $oTopic->getDateLastMod(), $sChangeFreq, $nPriority);
$iIndex += 1;
}
// тег 'blog_update' т.к. при редактировании блога его тип может измениться
// с открытого на закрытый или наоборот
E::ModuleCache()->Set($aData, $sCacheKey, array('topic_new', 'topic_update', 'blog_update'), C::Get('plugin.sitemap.type.topics.cache_lifetime'));
}
return $aData;
}
示例2: RegisterEvent
/**
* Регистрация евентов
*/
protected function RegisterEvent()
{
if (C::Get('rating.enabled')) {
$this->AddEventPreg('/^vote$/i', '/^comment$/', 'EventVoteComment');
$this->AddEventPreg('/^vote$/i', '/^topic$/', 'EventVoteTopic');
$this->AddEventPreg('/^vote$/i', '/^blog$/', 'EventVoteBlog');
$this->AddEventPreg('/^vote$/i', '/^user$/', 'EventVoteUser');
}
$this->AddEventPreg('/^vote$/i', '/^poll$/', 'EventVotePoll');
$this->AddEventPreg('/^vote$/i', '/^question$/', 'EventVoteQuestion');
$this->AddEventPreg('/^favourite$/i', '/^save-tags/', 'EventFavouriteSaveTags');
$this->AddEventPreg('/^favourite$/i', '/^topic$/', 'EventFavouriteTopic');
$this->AddEventPreg('/^favourite$/i', '/^comment$/', 'EventFavouriteComment');
$this->AddEventPreg('/^favourite$/i', '/^talk$/', 'EventFavouriteTalk');
$this->AddEventPreg('/^stream$/i', '/^comment$/', 'EventStreamComment');
$this->AddEventPreg('/^stream$/i', '/^topic$/', 'EventStreamTopic');
$this->AddEventPreg('/^stream$/i', '/^wall/', 'EventStreamWall');
$this->AddEventPreg('/^blogs$/i', '/^top$/', 'EventBlogsTop');
$this->AddEventPreg('/^blogs$/i', '/^self$/', 'EventBlogsSelf');
$this->AddEventPreg('/^blogs$/i', '/^join$/', 'EventBlogsJoin');
$this->AddEventPreg('/^preview$/i', '/^text$/', 'EventPreviewText');
$this->AddEventPreg('/^preview$/i', '/^topic/', 'EventPreviewTopic');
$this->AddEventPreg('/^upload$/i', '/^image$/', 'EventUploadImage');
$this->AddEventPreg('/^autocompleter$/i', '/^tag$/', 'EventAutocompleterTag');
$this->AddEventPreg('/^autocompleter$/i', '/^user$/', 'EventAutocompleterUser');
$this->AddEventPreg('/^comment$/i', '/^delete$/', 'EventCommentDelete');
$this->AddEventPreg('/^geo/i', '/^get/', '/^regions$/', 'EventGeoGetRegions');
$this->AddEventPreg('/^geo/i', '/^get/', '/^cities/', 'EventGeoGetCities');
$this->AddEventPreg('/^infobox/i', '/^info/', '/^blog/', 'EventInfoboxInfoBlog');
$this->AddEvent('fetch', 'EventFetch');
// Менеджер изображений
$this->AddEvent('image-manager-load-tree', 'EventImageManagerLoadTree');
$this->AddEvent('image-manager-load-images', 'EventImageManagerLoadImages');
}
示例3: loadConfig
/**
* @param string $sType
* @param bool $bClear
*
* @throws Exception
*/
public function loadConfig($sType = 'default', $bClear = true)
{
if ($bClear) {
$this->tagsRules = array();
}
$aConfig = C::Get('qevix.' . $sType);
if (is_array($aConfig)) {
foreach ($aConfig as $sMethod => $aExec) {
if ($sMethod == 'cfgSetAutoReplace') {
$this->aAutoReplace = $aExec;
continue;
}
foreach ($aExec as $aParams) {
call_user_func_array(array($this, $sMethod), $aParams);
}
}
// * Хардкодим некоторые параметры
unset($this->entities1['&']);
// разрешаем в параметрах символ &
if (C::Get('view.noindex') && isset($this->tagsRules['a'])) {
$this->cfgSetTagParamDefault('a', 'rel', 'nofollow', true);
}
}
if (C::Get('module.text.char.@')) {
$this->cfgSetSpecialCharCallback('@', array(E::ModuleText(), 'CallbackTagAt'));
}
if ($aData = C::Get('module.text.autoreplace')) {
$this->aAutoReplace = array(array_keys($aData), array_values($aData));
}
}
示例4: RegisterHook
/**
* Регистрация событий на хуки
*/
public function RegisterHook()
{
// Выводим интерфейс работы с рейтингом только если он включён
if (C::Get('rating.enabled')) {
if (C::Get('plugin.simplerating.user.vote')) {
$this->AddHook('template_profile_header', 'HookProfileRatingInject');
$this->AddHook('template_user_list_header', 'HookUserListHeaderInject');
$this->AddHook('template_user_list_line', 'HookUserListLineInject');
$this->AddHook('template_user_list_linexxs', 'HookUserListLineXssInject');
}
if (C::Get('plugin.simplerating.blog.vote')) {
$this->AddHook('template_blog_infobox', 'HookBlogInfoboxRatingValueInject');
$this->AddHook('template_blog_list_header', 'HookBlogListHeaderInject');
$this->AddHook('template_blog_list_line', 'HookBlogListLineInject');
$this->AddHook('template_blog_list_linexxs', 'HookBlogListLineXssInject');
$this->AddHook('template_blog_header', 'HookBlogHeaderInject');
$this->AddHook('template_blog_stat', 'HookBlogStatInject');
}
if (C::Get('plugin.simplerating.comment.vote')) {
$this->AddHook('template_comment_list_info', 'HookCommentListInfoInject');
$this->AddHook('template_comment_info', 'HookCommentInfoInject');
}
if (C::Get('plugin.simplerating.topic.vote')) {
$this->AddHook('template_topic_show_info', 'HookTopicShowInfoInject');
}
}
}
示例5: loadConfig
/**
* @param string $sType
* @param bool $bClear
*
* @throws Exception
*/
public function loadConfig($sType = 'default', $bClear = true)
{
if ($bClear) {
$this->tagsRules = array();
}
$aConfig = C::Get('jevix.' . $sType);
if (is_array($aConfig)) {
foreach ($aConfig as $sMethod => $aExec) {
foreach ($aExec as $aParams) {
if (in_array(strtolower($sMethod), array_map('strtolower', array('cfgSetTagCallbackFull', 'cfgSetTagCallback')))) {
if (isset($aParams[1][0]) && $aParams[1][0] == '_this_') {
$aParams[1][0] = E::ModuleText();
}
}
call_user_func_array(array($this, $sMethod), $aParams);
}
}
// * Хардкодим некоторые параметры
unset($this->entities1['&']);
// разрешаем в параметрах символ &
if (C::Get('view.noindex') && isset($this->tagsRules['a'])) {
$this->cfgSetTagParamDefault('a', 'rel', 'nofollow', true);
}
}
}
示例6: _processConfig
/**
* Обрабатывает поля конфига и возвращает данные для компиляции
*
* @param $aFields
* @param $bSave
* @return array
*/
private function _processConfig($aFields, $bSave)
{
if ($bSave) {
// Сохраняемые данные
$aData = array();
// Компилируемые данные
$aCompiledData = array();
foreach ($aFields as $sFieldConfig => $aFieldDefault) {
$sFieldName = str_replace('.', '_', $sFieldConfig);
$aData["plugin.estheme.{$sFieldConfig}"] = getRequest($sFieldName, $aFieldDefault[0]);
$_REQUEST[$sFieldName] = $aData["plugin.estheme.{$sFieldConfig}"];
if (isset($aFieldDefault[2])) {
// Если нужно, то используем форматированиеперед вставкой стилевого значения less
$aCompiledData[$aFieldDefault[1]] = str_replace('{{value}}', $aData["plugin.estheme.{$sFieldConfig}"], $aFieldDefault[2]);
} else {
$aCompiledData[$aFieldDefault[1]] = $aData["plugin.estheme.{$sFieldConfig}"];
}
}
Config::WriteCustomConfig($aData);
return $aCompiledData;
} else {
foreach ($aFields as $sFieldConfig => $aFieldDefault) {
$sFieldName = str_replace('.', '_', $sFieldConfig);
$_REQUEST[$sFieldName] = C::Get("plugin.estheme.{$sFieldConfig}");
}
return array();
}
}
示例7: setRating
public function setRating($nRating)
{
parent::setRating($nRating);
if ((double) $nRating >= C::Get('plugin.sandbox.topic_rating_out')) {
$this->setTopicStatus(0);
}
}
示例8: Init
public static function Init($sFuncStats)
{
if (!self::IsAvailable()) {
return false;
}
$oCache = new Zend_Cache_Backend_File(array('cache_dir' => C::Get('sys.cache.dir'), 'file_name_prefix' => E::ModuleCache()->GetCachePrefix(), 'read_control_type' => 'crc32', 'hashed_directory_level' => C::Get('sys.cache.directory_level'), 'read_control' => true, 'file_locking' => true));
return new self($oCache, $sFuncStats);
}
示例9: Init
/**
* Инициализация модуля
*
*/
public function Init()
{
$sCharset = C::Get('db.params.charset');
if (!$sCharset) {
$sCharset = 'utf8';
}
$this->aInitSql = str_replace('%%charset%%', $sCharset, $this->aInitSql);
}
示例10: Deactivate
/**
* Деактивация плагина
* @return bool
*/
public function Deactivate()
{
$aMenuList = C::Get('menu.data.user.list');
unset($aMenuList['plugin_menutest_my_menu']);
C::WriteCustomConfig(array('menu.data.user.list' => $aMenuList));
C::ResetCustomConfig('menu.data.user.list.plugin_menutest_my_menu');
return TRUE;
}
示例11: _createTextParser
/**
* Create a typographer and load its configuration
*/
protected function _createTextParser()
{
$sParser = C::Get('module.text.parser');
$sClassName = 'TextParser' . $sParser;
$sFileName = './parser/' . $sClassName . '.class.php';
F::IncludeFile($sFileName);
$this->oTextParser = new $sClassName();
}
示例12: Init
public static function Init($sFuncStats)
{
if (!self::IsAvailable()) {
return false;
}
$aConfigMem = C::Get('memcache');
$oCache = new Dklab_Cache_Backend_MemcachedMultiload($aConfigMem);
return new self(new Dklab_Cache_Backend_Profiler($oCache, $sFuncStats));
}
示例13: Init
/**
* Инициализация модуля
*
*/
public function Init()
{
$sCharset = C::Get('db.params.charset');
if (!$sCharset) {
$sCharset = 'utf8';
}
$this->aInitSql = str_replace('%%charset%%', $sCharset, $this->aInitSql);
$this->sLogFile = Config::Get('sys.logs.sql_query_file');
}
示例14: RegisterEvent
/**
* Регистрация евентов
*
*/
protected function RegisterEvent()
{
$this->AddEventPreg('/^(page([1-9]\\d{0,5}))?$/i', 'EventIndex');
$this->AddEventPreg('/^new$/i', '/^(page([1-9]\\d{0,5}))?$/i', 'EventNew');
$this->AddEventPreg('/^newall$/i', '/^(page([1-9]\\d{0,5}))?$/i', 'EventNewAll');
$this->AddEventPreg('/^discussed/i', '/^(page([1-9]\\d{0,5}))?$/i', 'EventDiscussed');
if (C::Get('rating.enabled')) {
$this->AddEventPreg('/^top/i', '/^(page([1-9]\\d{0,5}))?$/i', 'EventTop');
}
}
示例15: ClearUrl
public function ClearUrl($sUrl)
{
$sUrl = trim(filter_var($sUrl, FILTER_SANITIZE_URL), '/');
if (C::Get('plugin.seopack.url.skip_scheme')) {
if (preg_match('/^https?:(.*)$/i', $sUrl, $aMatches)) {
$sUrl = $aMatches[1];
}
}
return $sUrl;
}