位置: 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

  • 已抵扣进项税转出是在哪个属期
  • 营业外收支的账务处理
  • 手机超过多少钱可以报警立案
  • 小规模纳税人报销会计分录
  • 忘记先抄税再申报了怎么办
  • 增值税采用零税率政策的内容
  • 材料折扣率
  • 境外公司付款给国内公司人民币
  • 企业每月纳税申报流程
  • 固定资产出售税务处理方法
  • 2020年资金账簿印花税最新规定
  • 无法读取金税盘时间版本怎么解决
  • win10应用商店变成英文怎么改成中文
  • 进货的运费怎么计算
  • 工资只发一半
  • win10永久激活码神key一周内
  • php文件可包含哪三部分代码
  • php数组函数实现机选双色球
  • win7如何禁用wifi
  • 补缴的耕地占用税怎么做账
  • 查补以前年度收入怎么做会计分录
  • 企业银行贷款利率2023
  • 计提本月固定资产折旧,其中车间折旧额1100
  • 【第三趴】uni-app页面搭建与路由配置(了解工程目录结构、学会搭建页面、配置路由并成功运行)
  • 企业购买预付卡怎么做账
  • 公司上市的好处
  • javaweb重点知识总结
  • rc远程桌面
  • vue-print-nb-jeecg
  • 分公司以总公司名义
  • 税务维护费抵扣分录
  • mysql 5.7特性
  • Ubuntu自启动U盘
  • 详解九章算法
  • mongodb subtract
  • 小微企业城建税及附加减免优惠
  • 企业之间支付的管理费指什么
  • 银行转账支付中是什么状态
  • 无法连接配置的sql服务器
  • 营改增之后账务怎么处理
  • 企业所得税本年累计
  • 总资产报酬率的公式
  • 商场扣点怎么做分录
  • 纳税检查企业多缴企业所得税如何处理
  • 发票还没认证可以报销吗
  • 出差补贴如何账务处理
  • 购买原材料无法准确划分用途的进项税额怎么抵扣
  • 房产经纪公司有哪些部门组成
  • 股东之间资金往来
  • 车辆购置税的会计科目怎么写
  • 开具红字增值税专用发票信息表需要盖章吗
  • 所有者权益的确认依赖于资产和负债的确认
  • 毛利体现的是什么
  • 有限公司能否申请银行存对支票
  • 混合销售行为的概念
  • 管理会计与核算会计的区别
  • SQL入侵恢复xp_cmdshell方法总结
  • 不同数据库之间的数据一同传递
  • jmeter怎么连接数据库
  • ubuntu14.04 LTS 下vsftpd安装与配置教程详解
  • bios屏蔽nvme
  • win8怎么玩帝国时代2
  • qclean.exe - qclean是什么进程 有什么用
  • win10桌面是什么样的
  • #pragma UNROLL 4
  • 那些年的我们什么意思
  • 了不起的女孩
  • unity摄像机范围
  • unityplayer安卓
  • hbuilderx打包app教程
  • unity给物体添加重力
  • js prototype constructor
  • python守护线程与非守护线程
  • js数组操作的常用方法有哪些
  • 广西国税发票查询系统
  • 电子税务局如何查询财务报表
  • 福州电动车怎么报废处理
  • 车船税单独交行吗
  • 微信申报缴税流程
  • 承租房变更承租人申请怎么写
  • 免责声明:网站部分图片文字素材来源于网络,如有侵权,请及时告知,我们会第一时间删除,谢谢! 邮箱:opceo@qq.com

    鄂ICP备2023003026号

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

    友情链接: 武汉网站建设