织梦手机站静态源码链接地址是静态页地址为什么不跳转到html文件而调到动态地址

DEDECMS使之动态地址成为静态地址
我的图书馆
DEDECMS使之动态地址成为静态地址
/include/helpers/channelunit.helper.php&&161行,//alter使之动态地址成为静态地址global&$&&&&&&&&$flag&=&$dsql-&GetOne("select&*&from&`#@__archives`&where&id&=&$");&&&&&&&&$flag&=&$flag['flag'];&&&&&&&&if(preg_match("/j/",$flag)){&&&&&&&&&$addontable&=&$dsql-&GetOne("select&art.id,cht.addtable&from&`#@__arctype`&art&left&join&`#@__channeltype`&cht&on&art.channeltype&=&cht.id&where&art.id&=&$typeid");&&&&&&&&&$addtable&=&$addontable['addtable'];&&&&&&&&&$GoUrl&=&$dsql-&GetOne("select&redirecturl&from&$addtable&where&aid&=&$aid");&&&&&&&&&$redirecturl&=&$GoUrl['redirecturl'];&&&&&&&&&if($redirecturl&!=&''){&&&&&&&&&return&$&&&&&&&&&}&&&&&&&&}修改的文件路径:如下图所示:修改channelunit.helper.php这个文件的源点:如下图所示:织梦里面添加文章,有时候会涉及到专题跳转链接,一般调出来的是动态地址,使之改成静态的地址,更改以上PHP文件代码可实现;
TA的最新馆藏[转]&[转]&dedecms织梦系统生成wap手机版静态页完整版
dedecms织梦系统生成wap手机版静态页完整版。 打开include目录下的common.inc.php,在26行加入代码: define(DEDEWAPPATH,/wap);//生成手机版静态页目录 define(DEDEWAPTEMPLATESPATH,/wap/);//手机版模板目录
dedecms织梦系统生成wap手机版静态页完整版。
打开include目录下的common.inc.php,在26行加入代码:
define('DEDEWAPPATH','/wap');//生成手机版静态页目录
define('DEDEWAPTEMPLATESPATH','/wap/');//手机版模板目录templets
首先创建手机版的文章模板,这里自己创建,跟其他模板一样,不过保存路径/templets/wap/article_article.htm
首先找到include目录下的arc.archives.class.php,修改文件前最好备份一下,找到函数function MakeHtml($isremote=0),函数最后一行代码438行修改一如下:
$returl=$this-&GetTrueUrl($filename);
$this-&MakeWapHtml($isremote);
& & & & return $
在442行增加函数代码
function MakeWapHtml($isremote=0)
global $cfg_df_style,$cfg_
$tempfile = $this-&GetTempletFile();
$tempfile = str_replace('/' . $cfg_df_style . '/',DEDEWAPTEMPLATESPATH,$tempfile);
& & & & & & if(!file_exists($tempfile) || !is_file($tempfile))
& & & & & & {
& & & & & & }else{
& & & & global $cfg_remote_site,$fileF
& & & & if($this-&IsError)
& & & & & & return '';
& & & & $this-&Fields[&displaytype&] = &st&;
& & & & //预编译$th
& & & & $this-&dtp-&LoadTemplate($tempfile);
& & & & $this-&TempSource = $this-&dtp-&SourceS
& & & & $this-&ParAddTable();
& & & & $this-&ParseTempletsFirst();
& & & & $this-&Fields['senddate'] = empty($this-&Fields['senddate'])? '' : $this-&Fields['senddate'];
& & & & $this-&Fields['title'] = empty($this-&Fields['title'])? '' : $this-&Fields['title'];
& & & & $this-&Fields['arcrank'] = empty($this-&Fields['arcrank'])? 0 : $this-&Fields['arcrank'];
& & & & $this-&Fields['ismake'] = empty($this-&Fields['ismake'])? 0 : $this-&Fields['ismake'];
& & & & $this-&Fields['money'] = empty($this-&Fields['money'])? 0 : $this-&Fields['money'];
& & & & $this-&Fields['filename'] = empty($this-&Fields['filename'])? '' : $this-&Fields['filename'];
& & & & //分析要创建的文件名称
& & & & $filename = GetFileNewName(
& & & & & & $this-&ArcID,$this-&Fields['typeid'],$this-&Fields['senddate'],
& & & & & & $this-&Fields['title'],$this-&Fields['ismake'],$this-&Fields['arcrank'],
& & & & & & $this-&TypeLink-&TypeInfos['namerule'],$this-&TypeLink-&TypeInfos['typedir'],$this-&Fields['money'],$this-&Fields['filename']
& & & & );
& & & & $filename=str_replace($cfg_arcdir .'/',DEDEWAPPATH .'/',$filename);
& & & & $filenames &= explode(&.&, $filename);
& & & & $this-&ShortName = $filenames[count($filenames)-1];
& & & & if($this-&ShortName=='') $this-&ShortName = 'html';
& & & & $fileFirst = preg_replace(&/\.&.$this-&ShortName.&$/i&, &&, $filename);
& & & & $this-&Fields['namehand'] = basename($fileFirst);
& & & & $filenames &= explode(&/&, $filename);
& & & & $this-&NameFirst = preg_replace(&/\.&.$this-&ShortName.&$/i&, &&, $filenames[count($filenames)-1]);
& & & & if($this-&NameFirst=='')
& & & & & & $this-&NameFirst = $this-&arcID;
& & & & //获得当前文档的全名
& & & & $filenameFull = GetFileUrl(
& & & & & & $this-&ArcID,$this-&Fields['typeid'],$this-&Fields[&senddate&],
& & & & & & $this-&Fields[&title&],$this-&Fields[&ismake&],
& & & & & & $this-&Fields[&arcrank&],$this-&TypeLink-&TypeInfos['namerule'],$this-&TypeLink-&TypeInfos['typedir'],$this-&Fields[&money&],$this-&Fields['filename'],
& & & & & & $this-&TypeLink-&TypeInfos['moresite'],$this-&TypeLink-&TypeInfos['siteurl'],$this-&TypeLink-&TypeInfos['sitepath']
& & & & );
& & & & $this-&Fields['arcurl'] = $this-&Fields['fullname'] = $filenameF
& & & & //对于已设置不生成HTML的文章直接返回网址
& & & & if($this-&Fields['ismake']==-1 || $this-&Fields['arcrank']!=0 || $this-&Fields['money']&0&
& & & & & &|| ($this-&Fields['typeid']==0 && $this-&Fields['channel'] != -1) )
& & & & & & return $this-&GetTrueUrl($filename);
& & & & //循环生成HTML文件
& & & & else
& & & & & & for($i=1;$i&=$this-&TotalP$i++)
& & & & & & {
& & & & & & & & if($this-&TotalPage & 1) {
& & & & & & & & & & $this-&Fields['tmptitle'] = (empty($this-&Fields['tmptitle']) ? $this-&Fields['title'] : $this-&Fields['tmptitle']);
& & & & & & & & & & if($i&1) $this-&Fields['title'] = $this-&Fields['tmptitle'].&($i)&;
& & & & & & & & }
& & & & & & & & if($i&1)
& & & & & & & & {
& & & & & & & & & & $TRUEfilename = $this-&GetTruePath().$fileFirst.&_&.$i.&.&.$this-&ShortN
& & & & & & & & }
& & & & & & & & else
& & & & & & & & {
& & & & & & & & & & $TRUEfilename = $this-&GetTruePath().$
& & & & & & & & }
& & & & & & & & $this-&ParseDMFields($i,1);
if(!is_dir(dirname($TRUEfilename))) {
& & mkdir(dirname($TRUEfilename), 0777, true);
& & & & & & & & $this-&dtp-&SaveTo($TRUEfilename);
& & & & & & & & //如果启用远程发布则需要进行判断
& & & & & & & & if($cfg_remote_site=='Y' && $isremote == 1)
& & & & & & & & {
& & & & & &&
& & & & & & & & & & //分析远程文件路径
& & & & & & & & & & $remotefile = str_replace(DEDEROOT, '', $TRUEfilename);
& & & & & & & & & & $localfile = '..'.$
& & & & & & & & & & //创建远程文件夹
& & & & & & & & & & $remotedir = preg_replace(&#[^\/]*\.html#&, '', $remotefile);
& & & & & & & & & & $this-&ftp-&rmkdir($remotedir);
& & & & & & & & & & $this-&ftp-&upload($localfile, $remotefile, 'ascii');
& & & & & & & & }
& & & & & & }
$this-&TempSource=='';
wap模板中调用头部和底部文件需要修改
找到include目录文件dedetag.class.php中大概1013行的函数
function IncludeFile
return &无法在这个位置找到: $filename&;
else if(file_exists(DEDEROOT.'/templets'.DEDEWAPTEMPLATESPATH.$filename) )
$okfile = DEDEROOT.'/templets'.DEDEWAPTEMPLATESPATH.$
注意wap模板的头文件不要与pc头文件名相同,如用wap_header.htm和wap_footer.htm
栏目页生成html
首先找到include目录下的arc.listview.class.php,修改文件前最好备份一下,找到143行function CountRecord
给函数加一个参数修改成&&function CountRecord($iswap=0)
并在函数中229行 if(!file_exists($tempfile))前加入代码
if($iswap==1){
$tempfile = str_replace('/'.$GLOBALS['cfg_df_style'].'/',DEDEWAPTEMPLATESPATH,$tempfile);
function MakeHtml($startpage=1, $makepagesize=0, $isremote=0)
把最后面373行
& return $修改成
$this-&MakeWapHtml($startpage, $makepagesize, $isremote);
& & & & return $
377行添加函数MakeWapHtml
function MakeWapHtml($startpage=1, $makepagesize=0, $isremote=0)
& & & & global $cfg_remote_site,$cfg_
& & & & if(empty($startpage))
& & & & & & $startpage = 1;
& & & & //创建封面模板文件
& & & & if($this-&TypeLink-&TypeInfos['isdefault']==-1)
& & & & & & echo '这个类目是动态类目!';
& & & & & &// return '../plus/list.php?tid='.$this-&TypeLink-&TypeInfos['id'];
& & & & //单独页面
& & & & else if($this-&TypeLink-&TypeInfos['ispart']&0)
& & & & & & $reurl = $this-&MakePartTemplets();
& & & & & &// return $
& & & & $this-&CountRecord(1);
& & & & //初步给固定值的标记赋值
& & & & $this-&ParseTempletsFirst();
& & & & $totalpage = ceil($this-&TotalResult/$this-&PageSize);
& & & & if($totalpage==0)
& & & & & & $totalpage = 1;
& & & & CreateDir(MfTypedir($this-&Fields['typedir']));
& & & & $murl = '';
& & & & if($makepagesize & 0)
& & & & & & $endpage = $startpage+$
& & & & else
& & & & & & $endpage = ($totalpage+1);
& & & & if( $endpage &= $totalpage+1 )
& & & & & & $endpage = $totalpage+1;
& & & & if($endpage==1)
& & & & & & $endpage = 2;
& & & & for($this-&PageNo=$ $this-&PageNo & $ $this-&PageNo++)
& & & & & & $this-&ParseDMFields($this-&PageNo,1);
& & & & & & $makeFile = $this-&GetMakeFileRule($this-&Fields['id'],'list',$this-&Fields['typedir'],'',$this-&Fields['namerule2']);
& & & & & & $makeFile = str_replace(&{page}&, $this-&PageNo, $makeFile);
& & & & & & $murl = $makeF
& & & & & & if(!preg_match(&/^\//&, $makeFile))
& & & & & & {
& & & & & & & & $makeFile = &/&.$makeF
& & & & & & }
& & & & & & $makeFile = $this-&GetTruePath().$makeF
& & & & & & $makeFile = preg_replace(&/\/{1,}/&, &/&, $makeFile);
$makeFile=str_replace($cfg_arcdir.'/',DEDEWAPPATH . '/',$makeFile);
& & & & & & $murl = $this-&GetTrueUrl($murl);
if(!is_dir(dirname($makeFile))) {
& & mkdir(dirname($makeFile), 0777, true);
& & & & & & $this-&dtp-&SaveTo($makeFile);
& & & & & & //如果启用远程发布则需要进行判断
& & & & & & if($cfg_remote_site=='Y'&& $isremote == 1)
& & & & & & {
& & & & & & & & //分析远程文件路径
& & & & & & & & $remotefile = str_replace(DEDEROOT, '',$makeFile);
& & & & & & & & $localfile = '..'.$
& & & & & & & & $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile);
& & & & & & & & //不相等则说明已经切换目录则可以创建镜像
& & & & & & & & $this-&ftp-&rmkdir($remotedir);
& & & & & & & & $this-&ftp-&upload($localfile, $remotefile, 'acii');
& & & & & & }
& & & & 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().$
$list_1=str_replace($cfg_arcdir.'/',DEDEWAPPATH . '/',$list_1);
& & & & & & & & $murl = MfTypedir($this-&Fields['typedir']).'/'.$this-&Fields['defaultname'];
& & & & & & & & //如果启用远程发布则需要进行判断
& & & & & & & & if($cfg_remote_site=='Y'&& $isremote == 1)
& & & & & & & & {
& & & & & & & & & & //分析远程文件路径
& & & & & & & & & & $remotefile = $
& & & & & & & & & & $localfile = '..'.$
& & & & & & & & & & $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile);
& & & & & & & & & & //不相等则说明已经切换目录则可以创建镜像
& & & & & & & & & & $this-&ftp-&rmkdir($remotedir);
& & & & & & & & & & $this-&ftp-&upload($localfile, $remotefile, 'acii');
& & & & & & & & }
& & & & & & & & $indexname = $this-&GetTruePath().$
$indexname=str_replace($cfg_arcdir.'/',DEDEWAPPATH . '/',$indexname);
& & & & & & & & copy($list_1,$indexname);
& & & & & & }
找到580行函数&function MakePartTemplets()
修改最后面的代码
&return $this-&GetTrueUrl($makeUrl);修改成
$returl=$this-&GetTrueUrl($makeUrl);
$this-&MakeWapPartTemplets();
& & & & return $
584行添加函数function MakeWapPartTemplets()
function MakeWapPartTemplets()
global $cfg_df_style,$cfg_
& & & & $this-&PartView = new PartView($this-&TypeID,false);
& & & & $this-&PartView-&SetTypeLink($this-&TypeLink);
& & & & $nmfa = 0;
& & & & $tmpdir = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir'];
& & & & if($this-&Fields['ispart']==1)
& & & & & & $tempfile = str_replace(&{tid}&,$this-&TypeID,$this-&Fields['tempindex']);
& & & & & & $tempfile = str_replace(&{cid}&,$this-&ChannelUnit-&ChannelInfos['nid'],$tempfile);
& & & & & & $tempfile = $tmpdir.&/&.$
$tempfile=str_replace('/'.$GLOBALS['cfg_df_style'].'/',DEDEWAPTEMPLATESPATH,$tempfile);
& & & & & & if(!file_exists($tempfile))
& & & & & & {
& & & & & & & & $tempfile = $tmpdir.&/&.$GLOBALS['cfg_df_style'].&/index_default.htm&;
& & & & & & }
& & & & & & $this-&PartView-&SetTemplet($tempfile);
& & & & else if($this-&Fields['ispart']==2)
& & & & & & //跳转网址
& & & & & &// return $this-&Fields['typedir'];
& & & & CreateDir(MfTypedir($this-&Fields['typedir']));
& & & & $makeUrl = $this-&GetMakeFileRule($this-&Fields['id'],&index&,MfTypedir($this-&Fields['typedir']),$this-&Fields['defaultname'],$this-&Fields['namerule2']);
& & & & $makeUrl = preg_replace(&/\/{1,}/&, &/&, $makeUrl);
& & & & $makeFile = $this-&GetTruePath().$makeU
$makeFile=str_replace($cfg_arcdir.'/',DEDEWAPPATH . '/',$makeFile);
& & & & if($nmfa==0)
if(!is_dir(dirname($makeFile))) {
& & mkdir(dirname($makeFile), 0777, true);
& & & & & & $this-&PartView-&SaveToHtml($makeFile);
& & & & & & //如果启用远程发布则需要进行判断
& & & & & & if($GLOBALS['cfg_remote_site']=='Y'&& $isremote == 1)
& & & & & & {
& & & & & & & & //分析远程文件路径
& & & & & & & & $remotefile = str_replace(DEDEROOT, '',$makeFile);
& & & & & & & & $localfile = '..'.$
& & & & & & & & $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile);
& & & & & & & & //不相等则说明已经切换目录则可以创建镜像
& & & & & & & & $this-&ftp-&rmkdir($remotedir);
& & & & & & & & $this-&ftp-&upload($localfile, $remotefile, 'acii');
& & & & & & }
& & & & else
& & & & & & if(!file_exists($makeFile))
& & & & & & {
& & & & & & & & $this-&PartView-&SaveToHtml($makeFile);
& & & & & & & & //如果启用远程发布则需要进行判断
& & & & & & & & if($cfg_remote_site=='Y'&& $isremote == 1)
& & & & & & & & {
& & & & & & & & & & //分析远程文件路径
& & & & & & & & & & $remotefile = str_replace(DEDEROOT, '',$makeFile);
& & & & & & & & & & $localfile = '..'.$
& & & & & & & & & & $remotedir = preg_replace('/[^\/]*\.html/', '',$remotefile);
& & & & & & & & & & //不相等则说明已经切换目录则可以创建镜像
& & & & & & & & & & $this-&ftp-&rmkdir($remotedir);
& & & & & & & & & & $this-&ftp-&upload($localfile, $remotefile, 'acii');
& & & & & & & }
& & & & & & }
首页生成静态页修改代码
后台目录找到:makehtml_homepage.php文件,47行:&
$pv-&SaveToHtml($homeFile);后面加上代码:
$pv-&SetTemplet(str_replace('/'.$cfg_df_style.'/',DEDEWAPTEMPLATESPATH,$cfg_basedir.$cfg_templets_dir.&/&.$templet));
$pv-&SaveToHtml(str_replace('/index.html',DEDEWAPPATH.'/index.html',$homeFile));
wap模板中文章路径或栏目路径替把pc路径替换成wap路径。
打开include目录下extend.func.php在最后面
function GetWapUrl($pcurl){
global $cfg_
return str_replace($cfg_arcdir.'/',DEDEWAPPATH.'/',$pcurl);
模板中栏目url调用
{dede:channelartlist typeid='top' }
&a href=&{dede:field.typeurl function='GetWapUrl(@me)'/}&&{dede:field.typename/}&/a&
{/dede:channelartlist}
文章url调用
&a href=&[field:arcurl function='GetWapUrl(@me)' /]&&[field:title/]&/a&
基本的就是这些,细节根据各自要求修改。
(责任编辑:最模板)
------分隔线----------------------------
今天给一个客户开发一个批量上传图片,并显示出来到分类信息...
许多织梦dedecms网站开启了会员投稿功能,有时候会发现后台未审...
本文主要讲解了织梦dedecms缩略图失真模糊的解决方法,由于织梦...
其实dedecms织梦的flash的源代码调整起来是非常方便的,包括了可...
搜索引擎看不懂图片,通过给图片添加alt属性,有助于搜索引擎判...
CopyRight (C)
最模板 , 深圳奇好科技有限公司 All Rights Reserved.在ASP中不用模板生成HTML静态页直接生成.html页面-源码库|专注为中国站长提供免费商业网站源码下载!
当前位置:----在ASP中不用模板生成HTML静态页直接生成.html页面
在ASP中不用模板生成HTML静态页直接生成.html页面
有没有办法不用模板,如一个正常的htmer.asp页面,直接生成为htmer.html页面呢?当然是可以的,而且非常简单,今天就教大家在ASP中不用模板生成HTML静态页的方法
我们一般生成HTML静态页时,常常会事先做好一个模板,然后生成时调用模板文件。那么有没有办法不用模板,如一个正常的htmer.asp页面,直接生成为htmer.html页面呢?当然是可以的,而且非常简单,今天就教大家在ASP中不用模板生成HTML静态页的方法。
这里假设有一个htmer.asp动态页面,你想把它生成为HTML静态页面htmer.html,那么我们首先新建一个ASP程序文件htmer_to_html.asp(该文件就是用来将htmer.asp动态页面生成为静态页面htmer.html的),htmer_to_html.asp的具体代码如下所示:
&form method=&post& action=&&&
&textarea name=&asp2html& style=&display:none&&&!--#include file=&htmer.asp&--&&/textarea&
&input type=&submit& value=&生成html页&/&
Dim Filename,Fso,Fout
If Request.Form(&asp2html&)&&&& Then
Filename=&htmer.html&
Set Fso=Server.CreateObject(&Scripting.FileSystemObject&)
Set Fout=Fso.CreateTextFile(Server.Mappath(Filename))
Fout.Write Request.Form(&asp2html&)
Fout.Close
Set Fout=Nothing
Set Fso=Nothing
相关ASP教程:
相关资源下载:
ASP教程搜索
ASP教程推荐
热门源码推荐
搞笑视频网整站源码(织梦CMS+CKplayer
热门ASP教程
©2012

我要回帖

更多关于 织梦手机站静态 的文章

 

随机推荐