Dedecms织梦联动地区后台显示为数字的正确解决方法,网络上有类似的文章,但是都是不完整,错误的方法。所谓一子错,满盘皆输.
以下是本站长整理出来亲身验证无误的方法.
1.在\dede\templets\diy_list.htm 找到(大约在41行):
PHP">else if($fielddata[1]=='addon') { $fields[$field] = " 其它附件"; }
Execute('me',"SELECT * FROM `SzsFox_stepselect` WHERE egroup='{$field}'"); while($arr = $db->GetArray(me)) { $egroup = $arr['egroup']; } $fields[$field] = Getenums("{$fields[$field]}",$egroup); }
PHP">{/dede:datalist}
PHP">= 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 = ($egroup == 'nativeplace') ? preg_replace('/(?<=\.)[0]+/','',$evalue) : $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]; } } } } ?>
修改完毕。
原文链接:https://www.f2er.com/dedecms/403745.html