最新织梦全国多城市分站地区插件dedecms分站网站源码插件

插件模板

织梦城市分站插件系统使用说明

温馨提示:使用前请先备份网站,以防万一。

1、系统设置:

核心设置—— 是否使用伪静态:是

其他选项—— 模板引擎禁用标签:清空,去掉PHP

性能选项——arclist标签调用缓存:0

2、后台-系统-SQL命令行工具中执行两语句:

(1)将所有文档设置为仅动态浏览

update dede_archives set ismake=-1
(1)将所有栏目设置为使用动态页

update dede_arctype set isdefault=-1
3、文件覆盖:

上传整个mycity文件夹和.htaccess文件到根目录;覆盖根目录下的dede和include两个文档;切记覆盖前先备份好网站文件及数据库,数据丢失概不负责。

/include/helpers/
—–channelunit.helper.php //伪静态设置
/include/
—-arc.listview.class.php //文章分页
—-arc.taglist.class.php //标签分页
—-typelink.class.php //当前位置
—-arc.archives.class //上一篇下一篇
/include/taglib/
—-arclist.lib.php //分页
—-channel.lib.php //导航
—-tag.lib.php //标签

伪静态设置请根据自己的环境来设置,文件中的bcloud_nginx_user.conf是百度云主机的伪静态文件,直接上传百度云虚拟主机就行,Nginx.txt是linux提供宝塔的伪静态内容,复制里面的内容到伪静态设置即可。windows的IIS可以去https://www.toolnb.com/tools/rewriteTools.html这里转换伪静态规则。

4、域名信息:(设置站点)

打开mycity文件夹下的index.php文件,修改文件中的域名。不需要加http

5、修改每个模板文件的头部代码

在需要添加分站的模板和之间添加以下代码;

{dede:php}require (DEDEROOT.’/mycity/index.php’);{/dede:php} //模板引用城市,必不可少的

这段代码一定要放在头部TDK之前,才有效。

(1)主页模板标题改为

{dede:php}echo constant(“title”);{/dede:php}
格式:’分站 站群’ => ‘北京分站|北京站群’,在系统设置里的网站名称里填入分站 站群,即可有北京分站|北京站群 这样的效果

(2)主页模板关键词改为

{dede:php}echo constant(“keywords”);{/dede:php}
格式:’分站,站群’ => ‘北京分站,北京站群’

(3)主页模板描述改为

{dede:php}echo constant(“city”);{/dede:php}{dede:global.cfg_description/}

首页TDK实例:

{dede:php}require(DEDEROOT.’/mycity/index.php’);{/dede:php}
{dede:php}echo constant(“keywords”);{/dede:php}” />

6、修改栏目调用链接

所有栏目调用链接[field:typelink/]修改为
[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/list-[field:id/].html
栏目名称调用[field:typename/]修改为
[field:city runphp=’yes’]@me=constant(‘city’);[/field:city][field:typename/]
如果{dede:channel type=son noself=yes}这个标签的导航高亮不好使的话,就改为
{dede:channelartlist row=7 typeid=top currentstyle=current}这样的标签的导航高亮
{dede:channelartlist row=7 typeid=top currentstyle=current}
{dede:field.typeurl/}{dede:field.typename/}{/dede:channelartlist}这样调用,栏目链接{dede:field.typeurl/}改为:{dede:type }[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/list-[field:id/].html{/dede:type}
栏目名称{dede:field.typename/}改为:{dede:type}[field:city runphp=’yes’]@me=constant(‘city’);[/field:city][field:typename/]{/dede:type}

头部head.htm模板里的首页调用可以这样写:

{dede:type }[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/index.html{/dede:type}
栏目页TDK实例:

{dede:php}require (DEDEROOT.’/mycity/index.php’);{/dede:php}

7、修改文章标题和链接调用

所有文章标题调用链接[field:title/]修改为

[field:cityrunphp=’yes’]@me=constant(‘city’);[/field:city][field:title/]
*看个人需求,文章标题链接调用可改可不改,修改了文章标题也会随着城市的切换改变城市状态。

所有文章调用链接[field:arcurl/]修改为

[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/view-[field:id/].html

内容页文章标题{dede:field.title/}修改为:

{dede:php}echo constant(“city”);{/dede:php}{dede:field.title/}

文章页TDK实例:

{dede:php}require (DEDEROOT.’/mycity/index.php’);{/dede:php}

8、当前位置调用

当前位置调用

{dede:field name=’position’/}改为
{dede:field name=’position’ runphp=’yes’}
$st=split(‘ > ‘,@me);
$l = ”;
foreach ($st as $v) {
$s = split(“‘>”,$v);
if($s[‘1’]){
$l.= $s[‘0’].”‘>”.city.$s[‘1’].” > “;
}
}
@me=$l;
{/dede:field}
*当前栏目点击不能调到对应栏目,只能跳到首页

9、调用所有城市列表

可以创建一个栏目和城市模板去调用,也可以放到自己想要调用城市的页面,这随意。

在需要显示城市名的地方插入以下代码中的一项,有两种展示形式,

(1)全国分类城市展示

{dede:php}echo constant(“link”);{/dede:php}

(2)城市全部列表

{dede:php}echo constant(“links”);{/dede:php}

要调用城市名称请用这个标签调用

{dede:php}echo constant(“city”);{/dede:php}


下载地址

继续阅读
发表观点
  • 昵称不能为空
  • 邮箱不能为空
  • 还是写点什么卅...