织梦多城市分站站群插件,dedecms城市分站伪静态插件
织梦多城市分站站群插件,dedecms城市分站伪静态插件,这是根据大神春哥的教程,仅作个人学习之用。
先给大家看看安装后后台的显示效果:
每个地区都可以单独定义的
系统参数:
下面是使用教程:
根据自己主机web环境添加伪静态规则
Nginx:
rewrite ^/areas_([a-z]+)/(.*)/([0-9]+)\.html$ /areas/plus/view.php?aid=$3&area=$1 last;
rewrite ^/areas_([a-z]+)/(.*)/([0-9]+)_([0-9]+)\.html$ /areas/plus/view.php?aid=$2&pageno=$3&area=$1 last;
rewrite ^/areas_([a-z]+)/(.*)/$ /areas/plus/list.php?tid=$2&area=$1 last;
rewrite ^/areas_([a-z]+)/(.*)/list_([0-9]+)_([0-9]+)\.html$ /areas/plus/list.php?tid=$2&PageNo=$4&area=$1 last; rewrite ^/areas_([a-z]+)/$ /areas/index.php?area=$1 last;
rewrite ^/areas.html$ /areas/index.php last;
apache
RewriteEngine On
RewriteBase /
RewriteRule ^areas_([a-z0-9_\-]+)/(.*)/([0-9]+)\.html$ areas/plus/view\.php?aid=$3&area=$1 [L]
RewriteRule ^areas_([a-z0-9_\-]+)/(.*)/([0-9]+)_([0-9]+)\.html$ areas/plus/view\.php?aid=$2&pageno=$3&area=$1 [L]
RewriteRule ^areas_([a-z0-9_\-]+)/(.*)/$ areas/plus/list\.php?tid=$2&area=$1 [L]
RewriteRule ^areas_([a-z0-9_\-]+)/(.*)/list_([0-9]+)_([0-9]+)\.html$ areas/plus/list\.php?tid=$3&PageNo=$4&area=$1 [L]
RewriteRule ^areas_([a-z0-9_\-]+)/$ areas/index\.php?area=$1 [L]
RewriteRule ^areas\.html$ areas/index\.php [L]
打开 /include/arc.archives.class.php 找到
$preRow = $this->dsql->GetOne($query.$pre);
在它下面加入
if(is_array($preRow)) $preRow['title'] = $GLOBALS['cfg_areas_title'] . $preRow['title'];
if(is_array($nextRow)) $nextRow['title'] = $GLOBALS['cfg_areas_title'] . $nextRow['title'];
调用一级地区
{dede:areas sqlstr="" row="5"}{/dede:areas}
调用一级和二级地区
{dede:areas sqlstr="istop = 1" row="5"}
[field:sonareas1][/field:sonareas1]
{/dede:areas}
调用一级、二级、三级地区
{dede:areas sqlstr="istop = 1" row="5"}
[field:sonareas1]
[field:sonareas2][/field:sonareas2]
[/field:sonareas1]
{/dede:areas}
调用推荐的地区
sqlstr="istop = 1"
调用地区个数
row="5"
在自己模板文件夹里新建一个areas.htm全国城市模板文件
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>全国城市分站</title> </head> <body> <!--可以引入自己的头部和尾部--> <style> .all_city{clear:both;max-width:1200px;margin:0 auto} .all_city h2{padding:0;margin:0;font-size:16px;font-weight:700;width:70px;color:#00a0e9;line-height:30px} .all_city h2 a{text-decoration:none;font-size:16px;font-weight:700;width:70px;color:#222;line-height:30px} .all_city ul{padding:0;margin:0;list-style:none;float:left;padding-left:20px} .all_city ul li.all_city_li{clear:both;float:left;line-height:30px} .all_city ul.all_city_ul li{list-style:none;float:left} .all_city ul li.all_city_li a,.all_city ul.all_city_ul li a{display:block;float:left;padding-left:10px;color:#222;text-decoration:none;font-size:14px} </style> {dede:areas} <div class="all_city"> <h2><a href='[field:arcurl/]'>[field:title/]</a></h2> <ul> [field:sonareas1] <li class="all_city_li"> <a href='[field:arcurl/]'><b>[field:title/]</b></a> <ul class="all_city_ul"> [field:sonareas2] <li><a href='[field:arcurl/]'>[field:title/]</a></li> [/field:sonareas2] </ul> </li> [/field:sonareas1] </ul> </div> {/dede:areas} </body> </html>
关于城市分站安装之后,内容页跳转到404的问题:
根据栏目的文章命名规则进行修改:
插件安装完之后,在根目录有一个文件夹:areas\plus
view.php
如图画红线部分,$aid = substr($aid, 6);
数字6可以根据自身命名规则进行改变,可以是2、3、4、5。
Dedecms后台程序不建议使用dede58的,如果使用建议注释掉(删除)一部位代码。
dede58添加了子目录设置
找到文件:
include/arc.listview.class.php
一共有两处需要删除或注释。
\include\taglib\arclist.lib.php
也需要注释掉。
PS:注释掉这些代码是因为在伪静态,给调用缩略图的文章列表,url地址不对,会自动加上当前城市名称,导致图片URL地址不正确。
具体详情和插件下载移步:
https://pan.baidu.com/s/11JTadHezWidIv7sQ3r963A
-
用微信 “扫一扫”
将文章分享到朋友圈。
关注公众号:xue-jiqiao
本文版权归原作者所有,转载请注明原文来源出处,学技巧网站制作感谢您的支持!
- dedeCMS教程
- phpcms教程
- 迅睿Cms教程
- 自媒体
- Div+Css教程
- 优化技巧
- PHP编程教程
- 服务器教程
- 1 织梦上一页下一页列表翻页单独调用的实现代码
- 2 把数据保存到数据库附加表 `dede_addonarticle` 时出错,请把相关信息提交给DedeCms官方
- 3 如何去除dede织梦后台"织梦内容管理系统"
- 4 dedecms后台一键更新不了怎么办
- 5 DeDeCMS后台批量修改替换sql语句大全
- 6 dedecms还原数据库后台系统参数空白解决方法
- 7 织梦更新出现:读取频道信息失败,无法进行后续操作!解决方法
- 8 织梦dedecms在后台自定义字段首页如何调用
- 9 织梦dedecms隐藏网站模板真实路径技巧
- 10 织梦dedecms百度sitemap.html怎么做
-
笑话网站源码织梦模板带有全站数据和会员系统
栏目:
-
织梦dedecms微小说清新文章站源码
栏目:
-
最新dedecms网页游戏开服表发号网站源码模板
栏目:
-
极品美女网站源码,正妹图片网dedecms模板(带整站数据+采集)
栏目: