dede生成栏目列表页排序多样化pubdate,click等排序格式

时间:2014-03-31 13:21 / 来源:未知 / 作者:admin / 点击:
第1步:
在dede/inc_menu.php中找到“更新主页HTML“ 在这一部分中增加若干行必要的代码:
例如 <m:item name='更新Click排序列表' link='makehtml_list_click.php' rank='sys_MakeHtml' target='main' />
 
第2步:
在dede目录中找到 makehtml_list.php、makehtml_list_action.php,分别复制一份重命名为 makehtml_list_click.php、makehtml_list_click_action.php。
在makehtml_list_click.php 中将“makehtml_list.htm” 改为“makehtml_list_click.htm”;
在makehtml_list_click_action.php  中将“arc.listview.class.php” 替换为 “arc.list.click.view.class.php”;接着在大概文件末尾,找到 “makehtml_list_action.php” 改为“makehtml_list_click_action.php”;
 
第3步:
在dede/templets目录中找到 makehtml_list.htm,复制一份重命名为 makehtml_list_click.htm;然后打开新建的文件找到action="makehtml_list_action.php",替换为 action="makehtml_list_click_action.php"
 
第4步:
这一步需要改的比较多点了
在   include目录中找到 arc.listview.class.php 复制一份重命名为 arc.list.click.view.class.php;
接着打开您新建的这个文件arc.list.click.view.class.php:
①:找到
$tempfile = $GLOBALS['cfg_basedir'].$GLOBALS['cfg_templets_dir']."/".$this->TypeLink->TypeInfos['templist']; //
$tempfile = str_replace("{tid}", $this->TypeID, $tempfile);
$tempfile = str_replace("{cid}", $this->ChannelUnit->ChannelInfos['nid'], $tempfile);
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_click_article.htm"; // list_click_article.htm是你自己制作的按click排序的模板,官方默认的模板是按pudate排序,这个看您自己的喜好了。
 
②、找到
$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($this->Fields['typedir']).'/'.$this->Fields['defaultname'];
全部删掉或者注释掉即可。
 
③、找到   
$namerule2 = str_replace('{tid}',$typeid,$namerule2);
替换为
$namerule2 = str_replace('{tid}',$typeid.'_click',$namerule2); //
其中_click,按自己喜好命名,例如参考:http://域名/list_83_score_1.html,的命名方式。

猜你喜欢

推荐栏目

DEDECMS
DEDECMS

DEDE使用经验和技巧

WordPress
Wordpress

WP使用经验和技巧

Zblog
Zblog

Zblog使用经验和技巧

CSS
CSS

CSS使用经验和技巧

网络资料
网络资料

转载实用网络资料

按键伤人
按键伤人

转载乱七八糟的网络资源

我是酱油
我是酱油

随笔札记 记录生活点滴

本站推荐

百度站内搜索

专业博客主机