本文整理汇总了PHP中cls_template::assign方法的典型用法代码示例。如果您正苦于以下问题:PHP cls_template::assign方法的具体用法?PHP cls_template::assign怎么用?PHP cls_template::assign使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类cls_template
的用法示例。
在下文中一共展示了cls_template::assign方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: intval
@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) {
// 没有找到这个记录
setcookie($_COOKIE['ECSCP']['admin_id'], '', 1);
setcookie($_COOKIE['ECSCP']['admin_pass'], '', 1);
if (!empty($_REQUEST['is_ajax'])) {
make_json_error($_LANG['priv_error']);
} else {
// die("HTTP_REFERER2");
示例2: header
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');
} else {
$smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style.css');
}
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? htmlspecialchars($_GET['from']) : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;
$_SESSION['from_ad'] = $from_ad;
示例3: count
}
}
if ((DEBUG_MODE & 1) == 1) {
error_reporting(E_ALL);
} else {
error_reporting(E_ALL ^ E_NOTICE);
}
if ((DEBUG_MODE & 4) == 4) {
include ROOT_PATH . 'includes/lib.debug.php';
}
/* 判断是否支持gzip模式 */
if (gzip_enabled()) {
ob_start('ob_gzhandler');
}
/* wap头文件 */
//if (substr($_SERVER['SCRIPT_NAME'], strrpos($_SERVER['SCRIPT_NAME'], '/')) != '/user.php')
//{}
header("Content-Type:text/html; charset=utf-8");
if (empty($_CFG['wap_config'])) {
echo "<meta http-equiv='Content-Type' content='text/html; charset=utf-8' /><title>" . $GLOBALS['_CFG']['shop_name'] . "</title></head><body><p align='left'>对不起,{$_CFG['shop_name']}暂时没有开启手机购物功能</p></body></html>";
exit;
}
//20:56 2013-7-11
$GLOBALS['smarty']->assign('shop_name', $GLOBALS['_CFG']['shop_name']);
$GLOBALS['smarty']->assign('service_phone', $GLOBALS['_CFG']['service_phone']);
$GLOBALS['smarty']->assign('points_name', $GLOBALS['_CFG']['integral_name']);
$GLOBALS['smarty']->assign('use_integral', $GLOBALS['_CFG']['use_integral']);
$GLOBALS['smarty']->assign('site', get_domain());
if (isset($_SESSION['user_id']) && $_SESSION['user_id'] && isset($smarty)) {
$smarty->assign('bindusercardme', $db->getOne("select count(user_id) from " . $ecs->table("user_card") . " where user_id=" . $_SESSION['user_id']));
}
示例4: header
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')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? $_GET['from'] : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;
$_SESSION['from_ad'] = $from_ad;
// 用户点击的广告ID
$_SESSION['referer'] = stripslashes($site_name);
// 用户来源
unset($site_name);
if (!defined('INGORE_VISIT_STATS')) {
示例5: header
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');
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? htmlspecialchars($_GET['from']) : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;
$_SESSION['from_ad'] = $from_ad;
// 用户点击的广告ID
$_SESSION['referer'] = stripslashes($site_name);
// 用户来源
示例6: get_template
private function get_template()
{
global $_SGLOBAL, $_SC;
$this->get_ua();
if ($this->ua['is_pc'] || $this->ua['is_mac']) {
$this->template = $_SGLOBAL['db']->getone('select value from ' . tname('wz_weixin_setting') . ' where op_wxid=' . $this->token_info['op_wxid'] . ' and mid=' . $this->token_info['mid'] . ' and var="pc_template"');
} else {
$this->template = $_SGLOBAL['db']->getone('select value from ' . tname('wz_weixin_setting') . ' where op_wxid=' . $this->token_info['op_wxid'] . ' and mid=' . $this->token_info['mid'] . ' and var="mobile_template"');
}
if (!$this->template) {
$this->template = $this->module_info['module_default_template'];
}
header('Cache-control: private');
header('Content-type: text/html; charset=' . $_SC['charset']);
/* 创建 Smarty 对象。*/
include_once S_ROOT . './source/cls_template.php';
$smarty = new cls_template();
$smarty->cache_lifetime = 1;
//$_SCONFIG['cache_time'];
$smarty->template_dir = S_ROOT . './module/' . $this->module_info['module_dir'] . '/themes/' . $this->template;
$smarty->cache_dir = S_ROOT . './temp/caches';
$smarty->compile_dir = S_ROOT . './temp/compiled';
$smarty->compile_id = $this->module_info['module_dir'] . '_' . $this->weixin_info['op_uid'];
$smarty->direct_output = false;
$smarty->force_compile = false;
$smarty->assign('lang', $_SC['lang']);
$smarty->assign('charset', $_SC['charset']);
$this->smarty = $smarty;
}
示例7: getsiteurl
$_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);
session_save_path(S_ROOT . "./data/session_tmp");
session_start();
示例8: header
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');
} else {
$smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style.css');
}
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? $_GET['from'] : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;
$_SESSION['from_ad'] = $from_ad;
示例9:
}
//清理模板
clear_all_files();
/*end*/
$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');
} else {
$smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style.css');
}
$smarty->assign('css_path', 'themes/' . $_CFG['template'] . '/');
}
if (isset($smarty)) {
//print_r($_SESSION);
$GLOBALS['smarty']->assign('loogo', $_CFG['shop_logo']);
$GLOBALS['smarty']->assign('user', $_SESSION ? $_SESSION : '0');
$GLOBALS['smarty']->assign('is_store_user', $_SESSION['user_rank'] ? $_SESSION['user_rank'] : '0');
if ($_SESSION['user_rank']) {
$sql_rank_name = 'SELECT rank_name FROM ' . $ecs->table('user_rank') . " WHERE rank_id = " . $_SESSION['user_rank'];
示例10:
//加载语言包文件
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');
}
}
if (EC_CHARSET == 'gbk'){
if (file_exists(ROOT_PATH . 'plugins/zywx/languages/'.$_CFG['lang'].'/common_gbk.php'))
{
require( ROOT_PATH . 'plugins/zywx/languages/'.$_CFG['lang']. '/common_gbk.php');
}
}
!empty($_LANG) && $smarty->assign('lang', $_LANG);
$smarty->assign('img_dir', 'images');
/* 验证管理员身份 */
if((!isset($_SESSION['admin_id']) || intval($_SESSION['admin_id']) <=0) && !in_array($_REQUEST['act'],array('login','signin')) && !defined('NO_LOGIN'))
{
if (!empty($_REQUEST['is_ajax']))
{
make_json_error($_LANG['priv_error']);
}else
{
echo $_LANG['login_time_past'];
}
示例11: 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;
}
示例12: header
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');
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? htmlspecialchars($_GET['from']) : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;
$_SESSION['from_ad'] = $from_ad;
// 用户点击的广告ID
$_SESSION['referer'] = stripslashes($site_name);
// 用户来源
示例13: tname
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']);
}
$_SGLOBAL['login'] = false;
if (checkauth()) {
$_SGLOBAL['login'] = true;
$query = $_SGLOBAL['db']->query("select uid,fullname,username,email,mobile,state from " . tname("open_member") . " where uid=" . $_SGLOBAL['supe_uid']);
if ($rs = $_SGLOBAL['db']->fetch_array($query)) {
$_SGLOBAL['uid'] = $rs['uid'];
$_SGLOBAL['fullname'] = $rs['fullname'];
$_SGLOBAL['username'] = $rs['username'];
$_SGLOBAL['email'] = $rs['email'];
$_SGLOBAL['mobile'] = $rs['mobile'];
$_SGLOBAL['state'] = $rs['state'];
unset($rs);
}
示例14:
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);
if (!empty($_CFG['stylename'])) {
$smarty->assign('ectouch_css', 'themes/' . $_CFG['template'] . '/style_' . $_CFG['stylename'] . '.css');
} else {
$smarty->assign('ectouch_css', 'themes/' . $_CFG['template'] . '/style.css');
}
$smarty->assign('ectouch_themes', 'themes/' . $_CFG['template']);
$smarty->assign('site_url', $config['site_url']);
//不带/结尾
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
示例15: isset
@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);
}
$smarty->cache_dir = APP_ROOT_PATH . 'temp/caches';
$smarty->compile_dir = APP_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);
$smarty->assign('url', str_replace('app/', '', $ecs->url()));
if (!empty($_CFG['stylename'])) {
$smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style_' . $_CFG['stylename'] . '.css');
} else {
$smarty->assign('ecs_css_path', 'themes/' . $_CFG['template'] . '/style.css');
}
}
if (!defined('INIT_NO_USERS')) {
/* 会员信息 */
$user =& init_users();
if (!isset($_SESSION['user_id'])) {
/* 获取投放站点的名称 */
$site_name = isset($_GET['from']) ? $_GET['from'] : addslashes($_LANG['self_site']);
$from_ad = !empty($_GET['ad_id']) ? intval($_GET['ad_id']) : 0;