• 织梦分类信息联动地区伪静态 apache伪静态规则-002cc全讯开户送白菜

  • 专注网站建设 服务热线: 13061801310

织梦分类信息联动地区伪静态 apache伪静态规则

发布时间:2021-04-30 | 发布者:  | 浏览次数: 次

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&infotype=$4
rewriterule ^category/list-([0-9] )-([0-9] )-([0-9] )-([0-9] )-([0-9] )\.html$ /plus/list.php?tid=$1&totalresult=$2&nativeplace=$3&infotype=$4&pageno=$5

/include/taglib/infolink.lib.php  整个文件修改为

>dede>>
分类信息地区与类型快捷链接
全局标记
v55,v56,v57
调用分类信息地区与类型快捷链接

{dede:infolink /}


 
>>dede>>*/
 
require_once(dedeinc.'/enums.func.php');
require_once(dededata.'/enums/nativeplace.php');
require_once(dededata.'/enums/infotype.php');
function lib_infolink(&$ctag,&$refobj)
{
    global $cfg_rewrite,$dsql,$nativeplace,$infotype,$hassetenumjs,$cfg_cmspath,$cfg_mainsite;
    global $em_nativeplaces,$em_infotypes;
    
    //属性处理
    //$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_mainsite).$cmspath;
    
    $smalltypes = '';
    if( !empty($refobj->typelink->typeinfos['smalltypes']) ) {
        $smalltypes = explode(',', $refobj->typelink->typeinfos['smalltypes']);
    }
    
    if(empty($refobj->fields['typeid'])) {
        $row = $dsql->getone("select id from `dede_arctype` where channeltype='-8' and reid = '0' ");
        $typeid = (is_array($row) ? $row['id'] : 0);
    }
    else {
        $typeid = $refobj->fields['typeid'];
    }
    
    $innertext = trim($ctag->getinnertext());
    if(empty($innertext)) $innertext = getsystemplets("info_link.htm");
    $ctp = new dedetagparse();
    $ctp->setnamespace('field','[',']');
    $ctp->loadsource($innertext);
    $revalue = $seli = '';
    $channelid = ( empty($refobj->typelink->typeinfos['channeltype']) ? -8 : $refobj->typelink->typeinfos['channeltype'] );
    
    $fields = array('nativeplace'=>'','infotype'=>'','typeid'=>$typeid,
                    'channelid'=>$channelid,'linkallplace'=>'','linkalltype'=>'');
    
    $fields['nativeplace'] = $fields['infotype'] = '';
    
	
	//伪静态
	if($cfg_rewrite == 'y')
	{
		$rwlinkallplace = "/category/list-".$channelid."-".$typeid."-".$infotype."-0.html";
		$fields['linkallplace'] = "";
	}
	else
	{
		$fields['linkallplace'] = "";
	}
	//伪静态
	if($cfg_rewrite == 'y')
	{
		$rwlinkalltype = "/category/list-".$channelid."-".$typeid."-".$nativeplace."-0.html";
		$fields['linkalltype'] = "";
	}
	else
	{
		$fields['linkalltype'] = "";
	}
    
    //地区链接
    if(empty($nativeplace))
    {
        foreach($em_nativeplaces as $eid=>$em)
        {
            if($eid % 500 != 0) continue;
			//伪静态
			if($cfg_rewrite == 'y')
			{
				$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$eid."-".$infotype.".html";
				$fields['nativeplace'] .= "";
			}
			else
			{
				$fields['nativeplace'] .= " \r\n";
			}
        }
    }
    else
    {
        $sontype = ( ($nativeplace % 500 != 0) ? $nativeplace : 0 );
        $toptype = ( ($nativeplace % 500 == 0) ? $nativeplace : ( $nativeplace-($nativeplacep0) ) );
		//2011-6-21 修改地区列表的一个小空格 论坛http://bbs.dedecms.com/371492.html(by:织梦的鱼)
		//伪静态
		if($cfg_rewrite == 'y')
		{
			$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$toptype."-".$infotype.".html";
			$fields['nativeplace'] = " >> ";
		}
		else
		{
			$fields['nativeplace'] = " >> ";
		}
        foreach($em_nativeplaces as $eid=>$em)
        {
            if($eid < $toptype 1 || $eid > $toptype 499) continue;
            if($eid == $nativeplace) {
                $fields['nativeplace'] .= " {$em}\r\n";
            }
            else {
				//伪静态
				if($cfg_rewrite == 'y')
				{
					$rwnativeplace = "/category/list-".$channelid."-".$typeid."-".$eid."-".$infotype.".html";
					$fields['nativeplace'] .= "\r\n";
				}
				else
				{
					$fields['nativeplace'] .= " \r\n";
				}
          }
      }
    }
    //小分类链接
    if(empty($infotype) || is_array($smalltypes))
    {
        
        foreach($em_infotypes as $eid=>$em)
        {
            if(!is_array($smalltypes) && $eid % 500 != 0) continue;
            if(is_array($smalltypes) && !in_array($eid, $smalltypes)) continue;
            if($eid == $infotype) 
            {
                $fields['infotype'] .= " {$em}\r\n";
            }
            else {
				//伪静态
				if($cfg_rewrite == 'y')
				{
					$rwinfotype = "/category/list-".$channelid."-".$typeid."-".$eid."-".$nativeplace.".html";
					$fields['infotype'] .= " \r\n";
				}
				else
				{
					$fields['infotype'] .= " \r\n";
				}
            }
        }
    }
    else
    {
        $sontype = ( ($infotype % 500 != 0) ? $infotype : 0 );
        $toptype = ( ($infotype % 500 == 0) ? $infotype : ( $infotype-($infotypep0) ) );
		//伪静态
		if($cfg_rewrite == 'y')
		{
			$rwinfotype = "/category/list-".$channelid."-".$typeid."-".$toptype."-".$nativeplace.".html";
			$fields['infotype'] .= " >> ";
		}
		else
		{
			$fields['infotype'] .= " >> ";
		}
        foreach($em_infotypes as $eid=>$em)
        {
            if($eid < $toptype 1 || $eid > $toptype 499) continue;
            if($eid == $infotype) {
                $fields['infotype'] .= " {$em}\r\n";
            }
            else {
				//伪静态
				if($cfg_rewrite == 'y')
				{
					$rwinfotype = "/category/list-".$channelid."-".$typeid."-".$eid."-".$nativeplace.".html";
					$fields['infotype'] .= " >> ";
				}
				else
				{
					$fields['infotype'] .= " \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;
}

打开/include/arc.sglistview.class.php 找到

$row['ismake'] = 1;

改成

$row['ismake'] = -1;

继续找到

global $nativeplace,$infotype,$keyword;

改成

global $cfg_rewrite,$nativeplace,$infotype,$keyword;

继续找到

$geturl = "tid=".$this->typeid."&totalresult=".$this->totalresult."&nativeplace=$nativeplace&infotype=$infotype&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&infotype=$infotype&";

最后找到

$plist = $indexpage.$prepage.$listdd.$nextpage.$endpage;

改成

$plist = $indexpage.$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('&infotype=', '-', $plist);
    $plist = preg_replace("/&pageno=(\d )/i",'-\\1.html',$plist);
}

转载请标注:——

上一篇:
下一篇:
网站地图