本文整理汇总了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) {
// 没有找到这个记录
示例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');
示例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();
示例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')) {
示例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');
示例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);
示例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);
}
示例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 {
示例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');
示例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;
}
示例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');
示例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']);
示例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);
示例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) {
示例15: smarty_block_static
function smarty_block_static($params, $content, &$smarty, &$repeat)
{
cls_template::assign('STATIC', $content);
return '';
}