📄 post.php
字号:
<?php
require_once("variable.php");
echo $WmlDeclare;
$nav = "<a href='./?session=$session'>首页</a> | <a href='thread.php?fid=$_GET[fid]&session=$session'>上一级</a><br/>";
$rowforum = mysql_fetch_array(mysql_query("select name,allowpost from ".$dbTablePx."forums where fid='$_GET[fid]' limit 1"));
?>
<wml>
<head>
<meta http-equiv="Cache-Control" content="no-cache" forua="true"/>
</head>
<card id="menu" title="发表帖子">
<p align="left">
<?php
echo $nav;
if($_GET[action]=="post" and $session!=""){
if(empty($_GET[subject]) or empty($_GET[content])){
echo "请填写标题与内容!<br/>";
}else{
$subject = iconv("UTF-8","GB2312",htmlspecialchars($_GET[subject]));
$content = iconv("UTF-8","GB2312",htmlspecialchars($_GET[content]."[Post by WAP]"));
if($session==""){
$username = "cvmlsdjt64mcmdlsd";
}
$row = mysql_fetch_array(mysql_query("select * from ".$dbTablePx."members where username='$username' limit 1"));
if($session==$row[md5id]){
$idif = substr_count($rowforum[allowpost], ','.$row[groupid].',');
$idifb = substr_count($rowforum[allowpost], ','.$row[memberid].',');
$AllowP = 0;
if(str_replace(" ","",$rowforum[allowpost])==""){
$AllowP = 1;
}else{
if(($idif+$idifb) > 0){
$AllowP = 1;
}else{
$AllowP = 0;
}
}
if($row[groupid]==6){$AllowP = 0;}
if($AllowP==1){
if(mysql_query("insert into ".$dbTablePx."threads (fid,author,authorid,subject,postdate,lastpost,lastposter,ifcheck) values ('$_GET[fid]','$username','$row[uid]','$subject',UNIX_TIMESTAMP(),UNIX_TIMESTAMP(),'$username','1')")){
$tid = mysql_insert_id();
if(mysql_query("insert into ".$dbTablePx."tmsgs (tid,userip,content) values ('$tid','$_SERVER[REMOTE_ADDR]','$content')")){
$mm = $subject." ".time()." ".$username;
mysql_query("update ".$dbTablePx."forums set threads=threads+1,lastpost='$mm' where fid='$_GET[fid]'");
mysql_query("update ".$dbTablePx."memberdata set lastpost=UNIX_TIMESTAMP(),todaypost=todaypost+1,postnum=postnum+1 where uid='$row[uid]'");
}
}
echo "发表成功!<br/><a href='thread.php?fid=$_GET[fid]&session=$session'><<返回上一级</a><br/>";
}else{
echo "此版只接受特殊权限会员的文章发表!<br/><a href='thread.php?fid=$_GET[fid]&session=$session'><<返回上一级</a><br/>";
}
}else{
echo "用户出错!<br/>";
echo "<anchor>[返回上一页]<prev/></anchor><br/>";
}
}
}elseif($session!=""){
?>
论坛版区:<?php echo $rowforum[name];?><br/>
标题:<input name="subject" type="text" format="*M" value="" emptyok="true" maxlength="60"/><br/>
内容:<input name="content" type="text" format="*M" value="" emptyok="true" maxlength="300"/><br/>
<anchor>
[发表]
<go href="post.php?action=post&fid=<?php echo $_GET[fid];?>&session=<?=$session;?>" method="get">
<postfield name="subject" value="$(subject)"/>
<postfield name="content" value="$(content)"/>
</go>
</anchor>
<a href="thread.php?fid=<?php echo $_GET[fid];?>&session=<?=$session;?>">[取消]</a>
<?php
}else{
echo "请先登录!";
}
?>
<br/>
<?php echo $nav;?>
<br/>
<small>(C)copyright by <?php echo $siteSign;?></small>
</p>
</card>
</wml>
<?php
LangFlush(ob_get_contents());
?>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -