精品国产免费观看久久久_久久天天躁狠狠躁夜夜爽_无码人妻少妇久久中文字幕_狠狠做深爱婷婷久久综合一区

互聯網知識

精準傳達 ? 價值共享

洞悉互聯網前沿資訊,探尋網站營銷規律

查看其它板塊

織夢DEDECMS多城市分站站群插件

作者:狐靈科技 | 2021-06-03 07:02 |點擊:

分站插件特點:無需修改模板無需生成分站,支持增刪改查城市,偽靜態實現多城市分站

織夢DEDECMS多城市分站站群插件





插件特色

  • 無需生成任何文件,偽靜態實現多城市分站
  • 后臺城市管理自由增刪改查,無限級城市分類
  • 無需修改現有模板文件

使用說明

1、文末下載插件,解壓。網站后臺-模塊-上傳新模塊,安裝(注意插件安裝的時候php版本不能過高 5.6以下)

2、根據自己主機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>

 

3、打開 /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';

5、打開 /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'];

6、打開 /include/taglib/arclist.lib.php 找到

//處理一些特殊字段

在它上面加入

$row['title'] = $GLOBALS['cfg_areas_title'] . $row['title'];

 

7、打開 /include/taglib/channel.lib.php 找到

$row['sonids'] = $row['rel'] = '';

在它上面加入

$row['typename'] = $GLOBALS['cfg_areas_title'] . $row['typename'];

8、打開 /include/taglib/channelartlist.lib.php 找到

$pv->Fields['typeurl'] = GetOneTypeUrlA($typeids[$i]);

在它下面加入

$pv->Fields['typename'] = $GLOBALS['cfg_areas_title'] . $typeids[$i]['typename'];

9、打開 /include/taglib/type.lib.php 找到

$row['typelink'] = $row['typeurl'] = GetOneTypeUrlA($row);

上面加入

$row['typename'] = $GLOBALS['cfg_areas_title'] . $row['typename'];

到這里后 需要修改的文件全部修改完畢  以下是調用標簽 可供參考

 

10、在你網站模板里任意地方可以加入調用輸出你想要的地區名稱和鏈接
 

{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"

 

11、在自己模板文件夾里新建一個areas.htm全國城市模板文件
 

如圖

 




 

 

  1. <!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>

 


核心的代碼主要是紅色的部分  樣式可以自己寫


 

或者參考我這邊寫的樣式代碼

 

  1. <style type="text/css">
    .hlwlcity{position:relative;margin-bottom:20px;border:1px solid #ddd;padding:15px 10px 10px;font-size:0}
    .hlwlcity a:hover{color:#d90000}
    .hlwlcity .one{position:absolute;left:10px;top:-19px;padding:5px;background:#fff;color:#d90000;font-size:16px;font-weight:bold}
    .hlwlcity .two{display:inline-block;vertical-align:top;*display:inline;*zoom:1;width: 10%;font-size:14px;line-height:32px;padding-left:5px;}
    .hlwlcity .two dt:before{content:'';display:inline-block;vertical-align:top;*display:inline;*zoom:1;width:4px;height:4px;margin-top:14px;background:#d90000;margin-right:5px}
    .hlwlcity .two dd{padding-bottom:5px}
    .hlwlcity .thr a{display:block;font-size:13px;line-height:30px;padding-left:12px}
    </style>
     
     
     
    {dede:areas}
    <div class="hlwlcity">
    <h3 class="one"><a href="[field:arcurl/]">[field:title/]</a></h3>
       [field:sonareas1]
      <dl class="two"><dt><a href="[field:arcurl/]">[field:title/]</a></dt></dl>
    [field:sonareas2]
    <dl class="two"><dt><a href="[field:arcurl/]">[field:title/]</a></dt></dl>
       [/field:sonareas2]
      [/field:sonareas1]
    </div>   
    {/dede:areas} 
     
 
全部完成后,打開 http://你的域名/areas.html  查看全國城市頁面

11、后臺-系統-系統基本參數可以開啟和關閉分站獨立SEO信息

 

特別說明

如果你主站有城市地區名的地方,在分站想跟隨分站更換城市名話,可以用這個標簽來

{dede:global.cfg_areas_title runphp=yes}@me = @me ? @me : '包頭';{/dede:global.cfg_areas_title}

主站默認顯示為包頭XXX,分站時顯示當前城市名

主站默認效果如下

分站效果如下

head.htm 頭部模板里的寫法示例


 

插件下載

織夢多城市分站站群插件

如沒特殊注明,文章均為狐靈科技原創,轉載請注明?? "織夢DEDECMS多城市分站站群插件
多一份免費策劃方案,總有益處。

請直接添加技術總監微信聯系咨詢

網站設計 品牌營銷

多一份參考,總有益處

聯系狐靈科技,免費獲得專屬《策劃方案》及報價

咨詢相關問題或預約面談,可以通過以下方式與我們聯系

業務熱線:15082661954 / 大客戶專線:15523356218