");
$ip = getenv(REMOTE_ADDR);
if($mode=='reply')
{
$year=date("Y");
$month=date("m");
$day=date("d");
$H=date("H");
$i=date("i");
$s=date("s");
$signdate=$year."-".$month."-".$day;
$signdate2=$H.":".$i.":".$s;
$name=addslashes($name);
$name=htmlspecialchars($name);
$comment=addslashes($comment);
$comment=htmlspecialchars($comment);
mysql_query("insert into $reply_table values ('',
'$m_number',
'$signdate',
'$signdate2',
'$comment',
'$name',
'$pass',
'$ip' )",$dbcon);
echo(" ");
}
else
{
for($i = 1; $i <= $num; $i++) {
$userfile=${"userfile".$i};
$userfile_name=${"userfile".$i."_name"};
if($userfile && $userfile_name){
$ext = getimagesize("$userfile");
if($ext[2] != "2" && $ext[2] != "1")
{
echo("
");
exit();
}
$rand=rand(1,10000);
$fname=explode(".","$userfile_name");
$nf_name=$table_name.$year.$month.$day.$rand;
$arr=array("$nf_name","$fname[1]");
$userfile_name=implode(".",$arr);
$exist = file_exists("photo/$table_name/photo/$userfile_name");
if($exist)
{
echo(" ÆÄÀÏ À̸§ÀÌ Áߺ¹ µÇ¾ú½À´Ï´Ù ");
exit;
}
if(!copy($userfile,"photo/$table_name/photo/$userfile_name"))
{
echo(" ÆÄÀÏ º¹»ç ½ÇÆÐ ");
exit;
}
$photo_small_height="80";
$photo_small_width="80";
$photo_middle_height="350";
$photo_middle_middle="350";
$pnm_dest = "photo_temp/".$userfile_name.".pnm";
$thumb_dest_middle = "photo/$table_name/photo_middle/$userfile_name";
$thumb_dest_small = "photo/$table_name/photo_small/$userfile_name";
$size=getimagesize("photo/$table_name/photo/$userfile_name");
if($fname[1]=='jpg' || $fname[1]=='JPG' || $fname[1]=='jpeg' || $fname[1]=='JPEG')
{
exec( "djpeg -pnm photo/$table_name/photo/$userfile_name > $pnm_dest" );
if($size[0] > 350 || $size[1] > 350){
exec( "pnmscale -xy 350 350 $pnm_dest | cjpeg -progressive -optimize -smooth 1 -outfile $thumb_dest_middle" );
}else{
if(!copy($userfile,"photo/$table_name/photo_middle/$userfile_name"))
{
echo(" ÆÄÀÏ º¹»ç ½ÇÆÐ ");
exit;
}
}
exec( "pnmscale -xy $photo_small_width $photo_small_height $pnm_dest | cjpeg -progressive -optimize -smooth 1 -outfile $thumb_dest_small" );
unlink( "$pnm_dest" );
}
if($fname[1]=='gif' || $fname[1]=='GIF')
{
exec( "giftopnm photo/$table_name/photo/$userfile_name > $pnm_dest" );
if($size[0] > 350 || $size[1] > 350){
exec( "pnmscale -xy 350 350 $pnm_dest | cjpeg -progressive -optimize -smooth 1 -outfile $thumb_dest_middle" );
}else{
if(!copy($userfile,"photo/$table_name/photo_middle/$userfile_name"))
{
echo(" ÆÄÀÏ º¹»ç ½ÇÆÐ ");
exit;
}
}
exec( "pnmscale -xy $photo_width $photo_height $pnm_dest | cjpeg -progressive -optimize -smooth 1 -outfile $thumb_dest_small" );
unlink( "$pnm_dest" );
}
if(!unlink($userfile))
{
echo(" Àӽà ÆÄÀÏ »èÁ¦ ½ÇÆÐ ");
}
$name2=addslashes($name);
$name2=htmlspecialchars($name2);
$subject2=addslashes($subject);
$subject2=htmlspecialchars($subject2);
//$content=nl2br($content);
$content2=addslashes($content);
$year = date("Y");
$month = date("m");
$day = date("d");
mysql_query("insert into $table_name values ('',
'$year',
'$month',
'$day',
'$subject2',
'$content2',
'$userfile_name',
'$name2',
'$pass',
'','$ip' )",$dbcon);
}
}
echo("
");
}
echo("