位置: IT常识 - 正文

织梦DEDECMS手机端生成静态页面方法(织梦使用教程)

编辑:rootadmin
实现手机端(wap版)静态生成

推荐整理分享织梦DEDECMS手机端生成静态页面方法(织梦使用教程),希望有所帮助,仅作参考,欢迎阅读内容。

文章相关热门搜索词:织梦cms不更新了吗,织梦cms怎么样,织梦使用手册,织梦使用手册,织梦使用手册,织梦手机端,织梦手机端,织梦手机端,内容如对您有帮助,希望把文章链接给更多的朋友!

一、添加后台导航栏目链接

1 打开dede/inc/inc_menu.php,在146行下面添加代码:<m:item name='更新WAP主页' link='makehtml_homepagewap.php' rank='sys_MakeHtml' target='main' /> <m:item name='更新WAP栏目' link='makehtml_listwap.php' rank='sys_MakeHtml' target='main' /> <m:item name='更新WAP文档' link='makehtml_archiveswap.php' rank='sys_MakeHtml' target='main' />

二、更新WAP主页

1.复制文件dede/makehtml_homepage.php,重命名为makehtml_homepagewap.php2.打开makehtml_homepagewap.php,找到最后一行

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

修改为

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

3.复制文件dede/templets/makehtml_homepage.htm,重命名为makehtml_homepagewap.htm

4打开dede/templets/makehtml_homepagewap.htm 修改21行

<form action="makehtml_homepage.php" method="post" name="form1" target="stafrm">

修改为

<form action="makehtml_homepagewap.php" method="post" name="form1" target="stafrm">

4.修改36行,指定生成WAP主页模板

<input name="templet" type="text" id="templet" style="width:300" value="default/wap.htm">

5.修改48行,指定生成WAP主页路径

<td height="20" valign="top" bgcolor="#FFFFFF"><input name="position" type="text" id="position" value="../m/index.html" size="30">

6.修改69~70行,“checked”移到“不保存当前选项”,系统默认是提交保存主页模板和路径数据的

<input name="saveset" type="radio" value="0" class="np" checked>

不保存当前选项

<input name="saveset" type="radio" class="np" value="1" >

保存当前选项

END

三、更新WAP栏目页

1.复制文件dede/makehtml_list.php,重命名为makehtml_listwap.php

2.打开makehtml_listwap.php,找到最后一行

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

修改为

include DedeInclude('templets/makehtml_listwap.htm');织梦DEDECMS手机端生成静态页面方法(织梦使用教程)

3.复制文件dede/templets/makehtml_list.htm 重命名为makehtml_listwap.htm ,修改第10行

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

修改为

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

4.复制dede/makehtml_list_action.php 重命名makehtml_listwap_action.php

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

修改为

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

5.复制include/arc.listview.class.php 重命名为arc.listwapview.class.php

if(!file_exists($tempfile)){$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_default.htm";}if(!file_exists($tempfile)||!is_file($tempfile)){echo "模板文件不存在,无法解析文档!";exit();}

替换为

为$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$GLOBALS['cfg_df_style']."/list_wap.htm";

修改栏目储存目录,在658-659行后面添加代码,生成的栏目文件保存在文件夹“m”下面

$typedir = MfTypedir('/m/'.$typedir);

修改

function GetMakeFileRule($typeid,$wname,$typedir,$defaultname,$namerule2){$typedir = MfTypedir('/m/'.$typedir);if($wname=='index')代码345-371行是把list第一页复制为首页index.html的,修改354行修改复制保存路径,在$this->Fields['typedir'])前面添加'/m/'. 如下面10行所示if($startpage==1){//如果列表启用封面文件,复制这个文件第一页if($this->TypeLink->TypeInfos['isdefault']==1&& $this->TypeLink->TypeInfos['ispart']==0){$onlyrule = $this->GetMakeFileRule($this->Fields['id'],"list",$this->Fields['typedir'],'',$this->Fields['namerule2']);$onlyrule = str_replace("{page}","1",$onlyrule);$list_1 = $this->GetTruePath().$onlyrule;$murl = MfTypedir('/m/'.$this->Fields['typedir']).'/'.$this->Fields['defaultname'];//如果启用远程发布则需要进行判断if($cfg_remote_site=='Y'&& $isremote == 1){//分析远程文件路径$remotefile = $murl;$localfile = '..'.$remotefile;$remotedir = preg_replace('/[^/]*.html/', '',$remotefile);//不相等则说明已经切换目录则可以创建镜像$this->ftp->rmkdir($remotedir);$this->ftp->upload($localfile, $remotefile, 'acii');}$indexname = $this->GetTruePath().$murl;copy($list_1,$indexname);}}return $murl;}

四、更新WAP文档

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

免责

本文链接地址:https://www.jiuchutong.com/zhishi/313033.html 转载请保留说明!

上一篇:phpcms如何关联连接?(怎么连接php)

下一篇:解决Dede5.6联动类型更改排序数字的BUG

  • 个税返还手续费增值税申报填在哪里
  • 平均税额怎么算
  • 企业对外投资收益税收
  • 银行账户利息怎么记账
  • 集装箱维护是做什么的
  • 滴滴上开的发票是增值税发票还是普通发票
  • 反写了可以重新申报吗
  • 金税维护费申报表
  • 进项税抵扣销项税怎么做账
  • 没收不还
  • 银行收费错误当天怎么办
  • 其他应付款跨年如何应对
  • 资本公积转增股本个人所得税
  • 企业安全生产费用提取标准 最新
  • 海关进口货物如何消杀
  • 管理费用中的水费电费在纳税申报表A104000
  • 房租开的专票怎么做账
  • 2018购房契税税率
  • 营改增房租增值税税率
  • 连年亏损的企业因为具有递延税金的优势
  • 1697508803
  • 企业季度所得税可以弥补以前年度亏损吗
  • 固定资产达到使用状态时发生的安装费用
  • 关税保险费计算方法
  • 任务栏图标重叠一起
  • 旅游业小规模差额计税的能开1%
  • .exe文件病毒
  • 安装费如何做账
  • 非限定性净资产年末怎么处理
  • 在公司发明的东西专利权归谁
  • 资产减值损失如何录入
  • 阿德莱德 景点
  • 美国大峡谷在哪儿
  • 小规模纳税人免税会计分录
  • 建设工程项目设计质量控制的内容
  • 京东到家的物流模式
  • oc底层原理
  • 集团对子公司拨款的规定
  • 销售折扣购物卡怎么做账
  • 工程项目过路费是指什么意思啊
  • 帝国cms真的很好用
  • {dede:channel type='son'}无栏目调用同级栏目
  • mysql null+1
  • 项目支出可以列支差旅费吗
  • 征地拆迁的费用可以作为资产吗
  • 基本社会保险制度范围
  • 劳务费怎么要的回来
  • 商业保理怎么账务处理?
  • 固定资产计提折旧的账务处理
  • 银行三证合一是哪三证
  • 事业单位零余额账户使用流程
  • 为什么说资产负债表是静态报表
  • 所有者权益类期末贷方余额公式
  • 会议费报销时应当提供哪些材料
  • 固定资产为什么不能直接计入费用
  • 固定资产一次性扣除申报表怎么填
  • 投资收益科目的借贷
  • 附表1是什么意思
  • 给别人的借款怎么记账
  • 新单位建账怎么做
  • 基本的select命令及作用
  • Mac无法连接到iCloud
  • pb程序是什么
  • regsvc32.exe - regsvc32是什么进程 有什么用
  • linux删除后恢复
  • win8开机启动项
  • w10自启
  • VMware Workstation虚拟机网络连接不可用
  • unity ar sdk
  • Android通过HttpURLConnection获取JSON并进行UI更新
  • python urljoin
  • javascript基础编程
  • node搭建项目
  • android 自定义dialog
  • centos6.5
  • bootstrap导航栏怎么居中
  • 税务局高风险是怎么办
  • 四川税务专管员查询
  • 西安市灵活就业社保缴费截止时间
  • 山东省国税局电话客服热线
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

    网站地图: 企业信息 工商信息 财税知识 网络常识 编程技术

    友情链接: 武汉网站建设