代码中调用模板的部分有哪些呢?
ecshop 前台使用模板的代码,我就找到\includes\init.php 157-159行
$smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
$smarty->cache_dir = ROOT_PATH . 'templates/caches';
$smarty->compile_dir = ROOT_PATH . 'templates/compiled';
如果此时,$_CFG['template'] = 'green,joyo25';
$smarty->template_dir = ROOT_PATH . 'themes/' . $_CFG['template'];
改成
$tplArr = explode(',',$_CFG['template']);
$smarty->template_dir = ROOT_PATH . 'themes/' . $tplArr[0];
然后,清除缓存,刷新主页面,可以显示文字,图片啊(模板的)、CSS啊啥的都不能显示。。。
这是为什么啊?然道还有哪用到模板名称$_CFG['template']的么?
谁知道哈?麻烦指导一下。。。:handshake :) :Q 大家给点建议哈 :( 版主给你帮助一下吧,呵呵。 :Q :Q :handshake 再顶起。。。 贴一下您的网店地址 稍等下,我在本地弄的,现在挂到服务器上去,稍等下。。。 程序上传ing
刚才看了一下编译后的模板文件(complied/index.dwt.php),猛然发现:
<link href="themes/green,joyo25/style.css" rel="stylesheet" type="text/css" />
其中green,joyo25就是我当前变量$_CFG['template']
看了一下元神文件(themes/green/index.dwt):
<link href="style.css" rel="stylesheet" type="text/css" />
我在index.php里没有找到控制样式表名称的语句。。。:Q
页:
[1]
