织梦CMS分类信息联动地区伪静态+apache伪静态规
网站建设 2022-07-27 08:13www.1681989.com免费网站
dedecms织梦分类信息联动地区伪静态+apache伪静态规则,需要的同学可以看看,由于改动多,需要对比修改的同学可以用【 Beyond Compare 】软件来修改 apache 分类信息联动地区伪静态规则 RewriteRule ^category/list-(-[0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?channelid= $1 tid= $2 nativeplace= $3 fotype= $4 RewriteRule […]
dedecms织梦分类信息联动地区伪静态+apache伪静态规则,需要的同学可以看看,由于改动多,需要对比修改的同学可以用【Beyond Compare】软件来修改
apache 分类信息联动地区伪静态规则
RewriteRule ^category/list-(-[0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?channelid=$1&tid=$2&nativeplace=$3&fotype=$4
RewriteRule ^category/list-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)-([0-9]+)\.html$ /plus/list.php?tid=$1&TotalResult=$2&nativeplace=$3&fotype=$4&PageNo=$5
/clude/taglib/folk.lib.php 整个文件修改为
<?php if(!defed('DEDEINC')) exit('Request Error!');
/
分类信息地区与类型快捷链接
@version $Id: folk.lib.php 1 9:29 2010年7月6日Z tianya $
@package DedeCMS.Taglib
@copyright Copyright (c) 2007 - 2010, DesDev, Inc.
@license http://help.dedecms./usersguide/license.html
@lk http://.dedecms.
/
/>>dede>>
<name>分类信息地区与类型快捷链接</name>
<type>全局标记</type>
<for>V55,V56,V57</for>
<description>调用分类信息地区与类型快捷链接</description>
<demo>
{dede:folk /}
</demo>
<attributes>
</attributes>
>>dede>>/
require_once(DEDEINC.'/enums.func.php');
require_once(DEDEDATA.'/enums/nativeplace.php');
require_once(DEDEDATA.'/enums/fotype.php');
function lib_folk(&$ctag,&$refObj)
{
global $cfg_rewrite,$dsql,$nativeplace,$fotype,$hasSetEnumJs,$cfg_cmspath,$cfg_masite;
global $em_nativeplaces,$em_fotypes;
//属性处理
//$attlist="row|12,titlelen|24";
//FillAttsDefault($ctag->CAttribute->Items,$attlist);
//extract($ctag->CAttribute->Items, EXTR_SKIP);
$cmspath = ( (empty($cfg_cmspath) || !preg_match("#\/$#", $cfg_cmspath)) ? $cfg_cmspath.'/' : $cfg_cmspath );
$baseurl = preg_replace("#\/$#", '', $cfg_masite).$cmspath;
$smalltypes = '';
if( !empty($refObj->TypeLk->TypeInfos['smalltypes']) ) {
$smalltypes = explode(',', $refObj->TypeLk->TypeInfos['smalltypes']);
}
if(empty($refObj->Fields['typeid'])) {
$row = $dsql->GetOne("SELECT id FROM `58pic_arctype` WHERE channeltype='-8' And reid = '0' ");
$typeid = (is_array($row) ? $row['id'] : 0);
}
else {
$typeid = $refObj->Fields['typeid'];
}
$nerText = trim($ctag->GetInnerText());
if(empty($nerText)) $nerText = GetSysTemplets("fo_lk.htm");
$ctp = new DedeTagParse();
$ctp->SetNameSpace('field','[',']');
$ctp->LoadSource($nerText);
$revalue = $seli = '';
$channelid = ( empty($refObj->TypeLk->TypeInfos['channeltype']) ? -8 : $refObj->TypeLk->TypeInfos['channeltype'] );
$fields = array('nativeplace'=>'','fotype'=>'','typeid'=>$typeid,
'channelid'=>$channelid,'lkallplace'=>'','lkalltype'=>'');
$fields['nativeplace'] = $fields['fotype'] = '';
//伪静态
if($cfg_rewrite == 'Y')
{
$rwlkallplace = "/category/list-".$channelid."-".$typeid."-".$fotype."-0.html";
$fields['lkallplace'] = "<a href='{$rwlkallplace}'>不限</a>";
}
else
{
$fields['lkallplace'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&fotype={$fotype}'>不限</a>";
}
//伪静态
if($cfg_rewrite == 'Y')
{
$rwlkalltype = "/category/list-".$channelid."-".$typeid."-".$nativeplace."-0.html";
$fields['lkalltype'] = "<a href='{$rwlkalltype}'>不限</a>";
}
else
{
$fields['lkalltype'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$nativeplace}'>不限</a>";
}
//地区链接
if(empty($nativeplace))
{
foreach($em_nativeplaces as $eid=>$em)
{
if($eid % 500 != 0) contue;
//伪静态
if($cfg_rewrite == 'Y')
{
$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$eid."-".$fotype.".html";
$fields['nativeplace'] .= "<a href='{$rwnativeplace}'>{$em}</a>";
}
else
{
$fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&fotype={$fotype}'>{$em}</a>\r\n";
}
}
}
else
{
$sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 );
$type = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplace%500) ) );
//2011-6-21 修改地区列表的一个小空格 论坛http://bbs.dedecms./371492.html(by织梦的鱼)
//伪静态
if($cfg_rewrite == 'Y')
{
$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$type."-".$fotype.".html";
$fields['nativeplace'] = "<a href='{$rwnativeplace}'> <b>{$em_nativeplaces[$type]}</b></a> >> ";
}
else
{
$fields['nativeplace'] = "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$type}&fotype={$fotype}'> <b>{$em_nativeplaces[$type]}</b></a> >> ";
}
foreach($em_nativeplaces as $eid=>$em)
{
if($eid < $type+1 || $eid > $type+499) contue;
if($eid == $nativeplace) {
$fields['nativeplace'] .= " <b>{$em}</b>\r\n";
}
else {
//伪静态
if($cfg_rewrite == 'Y')
{
$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$eid."-".$fotype.".html";
$fields['nativeplace'] .= "<a href='{$rwnativeplace}'>{$em}</a>\r\n";
}
else
{
$fields['nativeplace'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&nativeplace={$eid}&fotype={$fotype}'>{$em}</a>\r\n";
}
}
}
}
//小分类链接
if(empty($fotype) || is_array($smalltypes))
{
foreach($em_fotypes as $eid=>$em)
{
if(!is_array($smalltypes) && $eid % 500 != 0) contue;
if(is_array($smalltypes) && !_array($eid, $smalltypes)) contue;
if($eid == $fotype)
{
$fields['fotype'] .= " <b>{$em}</b>\r\n";
}
else {
//伪静态
if($cfg_rewrite == 'Y')
{
$rwfotype = "/category/list-".$channelid."-".$typeid."-".$eid."-".$nativeplace.".html";
$fields['fotype'] .= " <a href='{$rwfotype}'>{$em}</a>\r\n";
}
else
{
$fields['fotype'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&fotype={$eid}&nativeplace={$nativeplace}'>{$em}</a>\r\n";
}
}
}
}
else
{
$sontype = ( ($fotype % 500 != 0) ? $fotype : 0 );
$type = ( ($fotype % 500 == 0) ? $fotype : ( $fotype-($fotype%500) ) );
//伪静态
if($cfg_rewrite == 'Y')
{
$rwfotype = "/category/list-".$channelid."-".$typeid."-".$type."-".$nativeplace.".html";
$fields['fotype'] .= "<a href='{$rwfotype}'><b>{$em_fotypes[$type]}</b></a> >> ";
}
else
{
$fields['fotype'] .= "<a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&fotype={$type}&nativeplace={$nativeplace}'><b>{$em_fotypes[$type]}</b></a> >> ";
}
foreach($em_fotypes as $eid=>$em)
{
if($eid < $type+1 || $eid > $type+499) contue;
if($eid == $fotype) {
$fields['fotype'] .= " <b>{$em}</b>\r\n";
}
else {
//伪静态
if($cfg_rewrite == 'Y')
{
$rwfotype = "/category/list-".$channelid."-".$typeid."-".$eid."-".$nativeplace.".html";
$fields['fotype'] .= "<a href='{$rwfotype}'><b>{$em_fotypes[$type]}</b></a> >> ";
}
else
{
$fields['fotype'] .= " <a href='{$baseurl}plus/list.php?channelid={$channelid}&tid={$typeid}&fotype={$eid}&nativeplace={$nativeplace}'>{$em}</a>\r\n";
}
}
}
}
if(is_array($ctp->CTags))
{
foreach($ctp->CTags as $tagid=>$ctag)
{
if(isset($fields[$ctag->GetName()])) {
$ctp->Assign($tagid,$fields[$ctag->GetName()]);
}
}
$revalue .= $ctp->GetResult();
}
return $revalue;
}
打开/clude/arc.sglistview.class.php 找到
$row['ismake'] = 1;
改成
$row['ismake'] = -1;
继续找到
global $nativeplace,$fotype,$keyword;
改成
global $cfg_rewrite,$nativeplace,$fotype,$keyword;
继续找到
$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&nativeplace=$nativeplace&fotype=$fotype&keyword=".urlencode($keyword)."&";
改成
// 如果开启为静态,则对规则进行替换
if($cfg_rewrite == 'Y')
{
$nowurls = preg_replace("/\-/", ".php?", $purl);
$nowurls = explode("?", $nowurls);
$purl = $nowurls[0];
}
$geturl = "tid=".$this->TypeID."&TotalResult=".$this->TotalResult."&nativeplace=$nativeplace&fotype=$fotype&";
找到
$plist = $dexpage.$prepage.$listdd.$nextpage.$endpage;
改成
$plist = $dexpage.$prepage.$listdd.$nextpage.$endpage;
if($cfg_rewrite == 'Y')
{
$plist = str_replace('.php?tid=', '-', $plist);
$plist = str_replace('&TotalResult=', '-', $plist);
$plist = str_replace('&nativeplace=', '-', $plist);
$plist = str_replace('&fotype=', '-', $plist);
$plist = preg_replace("/&PageNo=(\d+)/i",'-\\1.html',$plist);
}