织梦DedeCms地区联动在当前页面title加入选择的地区名

打开 \include\arc.sglistview.class.php 搜索

$this->Fields['typeid'] = $this->TypeID;

在它下面加入代码

$this->Fields['nativeplace'] = $this->searchArr['nativeplace'];

打开 \include\extend.func.php 在最下面增加个方法

if ( ! function_exists('GetSysEnum'))
{
	function GetSysEnum($evalue, $egroup)
	{
		global $dsql;
		$egroup = isset($egroup) ? $egroup : 'nativeplace';
		if($evalue % 500 == 0)
		{
			$rowtop = $dsql->GetOne("select ename from `SzsFox_sys_enum` where egroup='".$egroup."' and evalue='".$evalue."'");
			return $rowtop['ename'];
		}
		else
		{
			(preg_match("#\.#", $evalue)) ? $rowre = $dsql->GetOne("select ename from `SzsFox_sys_enum` where egroup='".$egroup."' and evalue='".( floor($evalue-($evalue%500))+1 )."'") : $rowre['ename'] = '';
			$rowtop = $dsql->GetOne("select ename from `SzsFox_sys_enum` where egroup='".$egroup."' and evalue='".( floor($evalue-($evalue%500)) )."'");
			$rowson = $dsql->GetOne("select ename from `SzsFox_sys_enum` where egroup='".$egroup."' and evalue='".$evalue."'");
			if(is_array($rowson))
			{
				return $rowtop['ename'].$rowre['ename'].$rowson['ename'];
			}
		}
	}
}

列表模板title处的标签调用代码

<title>{dede:field.nativeplace function=GetSysEnum(@me)/}_{dede:field.title/}_{dede:global.cfg_webname/}</title>

 

THE END