⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 post.php

📁 FTB安装版 v1.3(虚拟形象)FTB安装版 v1.3(虚拟形象)
💻 PHP
📖 第 1 页 / 共 3 页
字号:
$orcontent=str_replace("/傻笑","$str $sign 西西、禾禾~~$username 突然笑了起来..[img]images/act/031.gif[/img]",$orcontent);
$orcontent=str_replace("/痛哭","$str $sign 鼻子一酸,开始叭嗒叭嗒掉眼泪了…… [img]images/act/013.gif[/img]",$orcontent);
$orcontent=str_replace("/跳舞","$str $sign 乐地手足蹈舞![img]images/act/017.gif[/img]",$orcontent);
$orcontent=str_replace("/唱歌","$str $sign 清清嗓子唱起歌来:东方红,太阳升…… [img]images/act/09.gif[/img]",$orcontent);
$orcontent=str_replace("/害羞","$str $sign 害羞地脸都红了,恨没有地洞,好钻进去躲起来~~ [img]images/act/020.gif[/img]",$orcontent);
$orcontent=str_replace("/比酷","$str $sign 摆了个POSE道:“你、你、你没我酷..”[img]images/act/021.gif[/img]",$orcontent);
$orcontent=str_replace("/救命","$str $sign 大叫:狼来了!狼来了!救命啊!救命啊![img]images/act/022.gif[/img]",$orcontent);
$orcontent=str_replace("/狂妄","$str $sign 剑眉一轩,冷冷的瞥了一眼,背转身淡淡说道:你,不是我的,对手![img]images/act/025.gif[/img]",$orcontent);
$orcontent=str_replace("/拳击","$str $sign 叫道:你的身材好有型哦!给我练拳不?[img]images/act/026.gif[/img]",$orcontent);
$orcontent=str_replace("/我踢","$str $sign 说:我踢、我踢、我踢死你[img]images/act/029.gif[/img]",$orcontent);
$orcontent=str_replace("/我踩","$str $sign 大叫:我踩、我踩、踩死楼上的,踩扁楼下的![img]images/act/027.gif[/img]",$orcontent);
$orcontent=str_replace("/饶命","$str $sign 大喊:老婆!你就饶了我吧![img]images/act/028.gif[/img]",$orcontent);
$orcontent=str_replace("/眨眼","$str $sign 天真地眨了眨眼睛!一对会说话的眼睛闪闪动人^)^[img]images/act/032.gif[/img]",$orcontent);
$orcontent=str_replace("/臭美","$str $sign 嚷道:“你当你是谁呀,你以为你是张学友呀?”[img]images/act/033.gif[/img]",$orcontent);
$orcontent=str_replace("/拼酒","$str $sign 说:“什么时候咋俩拼拼酒啊。”[img]images/act/038.gif[/img]",$orcontent);
$orcontent=str_replace("/深情","$str $sign 深情地唱道:我早已为你种下,九百九十九朵玫瑰..[img]images/act/040.gif[/img]",$orcontent);
$orcontent=str_replace("/抽烟","$str $sign 从烟缸中拣出个烟屁股,用两根手指夹着点着了,眯起眼睛狂嘬几口。[img]images/act/039.gif[/img]",$orcontent);
$orcontent=str_replace("/拉勾","$str $sign 对楼上的说:我们拉拉勾就不许反悔了。[img]images/act/036.gif[/img]",$orcontent);
$orcontent=str_replace("/同意","$str $sign 说:“好耶好耶,我同意楼上的意见~”[img]images/act/035.gif[/img]",$orcontent);
$orcontent=str_replace("/kiss","$str $sign 说:“来吧,我们亲亲!”[img]images/act/034.gif[/img]",$orcontent);
$orcontent=str_replace("/生日","$str $sign 猪你生日快乐![img]images/act/030.gif[/img]",$orcontent);
$orcontent=str_replace("/晕倒","$str $sign 突然觉得天昏地暗,一声“我要晕了”后就倒下了![img]images/act/024.gif[/img]",$orcontent);
$orcontent=str_replace("/气你","$str $sign 对楼上的说:“哈哈,我气死你。”[img]images/act/018.gif[/img]",$orcontent);
$orcontent=str_replace("/恭喜","$str $sign 恭喜、贺喜什么时候请吃酒啊?[img]images/act/016.gif[/img]",$orcontent);
$orcontent=str_replace("/大笑","$str $sign 快要把我笑死了!哇哈哈哈哈~~~~~[img]images/act/015.gif[/img]",$orcontent);
$orcontent=str_replace("/考虑","$str $sign 来回地踱着方步陷入沉思中。[img]images/act/014.gif[/img]",$orcontent);
$orcontent=str_replace("/叹气","$str $sign 长叹了一口气那神情仿佛是在说:“我都是要进棺材的人了,还在乎些什么??!”[img]images/act/08.gif[/img]",$orcontent);
$orcontent=str_replace("/无奈","$str $sign 两手一摊无奈地耸耸肩。[img]images/act/07.gif[/img]",$orcontent);
////////////////////////////////////////////////////
				$articlecontent="[quote][i][b]下面是引用{$oruser}于{$ortime}发表的{$ortitle}:[/b][/i]\n{$orcontent}[/quote]\n";
				$articletitle="回复:$ortitle";
			}
		}
		require("header.php");echo"$headertp";
		headguide($headguide_des,$headguide_l2,"回复文章");
		print_form();
		print_old($file_content);
		require("footer.php");echo"$footertp";
		exit;
	}
	elseif ($step==2) {
		//----Check-------
		$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) {
		//-----User has uploaded some file-----
		//-----威望太少不可以上传附件
	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);

			//-----Check the Input------
			$articlecontent=str_replace("	","   ",$articlecontent);
			$articlecontent=stripslashes($articlecontent);	$articletitle=stripslashes($articletitle);
			$articletitle=str_replace(",",",",$articletitle); $articletitle=safe_convert($articletitle);$articlecontent=safe_convert($articlecontent);	$articledes=safe_convert($articledes);
if($inhiddentopic=='yes') $articlecontent="[hide=".$postweiwang."]".$articlecontent."[/hide]";
if($hidewithoutreply=='yes') $articlecontent="[post]".$articlecontent."[/post]";
$articlecontent=str_replace("[/sell]","[sell]",$articlecontent);

            if ($autourl=="yes") $articlecontent=autourl($articlecontent);
			if ($upload) {
				$upload_name="upload/forum${forumid}_".$filename."_".$timestamp.".".$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下!";
////////////////
				$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;
				}
			}
			
			//-----Do some preparation---
			$newcount=count($new); for ($j=11; $j<$newcount; $j++) unset($new[$j]);
			$lm=$articletitle.",".$username.",".$timestamp;
			$new[8]=$lm; $new[6]++;
			$new_line=implode("|",$new)."|\n";
			$oldlist=implode("\n",$oldlist);
			$newlist=push_heldtopics($new_line.$oldlist);
			$px_newpost="$old_t|$username|$timestamp|ran|$filename|$forumid|$forum_name\n";
			if ($forumid!=66) writetofile("bbsdata/newpost.php",$px_newpost,"a+"); 

			writetofile("{$idpath}forum$forumid/list.php",$newlist); //OK, write to the list
			
			$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_xxx

			//------OK,send e-mail to the latest user--------
			if ($send_mail==1) {
			$temp = explode("," , $oldlm);
			$receiver = $temp[1];
			if ($receiver != $username) {
			 $old_title=$temp[1];
			 $temp = get_user_info($receiver);
			 $send_address= $temp[4];
			 $textmessage="Hi, $receiver ,\n    我是{$bbs_title}邮件大使,\n    你在{$bbs_title}发的文章: $old_title\n    现在有人回复喽.快来看吧\n    {$script_pos}/read.php?forumid=$forumid&filename=$filename\n    下次再有人参与主题时,我将不来打扰了\n\n___________________________________\n欢迎访问 {$script_pos}\n本论坛由快乐的流星制作,欢迎光临FTB论坛 http://www.ofstar.com/bbs ";
			 if(mail("$send_address", "你有回复~~~", "$textmessage","From: $admin_email\nReply-To: $admin_email\nX-Mailer: {$bbs_title}の邮件"))
				 $ifmail="已经发送了一封邮件通知作者";
			 else
				 $ifmail="发送通知邮件失败";
			}
			}
			send_suc();$page=floor($new[6]/$read_perpage)+1;
			jump_page("read.php?forumid=$forumid&filename=$filename&page=$page#$new[6]","{$ifmail}回复帖子成功");

		} else {
			require("header.php");echo"$headertp";
		headguide($headguide_des,$headguide_l2,"发表失败");
			print_err();
			require("footer.php");echo"$footertp";
			exit;
		}
	}
}

if ($action=="modify") {
	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;
	$articlelist=file("{$idpath}forum$forumid/$filename");
	$count=count($articlelist);
	if (!isset($article) || !$articlelist[$article]) exit;
	list($oldarticletitle,$author,$oldarticlecontent,$time,$area,$oldicon,$p,$rvrc,$pfuser,$buyers)=explode("|",$articlelist[$article]);
	$ofstar=$count-1;
	$page=floor($ofstar/$read_perpage)+1;

	//------Check if the user got the right to modify--------
	if ($login_status==1 && ($author==$username || $username==$manager || ($login_status==1 && ($forum_admin && in_array($username,$forum_admin))))) $check_user=1;
   
	if ($check_user==0) {
		$status="您没有权利修改该贴,请您以合适的身份登录(文章原作者 或者 管理员)";
		require("header.php");echo"$headertp";
		headguide($headguide_des,$headguide_l2,"发生错误");
		print_err();
		require("footer.php");echo"$footertp";
		exit;
	}

	if (!$step) {
		$articletitle=str_replace('%a%','',$oldarticletitle);
		$articlecontent=str_replace("<br>","\r\n",$oldarticlecontent);
		$status="* 修改一篇旧文章";
		require("header.php");echo"$headertp";
		headguide($headguide_des,$headguide_l2,"修改文章");
		print_form();
		require("footer.php");echo"$footertp";
		exit;
	}
	elseif($step==2) {
		if (!$usericon) $usericon=$oldicon;
		//----Check-------
		$check=check_data();
		if ($check) {

			//-----安全检查------
			$timeedit=getfulldate($timestamp); 
			$articlecontent=$articlecontent."
[color=gray][此贴被".$username."在".$timeedit."重新编辑][/color]";
			$articlecontent=str_replace("	","   ",$articlecontent);
			$articlecontent=stripslashes($articlecontent);	$articletitle=stripslashes($articletitle);
			$articletitle=str_replace(",",",",$articletitle); $articletitle=safe_convert($articletitle);
			$articlecontent=safe_convert($articlecontent); $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 ($article>0) $articlecontent=str_replace("[/sell]","[sell]",$articlecontent);
			if ($article==0) {
				$lm=$articletitle.",".$username.",".$timestamp;
				$oldlist=readfromfile("{$idpath}forum$forumid/list.php");
				$oldlist=explode("\n",$oldlist);

				$listcount=count($oldlist);
				for ($j=0;$j<$listcount;$j++) {
					$listdetail=explode("|",$oldlist[$j]);
					if ($listdetail[5]==$filename) {
						$new_line=explode("|",$oldlist[$j]);//$listdetail;
						unset($oldlist[$j]);
					}
				}
				$oldlist=implode("\n",$oldlist);
				$new_line[0]=$articletitle;
				$new_line[3]=$articledes;
				if ($usericon) $new_line[4]=$usericon;
				$new_line[8]=$lm;
				$newlist=implode("|",$new_line)."\n".$oldlist;
				$newlist=push_heldtopics($newlist);
				writetofile("{$idpath}forum$forumid/list.php",$newlist); //ok, write to the list
			if($list_info[10]>2)
			{$postid="0";}
			else
			{
			$listtop=explode("\n",readfromfile("{$idpath}forum$forumid/list.php"));
            $countlist=count($listtop);
			$postid=0;
			for($j=0;$j<$countlist;$j++)
			{
				$listtop_info=explode("|",$listtop[$j]);
				if ($listtop_info[10]>2) 
				{
					$postid++;
				}
				else
					break;
					
			}
			}
			}
			$file_line=array($articletitle,
					$author,
					$articlecontent,
					$time,
					$area,
					$usericon,$p,$rvrc,$pfuser,$buyers);
			if ($usesignature=="checkbox") $file_line[6]='1'; else $file_line[6]='0';
				$file_line[7]=$rvrc;
				$file_line[8]=$pfuser;
			$articlelist[$article]=implode("|",$file_line)."|\n";
			
			$articlelist=implode("",$articlelist);
			writetofile("{$idpath}forum$forumid/$filename",$articlelist);

			jump_page("read.php?forumid=$forumid&filename=$filename&page=$page#$ofstar","修改帖子成功");

		} else {
			require("header.php");echo"$headertp";
			headguide($headguide_des,$headguide_l2,"修改失败");
			print_err();
			require("footer.php");echo"$footertp";
			exit;
		}
	}
}

function print_old($oldlist) {
global $echo_reply,$ftbcode_echo;
require("ofstarcode.php");
$allow=array('pic'=>'yes','flash'=>'no','fontsize'=>'no');
	echo "<br><center>以前文章内容回顾</center>";
	$count	=	count($oldlist)-1;
	$lastreply =	max($count-$echo_reply,0);
	for ($i=$count; $i>=$lastreply; $i--) {
		if ($i==0) $oldlist[0] = str_replace('%a%', '', $oldlist[0]);
		echo "<hr size=1 width=650><table align=center width=550 cellspacing=1 cellpadding=2><tr><td>";
		$detail=explode("|",$oldlist[$i]);
		print("<b>&nbsp; {$detail[1]}: $detail[0]</b><br>".convert($detail[2],$ftbcode_echo));
		echo "</td></tr></table>";
	}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -