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


PHP cls_template类代码示例

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


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

示例1: basename

require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/log_action.php';
if (file_exists(ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF))) {
    include ROOT_PATH . 'languages/' . $_CFG['lang'] . '/admin/' . basename(PHP_SELF);
}
if (!file_exists('../temp/caches')) {
    @mkdir('../temp/caches', 0777);
    @chmod('../temp/caches', 0777);
}
if (!file_exists('../temp/compiled/' . GURADIAN_PATH)) {
    @mkdir('../temp/compiled/' . GURADIAN_PATH, 0777);
    @chmod('../temp/compiled/' . GURADIAN_PATH, 0777);
}
clearstatcache();
/* 创建 Smarty 对象。*/
require ROOT_PATH . 'includes/cls_template.php';
$smarty = new cls_template();
$smarty->template_dir = ROOT_PATH . GURADIAN_PATH . '/templates';
$smarty->compile_dir = ROOT_PATH . 'temp/compiled/' . GURADIAN_PATH;
if ((DEBUG_MODE & 2) == 2) {
    $smarty->force_compile = true;
}
$smarty->assign('lang', $_LANG);
/* 验证管理员身份 */
if (!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) {
    /* session 不存在,检查cookie */
    if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass'])) {
        // 找到了cookie, 验证cookie信息
        $sql = 'SELECT * ' . ' FROM hteacher.ht_admin_user ' . " WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
        $row = $db->GetRow($sql);
        if (!$row) {
            // 没有找到这个记录
开发者ID:dalinhuang,项目名称:hteacher,代码行数:31,代码来源:init.php

示例2: cls_session

}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
    $smarty->cache_dir = ROOT_PATH . 'temp/caches';
    $smarty->compile_dir = ROOT_PATH . 'temp/compiled';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->assign('lang', $_LANG);
    $smarty->assign('ecs_charset', EC_CHARSET);
    if (!empty($_CFG['stylename'])) {
        $smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style_' . $_CFG['stylename'] . '.css');
开发者ID:nanhuacrab,项目名称:ecshop,代码行数:31,代码来源:init.php

示例3: cls_mysql

$yhcwebsite = "http://weixin.dream-gardens.com.cn/";
$yhctestdb = new cls_mysql("112.124.110.58", "root", "dream@sh123data", "yhctest");
/* 创建错误处理对象 */
$err = new ecs_error('message.dwt');
/* 载入系统参数 */
$_CFG = load_config();
/* 初始化session */
require ROOT_PATH . 'includes/cls_session.php';
$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ecsid');
define('SESS_ID', $sess->get_session_id());
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=utf-8');
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'mobile/templates';
    $smarty->cache_dir = ROOT_PATH . 'temp/caches';
    $smarty->compile_dir = ROOT_PATH . 'temp/compiled/mobile';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
}
if (!defined('INIT_NO_USERS')) {
    /* 会员信息 */
    $user =& init_users();
开发者ID:naliduo,项目名称:ecshop,代码行数:31,代码来源:init.php

示例4: array

        }
    }
    $_SESSION = array();
}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
    $smarty->cache_dir = ROOT_PATH . 'temp/caches';
    $smarty->compile_dir = ROOT_PATH . 'temp/compiled';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->assign('lang', $_LANG);
    $smarty->assign('ecs_charset', EC_CHARSET);
}
if (!defined('INIT_NO_USERS')) {
开发者ID:BGCX261,项目名称:zishashop-svn-to-git,代码行数:31,代码来源:init.php

示例5: cls_session

/* 载入语言文件 */
require ROOT_PATH . 'languages/' . $_CFG['lang'] . '/common.php';
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
    $smarty->cache_dir = ROOT_PATH . 'temp/caches';
    $smarty->compile_dir = ROOT_PATH . 'temp/compiled';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->assign('lang', $_LANG);
    $smarty->assign('hhs_charset', EC_CHARSET);
    $smarty->assign('hhs_css_path', 'themes/' . $_CFG['template'] . '/css');
    $smarty->assign('hhs_img_path', 'themes/' . $_CFG['template'] . '/images');
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:init2.php

示例6: explode

//时间
$mtime = explode(' ', microtime());
$_SGLOBAL['timestamp'] = $mtime[1];
$_SGLOBAL['supe_starttime'] = $_SGLOBAL['timestamp'] + $mtime[0];
//本站URL
if (empty($_SC['siteurl'])) {
    $_SC['siteurl'] = getsiteurl();
}
//链接数据库
dbconnect();
$_SCONFIG['template'] = 'base';
header('Cache-control: private');
header('Content-type: text/html; charset=' . $_SC['charset']);
/* 创建 Smarty 对象。*/
require S_ROOT . './source/cls_template.php';
$smarty = new cls_template();
$smarty->cache_lifetime = 1;
//$_SCONFIG['cache_time'];
$smarty->template_dir = S_ROOT . './themes/' . $_SCONFIG['template'];
$smarty->cache_dir = S_ROOT . './temp/caches';
$smarty->compile_dir = S_ROOT . './temp/compiled';
$smarty->compile_id = $_SCONFIG['template'];
$smarty->direct_output = false;
$smarty->force_compile = false;
$smarty->assign('lang', $_SC['lang']);
$smarty->assign('charset', $_SC['charset']);
//版本
include_once S_ROOT . './version.php';
$smarty->assign('template_path', './themes/' . $_SCONFIG['template']);
$smarty->assign('_SC', $_SC);
$smarty->assign('_SGLOBAL', $_SGLOBAL);
开发者ID:hugolong,项目名称:weixiao,代码行数:31,代码来源:common.php

示例7: cls_session

}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = APP_ROOT_PATH . 'themes/default';
    //$smarty->template_dir   = ROOT_PATH . 'themes/' . $_CFG['template'];
    if (!file_exists(APP_ROOT_PATH . 'temp')) {
        @mkdir(APP_ROOT_PATH . 'temp', 0777);
        @chmod(APP_ROOT_PATH . 'temp', 0777);
    }
    if (!file_exists(APP_ROOT_PATH . 'temp/caches')) {
        @mkdir(APP_ROOT_PATH . 'temp/caches', 0777);
        @chmod(APP_ROOT_PATH . 'temp/caches', 0777);
    }
    if (!file_exists(APP_ROOT_PATH . 'temp/compiled')) {
        @mkdir(APP_ROOT_PATH . 'temp/compiled', 0777);
        @chmod(APP_ROOT_PATH . 'temp/compiled', 0777);
    }
开发者ID:firsteam,项目名称:falcons,代码行数:31,代码来源:init.php

示例8: cls_session

}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    /*获取代理商关联user_id add by hg for date 2014-04-01*/
    $agency_where = agency_goods();
    $agency_user_id_arr = explode(' ', $agency_where);
    $agency_user_id = $agency_user_id_arr[2];
    if ($agency_user_id) {
        $user_tpl = $db->getRow("select agency_template from " . $ecs->table('admin_user') . " where agency_user_id = {$agency_user_id}");
    } else {
        $user_tpl = $db->getRow("select agency_template from " . $ecs->table('admin_user') . " where agency_user_id is null or action_list = 'all'");
    }
    if (!empty($user_tpl['agency_template'])) {
        //反序列化
        $user_tpl = unserialize($user_tpl['agency_template']);
        $_CFG['template'] = $user_tpl['tpl_name'];
        $_CFG['stylename'] = $user_tpl['tpl_fg'];
    } else {
开发者ID:dlpc,项目名称:ecshop,代码行数:31,代码来源:init.php

示例9: cls_session

	/* 初始化session */
	require(ROOT_PATH . 'includes/cls_session.php');
	$sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'), 'ECSCP_ID');

	/*初始化action*/
	if(!isset($_REQUEST['act']))
	{
		$_REQUEST['act'] = '';
	}

	/*载入系统参数*/
	$_CFG = load_config();

    /* 创建 Smarty 对象。*/
	require(ROOT_PATH . 'includes/cls_template.php');
	$smarty = new cls_template;

	$smarty->template_dir  = ROOT_PATH . 'plugins/zywx/templates';
	$smarty->compile_dir   = ROOT_PATH . 'temp/compiled/admin';
	if ((DEBUG_MODE & 2) == 2)
	{
		$smarty->force_compile = true;
	}

	
	//加载语言包文件
	require(ROOT_PATH . 'languages/' .$_CFG['lang']. '/admin/common.php');
	if (EC_CHARSET == 'utf-8'){
		if (file_exists(ROOT_PATH . 'plugins/zywx/languages/'.$_CFG['lang'].'/common.php'))
		{
			require(  ROOT_PATH . 'plugins/zywx/languages/'.$_CFG['lang']. '/common.php');
开发者ID:noikiy,项目名称:mdwp,代码行数:31,代码来源:init.php

示例10: template

function template($module, $weixin)
{
    global $_SC;
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . $_SC['charset']);
    /* 创建 Smarty 对象。*/
    require S_ROOT . './source/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = 1;
    //$_SCONFIG['cache_time'];
    $smarty->template_dir = S_ROOT . './module/' . $module['module_dir'] . '/themes/' . $module['module_template'];
    $smarty->cache_dir = S_ROOT . './temp/caches';
    $smarty->compile_dir = S_ROOT . './temp/compiled';
    $smarty->compile_id = $module['module_dir'] . '_' . $weixin['op_uid'];
    $smarty->direct_output = false;
    $smarty->force_compile = false;
    $smarty->assign('lang', $_SC['lang']);
    $smarty->assign('charset', $_SC['charset']);
    return $smarty;
}
开发者ID:hugolong,项目名称:weixiao,代码行数:20,代码来源:function_weizhan.php

示例11: cls_session

}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'includes/cls_session.php';
    $sess = new cls_session($db, $hhs->table('sessions'), $hhs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。*/
    require ROOT_PATH . 'includes/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
    $smarty->cache_dir = ROOT_PATH . 'temp/caches';
    $smarty->compile_dir = ROOT_PATH . 'temp/compiled';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->assign('lang', $_LANG);
    $smarty->assign('hhs_charset', EC_CHARSET);
    $smarty->assign('hhs_css_path', 'themes/' . $_CFG['template'] . '/css');
    $smarty->assign('hhs_img_path', 'themes/' . $_CFG['template'] . '/images');
开发者ID:shiruolin,项目名称:hzzshop,代码行数:31,代码来源:init.php

示例12: strripos

//判断是否Android;
$is_pc = strripos($_SERVER["HTTP_USER_AGENT"], 'windows nt');
//判断是否为(pc)电脑
$is_ucweb = strripos($_SERVER["HTTP_USER_AGENT"], 'UCWEB');
//判断是否为UC极速模式
if ($is_pc) {
    $_SCONFIG['template'] = 'pc';
} else {
    $_SCONFIG['template'] = 'pc';
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . $_SC['charset']);
    /* 创建 Smarty 对象。*/
    require S_ROOT . './source/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = 1;
    //$_SCONFIG['cache_time'];
    $smarty->template_dir = S_ROOT . './themes/' . $_SCONFIG['template'];
    $smarty->cache_dir = S_ROOT . './temp/caches';
    $smarty->compile_dir = S_ROOT . './temp/compiled';
    $smarty->compile_id = $_SCONFIG['template'];
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->assign('lang', $_SC['lang']);
    $smarty->assign('charset', $_SC['charset']);
开发者ID:hugolong,项目名称:weixiao,代码行数:31,代码来源:common.php

示例13: cls_session

}
if (!defined('INIT_NO_USERS')) {
    /* 初始化session */
    include ROOT_PATH . 'include/cls_session.php';
    $sess = new cls_session($db, $ecs->table('sessions'), $ecs->table('sessions_data'));
    define('SESS_ID', $sess->get_session_id());
}
if (isset($_SERVER['PHP_SELF'])) {
    $_SERVER['PHP_SELF'] = htmlspecialchars($_SERVER['PHP_SELF']);
}
if (!defined('INIT_NO_SMARTY')) {
    header('Cache-control: private');
    header('Content-type: text/html; charset=' . EC_CHARSET);
    /* 创建 Smarty 对象。 */
    require ROOT_PATH . 'include/cls_template.php';
    $smarty = new cls_template();
    $smarty->cache_lifetime = $_CFG['cache_time'];
    $smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
    $smarty->cache_dir = ROOT_PATH . 'data/caches';
    $smarty->compile_dir = ROOT_PATH . 'data/compiled';
    if ((DEBUG_MODE & 2) == 2) {
        $smarty->direct_output = true;
        $smarty->force_compile = true;
    } else {
        $smarty->direct_output = false;
        $smarty->force_compile = false;
    }
    $smarty->direct_output = false;
    $smarty->force_compile = false;
    $smarty->assign('lang', $_LANG);
    $smarty->assign('ecs_charset', EC_CHARSET);
开发者ID:seanguo166,项目名称:microdistribution,代码行数:31,代码来源:init.php

示例14: clearstatcache

if (!file_exists('../temp/caches')) {
    @mkdir('../temp/caches', 0777);
    @chmod('../temp/caches', 0777);
}
if (!file_exists('../temp/compiled/admin')) {
    @mkdir('../temp/compiled/admin', 0777);
    @chmod('../temp/compiled/admin', 0777);
}
clearstatcache();
/* 如果有新版本,升级 */
if (!isset($_CFG['ecs_version'])) {
    $_CFG['ecs_version'] = 'v2.0.5';
}
/* 创建 Smarty 对象。*/
require ROOT_PATH . 'includes/cls_template.php';
$smarty = new cls_template();
$smarty->template_dir = ROOT_PATH . ADMIN_PATH . '/templates';
$smarty->compile_dir = ROOT_PATH . 'temp/compiled/admin';
if ((DEBUG_MODE & 2) == 2) {
    $smarty->force_compile = true;
}
$smarty->assign('lang', $_LANG);
$smarty->assign('help_open', $_CFG['help_open']);
/* 验证管理员身份 */
if (!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <= 0) {
    /* session 不存在,检查cookie */
    if (!empty($_COOKIE['ECSCP']['admin_id']) && !empty($_COOKIE['ECSCP']['admin_pass'])) {
        // 找到了cookie, 验证cookie信息
        $sql = 'SELECT * ' . ' FROM ' . $ecs->table('admin_user') . " WHERE user_id = '" . intval($_COOKIE['ECSCP']['admin_id']) . "'";
        $row = $db->GetRow($sql);
        if (!$row) {
开发者ID:dalinhuang,项目名称:hteacher,代码行数:31,代码来源:init.php

示例15: smarty_block_static

function smarty_block_static($params, $content, &$smarty, &$repeat)
{
    cls_template::assign('STATIC', $content);
    return '';
}
开发者ID:Zniel,项目名称:fl_crtlpanel_self_dev,代码行数:5,代码来源:block.static.php


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