rendered paste body<?
function createthumb($name,$filename,$new_w,$new_h,$add_logo=0)
{
if (preg_match('/\.(jpg|jpeg)$/i',$filename)){$src_img=imagecreatefromjpeg($name);}
elseif (preg_match('/\.png$/i',$filename)){$src_img=imagecreatefrompng($name);}
else return;
$old_x=imageSX($src_img);
$old_y=imageSY($src_img);
if ($old_x > $old_y)
{
$thumb_w=$new_w;
$thumb_h=$old_y*($new_h/$old_x);
}
if ($old_x < $old_y)
{
$thumb_w=$old_x*($new_w/$old_y);
$thumb_h=$new_h;
}
if ($old_x == $old_y)
{
$thumb_w=$new_w;
$thumb_h=$new_h;
}
$dst_img=ImageCreateTrueColor($thumb_w,$thumb_h);
imagecopyresampled($dst_img,$src_img,0,0,0,0,$thumb_w,$thumb_h,$old_x,$old_y);
if ($add_logo == 1) {
$logo=imagecreatefromgif('images/logo.png');
imagecopy($dst_img,$logo,0,5,0,0,136,59);
}
if (preg_match('/\.png$/i',$name))
{
imagepng($dst_img,$filename);
} else {
imagejpeg($dst_img,$filename);
}
imagedestroy($dst_img);
imagedestroy($src_img);
}
$memberid="".$_COOKIE['memberid']."";
if(!empty($_POST['MyFocus'])) {
if(empty($_POST['title'])) { $error="לא הוכנסה כותרת הבלוג"; }
if(empty($_POST['message'])) { $error="לא הוכנס תוכן הבלוג"; }
if (empty($error)) {
$Mid="".$_GET['Mid']."";
$FromMid="".$_COOKIE['memberid']."";
if(!empty($_FILES['file']['name']))
{
$dir="albums/$id/blogs";
if(!is_dir($dir)) {
make_dir("$id/blogs/"); }
$upname=explode("." , $_FILES['file']['name']);
$name=$upname['0'].".".$upname[1];
$rand=rand(156449,1977777777);
if(eregi("[א-ת]+" , $upname[0])) {
$name=$rand.".".$upname[1]; }
if (file_exists($dir.$name)) {
$name=$rand.".".$upname[1]; }
if($_FILES['file']['size'] >= 1000*1024) {
$error= ", הקובץ גדול מהמותר"; }
if($upname[1] != "jpg" & $upname[1] != "JPG" & $upname[1] != "JPEG" & $upname[1] != "jpeg") {
$error.= "סוג התמונה שניסית להעלות לאתר
<br/>אינו מורשה, באפשרותך להעלות את הסוגים הבאים:
<br/>.jpg<br/>.JPG<br/>.jpeg<br/>.JPEG";
}else{
$name=$rand.".".$upname[1];
createthumb($file, $dir.'/'.$name, 535, 520,1);
createthumb($file, $dir.'/small_'.$name, 140, 140);
chmod($dir."/".$name, 0755);
$image="albums/$id/blogs/$name";
$timestamp=time();
$sql=mysql_query("INSERT INTO tblBlogs (Mid,BlogTitle,BlogContent,BlogImage,timestamp) VALUES ('$memberid','$_POST[title]','$_POST[message]','$image','$timestamp')")
or die(mysql_error());
} }
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=windows-1255">
<script language="javascript" type="text/javascript" src="inc/Blogs/wysiwyg/tiny_mce.js"></script>
<script language="javascript" type="text/javascript">
tinyMCE.init({
mode : "textareas",
theme : "advanced",
theme_advanced_buttons1 : "forecolor,backcolor,fontselect,fontsizeselect,bold,italic,underline,separator,strikethrough,justifyleft,justifycenter,justifyright, justifyfull,bullist,numlist,undo,redo,link,unlink",
theme_advanced_buttons2 : "",
theme_advanced_buttons3 : "",
theme_advanced_toolbar_location : "top",
theme_advanced_toolbar_align : "right",
theme_advanced_path_location : "bottom",
extended_valid_elements : "a[name|href|target|title|onclick],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name],hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]"
});
</script>
</head>
<body>
<table>
<tr>
<td width="600" align="center">
<table border="0" cellpadding="4" cellspacing="4" width="100%" align="center" dir="rtl">
<tr>
<td style="border: 1px solid #C0C0C0" bgcolor="#FFFFFF">
<table cellpadding="0" cellspacing="0" width="100%" bgcolor="#E0E9F6">
<tr>
<td height="25" bgcolor="#97B201"><img src="http://www.netkings.co.il/egotrip/images/newstyle/article.gif"></td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" width="590">
<tr>
<td height="2">
</td>
</tr>
<tr>
<td colspan="2">
<table cellpadding="4" cellspacing="0" width="590" style="border-left: 2px solid #AC1015; border-right: 2px solid #AC1015; border-top: 2px solid #AC1015; border-bottom: 2px solid #AC1015" bgcolor="#F4F5F8">
<form enctype="multipart/form-data" method="post" action="http://www.netkings.co.il/egotrip/send_article.php">
<input type="hidden" name="author" value="15209">
<tr>
<td align="right" bgcolor="#F7F7F9"><font color="#AC1015" size="2"><b>שם הכותב</b></font></td>
<td bgcolor=#F7F7F9 colSpan="2"><a class="small" href="viewprofile.php?Mid=<?=$memberid;?>" style="text-decoration: none"><font size="2" color="#5C9FE1"><b>Sparks</b></font></a></td>
</tr>
<tr>
<td balign="right" bgcolor="#F7F7F9"><font color="#AC1015" size="2"><b>כותרת הבלוג</b></font></td>
<td bgcolor=#F7F7F9 colSpan="2"><input class="input" type="text" name="title" size="67" value="" maxlength="35"><span class="error"></span><br><font color="#7F9DB9" size="1"><b>מוגבל עד 35 תווים בלבד.</b></font></td>
</tr>
<tr>
<td colSpan="3" height="25" background="http://www.netkings.co.il/egotrip/images/newstyle/cattitle_send_sub.gif"><font color="#FFFFFF" size="2"><b>תוכן ההודעה</b></td>
</tr>
<tr>
<td bgcolor=#F7F7F9 colSpan="3" align="center"><textarea id="subject" name="message" cols="69" rows="25"></textarea><span class="error"></span></td>
</tr>
<tr>
<td colSpan="3" height="25" background="http://www.netkings.co.il/egotrip/images/newstyle/cattitle_send_sub.gif"><font color="#FFFFFF" size="2"><b>הוספת תמונה</b></td>
</tr>
<tr>
<td balign="right" bgcolor="#F7F7F9" valign="top"><font color="#AC1015" size="2"><b>בחר את התמונה</b></font></td>
<td bgcolor=#F7F7F9 colSpan="2"><input type="file" value="" name="userfile" size="60"><span class="error"> </span></td>
</tr>
<tr>
<td balign="right" bgcolor="#F7F7F9" valign="top"><font color="#AC1015" size="2"><b>כותרת קצרה לתמונה</b></font></td>
<td bgcolor=#F7F7F9 colSpan="2"><input class="input" type="text" name="pic_title" size="20" value="" maxlength="15"><span class="error"></span><br><font color="#7F9DB9" size="1"><b>מוגבל עד 15 תווים בלבד.</b></font></td>
</tr>
<tr>
<td colSpan="3" height="25" background="http://www.netkings.co.il/egotrip/images/newstyle/cattitle_send_sub.gif"><font color="#FFFFFF" size="2"><b>בחירת נושא למאמר</b></td>
</tr>
<tr>
<td balign="right" bgcolor="#F7F7F9" valign="top"><font color="#AC1015" size="2"><b>בחר נושא</b></font></td>
<td bgcolor=#F7F7F9 colSpan="2">
<select name="select_type" size="1">
<option value="1">כללי</option>
<option value="2">שירים</option>
<option value="3">סיפורים</option>
<option value="4">מכתבי אהבה</option>
</select>
</td>
</tr>
<tr>
<td bgcolor=#F7F7F9 align="center" colspan="3"><input type="hidden" name="submit_article"><input type="image" src="http://www.netkings.co.il/egotrip/images/newstyle/send_article.gif" name="submit_article" value="שלח מאמר"></td>
</tr>
</form>
</table>
</td>
</tr>
</table>
<br>
</td>
</tr>
</table>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>