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

📄 messanger.php

📁 bmb的论坛
💻 PHP
📖 第 1 页 / 共 2 页
字号:
			  for ($i=0; $i<$extcount; $i++) {
				$currentext=$available_ext[$i];
				if (eregi("\.\\$currentext$",$FILE_NAME)) {
			  	  $is_ext_allowed=1; break;
			  	}
			  }
			  if (!$is_ext_allowed) {$upload=0; $check=0; }
		}
		if ($upload && $check) {
				$upload_aname="upload/pm${username}_{$timestamp}.{$currentext}";
				$upload_bname.="pm${username}_{$timestamp}.{$currentext}";
				attach_upload($FILE_URL,$upload_aname,$FILE_SIZE);
		}elseif(!$check){
				echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[104]</b></font></TD>
	</TR></table></table></table>";include("footer.php");
			exit;
		}
		if (file_exists("$idm_unique/".urlencode($ruser).".rec")) {$msg=file("$idm_unique/".urlencode($ruser).".rec");}else{ $msg[0]="";}

		$content=stripslashes(safe_convert($content));
		$title=stripslashes(safe_convert($title));
		
	
		$new="$user|$title|$timestamp|$content|0|$upload_bname|\n";

		$oldcount=count($msg);
		if ($oldcount>$short_msg_max) {
			for ($i=$short_msg_max; $i<$oldcount; $i++) {unset($msg);}
		}
		
		$old=implode("",$msg);
		$uisbadu="no";
		if (file_exists("$id_unique/".urlencode($ruser).".frd")) {
			$fp=fopen("$id_unique/".urlencode($ruser).".frd","r");
			flock($fp,LOCK_SH);
			$oldlist=file("$id_unique/".urlencode($ruser).".frd");
			fclose($fp);
			$count=count($oldlist);	
			for ($ci=0; $ci<$count; $ci++) {
				$detail=explode("|",$oldlist[$ci]);
				if($detail[0]==$username && $detail[2]=="b") {$uisbadu="yes";}
			}
		}
		if ($uisbadu!="yes") { writetofile("$idm_unique/".urlencode($ruser).".rec",$new.$old); }
		}
		if (file_exists("$idm_unique/$o_username.snd")) $old=readfromfile("$idm_unique/$o_username.snd");
		else $old="";
        $oldcount=count($old);
		if ($oldcount>$short_msg_max) {
			for ($i=$short_msg_max; $i<$oldcount; $i++) unset($old);
		}
		$new="$pruser|$title|$timestamp|$content|$upload_bname|\n";
		if($ssnd) writetofile("$idm_unique/$o_username.snd",$new.$old);
			echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[105]</b></font></TD>
	</TR></table></table></table>";include("footer.php");
		exit;
	}
}
if ($job=="clear") {
	if (file_exists("$idm_unique/$o_username.rec")) unlink("$idm_unique/$o_username.rec");
	if (file_exists("$idm_unique/$o_username.snd")) unlink("$idm_unique/$o_username.snd");
	echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[106]</b></font></TD>
	</TR></table></table></table>";
	include("footer.php");
	exit;
}
if ($job=="sendbox") {
	if (file_exists($idm_unique."/".$o_username.".snd")) {
		$receivelist=file($idm_unique."/".$o_username.".snd");
		$count=count($receivelist);
		if ($count<=1 && empty($receivelist[0])) {	echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[103]</b></font></TD>
	</TR></table></table></table>";
	include("footer.php");exit;}
	echo "<form action='messanger.php' method=POST >
	<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD width=5% bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[91]</b></font></TD>
		<TD width=10% bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[107]</b></font></TD>
		<TD width=* bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[93]</b></font></TD>
	</TR>";	?>
	<input type=hidden value=delsnd name=job>
	<input type=hidden value=more name=n>

	<?
		$counts=0;
		for ($i=0; $i<$count; $i++) {
			$counts++;
			if(floor($counts/2)==$counts/2) $bgcolors=$forumcolorone;
				else $bgcolors=$forumcolortwo;
			list($ruser,$title,$time,$content)=explode("|",$receivelist[$i]);
			echo "<tr align=center bgcolor=$bgcolors><td width=5%><input type='checkbox' name='delmore[]' value='checked'></td><td width=10%><acronym title='$gl[98]'><a href='messanger.php?job=write&target=".urlencode($ruser)."'>$ruser</a></acronym></td><td width=*><a href='messanger.php?job=readsnd&msg=$i'>$title</a></td></tr>";
		}
		echo "<tr bgcolor=$forumcolorone align=left><td colspan=4 width=100%><input type='button' name=chkall value=$gl[99] onclick='CheckAll(this.form)'><input type='button' name=clear2 value=$gl[100] onclick='FanAll(this.form)'><input type='reset' value='$gl[101]'><input type='submit' value='$gl[102]'></tr></form>";

	}
	else {echo "		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[103]</b></font></TD>
	</TR></table></table></table>";
	include("footer.php");exit;}
}
if ($job=="delone") {
	if (file_exists($idm_unique."/".$o_username.".rec")) {
		$receivelist=file($idm_unique."/".$o_username.".rec");
		$count=count($receivelist);
		if($n=="more") {
			$fp=fopen($idm_unique."/".$o_username.".rec","w");
			for ($a=0; $a<$count; $a++) {
				if($delmore[$a]!="checked") {
					fputs($fp,$receivelist[$a]);
				}
			}
			fclose($fp);
		}else{
			$fp=fopen($idm_unique."/".$o_username.".rec","w");
			for ($i=0; $i<$count; $i++) {
				if ($i!=$msg) fputs($fp,$receivelist[$i]);
			}
			fclose($fp);
		}
	echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[108]</b></font></TD>
	</TR></table></table></table>";include("footer.php");
	exit;	}
}
if ($job=="delsnd") {
	if (file_exists($idm_unique."/".$o_username.".snd")) {
		$receivelist=file($idm_unique."/".$o_username.".snd");
		$count=count($receivelist);
		if($n=="more") {
			$fp=fopen($idm_unique."/".$o_username.".snd","w");
			for ($a=0; $a<$count; $a++) {
				if($delmore[$a]!="checked") {
					fputs($fp,$receivelist[$a]);
				}
			}
			fclose($fp);
		}else{
			$fp=fopen($idm_unique."/".$o_username.".snd","w");
			for ($i=0; $i<$count; $i++) {
				if ($i!=$msg) fputs($fp,$receivelist[$i]);
			}
			fclose($fp);
		}
	echo "<form action='messanger.php' method=POST >
		<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=$bordercolor><TR><TD>
	<TABLE width=100% cellspacing=1 cellpadding=4>
	<TR align=center bgcolor=$tile_back background=\"$tile_back\">
		<TD colspan=4 bgcolor=$tile_back background=\"$tile_back\"><font color=$categoryfontcolor><b>$gl[109]</b></font></TD>
	</TR></table></table></table>";include("footer.php");
	exit;	}
}

echo "
	</TABLE>
	</TD>
</TR>
</TABLE></table>";
include("footer.php");

function attach_upload($attach,$source,$attach_size) {
global $login_status,$username,$fileusername,$timestamp,$tlastvisit,$deltopic,$delreply,$id_unique,$uploadfiletoday;
	if($login_status!=2 && $login_status!=0){
		$useri=get_user_info($username);
		$useri[28]++;
		$useri[29]=$timestamp;
		$uu=implode('|',$useri);
		writetofile("$id_unique/$fileusername",$uu);
	}
	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);
	}
}
function print_form() {
global $target,$bordercolor,$tile_back,$categorycolor,$categoryfontcolor,$forumcolorone,$send_msg_max,$o_username,$print_form,$fileusername,$max_daily_upload_size,$uploadfiletoday,$max_upload_size,$leftuploadnum,$max_upload_post,$allow_upload,$upload_num,$upload_type_available,$max_upload_num,$id_unique,$gl,$timu,$username,$neirong;
	$leftuploadnum=$max_daily_upload_size-$uploadfiletoday;
	if ($allow_upload) {
		$available_ext = explode(' ',$upload_type_available);
		$extcount=count($available_ext);
		$showtype="<select><option>$print_form[12]</option><option>---------</option>";
		for ($i=0; $i<$extcount; $i++) {
			$showtype.="<option>$available_ext[$i]</option>";
		}
		$uploadfileshow.="<input size=\"76\" style=\"background-color:#FEFEFF; border: 1 double #B4B4B4\"  type=\"file\" name=\"attachment\"><BR>";
		$showtype.="</select>";
	}

?>
<script language="JavaScript">
function friendls()
{
	var myfriend = document.FORM.friend.options[document.FORM.friend.selectedIndex].value;
	if (myfriend != "") document.FORM.pruser.value = document.FORM.pruser.value == "" ? myfriend : document.FORM.pruser.value + ";" + myfriend;
}
function ctlent(eventobject){
if(event.ctrlKey && window.event.keyCode==13){this.document.FORM.submit();}
}

</script>
<TABLE width=100% cellspacing=0 cellpadding=0 bgcolor=<?=$bordercolor?>><TR><TD>
<TABLE width=100% cellspacing=1 cellpadding=4><form name="FORM" action=messanger.php method=POST enctype="multipart/form-data">
<TR>
	<TD colspan=2  bgcolor=<?=$tile_back?> background="<?=$tile_back?>" height=20><font color=<?=$categoryfontcolor?>><b><?=$gl[116]?></b></font></TD>
</TR>
<TR bgcolor=<?=$forumcolorone?>>
	<TD width=60 valign=top><?=$gl[117]?></TD>
	<TD valign=top>
	<SELECT name=friend OnChange="friendls()">
                <OPTION selected value=""><?=$gl[118]?></OPTION>
                
<?
$favFile="$id_unique/$o_username.frd";
if (file_exists("$favFile")) {
//------get the line from the original list------
	$fp=fopen("$favFile","r");
	flock($fp,LOCK_SH);
	$oldlist=file("$favFile");
	fclose($fp);
	$count=count($oldlist);	
	for ($i=0; $i<$count; $i++) {
		$detail=explode("|",$oldlist[$i]);
		if ($detail[2]!="b") echo "<OPTION value=$detail[0]>$detail[0]</OPTION>";
	} 
}
?>
              </SELECT><input <? if (isset($target)) echo "value='$target'"; ?>  type=text size=60 name="pruser">(<?=$gl[119]?>)

</TR>
<TR bgcolor=<?=$forumcolorone?>>
	<TD width=60 valign=top><?=$gl[120]?></TD>
	<TD valign=top><input <? if (isset($timu)) echo "value='$timu'"; ?>  type=text size='71' name="title"></TD>
</TR>
<TR bgcolor=<?=$forumcolorone?>>
	<TD width=60 valign=top><?=$gl[121]?></TD>
	<TD valign=top><textarea onkeydown=ctlent()  name="content" cols=87 rows=5><?=$neirong?></textarea></TD>
</TR>
<TR bgcolor=<?=$forumcolorone?>>
	<TD width=60 valign=top><?=$print_form[69]?></TD>
	<TD valign=top><?=$uploadfileshow?>[<?=$print_form[70]?><?=$leftuploadnum?>] <?=$showtype?> <?=$print_form[71]?> <?=$max_upload_size?> <?=$print_form[72]?> <?=$print_form[73]?> <?=$max_upload_post?> <?=$print_form[74]?></TD>
</TR>
<TR bgcolor=<?=$forumcolorone?>>
	<TD colspan=2 valign=top><input  type=submit value="<?=$gl[85]?>"> <input type=checkbox name=ssnd value=1><?=$gl[122]?></TD>
</TR>
</TABLE></TD>
</TR>
</TABLE>


<input type=hidden name=job value=write>
<input type=hidden name=step value=2>
</td>
  </tr></form>
</table>
<?} ?>
		

⌨️ 快捷键说明

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