DEDE留言板调用导航的方法 DEDE插件模板标签解析

第一步:打开"/include/common.func.php",该文件5.6版本默认存在,5.5的不存在自己建一个。
 
然后在该文件中加入一个函数,代码如下:
 
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();
  $dtp->SetTemplet($tmpfile);
  $dtp->Display();
}
function pasterTempletDiy2($path)
{
  require_once(DEDEINC."/arc.partview.class.php");
  global $cfg_basedir,$cfg_templets_dir;
  $tmpfile = $cfg_basedir.$cfg_templets_dir."/".$path;//模版文件的路径
  $dtp = new PartView();
  $dtp->SetTemplet($tmpfile);
  $temstr = $dtp->GetResult();
  return $temstr;
}
 
第二步,打开留言本的模版文件,默认的是/templets/plus/guestbook.htm
 
 
 
用以下代码替换原因的调用头部代码
<?php
   pasterTempletDiy("/head.htm");
?>
 
其他的同理
 
5.7版本上的调用
 
if ( ! function_exists('pasterTempletDiy'))
{
function pasterTempletDiy($path)
{
  require_once(DEDEINC."/arc.partview.class.php");
  global $cfg_basedir,$cfg_templets_dir,$cfg_df_style;
  $tmpfile = $cfg_basedir.$cfg_templets_dir."/".$cfg_df_style."/".$path;//模版文件的路径
  $dtp = new PartView();
  $dtp->SetTemplet($tmpfile);
  $dtp->Display();
}
}