2# 玻璃屋女孩
恩是的 我找到了这个,可是没有添加操作,不知道是哪句话
if(submitcheck('mtagsubmit')) {
$fieldid = intval($_POST['fieldid']);
$profield = $_SGLOBAL['profield'][$fieldid];
if(empty($fieldid) || empty($profield)) {
showmessage('mtag_fieldid_does_not_exist');
}
$_POST['tagname'] = $_POST['tagname'][$fieldid];
if($profield['formtype'] == 'multi') {
$mtags = array();
foreach ($_POST['tagname'] as $value) {
$s = stripslashes($value);
if(in_array($s, $profield['choice'])) {
if($mtag = mtag_join('tagname', $s, $fieldid)) {
$mtags[] = $mtag;
}
}
}
if(empty($mtags)) {
showmessage('mtag_join_error');
} else {
$_GET['op'] = 'multiresult';
include template("cp_mtag");
exit();
}
} elseif($profield['formtype'] == 'select') {
$mtag = array();
if(in_array(stripslashes($_POST['tagname']), $profield['choice'])) {
$mtag = mtag_join('tagname', $_POST['tagname'], $fieldid);
}
if(empty($mtag)) {
showmessage('mtag_join_error');
} else {
showmessage('join_success', "space.php?uid=$_SGLOBAL[supe_uid]&do=mtag&tagid=$mtag[tagid]", 0);
}
} else {
$tagname = getstr($_POST['tagname'], 40, 1, 1, 1);
$province = getstr($_POST['city'], 50, 1, 1, 1, 1);
if(strlen($tagname) < 2) {
showmessage('mtag_tagname_error');
}
if(!empty($_POST['joinmode'])) {
//二次确认
$mtag = mtag_join('tagname', $tagname, $fieldid);
if(empty($mtag)) {
showmessage('mtag_join_error');
} else {
$url = $mtag['grade']>=8?"cp.php?ac=mtag&op=manage&tagid=$mtag[tagid]":"space.php?uid=$_SGLOBAL[supe_uid]&do=mtag&tagid=$mtag[tagid]";
showmessage('join_success', $url, 0);
}
} else {
//寻找
$findmtag = $likemtags = array();
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('mtag')." WHERE tagname='$tagname' AND fieldid='$fieldid'");
if(!$findmtag = $_SGLOBAL['db']->fetch_array($query)) {
$newtagname = stripslashes($_POST['tagname']);
$key = stripsearchkey($_POST['tagname']);
//找相似的
$query = $_SGLOBAL['db']->query("SELECT * FROM ".tname('mtag')." WHERE fieldid='$fieldid' AND tagname LIKE '%$key%' ORDER BY membernum DESC LIMIT 0,20");
while ($value = $_SGLOBAL['db']->fetch_array($query)) {
$likemtags[] = $value;
}
} else {
if(empty($findmtag['pic'])) $findmtag['pic'] = 'image/nologo.jpg';
}
$_GET['op'] = 'confirm';
include template("cp_mtag");
exit();
}
}
} |