All pastes #78960 Raw Edit

Stuff

public text v1 · immutable
·published 2006-07-04 19:05 UTC
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="&#1500;&#1488; &#1492;&#1493;&#1499;&#1504;&#1505;&#1492; &#1499;&#1493;&#1514;&#1512;&#1514; &#1492;&#1489;&#1500;&#1493;&#1490;"; }
	if(empty($_POST['message'])) { $error="&#1500;&#1488; &#1492;&#1493;&#1499;&#1504;&#1505; &#1514;&#1493;&#1499;&#1503; &#1492;&#1489;&#1500;&#1493;&#1490;"; }
	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("[&#1488;-&#1514;]+" , $upname[0])) {
	$name=$rand.".".$upname[1]; }
	if (file_exists($dir.$name)) {
	$name=$rand.".".$upname[1]; }
	if($_FILES['file']['size'] >= 1000*1024) {
	$error= ", &#1492;&#1511;&#1493;&#1489;&#1509; &#1490;&#1491;&#1493;&#1500; &#1502;&#1492;&#1502;&#1493;&#1514;&#1512;"; }
	if($upname[1] != "jpg" & $upname[1] != "JPG" & $upname[1] != "JPEG" & $upname[1] != "jpeg") {
	$error.= "&#1505;&#1493;&#1490; &#1492;&#1514;&#1502;&#1493;&#1504;&#1492; &#1513;&#1504;&#1497;&#1505;&#1497;&#1514; &#1500;&#1492;&#1506;&#1500;&#1493;&#1514; &#1500;&#1488;&#1514;&#1512; 
	<br/>&#1488;&#1497;&#1504;&#1493; &#1502;&#1493;&#1512;&#1513;&#1492;, &#1489;&#1488;&#1508;&#1513;&#1512;&#1493;&#1514;&#1498; &#1500;&#1492;&#1506;&#1500;&#1493;&#1514; &#1488;&#1514; &#1492;&#1505;&#1493;&#1490;&#1497;&#1501; &#1492;&#1489;&#1488;&#1497;&#1501;:
	<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>&#1513;&#1501; &#1492;&#1499;&#1493;&#1514;&#1489;</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>&#1499;&#1493;&#1514;&#1512;&#1514; &#1492;&#1489;&#1500;&#1493;&#1490;</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>&#1502;&#1493;&#1490;&#1489;&#1500; &#1506;&#1491; 35 &#1514;&#1493;&#1493;&#1497;&#1501; &#1489;&#1500;&#1489;&#1491;.</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>&#1514;&#1493;&#1499;&#1503; &#1492;&#1492;&#1493;&#1491;&#1506;&#1492;</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>&#1492;&#1493;&#1505;&#1508;&#1514; &#1514;&#1502;&#1493;&#1504;&#1492;</b></td>
	</tr>
	<tr>
		<td balign="right" bgcolor="#F7F7F9" valign="top"><font color="#AC1015" size="2"><b>&#1489;&#1495;&#1512; &#1488;&#1514; &#1492;&#1514;&#1502;&#1493;&#1504;&#1492;</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>&#1499;&#1493;&#1514;&#1512;&#1514; &#1511;&#1510;&#1512;&#1492; &#1500;&#1514;&#1502;&#1493;&#1504;&#1492;</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>&#1502;&#1493;&#1490;&#1489;&#1500; &#1506;&#1491; 15 &#1514;&#1493;&#1493;&#1497;&#1501; &#1489;&#1500;&#1489;&#1491;.</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>&#1489;&#1495;&#1497;&#1512;&#1514; &#1504;&#1493;&#1513;&#1488; &#1500;&#1502;&#1488;&#1502;&#1512;</b></td>
	</tr>
	<tr>
		<td balign="right" bgcolor="#F7F7F9" valign="top"><font color="#AC1015" size="2"><b>&#1489;&#1495;&#1512; &#1504;&#1493;&#1513;&#1488;</b></font></td>
		<td bgcolor=#F7F7F9 colSpan="2">
			<select name="select_type" size="1">
			<option value="1">&#1499;&#1500;&#1500;&#1497;</option>
			<option value="2">&#1513;&#1497;&#1512;&#1497;&#1501;</option>
			<option value="3">&#1505;&#1497;&#1508;&#1493;&#1512;&#1497;&#1501;</option>
			<option value="4">&#1502;&#1499;&#1514;&#1489;&#1497; &#1488;&#1492;&#1489;&#1492;</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="&#1513;&#1500;&#1495; &#1502;&#1488;&#1502;&#1512;"></td>
	</tr>
  </form>
</table>


		</td>
	</tr>

</table>

<br>
		</td>
	</tr>
</table>

		</td>
	</tr>
</table>
</td>
</tr>
</table>
</body>
</html>