打開 /include/extend.func.php 在最下面加入個方法
if(!function_exists('Getenums'))
{
function Getenums($evalue=0,$egroup)
{
if( !isset($GLOBALS['em_'.$egroup.'s']) )
{
$cachefile = DEDEDATA.'/enums/'.$egroup.'.php';
if(!file_exists($cachefile))
{
require_once(DEDEINC.'/enums.func.php');
WriteEnumsCache();
}
if(!file_exists($cachefile))
{
return '';
}
else
{
require_once($cachefile);
}
}
if($evalue>=500)
{
if($evalue % 500 == 0)
{
return (isset($GLOBALS['em_'.$egroup.'s'][$evalue]) ? $GLOBALS['em_'.$egroup.'s'][$evalue] : '');
}
else if (preg_match("#([0-9]{1,})\.([0-9]{1,})#", $evalue, $matchs))
{
$esonvalue = $matchs[1];
$etopvalue = $esonvalue - ($esonvalue % 500);
$esecvalue = $evalue;
$GLOBALS['em_'.$egroup.'s'][$etopvalue] = empty($GLOBALS['em_'.$egroup.'s'][$etopvalue])? ''
: $GLOBALS['em_'.$egroup.'s'][$etopvalue];
$GLOBALS['em_'.$egroup.'s'][$esonvalue] = empty($GLOBALS['em_'.$egroup.'s'][$esonvalue])? ''
: $GLOBALS['em_'.$egroup.'s'][$esonvalue];
$GLOBALS['em_'.$egroup.'s'][$esecvalue] = empty($GLOBALS['em_'.$egroup.'s'][$esecvalue])? ''
: $GLOBALS['em_'.$egroup.'s'][$esecvalue];
return $GLOBALS['em_'.$egroup.'s'][$etopvalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$esonvalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$esecvalue];
}
else
{
$elimit = $evalue % 500;
$erevalue = $evalue - $elimit;
$GLOBALS['em_'.$egroup.'s'][$erevalue] = empty($GLOBALS['em_'.$egroup.'s'][$erevalue])? ''
: $GLOBALS['em_'.$egroup.'s'][$erevalue];
$GLOBALS['em_'.$egroup.'s'][$evalue] = empty($GLOBALS['em_'.$egroup.'s'][$evalue])? ''
: $GLOBALS['em_'.$egroup.'s'][$evalue];
return $GLOBALS['em_'.$egroup.'s'][$erevalue].' -- '.$GLOBALS['em_'.$egroup.'s'][$evalue];
}
}
}
}
{dede:infolink}
<p>
<b>省份:</b>[field:linkallplace/]
</p>
<p>
<b>市級:</b>[field:nativeplace /]
</p>
<p>
<b>地區(qū):</b>[field:county /]
</p>
{/dede:infolink}
版權(quán)聲明: 本站資源均來自互聯(lián)網(wǎng)或會員發(fā)布,如果侵犯了您的權(quán)益請與我們聯(lián)系,我們將在24小時內(nèi)刪除!謝謝!
轉(zhuǎn)載請注明: 織夢前臺和后臺根據(jù)聯(lián)動枚舉數(shù)字輸出文字的方法