📄 savepost.php
字号:
}
}
formatpost();
$htmls = implode("|", $html);
if ($_POST["wforum"] && $userp2[9] && isset($wname[$_POST["wforum"]])) {
$wadmin = $username;
$wid = $_POST["wforum"];
$wposttime = $time;
} else {
$wtpl=0;
$wadmin = '';
$wauthor = '';
$wid = 0;
$wposttime = 0;
}
mysql_query("insert into {$db_prefix}posts (tid,author, authorid,state,posttime,content,postip,sign,html,annex) values('0','$username', '$user[id]','1','$time','$content','$_SERVER[REMOTE_ADDR]','$sign','$htmls','$annextypepost')", $myconn);
$insert_id = mysql_insert_id();
if ($annextypepost == 1) {
mysql_query("update {$db_prefix}annex set tid='$insert_id',fix='1' where sign='$sign'", $myconn);
}
mysql_query("update {$db_prefix}posts set tid='$insert_id' where id='$insert_id'", $myconn);
mysql_query("insert into {$db_prefix}title (fid,cid,wid,tpl,titlefont,author,wadmin,title,locks,elite,updown,posttime,posttimeup,lastposttime,html,money,moneytype,thumb,recommend,wauthor,wposttime) values('$fid','$insert_id','$wid','$wtpl','$titlefont','$username','$wadmin','$title','$lock','$elite','$updown','$time','$time','$time','$subhtml','$money','$moneytype','$thumb','$freval','$wauthor','$wposttime')", $myconn);
$content = substrs(str_replace("\t", "", $content), 24, 'sql');
$title = substrs(str_replace("\t", "", $title), 24, 'sql');
$consdf = "$username\t$time\tread.php?tid=$insert_id\t$title\t\t$content";
ka($consdf, 100);
mysql_query("update {$db_prefix}forums set lastpost='$consdf',tcount=tcount+1,count=count+1,pcount=pcount+1 where fid='$fid'", $myconn);
$userrank = rank($user["postnum"], $user["a"], $user["b"], $user["c"]);
$rankco = $vp * $userrank + 1.0;
if ($userp2[10]) $money = 0;
$a = number_format($tvp[0] * $rankco) - $money;
$b = number_format($tvp[1] * $rankco);
$c = number_format($tvp[2] * $rankco);
@mysql_query("update {$db_prefix}members set a=a+'$a',b=b+'$b',c=c+'$c',posttime='$time',postnum=postnum+'1' where id='$user[id]'", $myconn);
if ($thumb > 0) {
if ($freval > 0) @unlink('cache/new.twt');
$updir = $softdir . '/thumbs/' . floor($insert_id / 10000);
if (!is_dir($updir)) {
if (@mkdir($updir, 0777) == false) echoerror(9);
}
makethumb($softdir . '/uploads/' . $thumb_dir, $updir . '/' . $insert_id . '.jpg', $thumb_type, $freval, $updir . '/' . $insert_id . '_m.jpg');
}
$reurl = $wid?'vread.php?tid=' . $insert_id:'read.php?tid=' . $insert_id.'&hid='.$hid;
echoioy(1);
} else if ($type == 'newreply' && $id > 0) {
$p_result = mysql_query("select * from {$db_prefix}title where cid='$id'", $myconn);
$sub = mysql_fetch_array($p_result);
$fid = $sub[fid];
if ($sub['updown'] == 2 || $sub['updown'] == 3 || $sub['updown'] == 5 || $sub['updown'] == 6) $bbsmessagefix = 1;
$sub['state']?null:echoerror(1);
forumpurview();
include language();
$_posttime = $time - $user['posttime'];
if ($_posttime > 0) {
if (($userp1[6] - $_posttime) > 0) echoerror(3);
} else {
echoerror(3);
}
if (!$userp3[3])echoerror(78);
$userp3[5]?null:echoerror(12);
if ($sub['locks']) {
if (!$userp3[20]) echoerror(13);
}
if ($sub['lastposttime'] < ($time - $reouttime)) {
if (!$userp3[6] && !$sub['wid'] && !$sub['recommend'] && !$sub['elite']) echoerror(14);
}
$html[0] = $userp3[33] && $html[0] == 1?1:0;
$result = mysql_query("select * from {$db_prefix}annex where sign='$sign'", $myconn);
while ($row = mysql_fetch_array($result)) {
if ($row['tid'] > 0) echoerror(137);
if (@in_array($row['id'], $annexdel)) {
$delid[] = $row['id'];
$delcode[$row['id']] = $row['code'];
$delcontent[$row['id']] = $row['content'];
continue;
}
$addannex[$row['id']] = $row['id'];
$filetype[$row['id']] = $row['filetype'];
$annexdir[$row['id']] = $row['content'];
$annextypepost = 1;
}
$taddannex=$addannex;
while (list (, $did) = @each($delid)) {
if ($delcode[$did] == 'file') {
@unlink("$softdir/uploads/" . $delcontent[$did]);
}
mysql_query("delete from {$db_prefix}annex where id='$did'", $myconn);
}
if ($userp1[8]) {
foreach($addannex as $nid) {
$val=(int)$adownnum[$nid];
if ($val>0 && $val<9999999) mysql_query("update {$db_prefix}annex set downnum='$val' where id='$nid'", $myconn);
}
}
formatpost();
$htmls = implode("|", $html);
mysql_query("insert into {$db_prefix}posts (tid,author, authorid,state,posttime,content,postip,sign,html,annex) values('$id','$username', '$user[id]','1','$time','$content','$_SERVER[REMOTE_ADDR]','$sign','$htmls','$annextypepost')", $myconn);
$insert_id = mysql_insert_id();
$content = substrs(str_replace("\t", "", $content), 24, 'sql');
$title = substrs(str_replace("\t", "", $title), 24, 'sql');
if ($sub['money'] > 0 && $sub['moneytype'] < 1) {
$jmoney = rand($tanya[0], $tanya[1]);
if ($jmoney > $sub['money'] || $sub['money'] < 10) $jmoney = $sub['money'];
if ($jmoney > 0) {
$reuser = $_p_post[0] . $abc[0] . ':<b>' . $jmoney . '</b>';
}
}
if ($annextypepost == 1) {
mysql_query("update {$db_prefix}annex set tid='$insert_id',fix='1' where sign='$sign'", $myconn);
}
ka($content, 100);
mysql_query("update {$db_prefix}title set money=money-'$jmoney',lastposter='$username', lastposttime='$time',lastcontent='$content',replies=replies+1 where cid='$id'", $myconn);
$consdf = "$username\t$time\read.php?tid=$insert_id\t\t$title\t$content";
ka($consdf, 100);
mysql_query("update {$db_prefix}forums set lastpost='$consdf',count=count+1,pcount=pcount+1 where fid=$fid", $myconn);
$userrank = rank($user["postnum"], $user["a"], $user["b"], $user["c"]);
$rankco = $vp * $userrank + 1.0;
$a = number_format($rvp[0] * $rankco);
$b = number_format($rvp[1] * $rankco);
$c = number_format($rvp[2] * $rankco);
@mysql_query("update {$db_prefix}members set a=a+$a,b=b+$b,c=c+$c,posttime='$time',postnum=postnum+1 where id='$user[id]'", $myconn);
$a = $sub['replies'] + 1;
$page = Ceil($a / $headnum);
$reurl = "read.php?tid=" . $sub['cid'] .'&hid='.$hid. '&page=' . $page . '&tpage=' . $_POST['tpage'] . "#$a";
echoioy(2);
} else if ($type == 'edit' && $wid>0) {
if (!$userp2[9]) {
echoerror(143);
}
$p_result = mysql_query("select * from {$db_prefix}title where cid='$id'", $myconn);
if ($sub = mysql_fetch_array($p_result)) {
$money = 0;
$fid = $sub['fid'];
$title_strlen = bstrlen($title);
$title_strlen < $title_min?echoerror(79):null;
$title_strlen > $title_max?echoerror(80):null;
if (isset($whype[$wid])) {
$userp3=NULL;
$menufile = 'wmenu' . $wid;
wstyle($t4[$wid]);
include language();
$pagename_n = $wname[$wid];
$pagename_m = $_pagename[13];
$webnav=$wups[$wid]>0?$wname[$wups[$wid]]:$wname[$wid];
} else {
echoerror(70);
}
$p_result = mysql_query("select * from {$db_prefix}posts where id='$id'", $myconn);
$post = mysql_fetch_array($p_result);
if ($sub['state'] == 0) echoerror(4);
$html[0] = $html[0] == 1?1:0;
$subhtml = 0;
$titlefont = 0;
$lock = 0;
$elite = 0;
$note = 0;
$sign = $post['sign'];
$result = mysql_query("select * from {$db_prefix}annex where sign='$sign'", $myconn);
while ($row = mysql_fetch_array($result)) {
if ($row['tid'] > 0 && $row['tid'] != $id) echoerror(137);
if (@in_array($row['id'], $annexdel)) {
$delid[] = $row['id'];
$delcode[$row['id']] = $row['code'];
$delcontent[$row['id']] = $row['content'];
continue;
}
$addannex[$row['id']] = $row['id'];
$filetype[$row['id']] = $row['filetype'];
$annexdir[$row['id']] = $row['content'];
$annextypepost = 1;
}
$taddannex=$addannex;
while (list (, $did) = @each($delid)) {
if ($delcode[$did] == 'file') {
@unlink("$softdir/uploads/" . $delcontent[$did]);
}
mysql_query("delete from {$db_prefix}annex where id='$did'", $myconn);
}
if ($userp1[8]) {
foreach($addannex as $nid) {
$val=(int)$adownnum[$nid];
if ($val>0 && $val<9999999) mysql_query("update {$db_prefix}annex set downnum='$val' where id='$nid'", $myconn);
}
}
formatpost();
$htmls = implode('|', $html);
$pmauthor = '';
$pmpost = '';
$fre = (int)$_POST['fre'];
$fre_sql = '';
if (($fre == 2 || $fre == 3 || $fre == 0) && $sub['recommend'] != $fre) {
if ($fre == 0) $fre_sql = ",recommend='0'";
if ($fre == 2 || $fre == 3) $fre_sql = ",recommend='$fre'";
if ($fre == 0) {
$pmauthor .= $_p_affair[17] . ";";
$pmpost = "$time\t$username\t17|$pmpost";
event($fid, 17, $id, "");
@unlink('./cache/new.twt');
unthumb($id);
} else if ($sub["recommend"] == 0) {
$pmauthor .= $_p_affair[15] . ";";
$pmpost = "$time\t$username\t15|$pmpost";
event($fid, 15, $id, "");
@unlink('./cache/new.twt');
} else {
$pmauthor .= $_p_affair[16] . ";";
$pmpost = "$time\t$username\t16|$pmpost";
event($fid, 16, $id, "");
}
}
$sql_title = '';
if ($_POST['wforum']!=$sub['fid']){
if ($_POST['wforum']>0){
$pmauthor .= $_p_affair[29] . ";";
$pmpost = "$time\t$username\t29|$pmpost";
event($fid, 29, $id, "鈫
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -