一、安裝網(wǎng)站
1、上傳到服務(wù)器上輸入www.xxxx.com/install進(jìn)行安裝(具體安裝方法找百度一大堆);
可以參考http://www.hlzcb.com/zhimengxueyuan/zhimenganzhuangshiyong/25830.html
2.安裝好后臺(tái)點(diǎn)擊后臺(tái)系統(tǒng)→數(shù)據(jù)庫(kù)備份還原→數(shù)據(jù)還原,點(diǎn)擊下面的開(kāi)始還原數(shù)據(jù);
二、設(shè)置偽靜態(tài)
- 設(shè)置偽靜態(tài)。LINUX寶塔系統(tǒng)Nginx設(shè)置教程:(偽靜態(tài)代碼請(qǐng)查看壓縮包里的Nginx.txt)
2.找到網(wǎng)站根目錄下的mycity文件夾下的index.php文件。打開(kāi)編輯,把域名改成自己的。
這樣就設(shè)置完了,網(wǎng)站就可以正常訪(fǎng)問(wèn)了。
①環(huán)境是Apache的直接把.htaccess上傳到網(wǎng)站更目錄
②如果是IIS的服務(wù)器直接導(dǎo)入.htaccess規(guī)則,具體導(dǎo)入方法百度找找。
備注:建議使用Linux寶塔系統(tǒng)或是Wdcp系統(tǒng),環(huán)境使用Nginx。其他的環(huán)境的偽靜態(tài)可能會(huì)出現(xiàn)城市分站翻頁(yè)的bug。
注:更新主頁(yè)時(shí),有動(dòng)態(tài)生成。
三、調(diào)用代碼講解
每個(gè)頁(yè)面頭部必備的文件:
在板<head>和</head>之間添加以下代碼
{dede:php}require (DEDEROOT.’/mycity/index.php’);{/dede:php}
欄目鏈接:
[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/list-[field:id/].html
欄目名稱(chēng):
[field:city runphp=’yes’]@me=constant(‘city’);[/field:city] [field:typename/]
文章鏈接:
[field:cityurl runphp=’yes’]@me=constant(‘cityurl’);[/field:cityurl]/view-[field:id/].html
文章標(biāo)題:
[field:city runphp=’yes’]@me=constant(‘city’);[/field:city] [field:title/]
首頁(yè)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}” />
列表頁(yè)和內(nèi)容頁(yè)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)’/}” />
當(dāng)前欄目調(diào)用
當(dāng)前欄目調(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}
* 當(dāng)前欄目點(diǎn)擊不能調(diào)到對(duì)應(yīng)欄目,只能跳到首頁(yè)
想要增加修改城市 找到 mycity—city.php 想要添加自己的城市站點(diǎn) 還需要看下 pinyin.txt 有沒(méi)有對(duì)應(yīng)的拼音