1、打开 /include/extend.func.php 在这个自定义函数文件里,最下面加入
/** * 获取联动枚举相关信息 * * @access public * @param string $evalue 枚举值 * @param string $egroup 枚举组名 * @return string */ 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 = ($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]; } } } } }
2、把 /plus/diy.php 里面的
$mailbody .= "{$fieldvalue[0]}:{${$field}}";
改成
if($fieldvalue[1]=='stepselect') { $dsql->Execute('me',"SELECT * FROM `dede_stepselect` WHERE egroup='{$field}'"); while($arr = $dsql->GetArray(me)) { $egroup = $arr['egroup']; } $mailbody .= "{$fieldvalue[0]}:".Getenums(${$field},$egroup)."\r\n"; } else { $mailbody .= "{$fieldvalue[0]}:{${$field}}\r\n"; }
织梦二次开发QQ群
本站客服QQ号:862782808(点击左边QQ号交流),群号(383578617) 如果您有任何织梦问题,请把问题发到群里,阁主将为您写解决教程!
转载请注明: 织梦模板 » 织梦邮箱接收自定义表单联动地区显示为数字的解决方法