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


PHP cms_utils::get_current_pageid方法代码示例

本文整理汇总了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;
 }
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:34,代码来源:class.cge_smarty_plugins.php

示例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);
    }
}
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:31,代码来源:event.Core.ContentPostRender.php

示例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);
    }
}
开发者ID:aldrymaulana,项目名称:cmsdepdagri,代码行数:31,代码来源:event.Core.ContentPostRender.php

示例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 . ' ?>';
 }
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:35,代码来源:class.cge_smarty_plugins.php

示例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']);
    }
//.........这里部分代码省略.........
开发者ID:rainbow-studio,项目名称:cmsms,代码行数:101,代码来源:function.module_action.php


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