dedecms×÷Ϊµ±Ç°Ò»¿îʹÓ÷dz£¹ã·ºµÄ½¨Õ¾ÏµÍ³£¬ÈçºÎ¸üºÃµÄÓÅ»¯³ÉΪÿ¸öÕ¾³¤µÄµÚÒ»¼þ´óÊ£¬Ê×ÏÈÎÒÃÇÒª¿¼ÂǵÄÊÇDedecmsµÄurl¹æÔò£¬¶øÔÚurl¹æÔòÖУ¬tag±êÇ©ÊÇ×î²îµÄ£¬½¨Òé´ó¼ÒʹÓÃα¾²Ì¬£¬µ«ÊÇÍøÉϵĽ̶̳¼²»Ì«È«Ã棬±¾ÎľÍÊÕ¼¯ÕûÀíÁË×îеÄdedecms5.7±êÇ©tagÍêÉÆÎ±¾²Ì¬½Ì³Ì£¬»¶Ó´ó¼ÒÔĶÁ¡£
1.dedecms°æ±¾ 5.7 sp1 GBK
2.·þÎñÆ÷:windows 2008 iis7
»°²»¶à˵£¬¿ªÊ¼£¡
Ä¿±ê£ºÎÒÃÇҪʹÔÀ´tags.php?/veryhuo/ ±ä¶¯Îª/tags/veryhuo.html ²¢ÇÒΪα¾²Ì¬£¬ÎªÊ²Ã´ÒªÎªÎ±¾²Ì¬£¿ÒòΪÎÒÃǵĹؼü´Ê(tags)Ì«¶à£¬±ÈÕæÕý¾²Ì¬½ÚÊ¡¿Õ¼ä¡£
ÄÇôÎÒÃÇÒª×öÈçϹ¤×÷£¬¼ÇµÃÒ»²½Ò»²½À´Å¶£¡
µÚ1²½£º
Ê×ÏÈÕÒµ½/include/taglib/tag.lib.phpÖУ¬ÔÚ87ÐÐÕÒµ½
$row['link'] = $cfg_cmsurl."/tags?".urlencode($row['keyword']);¡¡¡¡
½«ÆäÐÞ¸ÄΪ£º
$row['link'] = $cfg_cmsurl."/tags/".urlencode($row['keyword']).".html";
µÚ2²½£º
Ð޸ķÖÒ³´úÂ벿ÃÅ
ÐÞ¸Äinclude/arc.taglist.class.php£¬ÕÒµ½·ÖÒ³º¯Êý£¬½«Æä¸ü»»Îª£º
×¢Ò⣺´Ó429ÐÐ ---->541ÐÐ ÓÃÒÔÏÂÄÚÈÝÌæ»»£¡
£¨Ìáʾ£ºÍøÉÏÓÐÎÄÕÂÖн²µÄÒÔÏ´úÂëÖеÄ"pageinfo"ÊÇ´íÎóµÄ£¬Ó¦¸ÃΪ\"pageinfo\"£¬²»È»»áÓдíÎóÌáʾŶ£¡ÒѾ´úÂë²âÊÔOK£¡£©
/**
* »ñÈ¡¶¯Ì¬µÄ·ÖÒ³Áбí
*
* @access public
* @param int $list_len Áбí¿í¶È
* @param string $listitem ÁбíÑùʽ
* @return string
*/
function GetPageListDM($list_len,$listitem="info,index,end,pre,next,pageno")
{
$prepage="";
$nextpage="";
$prepagenum = $this->PageNo - 1;
$nextpagenum = $this->PageNo + 1;
if($list_len == "" || preg_match("/[^0-9]/", $list_len))
{
$list_len = 3;
}
$totalpage = $this->TotalPage;
if($totalpage <= 1 && $this->TotalResult > 0)
{
return "<span class=\"pageinfo\">¹²1Ò³/".$this->TotalResult."Ìõ</span>";
}
if($this->TotalResult == 0)
{
return "<span class=\"pageinfo\">¹²0Ò³/".$this->TotalResult."Ìõ</span>";
}
$maininfo = "<span class=\"pageinfo\">¹²{$totalpage}Ò³/".$this->TotalResult."Ìõ</span>\r\n";
$purl = $this->GetCurUrl();
$purl .= "?/".urlencode($this->Tag);
//»ñµÃÉÏÒ»Ò³ºÍÏÂÒ»Ò³µÄÁ´½Ó
if($this->PageNo != 1)
{
$prepage.="<li><a href='".$purl."/$prepagenum/'>ÉÏÒ»Ò³</a></li>\r\n";
$indexpage="<li><a href='".$purl."/1/'>Ê×Ò³</a></li>\r\n";
}
else
{
$indexpage="<li><a>Ê×Ò³</a></li>\r\n";
}
if($this->PageNo!=$totalpage && $totalpage>1)
{
$nextpage.="<li><a href='".$purl."/$nextpagenum/'>ÏÂÒ»Ò³</a></li>\r\n";
$endpage="<li><a href='".$purl."/$totalpage/'>ĩҳ</a></li>\r\n";
}
else
{
$endpage="<li><a>ĩҳ</a></li>\r\n";
}
//»ñµÃÊý×ÖÁ´½Ó
$listdd="";
$total_list = $list_len * 2 + 1;
if($this->PageNo >= $total_list)
{
$j = $this->PageNo - $list_len;
$total_list = $this->PageNo + $list_len;
if($total_list > $totalpage)
{
$total_list = $totalpage;
}
}
else
{
$j=1;
if($total_list > $totalpage)
{
$total_list = $totalpage;
}
}
for($j; $j<=$total_list; $j++)
{
if($j == $this->PageNo)
{
$listdd.= "<li class=\"thisclass\"><a>$j</a></li>\r\n";
}
else
{
$listdd.="<li><a href='".$purl."/$j/'>".$j."</a></li>\r\n";
}
}
$plist = '';
if(preg_match('/info/i', $listitem))
{
$plist .= $maininfo.' ';
}
if(preg_match('/index/i', $listitem))
{
$plist .= $indexpage.' ';
}
if(preg_match('/pre/i', $listitem))
{
$plist .= $prepage.' ';
}
if(preg_match('/pageno/i', $listitem))
{
$plist .= $listdd.' ';
}
if(preg_match('/next/i', $listitem))
{
$plist .= $nextpage.' ';
}
if(preg_match('/end/i', $listitem))
{
$plist .= $endpage.' ';
}
return $plist;
}
µÚ3²½£º
ÉèÖÃα¾²Ì¬¹æÔò£º
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="weather1" stopProcessing="true">
<match url="tags/([^-]+).html$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/tags.php?/{R:1}" appendQueryString="false" />
</rule>
<rule name="weather2" stopProcessing="true">
<match url="tags/([^-]+)-([0-9]+).html$" ignoreCase="true" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="/tags.php?/{R:1}/{R:2}" appendQueryString="false" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
°ÑÒÔÉÏÄÚÈݱ£´æÎª£ºweb.config ·Åµ½ÍøÕ¾¸ùĿ¼!
µÚ4²½£º
Éú³ÉÎÄÕ£¬ä¯ÀÀ£¡´ó¹¦¸æ³É£¿´í£¬ÓпÉÄÜÄã»á³öÏÖ·¢Ï´íÎó£¡
ϵͳÎ޴˱êÇ©£¬¿ÉÄÜÒÑ¾ÒÆ³ý£¡
Ä㻹¿ÉÒÔ³¢ÊÔͨ¹ýËÑË÷³ÌÐòÈ¥ËÑË÷Õâ¸ö¹Ø¼ü×Ö£ºÇ°ÍùËÑË÷>>
Èç¹ûÄãµÄä¯ÀÀÆ÷û·´Ó¦£¬Çëµã»÷ÕâÀï...
½â¾ö°ì·¨ÈçÏ£º
ÔÚÍøÕ¾¸ùĿ¼ÏÂÕÒµ½tags.php ´ËÎļþ£¬½«ÒÔÏ´úÂëÌæ»»µô£º
¡¡¡¡$tag = trim($_SERVER['QUERY_STRING']);
¡¡¡¡»»³É
$tag = strtolower(trim($_SERVER['QUERY_STRING']));
³öÏÖÕâ¸öÎÊÌâµÄÔÒòÊÇIISα¾²Ì¬ÖÐÎÄתÂëΪUTF8£¬½â¾ö·½·¨¾ÍÊÇÔÚtags.phpÖмÓÈëÅжÏUTF8±àÂëµÄÓï¾ä£¬Èç¹ûÊÇÔòת»»ÎªGBK£¬ÕâÑù¾Í¿ÉÒÔ½â¾öÁË
·½·¨£º
1.°ÑÒÔÏ´úÂë¼ÓÈëµ½¸ùĿ¼ÏÂtags.phpÖеÄ18ÐÐÏÂÃæ£¬¼ÇµÃÊÇÏÂÃæÅ¶£º
function is_utf8($tag)
{
if (preg_match("/^([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}/",$tag) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){1}$/",$tag) == true || preg_match("/([".chr(228)."-".chr(233)."]{1}[".chr(128)."-".chr(191)."]{1}[".chr(128)."-".chr(191)."]{1}){2,}/",$tag) == true)
{
return true;
}
else
{
return false;
}
}
2.ÔÚµÚ25ÐÐÉÏÃæ¼ÓÈëÒÔÏÂÓï¾ä£¬Ò²¾ÍÊÇÔÚ$tag = FilterSearch(urldecode($tag));ÉÏÃæ¼ÓÈ룬¼ÇµÃÕâÀïÊÇÉÏÃæÅ¶£¡
if(is_utf8($tag)==1) { $tag = iconv("utf-8","gbk",$tag); }
Õâ¸ö×÷ÓþÍÊǵ÷ÓÃÉÏÃæµÄº¯ÊýÅжϱàÂë Èç¹ûÊÇ utf8ÔòתΪgbk£»
µ½´Ë£¬tagsα¾²Ì¬ÎÊÌâÈ«ÃæÍêÃÀ½â¾ö£¡
±¾ÎÄÓɶ«Ý¸ÍøÕ¾½¨É裬¶«Ý¸ÍøÕ¾½¨É蹫˾£¬¶«Ý¸ÍøÕ¾ÖÆ×÷£¬¶«Ý¸ÍøÕ¾ÖÆ×÷¹«Ë¾ÕûÀí·¢²¼