📄 globalpost.php
字号:
<?
if (!$forumid || !file_exists("{$idpath}forum$forumid")) exit;
if($forum_post==0) $nopost="disabled";else $nopost="";
if($forum_hide==0) $nohide="disabled";else $nohide="";
if($forum_sell==0) $nosell="disabled";else $nosell="";
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]));
if ($detail[0]==$forumid) $forum_admin[]=$detail[1];
}
}
$add_title=" > $forum_name > POST";
$headguide_des="您现在正处在<br>$forum_name<br>的POST程式中";
get_father_info();
$headguide_l2="";
if ($exists_forum_father==1) $headguide_l2.="<a href='thread.php?forumid=$father_id'>$father_name</a> >> ";
$headguide_l2.="<a href='thread.php?forumid=$forumid'>$forum_name</a>";
if ($login_status==0 && $step==2) {
if (!($HTTP_POST_VARS["username"]) || !($HTTP_POST_VARS["password"])) {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"发生错误");
$status='用户名/密码 空缺,请修正';
print_err();
require("footer.php");echo"$footertp";
exit;
}
if (!checkpass($username,$password)) {
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"发生错误");
$status="用户名/密码 错误,请修正";
print_err();
require("footer.php");echo"$footertp";
exit;
}
$ofstarid=$username;
$ofstarpwd=$password;
session_register("ofstarpwd");
session_register("ofstarid");
$login_status=1;
getUserInfo();
}
if ($login_status==1 && !check_permission($username,$forum_type)) {
//---to check if the user have got the permission to post-------
require("header.php");echo"$headertp";
headguide($headguide_des,$headguide_l2,"发生错误");
$status="你没有权利在此版块发贴,如果有问题请向管理员咨询";
print_err();
require("footer.php");echo"$footertp";
exit;
}
require("userdata/style.php");
$panelbar="
<!-- Panel bar -->
<table cellspacing=0 width=500 cellpadding=0 bgcolor=$bordercolor>
<tr><td>
<table cellspacing=1 cellpadding=3 width=100%>
<tr><td bgcolor=$article_color2>
<b>辅助面板</b>: [ <a href='images/editor/panel1.htm' target=fontpanel><font color=$categoryfontcolor>字体属性面板</font></a> -
<a href='images/editor/panel2.htm' target=fontpanel><font color=$categoryfontcolor>字体特效面板</font></a> -
<a href='images/editor/panel3.htm' target=fontpanel><font color=$categoryfontcolor>ASCII图案生成面板</font></a> ] - 点击切换
<br>
<hr size=1>
<iframe name='fontpanel' frameborder=0 src='images/editor/panel2.htm' width=100% height=30></iframe>
</td></tr>
</table>
</td></tr>
</table>
<img src='' height=5><br>
<!-- Panel bar end -->
";
$ftbemote='
<tr align=left>
<td><img src="images/pic/1.gif" onClick="javascript:AddText(\'[ye1]\');">
<img src="images/pic/2.gif" onClick="javascript:AddText(\'[ye2]\');">
<img src="images/pic/3.gif" onClick="javascript:AddText(\'[ye3]\');">
<img src="images/pic/4.gif" onClick="javascript:AddText(\'[ye4]\');">
<img src="images/pic/5.gif" onClick="javascript:AddText(\'[ye5]\');">
<img src="images/pic/6.gif" onClick="javascript:AddText(\'[ye6]\');">
<img src="images/pic/7.gif" onClick="javascript:AddText(\'[ye7]\');">
<img src="images/pic/8.gif" onClick="javascript:AddText(\'[ye8]\');">
<img src="images/pic/9.gif" onClick="javascript:AddText(\'[ye9]\');">
<img src="images/pic/10.gif" onClick="javascript:AddText(\'[ye10]\');">
<img src="images/pic/11.gif" onClick="javascript:AddText(\'[ye11]\');">
<img src="images/pic/12.gif" onClick="javascript:AddText(\'[ye12]\');">
<img src="images/pic/13.gif" onClick="javascript:AddText(\'[ye13]\');">
</td>
</tr>';
$loginform=<<<EOT
<tr bgcolor=$article_color1>
<td><b>你的用户名</b>:</td>
<td colspan=2>
<input maxlength=25 size=25 name=username style="background-color:#FEFEFF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
</td>
</tr>
<tr bgcolor=$article_color2>
<td><b>你的密码:</b><br>
<a href="sendpwd.php" target=_blank>忘了密码?</a></td>
<td colspan=2>
<input maxlength=25 size=25 name=password type=password style="background-color:#FEFEFF; border: 1 double #B4B4B4" onMouseOver = "this.style.backgroundColor = '#E5F0FF'" onMouseOut = "this.style.backgroundColor = ''">
</td>
</tr>
EOT;
//---------Flood Control-------------------
function flood_limit($name,$limit) {
global $manager,$forum_admin,$timestamp;
if ($name==$manager) return 1;
if ($forum_admin && in_array($name,$forum_admin)) return 1;
$userdata=get_user_info($name);
if ($timestamp-$userdata[12]>=$limit) return 1;
else
return 0;
}
//---------Display the Error Message Table-------------------
function print_err() {
global $status;
msg_box("发生错误","POST程式发生了错误,情况:<br><br>$status<br><ul><li><a href='javascript:history.back(1)'>返回前一页</a></li></ul>");
}
//---------Change certain information-------------------
function send_suc(){
global $timestamp,$username,$postid,$forumid,$articletitle,$filename,$msgpath,$userpath,$idpath,$post_rvrc,$post_ofstar,$tdtime,$star_ofstar;
// change the information in last_mo.php
if (file_exists("{$idpath}forum$forumid/last_mo.php")) {
$filecc=readfromfile("{$idpath}forum$forumid/last_mo.php");
$temp=explode('|',$filecc);
$art_count=$temp[1];
}
else $art_count=0;
$art_count++;
$use_date=get_date($timestamp).' '.get_time($timestamp);
$new_line="$articletitle,$username,$use_date,$filename|$art_count";
writetofile("{$idpath}forum$forumid/last_mo.php",$new_line);
// change user's data
$useri=get_user_info($username);
$ofstarfile=readfromfile('bbsdata/ofstar.php');
$qqq=explode('|',$ofstarfile);
$userii=get_user_info($qqq[1]);
$useriii=get_user_info($qqq[0]);
if($tdtime>=$useriii[12]) $useriii[29]=0;
if($tdtime>=$useri[12]) $useri[29]=1;
else $useri[29]++;
$useri[12]=$timestamp;
$useri[13]++;
$useri[16]=$useri[16]+$post_rvrc;
$useri[24]=$useri[24]+$post_ofstar;
if($useri[29]>=$useriii[29]) $qqq[0]=$username;
if($useri[24]>=$userii[24]) $qqq[1]=$username;
$useri[25]="$articletitle $use_date";//最后发表文件名
$useri[26]="read.php?forumid=$forumid&filename=$filename";//最后发表链接
$uu=implode('|',$useri);
writetofile("$userpath/$username.php",$uu);
//改变主题总数与今日发贴数和最后发贴时间。
if (file_exists('bbsdata/forumdata.php')) $forumlist=file('bbsdata/forumdata.php');
$count=count($forumlist);
$bbszts=0;//主题总数
for ($i=1; $i<$count; $i++) {//1
$detail=explode('|',$forumlist[$i]);
if (file_exists($idpath."forum".$detail[3]."/list.php")) {//2
$forumname=file($idpath.'forum'.$detail[3].'/list.php');
$countzts=count($forumname);
$bbszts+=$countzts;//叠加主题总数
}//2
}//1
//改变主题总数与今日发贴数和最后发贴时间。
$qqq[3]=$bbszts;
if($qqq[7]<$tdtime) {
$qqq[5]=$qqq[4];
$qqq[4]=0;
if (file_exists('bbsdata/newuser.php')) $newuserinfo=readfromfile('bbsdata/newuser.php');
else $newuserinfo='|0|0';
$newuser_info=explode('|',$newuserinfo);
$lucknum=rand(0,$newuser_info[1]);
$user=explode("\n", readfromfile("bbsdata/userlist.php"));
if(file_exists("$userpath/$user[$lucknum].php")&&$user[$lucknum]!="") $qqq[2]=$user[$lucknum];
else $qqq[2]=$username;
$useriiii=get_user_info($qqq[2]);
$useriiii[24]=$useriiii[24]+$star_ofstar;
$uuuu=implode('|',$useriiii);
writetofile("$userpath/$qqq[2].php",$uuuu);
//给幸运儿发送获奖信息。
$lucktime=date("Y-m-d",$timestamp);
if (file_exists("userdata/$msgpath/{$qqq[2]}1.php")) $msg=file("userdata/$msgpath/{$qqq[2]}1.php"); else $msg[0]="";
$new="<?die;?>|系统信息|恭喜恭喜!|$timestamp|你被系统设定为 $lucktime 的幸运儿,由此你获得了价值 $star_ofstar $money_title 的幸运大奖!恭喜恭喜~|0|\n";
$old=implode("",$msg);
writetofile("userdata/$msgpath/{$qqq[2]}1.php",$new.$old);
//给幸运儿发送获奖信息。
$qqq[8]="";
$user_list_file='bbsdata/userlist.php';
if (file_exists($user_list_file)) {//3
$user_array=explode("\n",readfromfile($user_list_file));}//3
else {//3
$dh=opendir("$userpath/");
while ($userfile=readdir($dh)) {//4
if (($userfile!=".") && ($userfile!="..") && ($userfile!="")) {//5
$userfilename=explode(".",$userfile);
$user_array[]=$userfilename[0];
}//5
}//4
closedir($dh);
writetofile($user_list_file,implode("\n",$user_array)."\n");
}//3
$count=count($user_array);
for ($i=0;$i<$count;$i++){//3
if (!trim($user_array[$i])) continue;
$userfile=$userpath."/".trim($user_array[$i])."."."php";
if (!file_exists($userfile)) continue;
$user_info=explode("|",readfromfile($userfile));
$user_birth_temp=explode("-",$user_info[21]);
$user_birth=$user_birth_temp[1]."-".$user_birth_temp[2];
$get_today=get_today($timestamp);
if ($user_birth==$get_today){
$qqq[8].=$user_info[1].",";
//给今天生日的会员送生日礼物
$useriiii=get_user_info($user_info[1]);
$useriiii[24]=$useriiii[24]+$star_ofstar;
$uuuu=implode('|',$useriiii);
writetofile("$userpath/$user_info[1].php",$uuuu);
//发短信
$lucktime=date("Y-m-d",$timestamp);
if (file_exists("userdata/$msgpath/{$user_info[1]}1.php")) $msg=file("userdata/$msgpath/{$user_info[1]}1.php"); else $msg[0]="";
$new="<?die;?>|系统信息|生日快乐!|$timestamp|今日是 $lucktime ——你的生日。本论坛全体管理员祝你生日快乐!作为生日礼物,我们送给你 $star_ofstar $money_title ,请笑纳~|0|\n";
$old=implode("",$msg);
writetofile("userdata/$msgpath/{$user_info[1]}1.php",$new.$old);
//给今天生日的会员送生日礼物
}
}//3
}
$qqq[4]++;
if($qqq[6]<$qqq[4]) $qqq[6]=$qqq[4];
$qqq[7]=$tdtime;
$uuu=implode('|',$qqq);
writetofile("bbsdata/ofstar.php",$uuu);
// change the information in newuser.php
$newuser=readfromfile('bbsdata/newuser.php');
$newuser_detail=explode('|',$newuser);
$newuser_detail[2]++;
writetofile('bbsdata/newuser.php',"$newuser_detail[0]|$newuser_detail[1]|$newuser_detail[2]");
}
//---------Check data-------------------
function check_data($type="post") {
global $articlecontent,$min_post_length,$max_post_length,$articletitle,$status,$articledes,$selections,$title,$by,$address,$downaddress,$file_size,$logourl;
$check=1;
if (strlen($articlecontent)<=$min_post_length) {$status="文章少于管理员指定的长度"; $check=0;}
if (strlen($articlecontent)>=$max_post_length) {$status="文章超过管理员指定的长度"; $check=0;}
if (empty($articletitle)) {$status="没有填写标题"; $check=0;}
elseif (strlen($articletitle)>=80) {$status="标题太长了"; $check=0;}
if (strlen($articledes)>=80) {$status="文章描述太长了"; $check=0;}
if ($type=="vote" && empty($selections)) {$status="不接受空选项"; $check=0;}
return $check;
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -