1、后臺-系統(tǒng)-SQL命令行工具-執(zhí)行
ALTER TABLE `dede_tagindex` ADD `filename` CHAR( 255 ) NOT NULL DEFAULT '';
2、對TAG標簽表已有數(shù)據(jù)的拼音字段生成拼音
點擊下面鏈接下載文件,根據(jù)自己程序編碼,選擇pinyin.php文件,放到網(wǎng)站根目錄
pinyin.php放到網(wǎng)站根目錄后,在瀏覽器上打開
http://你的域名/pinyin.php
打開后文件會自動對已有的TAG標簽生成拼音,完成即可,完成后刪除這個文件。以后添加文檔或者TAG標簽后不再需要執(zhí)行它了,第3步是為了以后的TAG自動生成拼音。
3、/include/helpers/archive.helper.php 找到
$tid = $dsql->GetLastID();
在它下面加入
$pinyin = GetPinyin($tag);
$shuzi = '';
$fnrow = $dsql->GetOne("SELECT id FROM `dede_tagindex` WHERE filename LIKE '$pinyin' ORDER BY id DESC LIMIT 1");
if(is_array($fnrow))
{
$strarr = str_split($pinyin);
$strend = $strarr[count($strarr) - 1];
$shuzi = is_numeric($strend) ? $strend+1 : 1;
}
$upquery = "UPDATE `dede_tagindex` SET `filename`='{$pinyin}{$shuzi}' WHERE id='$tid' ";
$dsql->ExecuteNoneQuery($upquery);
4、/tags.php 找到 25行
$tag = FilterSearch(urldecode($tag));
在它上面加入
$tag = reset(explode("_", $tag));
$PageNo = stripos(GetCurUrl(), '.html') ? intval(str_replace('.html', '', end(explode("_", GetCurUrl())))) : 1;
$row = $dsql->GetOne("SELECT tag FROM `dede_tagindex` WHERE filename = '$tag' ORDER BY id DESC LIMIT 1");
if(is_array($row))
{
$tag = $row['tag'];
define('DEDERETAG', 'Y');
}
5、/include/taglib/tag.lib.php 找到 87行
$row['link'] = $cfg_cmsurl."/tags.php?/".urlencode($row['keyword'])."/";
改成
$row['link'] = $cfg_cmsurl."/tags/".GetPinyin($row['tag']).".html";
6、/include/arc.taglist.class.php 找到 121行
$this->PageNo = $GLOBALS['PageNo'];
在它下面加入
if($this->PageNo == 0)
{
$this->PageNo = 1;
}
繼續(xù)找到
$purl .= "?/".urlencode($this->Tag);
改成
if(!defined('DEDERETAG'))
{
$purl .= "?/".urlencode($this->Tag);
}
else
{
$purl = $cfg_cmsurl."/tags/".GetPinyin($this->Tag);
}
繼續(xù)找到
return $plist;
在它上面加入
if(defined('DEDERETAG'))
{
$plist = str_replace('.html', '', $plist);
$plist = preg_replace("/\/(\d+)\//i",'_\\1.html',$plist);
$plist = preg_replace("/PageNo=(\d+)/i",'_\\1.html',$plist);
}
7、電腦站TAG標簽偽靜態(tài)規(guī)則,根據(jù)自己網(wǎng)站的主機環(huán)境選擇下面的規(guī)則
.htaccess (Apache)
RewriteEngine On
RewriteBase /
RewriteRule ^tags\.html$ tags\.php
RewriteRule ^tags/(.*)_([0-9]+)\.html$ tags\.php\?\/$1\/$2 [L]
RewriteRule ^tags/(.*)_([0-9]+)\.html$ tags\.php\?\/$1\/$2\/ [L]
RewriteRule ^tags/(.*)\.html$ tags\.php\?\/$1
RewriteRule ^tags/(.*)\.html$ tags\.php\?\/$1\/
Nginx
rewrite ^/tags\.html$ /tags.php;
rewrite ^/tags/(.*)-([0-9]+)\.html$ /tags.php?\/$1\/$2;
rewrite ^/tags/(.*)\.html$ /tags.php?\/$1;
web.config (iis7 iis8)
<rule name="tag首頁">
<match url="^tags.html$" ignoreCase="false" />
<action type="Rewrite" url="tags.php" appendQueryString="false" />
</rule>
<rule name="tag列表分頁">
<match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
</rule>
<rule name="tag列表分頁最后有左斜杠">
<match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />
</rule>
<rule name="tag列表">
<match url="^tags/(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="tag列表最后有左斜杠">
<match url="^tags/(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" />
</rule>
打開 /dede/templets/tags_main.htm 找到 89行
<a href="../tags.php?/<?php echo urlencode($fields['tag']); ?>/" target="_blank">{dede:field.tag /}</a>
改成
<a href="../tags/<?php echo GetPinyin($fields['tag']); ?>.html" target="_blank">{dede:field.tag /}</a>
1、m 文件夾添加tags.php文件給手機站使用(點擊下方下載)
2、手機站TAG標簽偽靜態(tài)規(guī)則,根據(jù)自己網(wǎng)站的主機環(huán)境選擇下面的規(guī)則
.htaccess (Apache 放到m文件夾下)
RewriteEngine On
RewriteBase /
RewriteRule ^tags\.html$ tags\.php
RewriteRule ^tags/(.*)_([0-9]+)\.html$ tags\.php\?\/$1\/$2 [L]
RewriteRule ^tags/(.*)_([0-9]+)\.html$ tags\.php\?\/$1\/$2\/ [L]
RewriteRule ^tags/(.*)\.html$ tags\.php\?\/$1
RewriteRule ^tags/(.*)\.html$ tags\.php\?\/$1\/
Nginx
rewrite ^/tags\.html$ /tags.php;
rewrite ^/tags/(.*)-([0-9]+)\.html$ /tags.php?\/$1\/$2;
rewrite ^/tags/(.*)\.html$ /tags.php?\/$1;
web.config (iis7 iis8)
<rule name="tag首頁">
<match url="^tags.html$" ignoreCase="false" />
<action type="Rewrite" url="tags.php" appendQueryString="false" />
</rule>
<rule name="tag列表分頁">
<match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
</rule>
<rule name="tag列表分頁最后有左斜杠">
<match url="^tags/(.*)_([0-9]+).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}/" appendQueryString="false" />
</rule>
<rule name="tag列表">
<match url="^tags/(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="tag列表最后有左斜杠">
<match url="^tags/(.*).html$" ignoreCase="false" />
<action type="Rewrite" url="/tags.php?/{R:1}/" appendQueryString="false" />
</rule>
3、手機站TAG標簽首頁和TAG標簽列表頁模板為
4、TAG標簽調(diào)用與電腦站一樣
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢電腦站手機站TAG標簽偽靜態(tài)-單鏈接拼音版