织梦DEDECMS留言板调用模板头部及底部的方法
第一步: 打开"/include/common.func.php"
然后在该文件中加入一个函数,代码如下:
function pasterTempletDiy( $path ) { require_once (DEDEINC. "/arc.partview.class.php" ); global $cfg_basedir , $cfg_templets_dir ; $tmpfile = $cfg_basedir . $cfg_templets_dir . "/" . $path ; //模版文件的路径 $dtp = new PartView(); //phpfensi.com $dtp ->SetTemplet( $tmpfile ); $dtp ->Display(); }第二步 :打开留言本的模版文件,默认的是/templets/plus/guestbook.htm,用以下代码替换原来的调用头部代码.
<?php pasterTempletDiy( "default/head.htm" ); ?>>这里的default是默认的模板路径,如果你使用的其他的模板,注意修改这里的default,同理,用以下代码替换原因的调用底部代码:
<?php pasterTempletDiy( "default/footer.htm" ); ?>这样就可以直接使用系统的head、footer模板了,按这个方法,可实现.
查看更多关于织梦DEDECMS留言板调用模板头部及底部的方法 -的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did5654