格展网络
您现在的位置:主页 > 网站插件 > 织梦插件 > 织梦城市分站站群插件
织梦城市分站站群插件

织梦城市分站站群插件

  • 所属行业:织梦CMS
  • 支持版本:dedecms5.7
  • 支持编码:UTF-8+GBK
  • 插件编号:CJ-1372
  • 插件大小:230 KB
  • 插件售价:
  • 下载对象:

    开放浏览

收费指导安装 收费修改模板亲测可用 建站交流群 TAG 充值 代理加盟
评价: 热度: 888 ℃   

立即下载 加入收藏 打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,你说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

Powered by 格展网络,分享从这里开始,精彩与您同在

  • 插件描述
  • 下载记录
插件信息
ID编号:1372
最后更新:2021-05-30 10:10
  • 插件预览
  • 插件特色
无需生成任何文件,伪静态实现多城市分站
后台城市管理自由增删改查,无限级城市分类
无需修改现有模板文件
  • 使用说明
下载插件,解压。网站后台-模块-上传新模块,安装
根据自己主机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]
iis7+
<rule name="分站文章页">
<match url="^areas_([a-z]+)/(.*)/([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/areas/plus/view.php?aid={R:3}&amp;area={R:1}" appendQueryString="false" />
</rule>
<rule name="分站文章分页">
<match url="^areas_([a-z]+)/(.*)/([0-9]+)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/areas/plus/view.php?aid={R:2}&amp;pageno={R:3}&amp;area={R:1}" appendQueryString="false" />
</rule>
<rule name="分站栏目页">
<match url="^areas_([a-z]+)/(.*)/$" ignoreCase="false" />
<action type="Rewrite" url="/areas/plus/list.php?tid={R:2}&amp;area={R:1}" appendQueryString="false" />
</rule>
<rule name="分站栏目分页">
<match url="^areas_([a-z]+)/(.*)/list_([0-9]+)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/areas/plus/list.php?tid={R:3}&amp;PageNo={R:4}&amp;area={R:1}" appendQueryString="false" />
</rule>
<rule name="分站首页">
<match url="^areas_([a-z]+)/$" ignoreCase="false" />
<action type="Rewrite" url="/areas/index.php?area={R:1}" appendQueryString="false" />
</rule>
<rule name="分站全国">
<match url="^areas.html$" ignoreCase="false" />
<action type="Rewrite" url="/areas/index.php" appendQueryString="false" />
</rule>
打开/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'];
打开/include/arc.listview.class.php
找到
function Display()
改成
function Display($ismake=0)
继续找到
$this->ParseDMFields($this->PageNo,0);
改成
$this->ParseDMFields($this->PageNo,$ismake);
继续找到
//处理一些特殊字段
在它上面加入
$row['title'] = $GLOBALS['cfg_areas_title'] . $row['title'];
继续找到
$row['litpic'] = $GLOBALS['cfg_cmspath'].'/images/defaultpic.gif';
改成
$row['litpic'] = $GLOBALS['cfg_basehost'].'/images/defaultpic.gif';
打开/include/typelink.class.php
找到
$this->TypeInfos = $this->dsql->GetOne($query);
在它下面加入
$this->TypeInfos['typename'] = $GLOBALS['cfg_areas_title'] . $this->TypeInfos['typename'];
继续找到
$tinfos = $this->dsql->GetOne();
在它下面加入
$tinfos['typename'] = $GLOBALS['cfg_areas_title'] . $tinfos['typename'];
打开/include/taglib/arclist.lib.php
找到
//处理一些特殊字段
在它上面加入
$row['title'] = $GLOBALS['cfg_areas_title'] . $row['title'];
打开/include/taglib/channel.lib.php
找到
$row['sonids'] = $row['rel'] = '';
在它上面加入
$row['typename'] = $GLOBALS['cfg_areas_title'] . $row['typename'];
打开/include/taglib/channelartlist.lib.php
找到
$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);
在它下面加入
$pv->Fields['typename'] = $GLOBALS['cfg_areas_title'] . $typeids[$i]['typename'];
打开/include/taglib/type.lib.php
找到
$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);
在上面加入
$row['typename'] = $GLOBALS['cfg_areas_title'] . $row['typename'];
在你网站模板里任意地方可以加入调用输出你想要的地区名称和链接
{dede:areas sqlstr="" row="5"}
<dt>
<a href='[field:arcurl/]'>[field:title/]</a>
</dt>
<dd>
[field:sonareas1]
<a href='[field:arcurl/]'>[field:title/]</a>
[field:sonareas2]
<a href='[field:arcurl/]'>[field:title/]</a>
[/field:sonareas2]
[/field:sonareas1]
</dd>
{/dede:areas}
调用一级地区
{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>
全部完成后,打开 http://你的域名/areas.html  查看全国城市页面
后台-系统-系统基本参数可以开启和关闭分站独立SEO信息
特别说明
如果你主站有城市地区名的地方,在分站想跟随分站更换城市名话,可以用这个标签来
{dede:global.cfg_areas_title runphp=yes}@me = @me ? @me : '包头';{/dede:global.cfg_areas_title}
主站默认显示为包头XXX,分站时显示当前城市名
主站默认效果如下
分站效果如下
head.htm 头部模板里的写法示例

相关模板插件
相关城市建站