${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $aid); $inadd_f .= ',' . $vs[0] . " ='" . ${$vs[0]} . "' "; } } if (empty($dede_fieldshash) || $dede_fieldshash != md5($dede_addonfields . $cfg_cookie_encode)) { showMsg('数据校验不对,程序返回', '-1'); exit; } // 这里对前台提交的附加数据进行一次校验 $fontiterm = PrintAutoFieldsAdd($cInfos['fieldset'], 'autofield', FALSE); if ($fontiterm != $inadd_f) { ShowMsg("提交表单同系统配置不相符,请重新提交!", "-1"); exit; } } $body = AnalyseHtmlBody($body, $description); $body = HtmlReplace($body, -1); //处理图片文档的自定义属性 if ($litpic != '') { $flag = 'p'; } //更新数据库的SQL语句 $upQuery = "UPDATE `#@__archives` SET\n ismake='{$ismake}',\n arcrank='{$arcrank}',\n typeid='{$typeid}',\n title='{$title}',\n litpic='{$litpic}',\n description='{$description}',\n mtype = '{$mtypesid}',\n keywords='{$keywords}', \n flag='{$flag}'\n WHERE id='{$aid}' AND mid='{$mid}'; "; if (!$dsql->ExecuteNoneQuery($upQuery)) { ShowMsg("把数据保存到数据库主表时出错,请联系管理员!" . $dsql->GetError(), "-1"); exit; } if ($addtable != '') { $upQuery = "UPDATE `{$addtable}` SET typeid='{$typeid}',body='{$body}'{$inadd_f},userip='{$userip}' WHERE aid='{$aid}' "; if (!$dsql->ExecuteNoneQuery($upQuery)) { ShowMsg("更新附加表 `{$addtable}` 时出错,请联系管理员!", "javascript:;");
$body = AnalyseHtmlBody($body, $description, $litpic, $keywords, 'htmltext'); //分析处理附加表数据 $inadd_f = ''; $inadd_v = ''; if (!empty($dede_addonfields)) { $addonfields = explode(';', $dede_addonfields); $inadd_f = ''; $inadd_v = ''; if (is_array($addonfields)) { foreach ($addonfields as $v) { if ($v == '') { continue; } $vs = explode(',', $v); if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') { ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $litpic, $keywords, $vs[1]); } else { if (!isset(${$vs[0]})) { ${$vs[0]} = ''; } ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $id); } $inadd_f .= ",`{$vs[0]}` = '" . ${$vs[0]} . "'"; } } } //处理图片文档的自定义属性 if ($litpic != '' && !preg_match("#p#", $flag)) { $flag = $flag == '' ? 'p' : $flag . ',p'; } if ($redirecturl != '' && !preg_match("#j#", $flag)) {
//分析处理附加表数据 $inadd_f = ''; if (!empty($dede_addonfields)) { $addonfields = explode(';', $dede_addonfields); if (is_array($addonfields)) { foreach ($addonfields as $v) { if ($v == '') { continue; } $vs = explode(',', $v); if (!isset(${$vs[0]})) { ${$vs[0]} = ''; } //自动摘要和远程图片本地化 if ($vs[1] == 'htmltext' || $vs[1] == 'textdata') { ${$vs[0]} = AnalyseHtmlBody(${$vs[0]}, $description, $vs[1]); } ${$vs[0]} = GetFieldValueA(${$vs[0]}, $vs[1], $aid); $inadd_f .= ',`' . $vs[0] . "` ='" . ${$vs[0]} . "' "; } } } if ($addtable != '') { $upQuery = "Update `{$addtable}` set `title`='{$title}',`typeid`='{$typeid}',`arcrank`='{$arcrank}',litpic='{$litpic}',userip='{$userip}'{$inadd_f} where aid='{$aid}' "; if (!$dsql->ExecuteNoneQuery($upQuery)) { ShowMsg("更新附加表 `{$addtable}` 时出错,请联系管理员!", "javascript:;"); exit; } } UpIndexKey($aid, 0, $typeid, $sortrank, ''); $artUrl = MakeArt($aid, true);