织梦DEDECMS手机端生成静态页面方法(2)

1.复制dede/makehtml_archives.php 重命名为makehtml_archiveswap.php 修改最后一行

include DedeInclude('templets/makehtml_archives.htm');  

修改为

include DedeInclude('templets/makehtml_archiveswap.htm');  

2.复制dede/templets/makehtml_archives.htm 重命名为makehtml_archiveswap.htm 修改13行form提交地址

<form name="form1" action="makehtml_archives_action.php" method="get" target='stafrm'>  

修改为

<form name="form1" action="makehtml_archiveswap_action.php" method="get" target='stafrm'>  

3.复制dede/makehtml_archives_action.php 重命名为makehtml_archiveswap_action.php 修改13行 

require_once(DEDEINC."/arc.archives.class.php");

修改为

require_once(DEDEINC."/arc.archiveswap.class.php");

4.复制include/arc.archives.class.php 重命名为arc.archiveswap.class.php修改文章页储存位置,476行,站点真实路径后面添加"/m/" 如下第9行所示:

修改获得模板文件位置,屏蔽528-536行代码,后面添加调用模版路径 function GetTruePath() { $TRUEpath = $GLOBALS["cfg_basedir"].'/m/'; return $TRUEpath; }  


/* if(!empty($this->Fields['templet'])) { $filetag = MfTemplet($this->Fields['templet']); if( !preg_match("#/#", $filetag) ) $filetag = $GLOBALS['cfg_df_style'].'/'.$filetag; } else { $filetag = MfTemplet($this->TypeLink->TypeInfos["temparticle"]); }*/ $filetag = $GLOBALS['cfg_df_style'].'/'.'article_wap.htm';  

是将上面的代码注释掉

注意事项

DEDEcms手机目录是m

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/09b1d371691f09f23cf2a0d5dd2c173c.html