一、安裝網(wǎng)站
1、上傳到服務器上輸入www.xxxx.com/install進行安裝(具體安裝方法找百度一大堆);
可以參考http://www.hlzcb.com/zhimengxueyuan/zhimenganzhuangshiyong/25830.html
2.安裝好后臺點擊后臺系統(tǒng)→數(shù)據(jù)庫備份還原→數(shù)據(jù)還原,點擊下面的開始還原數(shù)據(jù);
二、設置偽靜態(tài)
- 設置偽靜態(tài)。LINUX寶塔系統(tǒng)Nginx設置教程:(偽靜態(tài)代碼請查看壓縮包里的Nginx.txt)
2.找到網(wǎng)站根目錄下的mycity文件夾下的index.php文件。打開編輯,把域名改成自己的。
這樣就設置完了,網(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 有沒有對應的拼音