一、安裝網(wǎng)站

1、上傳到服務器上輸入www.xxxx.com/install進行安裝(具體安裝方法找百度一大堆);

可以參考http://www.hlzcb.com/zhimengxueyuan/zhimenganzhuangshiyong/25830.html

2.安裝好后臺點擊后臺系統(tǒng)→數(shù)據(jù)庫備份還原→數(shù)據(jù)還原,點擊下面的開始還原數(shù)據(jù);

DedeCMS站群二 級目錄多城市分站,dedecms二級域名多城市站群

 

 

二、設置偽靜態(tài)

  1. 設置偽靜態(tài)。LINUX寶塔系統(tǒng)Nginx設置教程:(偽靜態(tài)代碼請查看壓縮包里的Nginx.txt)

111.jpg

 

設置偽靜態(tài)。LINUX寶塔系統(tǒng)Nginx設置教程:(偽靜態(tài)代碼請查看壓縮包里的Nginx.txt)

 

2.找到網(wǎng)站根目錄下的mycity文件夾下的index.php文件。打開編輯,把域名改成自己的。

 

dede城市分站站群,二級目錄分站模板,織夢城市分站程序,整站安裝說明

 

織夢dedecms做企業(yè)城市分站以及地區(qū)站群,織夢站群二級目錄

 

dede城市分站站群,dede城市分站管理,織夢城市分站程序,二級目錄分站模板

 

DedeCMS站群二級目錄多城市分站模板,dede城市站群

 

 

 

這樣就設置完了,網(wǎng)站就可以正常訪問了。

 

①環(huán)境是Apache的直接把.htaccess上傳到網(wǎng)站更目錄

②如果是IIS的服務器直接導入.htaccess規(guī)則,具體導入方法百度找找。

 

備注:建議使用Linux寶塔系統(tǒng)或是Wdcp系統(tǒng),環(huán)境使用Nginx。其他的環(huán)境的偽靜態(tài)可能會出現(xiàn)城市分站翻頁的bug。

 

注:更新主頁時,有動態(tài)生成。

三、調(diào)用代碼講解

每個頁面頭部必備的文件:

在板<head>和</head>之間添加以下代碼

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

 

欄目鏈接:

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

欄目名稱:

[field:city runphp=’yes’]@me=constant(‘city’);[/field:city] [field:typename/]

文章鏈接:

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

文章標題:

[field:city runphp=’yes’]@me=constant(‘city’);[/field:city] [field:title/]

 

首頁TDK調(diào)用:

<title>{dede:php}echo constant(“title”);{/dede:php}</title>

<meta name=”description” content=”{dede:php}echo

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

<meta name=”keywords” content=”

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

 

列表頁和內(nèi)容頁TDK在原有的前面添加{dede:php}echo constant(“city”);{/dede:php}:

<title>{dede:php}echo constant(“city”);{/dede:php}{dede:field.title/}_{dede:global.cfg_webname/}</title>

<meta name=”keywords” content=”{dede:php}echo constant(“city”);{/dede:php}{dede:field name=’keywords’/}” />

<meta name=”description” content=”{dede:php}echo constant(“city”);{/dede:php}{dede:field name=’description’ function=’html2text(@me)’/}” />

當前欄目調(diào)用

當前欄目調(diào)用{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}

* 當前欄目點擊不能調(diào)到對應欄目,只能跳到首頁

 

想要增加修改城市 找到 mycity—city.php 想要添加自己的城市站點 還需要看下 pinyin.txt 有沒有對應的拼音

聲明:本站所有資源由用戶發(fā)布分享以及互聯(lián)網(wǎng)轉(zhuǎn)載,只作為宣傳購買原版的參考,版權爭議與本站無關;如果你有什么不錯的資源,也可以提供給本站免費幫你發(fā)布宣傳;本站不對任何資源負法律責任以及索取相關費用,您若發(fā)現(xiàn)本站侵犯了你的版權利益,請聯(lián)系本站刪除處理!謝謝!