dede织梦手机端静态HTML生成之-移动静态文章页

overme5个月前 (10-17)网页设计267
以下分享织梦CMS手机移动文章页静态HTML生成方法:

1.复制dede/makehtml_archives.php 重命名为makehtml_archives_m.php

打开该文件,修改最后一行

将include DedeInclude(‘templets/makehtml_archives.htm’);

修改为

include DedeInclude(‘templets/makehtml_archives_m.htm’);

2.复制dede/templets/makehtml_archives.htm 重命名为makehtml_archives_m.htm

打开该文件,修改13行form action提交地址

<form name=”form1″ action=”makehtml_archives_action.php” method=”get” target=’stafrm’>

修改为

<form name=”form1″ action=”makehtml_archives_action_m.php” method=”get” target=’stafrm’>

3.复制dede/makehtml_archives_action.php 重命名为makehtml_archives_action_m.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

打开复制的文件,修改文章页储存位置,搜索function GetTruePath。

476行,站点真实路径后面添加”/m/”目录, 如下红色部分所示:

    function GetTruePath()

    {

        $TRUEpath = $GLOBALS[“cfg_basedir”].’/m/’;

        return $TRUEpath;

    }

修改模板文件位置,如果移动文章页使用同一个模板文件,可以屏蔽528-536行代码,后面添加唯一的模版文件路径,如下红色部分代码

/*  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_article_m.htm’;

如果希望移动文章模板跟随栏目设置变更,则不用屏蔽528-536行代码

ps.模板文件夹下,需要有PC模板加_m.htm的模板文件

$filetag = str_replace(‘.htm’,’_m.htm’,$filetag);

完成以上修改后,将有变更的文件上传到服务器对应目录,就可以登录网站后台,生成静态HTML文章页面了

发表评论

访客

看不清,换一张

◎欢迎参与讨论,请在这里发表您的看法和观点。