本文整理汇总了PHP中cms_utils::get_current_pageid方法的典型用法代码示例。如果您正苦于以下问题:PHP cms_utils::get_current_pageid方法的具体用法?PHP cms_utils::get_current_pageid怎么用?PHP cms_utils::get_current_pageid使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cms_utils
的用法示例。
在下文中一共展示了cms_utils::get_current_pageid方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cache_start
public static function cache_start($tag_arg, &$smarty)
{
if (!cms_cache_handler::can_cache()) {
return '{';
}
$tmp = debug_backtrace();
$bt = array();
foreach ($tmp as $elem) {
$bt[] = $elem['file'] . ':' . $elem['line'];
}
if (!is_array(self::$_cge_cache_keys)) {
self::$_cge_cache_keys = array();
self::$_cge_cache_keystack = array();
}
$nn = '';
while ($nn == '' || $nn < 100) {
$keyr = 'v' . md5(serialize($bt) . cms_utils::get_current_pageid() . cge_url::current_url());
$key = $keyr . $nn;
if (!in_array($key, self::$_cge_cache_keys)) {
break;
}
if ($nn == '') {
$nn = 1;
}
$nn = $nn++;
}
if ($key == '') {
return '{';
}
self::$_cge_cache_keys[] = $key;
self::$_cge_cache_keystack[] = $key;
$output = "\${$key}=cms_cache_handler::get_instance()->get('{$key}','cge_cache'); if(\${$key}!=''){echo '<!--cge_cache-->'.\${$key};}else{ob_start();";
return $output;
}
示例2: cmsms
# The projects homepage is: cmsmadesimple.org
# Version: 0.9.4
# File : event.Core.ContentPostRender.php
# Purpose: manages expiration of a page
# License: GPL
#
#-------------------------------------------------------------------------------
if (!function_exists('cmsms') || !is_object(cmsms())) {
exit;
}
if ($this->GetPreference('use_advanced_pageoptions', 0)) {
$config = cmsms()->GetConfig();
$redirect = false;
$db =& $this->GetDb();
# get all content of type advanced content that need to be set to active/inactive
$query = "SELECT C.content_id\r\n\t\tFROM " . cms_db_prefix() . "content C\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props USE_EXP\r\n\t\t\tON USE_EXP.content_id = C.content_id\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props START_DATE\r\n\t\t\tON START_DATE.content_id = C.content_id\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props END_DATE\r\n\t\t\tON END_DATE.content_id = C.content_id\r\n\t\tWHERE\r\n\t\t\tC.type = ? AND\r\n\t\t\tUSE_EXP.prop_name = ? AND\r\n\t\t\tUSE_EXP.content = ? AND (\r\n\t\t\t\t(\r\n\t\t\t\t\tSTART_DATE.prop_name = ? AND\r\n\t\t\t\t\tSTART_DATE.content <= ? AND\r\n\t\t\t\t\tEND_DATE.prop_name = ? AND\r\n\t\t\t\t\tEND_DATE.content > ? AND\r\n\t\t\t\t\tC.active = ?\r\n\t\t\t\t)\r\n\t\t\t\tOR\r\n\t\t\t\t(\r\n\t\t\t\t\tEND_DATE.prop_name = ? AND\r\n\t\t\t\t\tEND_DATE.content <= ? AND\r\n\t\t\t\t\tC.active = ?\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t";
$dbresult = $db->Execute($query, array('advanced_content', 'use_expire_date', '1', 'start_date', time(), 'end_date', time(), 0, 'end_date', time(), 1));
$contentops =& cmsms()->GetContentOperations();
while ($dbresult && ($row = $dbresult->FetchRow())) {
$content_obj = $contentops->LoadContentFromAlias($row['content_id']);
$content_obj->SetActive(!$content_obj->Active());
$content_obj->Save();
if ($row['content_id'] == cms_utils::get_current_pageid()) {
$redirect = $row['content_id'];
}
}
if ($redirect) {
$params['content'] = '';
$this->RedirectContent($redirect);
}
}
示例3: cmsms
$config = cmsms()->GetConfig();
$redirect = false;
$db =& $this->GetDb();
# get all content of type advanced that need to be set to active/inactive
$query = "SELECT C.content_id, C.active\r\n\t\tFROM " . cms_db_prefix() . "content C\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props USE_EXP\r\n\t\t\tON USE_EXP.content_id = C.content_id\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props START_DATE\r\n\t\t\tON START_DATE.content_id = C.content_id\r\n\t\tLEFT JOIN " . cms_db_prefix() . "content_props END_DATE\r\n\t\t\tON END_DATE.content_id = C.content_id\r\n\t\tWHERE\r\n\t\t\tC.type = ? AND\r\n\t\t\tUSE_EXP.prop_name = ? AND\r\n\t\t\tUSE_EXP.content = ? AND (\r\n\t\t\t\t(\r\n\t\t\t\t\tSTART_DATE.prop_name = ? AND\r\n\t\t\t\t\tSTART_DATE.content <= ? AND\r\n\t\t\t\t\tEND_DATE.prop_name = ? AND\r\n\t\t\t\t\tEND_DATE.content > ? AND\r\n\t\t\t\t\tC.active = ?\r\n\t\t\t\t)\r\n\t\t\t\tOR\r\n\t\t\t\t(\r\n\t\t\t\t\tEND_DATE.prop_name = ? AND\r\n\t\t\t\t\tEND_DATE.content <= ? AND\r\n\t\t\t\t\tC.active = ?\r\n\t\t\t\t)\r\n\t\t\t)\r\n\t\t";
$dbresult = $db->Execute($query, array('content2', 'use_expire_date', '1', 'start_date', time(), 'end_date', time(), 0, 'end_date', time(), 1));
$contents = array();
while ($dbresult && ($row = $dbresult->FetchRow())) {
if ($row['active']) {
$contents[$row['content_id']] = 0;
} else {
$contents[$row['content_id']] = 1;
}
}
if (count($contents)) {
cms_content_cache::clear();
#$this->smarty->clear_all_cache();
$this->smarty->clear_compiled_tpl();
foreach ($contents as $contentId => $active) {
$query = "UPDATE " . cms_db_prefix() . "content\r\n\t\t\t\tSET active = ? WHERE content_id = ?";
$dbresult = $db->Execute($query, array($active, $contentId));
if ($contentId == cms_utils::get_current_pageid()) {
$redirect = $contentId;
}
}
}
if ($redirect) {
$params['content'] = '';
$this->RedirectContent($redirect);
}
}
示例4: cache_start
public static function cache_start($tag_arg, $smarty)
{
$output = '';
if (!cms_cache_handler::get_instance()->can_cache()) {
$output = '{';
} else {
$bt = debug_backtrace();
if (!is_array(self::$_cge_cache_keys)) {
self::$_cge_cache_keys = array();
self::$_cge_cache_keystack = array();
}
$nn = '';
while ($nn == '' || $nn < 100) {
$keyr = 'v' . md5(serialize($bt) . cms_utils::get_current_pageid() . cge_url::current_url());
$key = $keyr . $nn;
if (!in_array($key, self::$_cge_cache_keys)) {
break;
}
if ($nn == '') {
$nn = 1;
}
$nn = $nn++;
}
if ($key == '') {
return '{';
}
self::$_cge_cache_keys[] = $key;
self::$_cge_cache_keystack[] = $key;
$output = "\${$key}=cms_cache_handler::get_instance()->get('{$key}','cge_cache'); if(\${$key}!=''){echo '<!--cge_cache-->'.\${$key};}else{ob_start();";
}
if (version_compare(CMS_VERSION, '1.11-alpha0') < 0) {
return $output;
}
return '<?php ' . $output . ' ?>';
}
示例5: module_action_link
function module_action_link($params, &$smarty)
{
$gCms = cmsms();
$mid = 'm1_';
$inline = FALSE;
$module = $smarty->get_template_vars('nmodule');
if (!$module) {
$module = $smarty->get_template_vars('actionmodule');
}
$module = get_parameter_value($params, 'module', $module);
if (!$module) {
return;
}
unset($params['module']);
$obj = cms_utils::get_module($module);
if (!is_object($obj)) {
return;
}
$text = $module;
if (isset($params['text'])) {
$text = trim($params['text']);
unset($params['text']);
}
$title = '';
if (isset($params['title'])) {
$title = trim($params['title']);
unset($params['title']);
}
$confmessage = '';
if (isset($params['confmessage'])) {
$confmessage = trim($params['confmessage']);
unset($params['confmessage']);
}
$image = '';
if (isset($params['image'])) {
$image = trim($params['image']);
unset($params['image']);
}
$class = 'systemicon';
if (isset($params['class'])) {
$class = trim($params['class']);
unset($params['class']);
}
$action = 'default';
if (isset($params['action'])) {
$action = $params['action'];
unset($params['action']);
}
if (isset($params['id'])) {
$mid = $params['id'];
$inline = TRUE;
unset($params['id']);
}
$imageonly = false;
if (isset($params['imageonly'])) {
$imageonly = true;
unset($params['imageonly']);
}
$pageid = cms_utils::get_current_pageid();
if (isset($params['page'])) {
// convert the page alias to an id
$manager = $gCms->GetHierarchyManager();
$node = $manager->sureGetNodeByAlias($params['page']);
if (isset($node)) {
$content = $node->GetContent();
if (isset($content)) {
$pageid = $content->Id();
}
} else {
$node = $manager->sureGetNodeById($params['page']);
if (isset($node)) {
$pageid = $params['detailpage'];
}
}
unset($params['page']);
}
$urlonly = cge_utils::to_bool(cge_utils::get_param($params, 'urlonly', false));
if ($urlonly) {
$urlonly = true;
unset($params['urlonly']);
}
$jsfriendly = cge_utils::to_bool(cge_utils::get_param($params, 'jsfriendly', false));
if ($jsfriendly) {
$jsfriendly = true;
$urlonly = true;
unset($params['jsfriendly']);
}
$forjs = cge_utils::to_bool(cge_utils::get_param($params, 'forjs', false));
if ($forjs) {
$jsfriendly = true;
$urlonly = true;
unset($params['forjs']);
}
$forajax = cge_utils::to_bool(cge_utils::get_param($params, 'forajax', false));
if ($forajax) {
$jsfriendly = true;
$urlonly = true;
$forajax = true;
unset($params['forajax']);
}
//.........这里部分代码省略.........