Salad UN

To Taste The Salad Of Life.

« dedecms 英文站翻译部分dedecms 时间部分代码 »

dedecms 英文站优化

[ At 2008-8-29 By Ash   0 comments ]

dedecms 英文站优化

英文站的时候,为了URL优化,设置生成文件名用文章标题。
但是遇到一个问题就是比如文章名是I LOVE YOU,dede生成的文章页是I_LOVE_YOU.htm.在搜索的眼里这个文件名就是ILOVEYOU.htm变成了一个无意义的单词。所以要把_变成-。这样生成的文件名是


I-LOVE-YOU.htm。做英文站URL包含关键字是相当重要的。现把做法分享给大家,此方法从BLT大哥那里请教来的,自己还没去试,第一时间发过来。

打开 include/inc/inc_fun_funAdmin.php

for($i=0;$i<$slen;$i++){
if(ord($str[$i])>0x80)
{
$c = $str[$i].$str[$i+1];
$i++;
if(isset($pinyins[$c])){
if($ishead==0) $restr .= $pinyins[$c];
else $restr .= $pinyins[$c][0];
}else $restr .= "-";
}else if( eregi("[a-z0-9]",$str[$i]) ){ $restr .= $str[$i]; }
else{ $restr .= "-"; }
}


$restr .= "-"; 这些东西

完全引用他原话,完毕。

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。

日历

最新评论及回复

最近发表

Powered By Z-Blog 1.8 Spirit Build 80722 Code detection by Codefense

Copyright 2008 www.s-un.cn. Some Rights Reserved.