📄 post.php
字号:
<?php
require("userdata/style.php");
require("global.php");
require("globalpost.php");
if($login_status)
{$userin=explode("|",readfromfile("$userpath/$username.php"));
if($userin[28]==2)
{
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"请速去验证用户");
echo "<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$bordercolor>
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor=$titlecolor>
<td colspan=2 class=title bgcolor=$titlecolor>发生错误啦~ 您没有验证邮件的有效性</td>
</tr>
<tr bgcolor=FFFFFF>
<td ><br>
<center><p>您将收到一封验证邮件以确认邮箱的有效性,用户收到邮件并激活账号后才能拥有正常的权限<p>请到您注册所用的Email里查看验证邮件并激活您的用户名 谢谢!<br><br>您的电子邮件是:$userin[3]<p><p>你可以选择 <a href=index.php><b>论坛首页</b></a> 或 <a href=javascript:history.go(-1)><b>返回前页</b></a><p><p><center>
<tr align=left>
<td colspan=2 bgcolor=$titlecolor> </td>
</tr>
</table>
</td>
</tr>
</table>";
require("footer.php");echo"$footertp";
exit;
}}
if (file_exists("bbsdata/superadmin.php")) {
include("bbsdata/superadmin.php");
if ($superadmin && in_array($username,$superadmin)) {
$forum_admin[]=$username;}}
$pbqq100=0;
if (!$action) $action="new";
if ($action=="new" || $action=="reply" || $action=="quote" )
// 灌水预防----
if ($flood_control && $username && !flood_limit($username,$flood_control)) {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"灌水预防警告");
$status="* 灌水预防机制已经打开,在 $flood_control 秒内不能发贴";
print_err();
require("footer.php");echo"$footertp";
exit;
}
if ($action=="new" || $action=="reply" || $action=="quote" )
if (file_exists("bbsdata/wordsfb.php")) {
include("bbsdata/wordsfb.php");
reset($wordsfb);
while (list($key,$value)=each($wordsfb)) {
if (ereg("$key+",$articletitle)) {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"主题出现不良言语");
echo "<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$bordercolor>
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=3>
<tr >
<td colspan=2 class=title bgcolor=$titlecolor>警告: 你的主题有不良言语!</td>
</tr>
<tr bgcolor=FFFFFF>
<td ><br>
<p>
你违反了网络管理安全法,你的主题含有不良言语。<br>
<br>
如发现你再次恶意破坏论坛,发表不良言语,如果公安部门追究责任!后果自负,希望你自重,不要让我们鄙视你!如果你无恶意行为,请联系管理员.我们将取消限制你的发言权<br>
<br><p><p>你可以选择 <ul>
<li><a href=\"javascript:history.back(1)\">重新书写主题,返回前页</a><br>
</li><br>
<li><a onclick=Show(messanger); href=\"messanger.php?job=write&target=$manager\" target=msg>给管理员发短消息,申明你无恶意!</a></li>
<br><br>
<li><a href=index.php>返回首页</a></li>
</ul><p>
<tr>
<td colspan=2 bgcolor=$titlecolor> </td>
</tr>
</table>
</td>
</tr>
</table>";
require("footer.php");echo"$footertp";
exit;}}}
//---------------------------
if ($action=="new") {
get_father_info();
if ($exists_forum_father==1) {
if (file_exists("bbsdata/admin.php")) {
$adminlist=file("bbsdata/admin.php");
$count=count($adminlist);
for ($i=0; $i<$count; $i++) {
$detail=explode("|", trim($adminlist[$i]));
$admin_list[]=$detail[1];
if ($detail[0]==$father_id && $username==$detail[1]) $admin=1;
}
}
}
if ($forum_type=='readonly' && $admin==0) {
require("header.php");echo"$headertp";
$error="本版块只能回复,只有班竹及管理员才能发新贴";
headguide($headguide_des,$headguide_l2,"发表新文章");
echo "<table width=$tablewidth border=0 cellspacing=0 cellpadding=0 align=center bgcolor=$bordercolor>
<tr>
<td>
<table width=100% border=0 cellspacing=1 cellpadding=3>
<tr bgcolor=$titlecolor>
<td colspan=2 class=title bgcolor=$titlecolor>发生错误啦~</td>
</tr>
<tr bgcolor=FFFFFF>
<td ><br>
<center><p><p><br><br>".$error."<p><p>你可以选择 <a href=login.php>登陆</a> 或 <a href=register.php>注册</a> 或 <a href=javascript:history.go(-1)>返回前页</a><p><p><center>
<tr align=left>
<td colspan=2 bgcolor=$titlecolor> </td>
</tr>
</table>
</td>
</tr>
</table>";
require("footer.php");echo"$footertp";
exit;}
if (!$step) {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"发表新文章");
$status="* 发表一篇新文章";
print_form();
require("footer.php");echo"$footertp";
exit;
}
elseif($step==2) {
$check=check_data();
if (($allow_upload||$username==$manager) && $attachment && $attachment != "none" && ereg("^php[0-9A-Za-z_.-]+$", basename($attachment))) $upload=1;
else $upload=0;
if ($check && $upload) {
if (file_exists("$userpath/$username.php") && $username) $usertemp=readfromfile("$userpath/$username.php");
$userdetail=explode("|",$usertemp);
$rvrc=floor($userdetail[16]/10);
if ($rvrc<$upload_ww) {
$check=0; $status='你的威望小于'.$upload_ww.',不可以上传附件。';
}
if ($attachment_size>$max_upload_size&&$username!=$manager) {
$check=0; $status='上传文件超过指定大小';
}else{
$available_ext = explode(' ',$upload_type_available);
$extcount=count($available_ext); $is_ext_allowed=0;
for ($i=0; $i<$extcount; $i++) {
$currentext=$available_ext[$i];
if (eregi("\.\\$currentext$",$attachment_name)) {
$is_ext_allowed=1; break;
}
}
if (!$is_ext_allowed) {$check=0; $status='上传文件的类型不符合准则';}
}
}
if ($check) {
if (!$usericon) $usericon="ran";
if (!isset($articledes)) $articledes=""; else $articledes=stripslashes($articledes);
$articlecontent=str_replace(" "," ",$articlecontent);
$articlecontent=stripslashes($articlecontent); $articlecontent=safe_convert($articlecontent);
$articletitle=str_replace('%a%','',$articletitle);
$articletitle=stripslashes($articletitle); $articletitle=str_replace(",",",",$articletitle);
$articletitle=safe_convert($articletitle); $articledes=safe_convert($articledes);
if($inhiddentopic=='yes') $articlecontent="[hide=".$postweiwang."]".$articlecontent."[/hide]";
if($hidewithoutreply=='yes') $articlecontent="[post]".$articlecontent."[/post]";
if($assell=='yes') $articlecontent="[sell=".$sellmoney."]".$articlecontent."[/sell]";
if ($autourl=="yes") $articlecontent=autourl($articlecontent);
if (file_exists("{$idpath}forum$forumid/list.php")) {
$filecc=readfromfile("{$idpath}forum$forumid/list.php");
$filename=get_next_filename($filecc,$forumid);
}
else $filename="f_1";
if ($upload) {
$upload_name="upload/forum${forumid}_$filename.$currentext";
$attach=$attachment;
$source=$upload_name;
if(@copy($attach, $source)) {
$attach_saved = TRUE;
} elseif(function_exists("move_uploaded_file")) {
if(@move_uploaded_file($attach, $source)) {
$attach_saved = TRUE;
}
}
if(!$attach_saved && is_readable($attach)) {
@$fp = fopen($attach, "rb");
@flock($fp, 2);
@$attachedfile = fread($fp, $attach_size);
@fclose($fp);
@$fp = fopen($source, "wb");
@flock($fp, 3);
if(@fwrite($fp, $attachedfile)) {
$attach_saved = TRUE;
}
@fclose($fp);
}
if (!$attach_saved) echo "上传附件失败,空间在safe_mode下!";
$articletitle='%a%'.$articletitle;
$useri=get_user_info($username);
$useri[16]=$useri[16]-$upload_ww*10;
$uu=implode('|',$useri);
writetofile("$userpath/$username.php",$uu);
if (eregi("\.(gif|jpg|jpeg|png|bmp)$",$attachment_name)) {
$articlecontent="[img]images/attach/pic.gif[/img] 本主题相关图片如下:<br>[url=$upload_name][img]${upload_name}[/img][/url]<br><br>".$articlecontent;
}elseif (eregi("\.(zip|rar)$",$attachment_name)) {
$articlecontent="[img]images/attach/zip.gif[/img] 本主题相关压缩包附件:[url=$upload_name][color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
}elseif (eregi("\.txt$",$attachment_name)) {
$articlecontent="[img]images/attach/txt.gif[/img] 本主题相关文本附件:[url=$upload_name][color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
}else {
$articlecontent="[img]images/attach/attach.gif[/img] 本主题相关附件:[url=$upload_name][color=red]${attachment_name}[/color][/url]<br>".$articlecontent;
}
}
$lm=$articletitle.",".$username.",".$timestamp;
$newlist="$articletitle|$username|$timestamp|$articledes|$usericon|$filename|0|0|$lm|0|0|\n";
if (isset($filecc)) $newlist.=$filecc;
$newlist=push_heldtopics($newlist); //----push the Held Topics to the beginning of the list
writetofile("{$idpath}forum$forumid/list.php",$newlist);//------OK, write to the list-----
$listtop=explode("\n",readfromfile("{$idpath}forum$forumid/list.php"));
$countlist=count($listtop);
$px_newpost="$articletitle|$username|$timestamp|$usericon|$filename|$forumid|$forum_name\n";
if ($forumid!=66) writetofile("bbsdata/newpost.php",$px_newpost,"a+");
$file_line=array($articletitle,
$username,
$articlecontent,
$timestamp,
$REMOTE_ADDR,
$usericon);
if ($usesignature=="checkbox") $file_line[6]="1"; else $file_line[6]="0";
$line_cc=implode("|",$file_line)."|||$username|\n";
writetofile("{$idpath}forum$forumid/$filename",$line_cc,"a"); //-----OK, write to the f_xxxx -------
if ($upload) $articletitle=str_replace('%a%','',$articletitle);
send_suc();
jump_page("read.php?forumid=$forumid&filename=$filename","发表帖子成功",
"<b>POST程式成功完成了发贴动作</b>");
} else {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"发生错误");
print_err();
require("footer.php");echo"$footertp";
exit;
}
}
}
if ($action=="reply" || $action=="quote") {
if(!$filename)
{
$list_temp=explode("\n",readfromfile("{$idpath}forum$forumid/list.php"));
$list_info=explode("|",$list_temp[$postid]);
$filename=$list_info[5];
}
if (!$filename || !$forumid || !ereg("^f_[0-9]+$",$filename)) exit;
if (!file_exists("{$idpath}forum$forumid/$filename")) exit;
global $username,$manager;
$oldlist=readfromfile("{$idpath}forum$forumid/list.php");
$oldlist=explode("\n",$oldlist);
$count=count($oldlist);
for ($i=0; $i<$count; $i++ ) {
//if (strpos($oldlist[$i],"|$filename|")) {
$detail = explode("|", $oldlist[$i]);
if ($detail[5]==$filename) {
$new=explode("|",$oldlist[$i]);
unset($oldlist[$i]); #$mark=$i;
$oldlm=$new[8];
$old_t="回复:".$new[0];
break;
}
}
if($username!=$manager){
if ($new[9]==1 || $new[9]==3) {
$status="该贴已被锁住,不可回复";
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"回复失败");
print_err();
require("footer.php");echo"$footertp";
exit;
}}
if (!$step) {
$status="直接回复文章";
$file_content=file("{$idpath}forum$forumid/$filename");
$articletitle="回复:";
if ($action=="quote") {
$status="引用并回复文章";
if ($file_content[$article]) {
$info=explode("|",$file_content[$article]);
$oruser=$info[1]; $ortitle=str_replace('%a%','',$info[0]); $ortime=get_date($info[3])." ".get_time($info[3]);
$orcontent=$info[2];
$orcontent=preg_replace("/\[hide=(.+?)\](.+?)\[\/hide\]/is","[color=red]此处是被引用的加密贴[/color]",$orcontent);
$orcontent=preg_replace("/\[post\](.+?)\[\/post\]/is","[color=red]此处是被引用的隐藏贴[/color]",$orcontent);
$orcontent=preg_replace("/\[sell=(.+?)\](.+?)\[\/sell\]/is","[color=red]此处是被引用的出售贴[/color]",$orcontent);
$orcontent=preg_replace("/\[quote\](.*)\[\/quote\]/is","",$orcontent);
$orcontent=str_replace("<br>","\n",$orcontent);
$contentall = explode("\n",$orcontent);
if (count($contentall) > 4) {
$orcontent = "$contentall[0]\n$contentall[1]\n$contentall[2]\n$contentall[3]\n.......";
}
///////////////////////////////////////////////////
$str="【动作】";
$sign=$oruser;
$orcontent=str_replace("/招呼","$str $sign 逢人就打招呼:大家好,今天是我大喜的日子!请吃糖! 请吃糖![img]images/act/05.gif[/img]",$orcontent);
$orcontent=str_replace("/无聊","$str $sign 拿出一张钞票:“你真的好无聊耶,无聊还不如去赌博算了,喏,俺给你点钱~省着点啊”[img]images/act/01.gif[/img]",$orcontent);
$orcontent=str_replace("/负责","$str $sign 哭着说:“你可要对我负责呀!”呜~~[img]images/act/02.gif[/img]",$orcontent);
$orcontent=str_replace("/生气","$str $sign 撅了撅嘴说:“气死我了呀!呀!呀!”[img]images/act/03.gif[/img]",$orcontent);
$orcontent=str_replace("/高兴","$str $sign 高兴地跳了起来。[img]images/act/037.gif[/img]",$orcontent);
$orcontent=str_replace("/鼓掌","$str $sign 鼓掌喝采[img]images/act/06.gif[/img]",$orcontent);
$orcontent=str_replace("/反对","$str $sign 恨恨地摇了摇头“我不同意!反对反对,坚决反对!”[img]images/act/04.gif[/img]",$orcontent);
$orcontent=str_replace("/浪漫","$str $sign 罗密欧与朱丽叶式的吹起曲子来“我悄悄地蒙上你的眼睛,让你猜猜我是谁?”[img]images/act/019.gif[/img]",$orcontent);
$orcontent=str_replace("/不要","$str $sign 摆了摆手,说:“不要呀!”[img]images/act/010.gif[/img]",$orcontent);
$orcontent=str_replace("/找死","$str $sign 说:跟我斗,你还嫩着哩;刚练成的无筋腿,拿你试试先![img]images/act/023.gif[/img]",$orcontent);
$orcontent=str_replace("/去死","$str $sign 嘿嘿,你去死吧![img]images/act/011.gif[/img]",$orcontent);
$orcontent=str_replace("/狂笑","$str $sign 仰天狂笑:“普天之下,竟然没有我的对手...”[img]images/act/012.gif[/img]",$orcontent);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -