<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Web Development Techniques</title>
	<atom:link href="http://widewebsolutions.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://widewebsolutions.wordpress.com</link>
	<description>Just another WordPress.com weblog</description>
	<lastBuildDate>Mon, 29 Sep 2008 10:01:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='widewebsolutions.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Web Development Techniques</title>
		<link>http://widewebsolutions.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://widewebsolutions.wordpress.com/osd.xml" title="Web Development Techniques" />
	<atom:link rel='hub' href='http://widewebsolutions.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Check All/Uncheck All Javascript</title>
		<link>http://widewebsolutions.wordpress.com/2008/09/29/heck-alluncheck-all-javascript/</link>
		<comments>http://widewebsolutions.wordpress.com/2008/09/29/heck-alluncheck-all-javascript/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 09:57:56 +0000</pubDate>
		<dc:creator>widewebsolutions</dc:creator>
				<category><![CDATA[Common]]></category>

		<guid isPermaLink="false">http://widewebsolutions.wordpress.com/?p=15</guid>
		<description><![CDATA[&#60;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&#62; &#60;html xmlns=”http://www.w3.org/1999/xhtml”&#62; &#60;head&#62; &#60;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&#62; &#60;title&#62;Untitled Document&#60;/title&#62; &#60;script type=”text/javascript”&#62; /** * Check All Check Boxes * @param String strFrmName * @param String strElemName * @param String strTriggerFrom * $return boolean */ function checkAllBox(strElemName,strTriggerFrom) { var objFrm        =    document.forms[0]; var objElem        =    objFrm[strElemName]; var objTrigger  [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=15&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<div class="entry">
<div class="snap_preview">
<p>&lt;!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Transitional//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd”&gt;<br />
&lt;html xmlns=”http://www.w3.org/1999/xhtml”&gt;<br />
&lt;head&gt;<br />
&lt;meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ /&gt;<br />
&lt;title&gt;Untitled Document&lt;/title&gt;<br />
&lt;script type=”text/javascript”&gt;</p>
<p>/**<br />
* Check All Check Boxes<br />
* @param String strFrmName<br />
* @param String strElemName<br />
* @param String strTriggerFrom<br />
* $return boolean<br />
*/<br />
function checkAllBox(strElemName,strTriggerFrom)<br />
{<br />
var objFrm        =    document.forms[0];<br />
var objElem        =    objFrm[strElemName];<br />
var objTrigger  =   objFrm[strTriggerFrom];<br />
var checkBoxCOunt = 0;<br />
if(objElem.length &gt; 0){<br />
checkBoxCOunt   =   objElem.length;<br />
}<br />
if(objTrigger.checked){<br />
if(checkBoxCOunt &lt;= 0){<br />
objElem.checked = true;<br />
} else {<br />
for(var i = 0; i&lt;objElem.length; i++){<br />
objElem[i].checked = true;<br />
}<br />
}<br />
} else {<br />
if(checkBoxCOunt&lt;=0){<br />
objElem.checked = false;<br />
} else {<br />
for(var i = 0; i&lt;objElem.length; i++){<br />
objElem[i].checked = false;<br />
}<br />
}<br />
}<br />
}</p>
<p>&lt;/script&gt;<br />
&lt;/head&gt;<br />
&lt;body&gt;<br />
&lt;form name=”frmList” method=”post” action=”#”&gt;<br />
&lt;table width=”67%” border=”0″ align=”center” cellspacing=”0″ style=”width: 100%; border-collapse: collapse;”&gt;<br />
&lt;tbody&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;table width=”100%” align=”center” border=”0″ cellspacing=”0″&gt;<br />
&lt;tbody&gt;<br />
&lt;tr&gt;<br />
&lt;td width=”3%” align=”left”&gt;&lt;input name=”select_all” value=”&#8221; onclick=”checkAllBox(’arrPermissionId[]‘,’select_all’);” type=”checkbox”&gt;<br />
&lt;/td&gt;<br />
&lt;td width=”29%”&gt;&lt;strong&gt;&amp;nbsp;Permission Name&lt;/strong&gt;&lt;/td&gt;<br />
&lt;td width=”47%”&gt;&lt;strong&gt;Description&lt;/strong&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td width=”3%” align=”left”&gt;&lt;input id=”PermissionId1″ name=”arrPermissionId[]” value=”1″ type=”checkbox”&gt;<br />
&lt;/td&gt;<br />
&lt;td width=”29%” align=”left”&gt; Play &lt;/td&gt;<br />
&lt;td width=”47%” align=”left”&gt; Play Permission &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td width=”3%” align=”left”&gt;&lt;input  id=”PermissionId2″ name=”arrPermissionId[]” value=”2″ type=”checkbox”&gt;<br />
&lt;/td&gt;<br />
&lt;td width=”29%” align=”left”&gt; View &lt;/td&gt;<br />
&lt;td width=”47%” align=”left”&gt; View All Permissions &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td width=”3%” align=”left”&gt;&lt;input  id=”PermissionId3″ name=”arrPermissionId[]” value=”3″ type=”checkbox”&gt;<br />
&lt;/td&gt;<br />
&lt;td width=”29%” align=”left”&gt; Change &lt;/td&gt;<br />
&lt;td width=”47%” align=”left”&gt; Change &lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;tr&gt;<br />
&lt;td&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;&lt;/td&gt;<br />
&lt;/tr&gt;<br />
&lt;/tbody&gt;<br />
&lt;/table&gt;<br />
&lt;/form&gt;<br />
&lt;/body&gt;<br />
&lt;/html&gt;</p></div>
</div>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/widewebsolutions.wordpress.com/15/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/widewebsolutions.wordpress.com/15/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/widewebsolutions.wordpress.com/15/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=15&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://widewebsolutions.wordpress.com/2008/09/29/heck-alluncheck-all-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/693330ea5c9fc19dc6461a9e2b33327d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">widewebsolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Login Using Email Instead of Username in Joomla 1.5</title>
		<link>http://widewebsolutions.wordpress.com/2008/09/29/login-using-email-instead-of-username-in-joomla-15/</link>
		<comments>http://widewebsolutions.wordpress.com/2008/09/29/login-using-email-instead-of-username-in-joomla-15/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 09:55:38 +0000</pubDate>
		<dc:creator>widewebsolutions</dc:creator>
				<category><![CDATA[Common]]></category>

		<guid isPermaLink="false">http://widewebsolutions.wordpress.com/?p=11</guid>
		<description><![CDATA[Hai Guys, This is an issue that I had faced during one of my project using Joomla 1.5. After some try I got this solution. I am sharing it here, hope it will help someone. Step By Step. 1. Open modules/mod_login/tmpl/default.php 2. Change the textbox name to email 3. Open components/com_user/controller.php 4. Inside the function [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=11&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hai Guys,</p>
<p>This is an issue that I had faced during one of my project using Joomla 1.5. After some try I got this solution. I am sharing it here, hope it will help someone.</p>
<p>Step By Step.</p>
<p>1.  Open modules/mod_login/tmpl/default.php<br />
2.  Change the textbox name to email<br />
3.  Open components/com_user/controller.php<br />
4.  Inside the function login replace $credentials['username'] with $credentials['email']<br />
5.  Open plugins/authentication/joomla.php<br />
6.  Inside the function onAuthenticate, Replace the  query around line no: 74<br />
$query = &#8216;SELECT `id`, `password`, `gid`&#8217;<br />
. &#8216; FROM `#__users`&#8217;<br />
. &#8216; WHERE email=&#8217; . $db-&gt;Quote( $credentials['email'] )<br />
;</p>
<p>Thats it. Try to login with your email id.</p>
<p>Please let me know if you have any other options for the same.</p>
<p>Thanks</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/widewebsolutions.wordpress.com/11/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/widewebsolutions.wordpress.com/11/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/widewebsolutions.wordpress.com/11/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=11&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://widewebsolutions.wordpress.com/2008/09/29/login-using-email-instead-of-username-in-joomla-15/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/693330ea5c9fc19dc6461a9e2b33327d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">widewebsolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>Customizable Image Uploading class, with thumbnail and watermarks using php</title>
		<link>http://widewebsolutions.wordpress.com/2008/09/29/customizable-image-uploading-class-with-thumbnail-and-watermarks-using-php/</link>
		<comments>http://widewebsolutions.wordpress.com/2008/09/29/customizable-image-uploading-class-with-thumbnail-and-watermarks-using-php/#comments</comments>
		<pubDate>Mon, 29 Sep 2008 09:50:48 +0000</pubDate>
		<dc:creator>widewebsolutions</dc:creator>
				<category><![CDATA[Class]]></category>

		<guid isPermaLink="false">http://widewebsolutions.wordpress.com/?p=7</guid>
		<description><![CDATA[Hello Guys, Here is the solution for a customizable image uploading class. This class can be used to upload images, along with its thumbnail with a single click. Each and every location for the image can be specified. Also you can create watermark images. Source Code Image.class.php &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; /** * Image File Upload Class * [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=7&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello Guys,</p>
<p>Here is the solution for a customizable image uploading class. This class can be used to upload images, along with its thumbnail with a single click. Each and every location for the image can be specified. Also you can create watermark images.</p>
<p>Source Code  Image.class.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
<span style="font-style:italic;"><br />
<span style="font-style:italic;">/**</span><br />
<span style="font-style:italic;"> * Image File Upload Class</span><br />
<span style="font-style:italic;"> * Author : Aneesh Ramakrishna Pillai</span><br />
<span style="font-style:italic;"> * Email  : aneeshrp@ymail.com</span><br />
<span style="font-style:italic;"> * Friday, July 25, 2008</span><br />
<span style="font-style:italic;"> * Version 1.0</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;">class Image</span><br />
<span style="font-style:italic;">{</span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Upload Dir</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strUploadPath                        =    &#8220;../images/Uploads&#8221;;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Directory Path Seperator</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strPathSeperator                    =    &#8220;/&#8221;;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Upload Dir</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strOriginalImageLocation                =    &#8220;FullSize&#8221;;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Upload Dir</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strThumbnailImageLocation            =    &#8220;Thumbnail&#8221;;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Upload Dir</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $fileFieldName                        =    NULL;</span></span></p>
<p><span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : DOUBLE</span><br />
<span style="font-style:italic;"> * Maximum Size of an Image</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $intMaximumImageSize                    =    2000000;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : ARRAY</span><br />
<span style="font-style:italic;"> * Allowd Image Types</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $arrAllowedImageType                    =    array(&#8220;JPEG&#8221;,&#8221;JPG&#8221;,&#8221;GIF&#8221;,&#8221;BMP&#8221;,&#8221;PNG&#8221;,&#8221;PJPEG&#8221;);</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var </span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Error Message</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strUploadErrorMessage                =    NULL;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Watermark Image</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strWaterMarkImage                    =    NULL;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : Boolean</span><br />
<span style="font-style:italic;"> * Boolean Watermark status</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $bolWaterMark                        =    FALSE;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * @var</span><br />
<span style="font-style:italic;"> * TYPE : String</span><br />
<span style="font-style:italic;"> * Final Path of the uploaded Image</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> var $strUploadedImage                    =    NULL;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Constructor</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function Image($strFieldName,$strLocation = NULL, $intMaxSize = NULL,$strWaterMarkResource = NULL,$bolWaterMark = true)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> $this-&gt;fileFieldName            =    $strFieldName;</span><br />
<span style="font-style:italic;"> if(!empty($strLocation)){</span><br />
<span style="font-style:italic;"> $this-&gt;strUploadPath        =    $strLocation; </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> if(!empty($intMaxSize)){</span><br />
<span style="font-style:italic;"> $this-&gt;intMaximumImageSize    =    $intMaxSize; </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> if($bolWaterMark){</span><br />
<span style="font-style:italic;"> $this-&gt;bolWaterMark            =    true;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> if(!empty($strWaterMarkResource)){</span><br />
<span style="font-style:italic;"> $this-&gt;strWaterMarkResource    =    $strWaterMarkResource;</span><br />
<span style="font-style:italic;"> } else {</span><br />
<span style="font-style:italic;"> $this-&gt;strWaterMarkResource    =    &#8220;NAME&#8221;;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Set Original Image Location</span><br />
<span style="font-style:italic;"> * @param String $strLocationName</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function setFullsizeLocation($strOriginalImageLocation)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> if(!empty($strOriginalImageLocation)){</span><br />
<span style="font-style:italic;"> $this-&gt;strOriginalImageLocation    =    $strOriginalImageLocation;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Set Original Image Location</span><br />
<span style="font-style:italic;"> * @param String $strThumbnailImageLocation</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function setThumbnailLocation($strThumbnailImageLocation)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> if(!empty($strThumbnailImageLocation)){</span><br />
<span style="font-style:italic;"> $this-&gt;strThumbnailImageLocation    =    $strThumbnailImageLocation;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span></p>
<p><span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> public function MoveImageToServer()</span><br />
<span style="font-style:italic;"> { </span><br />
<span style="font-style:italic;"> //Create Root Upload Directory for this section</span><br />
<span style="font-style:italic;"> //if(!is_dir($this-&gt;strUploadPath)){    mkdir($this-&gt;strUploadPath);} </span><br />
<span style="font-style:italic;"> //Create Sub Directory for orignal image</span><br />
<span style="font-style:italic;"> if(!is_dir($this-&gt;strOriginalImageLocation)){</span><br />
<span style="font-style:italic;"> mkdir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strOriginalImageLocation,0777);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> //Create Sub Directory for Thumbail image</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> if(!is_dir($this-&gt;strThumbnailImageLocation)){</span><br />
<span style="font-style:italic;"> mkdir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strThumbnailImageLocation,0777);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Upload Full Size Image</span><br />
<span style="font-style:italic;"> //Pick Image Format</span><br />
<span style="font-style:italic;"> $strImageType        =    $_FILES[$this-&gt;fileFieldName]['type'];</span><br />
<span style="font-style:italic;"> if(!empty($strImageType) &amp;&amp; stripos($strImageType,$this-&gt;strPathSeperator)){</span><br />
<span style="font-style:italic;"> $strImageType    =    split($this-&gt;strPathSeperator,$strImageType);</span><br />
<span style="font-style:italic;"> $strImageType    =    $strImageType[1];</span><br />
<span style="font-style:italic;"> } else {</span><br />
<span style="font-style:italic;"> $strImageType    =    NULL;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Pick Image Size</span><br />
<span style="font-style:italic;"> $intImageSize        =    $_FILES[$this-&gt;fileFieldName]['size']; </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> //Check Necessary Credentials</span><br />
<span style="font-style:italic;"> if(in_array(strtoupper($strImageType),$this-&gt;arrAllowedImageType)){</span><br />
<span style="font-style:italic;"> //Create New Image Name</span><br />
<span style="font-style:italic;"> $strNewImageName        =    substr(time(),rand(0,5),rand(5,9));</span><br />
<span style="font-style:italic;"> $strNewImageName        .=    basename($_FILES[$this-&gt;fileFieldName]['name']);</span><br />
<span style="font-style:italic;"> $strImageDestination = $this-&gt;strOriginalImageLocation . $this-&gt;strPathSeperator . $strNewImageName; </span><br />
<span style="font-style:italic;"> $this-&gt;strUploadedImage    =    $strImageDestination; </span><br />
<span style="font-style:italic;"> if(move_uploaded_file($_FILES[$this-&gt;fileFieldName]['tmp_name'], $strImageDestination)){</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $this-&gt;createThumbnailImage($strImageDestination); </span><br />
<span style="font-style:italic;"> //$this-&gt;addWaterMarks($strImageDestination); </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> return true;</span><br />
<span style="font-style:italic;"> } else {</span><br />
<span style="font-style:italic;"> $this-&gt;strUploadErrorMessage    =    &#8220;Pegasus does not support this format or Image size is too large&#8221;;</span><br />
<span style="font-style:italic;"> return false; </span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> public function MoveThumbnailImageToServer()</span><br />
<span style="font-style:italic;"> { </span><br />
<span style="font-style:italic;"> //Create Root Upload Directory for this section</span><br />
<span style="font-style:italic;"> if(!is_dir($this-&gt;strUploadPath)){    mkdir($this-&gt;strUploadPath);} </span><br />
<span style="font-style:italic;"> //Create Sub Directory for orignal image</span><br />
<span style="font-style:italic;"> if(!is_dir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strOriginalImageLocation)){</span><br />
<span style="font-style:italic;"> mkdir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strOriginalImageLocation,0777);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> //Create Sub Directory for Thumbail image</span><br />
<span style="font-style:italic;"> if(!is_dir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strThumbnailImageLocation)){</span><br />
<span style="font-style:italic;"> mkdir($this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strThumbnailImageLocation,0777);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Upload Full Size Image</span><br />
<span style="font-style:italic;"> //Pick Image Format</span><br />
<span style="font-style:italic;"> $strImageType        =    $_FILES[$this-&gt;fileFieldName]['type'];</span><br />
<span style="font-style:italic;"> if(!empty($strImageType) &amp;&amp; stripos($strImageType,$this-&gt;strPathSeperator)){</span><br />
<span style="font-style:italic;"> $strImageType    =    split($this-&gt;strPathSeperator,$strImageType);</span><br />
<span style="font-style:italic;"> $strImageType    =    $strImageType[1];</span><br />
<span style="font-style:italic;"> } else {</span><br />
<span style="font-style:italic;"> $strImageType    =    NULL;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Pick Image Size</span><br />
<span style="font-style:italic;"> $intImageSize        =    $_FILES[$this-&gt;fileFieldName]['size']; </span><br />
<span style="font-style:italic;"> //Check Necessary Credentials</span><br />
<span style="font-style:italic;"> if(in_array(strtoupper($strImageType),$this-&gt;arrAllowedImageType)){</span><br />
<span style="font-style:italic;"> //Create New Image Name</span><br />
<span style="font-style:italic;"> $strNewImageName        =    substr(time(),rand(0,5),rand(5,9));</span><br />
<span style="font-style:italic;"> $strNewImageName        .=    basename($_FILES[$this-&gt;fileFieldName]['name']);</span><br />
<span style="font-style:italic;"> $strImageDestination = $this-&gt;strUploadPath . $this-&gt;strPathSeperator . $this-&gt;strThumbnailImageLocation . $this-&gt;strPathSeperator . $strNewImageName; </span><br />
<span style="font-style:italic;"> $this-&gt;strUploadedImage    =    $strImageDestination; </span><br />
<span style="font-style:italic;"> if(move_uploaded_file($_FILES[$this-&gt;fileFieldName]['tmp_name'], $strImageDestination)){ </span><br />
<span style="font-style:italic;"> $this-&gt;createThumbnailImage($strImageDestination);</span><br />
<span style="font-style:italic;"> //$this-&gt;addWaterMarks($strImageDestination); </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> return true;</span><br />
<span style="font-style:italic;"> } else { </span><br />
<span style="font-style:italic;"> $this-&gt;strUploadErrorMessage    =    &#8220;Protaj does not support this format or Image size is too large&#8221;;</span><br />
<span style="font-style:italic;"> return false; </span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Create Thumbnail Images From Image ize</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function createThumbnailImage($strImageSource,$withSampling=true)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> //Create Thumnail Size</span><br />
<span style="font-style:italic;"> $ImageSize            =    getimagesize($strImageSource);</span><br />
<span style="font-style:italic;"> $Thumbnail                =    new Thumbnail($ImageSize[0],$ImageSize[1]);</span><br />
<span style="font-style:italic;"> $Thumbnail-&gt;ResizeImage();</span><br />
<span style="font-style:italic;"> $strNewFileName        =    basename($strImageSource);</span><br />
<span style="font-style:italic;"> $strImageDestination    =    $this-&gt;strThumbnailImageLocation . $this-&gt;strPathSeperator . $strNewFileName; </span></p>
<p><span style="font-style:italic;"> $strFileExtension        =    $this-&gt;getFileExtension(basename($strImageSource));</span><br />
<span style="font-style:italic;"> $strFileExtension        =    strtoupper($strFileExtension);</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $intNewWidth            =    $Thumbnail-&gt;New_Width;</span><br />
<span style="font-style:italic;"> $intNewheight            =    $Thumbnail-&gt;New_Height; </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> // Load</span><br />
<span style="font-style:italic;"> $thumb                =    imagecreatetruecolor($intNewWidth, $intNewheight);</span></p>
<p><span style="font-style:italic;"> switch($strFileExtension){</span><br />
<span style="font-style:italic;"> case &#8216;JPG&#8217;:</span><br />
<span style="font-style:italic;"> case &#8216;JPEG&#8217;:</span><br />
<span style="font-style:italic;"> $imSource        =    imagecreatefromjpeg($strImageSource); </span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;GIF&#8217;:</span><br />
<span style="font-style:italic;"> $imSource        =    imagecreatefromgif($strImageSource); </span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;PNG&#8217;:</span><br />
<span style="font-style:italic;"> $imSource        =    imagecreatefrompng($strImageSource); </span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> // Resize</span><br />
<span style="font-style:italic;"> if($withSampling)</span><br />
<span style="font-style:italic;"> imagecopyresampled($thumb, $imSource, 0, 0, 0, 0, $intNewWidth, $intNewheight, $ImageSize[0], $ImageSize[1]);</span><br />
<span style="font-style:italic;"> else </span><br />
<span style="font-style:italic;"> imagecopyresized($thumb, $imSource, 0, 0, 0, 0, $intNewWidth, $intNewheight, $ImageSize[0], $ImageSize[1]);</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> // Output</span><br />
<span style="font-style:italic;"> switch($strFileExtension){</span><br />
<span style="font-style:italic;"> case &#8216;JPG&#8217;:</span><br />
<span style="font-style:italic;"> case &#8216;JPEG&#8217;:</span><br />
<span style="font-style:italic;"> return imagejpeg($thumb,$strImageDestination);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;GIF&#8217;:</span><br />
<span style="font-style:italic;"> return imagegif($thumb,$strImageDestination);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;PNG&#8217;:</span><br />
<span style="font-style:italic;"> return imagepng($thumb,$strImageDestination);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Add water marks to full size images</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function addWaterMarks($strSourceImageName)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> list($o_Width,$o_Height)        =    getimagesize($strSourceImageName);</span><br />
<span style="font-style:italic;"> list($w_Width,$w_Height)        =    getimagesize($this-&gt;strWaterMarkResource); </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $intWaterMarkLocationHeight    =    ceil($o_Height/2) &#8211; ceil($w_Height/2);</span><br />
<span style="font-style:italic;"> $intWaterMarkLocationWidth    =    ceil($o_Width/2) &#8211; ceil($w_Width/2); </span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $strSourceImageExtension        =    $this-&gt;getFileExtension(basename($strSourceImageName));</span><br />
<span style="font-style:italic;"> $strSourceImageExtension        =    strtoupper($strSourceImageExtension);</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $WaterMarkIm                =    imagecreatefrompng($this-&gt;strWaterMarkResource);</span><br />
<span style="font-style:italic;"> switch($strSourceImageExtension){</span><br />
<span style="font-style:italic;"> case &#8216;JPG&#8217;:</span><br />
<span style="font-style:italic;"> case &#8216;JPEG&#8217;:</span><br />
<span style="font-style:italic;"> $imgIM            =    imagecreatefromjpeg($strSourceImageName);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;GIF&#8217;:</span><br />
<span style="font-style:italic;"> $imgIM            =    imagecreatefromgif($strSourceImageName);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;PNG&#8217;:</span><br />
<span style="font-style:italic;"> $imgIM            =    imagecreatefrompng($strSourceImageName); </span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> $newImage                    =    imagecreatetruecolor($o_Width,$o_Height);</span></p>
<p><span style="font-style:italic;"> imagecopyresized($newImage,$imgIM,0,0,0,0,$o_Width,$o_Height,$o_Width,$o_Height); </span><br />
<span style="font-style:italic;"> imagecopy($newImage, $WaterMarkIm, $intWaterMarkLocationWidth, $intWaterMarkLocationHeight,0,0,$w_Width,$w_Height);</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> switch($strSourceImageExtension){</span><br />
<span style="font-style:italic;"> case &#8216;JPG&#8217;:</span><br />
<span style="font-style:italic;"> case &#8216;JPEG&#8217;:</span><br />
<span style="font-style:italic;"> case &#8216;PNG&#8217;:</span><br />
<span style="font-style:italic;"> imagejpeg($newImage,$strSourceImageName,100);</span><br />
<span style="font-style:italic;"> break;</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> case &#8216;GIF&#8217;:</span><br />
<span style="font-style:italic;"> imagegif($newImage,$strSourceImageName,100);</span><br />
<span style="font-style:italic;"> break; </span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> chmod($strSourceImageName,0777);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Remove An Image from folder</span><br />
<span style="font-style:italic;"> * @param String $strImageLocation</span><br />
<span style="font-style:italic;"> * @return Boolean</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public static function Remove($strImageName,$id=&#8221;)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> if(!empty($strImageName)){</span><br />
<span style="font-style:italic;"> if(empty($id)){</span><br />
<span style="font-style:italic;"> //Remove FullSize Image</span><br />
<span style="font-style:italic;"> if(file_exists(PARENT_PATH . COMMON . FULLSIZE  . PATH_SEP . $strImageName)){</span><br />
<span style="font-style:italic;"> $bolRemoveFullSize    =    @unlink(PARENT_PATH . COMMON . FULLSIZE  . PATH_SEP . $strImageName);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Remove Thumbnail Image </span><br />
<span style="font-style:italic;"> if(file_exists(PARENT_PATH . COMMON . THUMBNAIL . PATH_SEP . $strImageName)){</span><br />
<span style="font-style:italic;"> $bolRemoveThumbnail    =    @unlink(PARENT_PATH . COMMON . THUMBNAIL . PATH_SEP . $strImageName); </span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> if($bolRemoveFullSize &amp;&amp; $bolRemoveThumbnail){</span><br />
<span style="font-style:italic;"> return true;</span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> } else {</span><br />
<span style="font-style:italic;"> //Remove FullSize Image</span><br />
<span style="font-style:italic;"> if(file_exists(PARENT_PATH . UPLOADS . $id . PATH_SEP . FULLSIZE  . PATH_SEP . $strImageName)){</span><br />
<span style="font-style:italic;"> $bolRemoveFullSize = unlink(PARENT_PATH . UPLOADS . $id . PATH_SEP . FULLSIZE . PATH_SEP . $strImageName);</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> //Remove Thumbnail Image </span><br />
<span style="font-style:italic;"> if(file_exists(PARENT_PATH . UPLOADS . $id . PATH_SEP . THUMBNAIL  . PATH_SEP . $strImageName)){</span><br />
<span style="font-style:italic;"> $bolRemoveThumbnail = unlink(PARENT_PATH . UPLOADS . $id . PATH_SEP . THUMBNAIL . PATH_SEP . $strImageName); </span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> if($bolRemoveFullSize &amp;&amp; $bolRemoveThumbnail){</span><br />
<span style="font-style:italic;"> return true;</span><br />
<span style="font-style:italic;"> } </span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;"> </span><br />
<span style="font-style:italic;"> /**</span><br />
<span style="font-style:italic;"> * Get File Extension From Given String</span><br />
<span style="font-style:italic;"> * @param String</span><br />
<span style="font-style:italic;"> * @return String</span><br />
<span style="font-style:italic;"> */</span><br />
<span style="font-style:italic;"> public function getFileExtension($strFileName)</span><br />
<span style="font-style:italic;"> {</span><br />
<span style="font-style:italic;"> $ext = substr($strFileName, strrpos($strFileName, &#8216;.&#8217;) + 1);</span><br />
<span style="font-style:italic;"> return $ext;</span><br />
<span style="font-style:italic;"> }</span><br />
<span style="font-style:italic;">}</span></p>
<p>Source Code upload_photo.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br />
<span style="font-style:italic;"><br />
<span style="font-style:italic;">//Calling the required class file</span><br />
<span style="font-style:italic;">require_once  &#8216;Image/Image.class.php&#8217;;</span></span></p>
<p><span style="font-style:italic;">$File    =    new Image(&#8216;file_input_name&#8217;,'upload_dir&#8217;,'watermark_image_loc&#8217;); </span><br />
<span style="font-style:italic;">$File-&gt;setFullsizeLocation(&#8216;fullsize_img_upload_location&#8217;);</span><br />
<span style="font-style:italic;">$File-&gt;setThumbnailLocation(&#8216;thumbnail_img_upload_location&#8217;);</span><br />
<span style="font-style:italic;">$File-&gt;MoveImageToServer();</span></p>
<p>Thats it ..</p>
<p>Execute the upload_photo.php and enjoy&#8230;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/widewebsolutions.wordpress.com/7/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/widewebsolutions.wordpress.com/7/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/widewebsolutions.wordpress.com/7/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=7&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://widewebsolutions.wordpress.com/2008/09/29/customizable-image-uploading-class-with-thumbnail-and-watermarks-using-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/693330ea5c9fc19dc6461a9e2b33327d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">widewebsolutions</media:title>
		</media:content>
	</item>
		<item>
		<title>PHP Image Resizing</title>
		<link>http://widewebsolutions.wordpress.com/2008/09/27/hello-world/</link>
		<comments>http://widewebsolutions.wordpress.com/2008/09/27/hello-world/#comments</comments>
		<pubDate>Sat, 27 Sep 2008 16:25:46 +0000</pubDate>
		<dc:creator>widewebsolutions</dc:creator>
				<category><![CDATA[Class]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[Hello, This code snippet allows you to resize the image dimensions without affecting the original image&#8217;s look and feel. Source Code ResizeImage.class.php &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211; /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=1&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Hello,</p>
<p>This code snippet allows you to resize the image dimensions without affecting the original image&#8217;s look and feel.</p>
<p>Source Code ResizeImage.class.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br />
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *<br />
*     Thumbnail Creation class.   Its s simple class where You can create Thobnail image  *<br />
*     of your current image, it will not create image rather it reduces the size of the   *<br />
*       image                                                                               *<br />
*                                                                                         *<br />
*       Name     :   Thumbnail Class                                                        *<br />
*       Author   :   Aneesh                                                                 *<br />
*       Email    :   webonphp@yahoo.com                                                     *<br />
*       Date     :   Saturday, April 07, 2007                                               *<br />
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */</p>
<p>class Thumbnail{</p>
<p>var $thumb_Width        =    100;   //Width Limit For Thumb Nail</p>
<p>var $thumb_Height        =    100;    //Height Limit For Thumb Nail</p>
<p>var  $medium_Width       =    275;   // Width Limit For Medium SIze Image (Say for Mouse Over Display)</p>
<p>var $medium_Height        =    250;   // Height Limit For Medium SIze Image (Say for Mouse Over Display)</p>
<p>var $large_Height        =   400;</p>
<p>var $large_Width         =   600;</p>
<p>var $small_Width        =    75;    //Less than a Thumnail</p>
<p>var $small_Height        =    75;    //Less than a Thumnail</p>
<p>var $original_Width;    // Original WIdth of the Image, ie the width of the image to be resized</p>
<p>var $original_Height;    // Original Height of the Image, ie the height of the image to be resized</p>
<p>var $New_Height;   // Resized Images&#8217; Height</p>
<p>var $New_Width;   // Resized Images&#8217; Width</p>
<p>var $reszie_Type;  // What typ of image we need to create ?? Thumb nail or mouse over</p>
<p>var $base_height;    //  Base height For Resize type, Will Update dynamically</p>
<p>var $base_width;    //  Base Width For Resize type, Will Update dynamically</p>
<p>/**<br />
@param  int OriginalWidth<br />
@param  int Originalheight<br />
@param  string ResizeType [Thumb | Hover | Full Size]<br />
return  NULL<br />
**/<br />
function Thumbnail($o_Width,$o_Height,$r_Type=&#8217;Thumb&#8217;){<br />
$this-&gt;original_Width     =    $o_Width;<br />
$this-&gt;original_Height    =    $o_Height;<br />
$this-&gt;reszie_Type        =    $r_Type;<br />
$this-&gt;SetBaseLimit();<br />
}</p>
<p>/**<br />
Set Base size or can say as size limits for each type of image<br />
$param NULL<br />
**/<br />
function SetBaseLimit(){<br />
switch($this-&gt;reszie_Type){<br />
case &#8216;Small&#8217;:<br />
// Base Size Limit for Thumb Nail Images<br />
$this-&gt;base_height    =    $this-&gt;small_Height;<br />
$this-&gt;base_width     =    $this-&gt;small_Width;<br />
break;</p>
<p>case &#8216;Thumb&#8217;:<br />
// Base Size Limit for Thumb Nail Images<br />
$this-&gt;base_height    =    $this-&gt;thumb_Height;<br />
$this-&gt;base_width     =    $this-&gt;thumb_Width;<br />
break;</p>
<p>case &#8216;Hover&#8217;:<br />
// Base Size Limit for Mouse Over Images<br />
$this-&gt;base_height    =    $this-&gt;medium_Height;<br />
$this-&gt;base_width     =    $this-&gt;medium_Width;<br />
break;</p>
<p>case &#8216;Large&#8217;:<br />
// Base Size Limit for Mouse Over Images<br />
$this-&gt;base_height    =    $this-&gt;large_Height;<br />
$this-&gt;base_width     =    $this-&gt;large_Width;<br />
break;<br />
}<br />
}</p>
<p>/**<br />
Finds the Image is to resized or not<br />
@param NULL<br />
$return Boolean<br />
**/<br />
function isImageToResize(){<br />
if($this-&gt;original_Width &gt; $this-&gt;base_width || $this-&gt;original_Height &gt; $this-&gt;base_height)<br />
return true;<br />
else<br />
return false;<br />
}</p>
<p>/**<br />
Fins the Width Type of Image, ie whther it is a Width &gt; Height Image<br />
or Height &gt;Width Image or Height == Width Image<br />
$return String W  ['Width &gt;Height'] |<br />
$return String H  ['Width<br />
$return String WH ['Width==Height'] |<br />
**/</p>
<p>function GetImageSizeType(){<br />
/*if($this-&gt;original_Width &gt; $this-&gt;original_Height)<br />
return &#8216;W&#8217;;<br />
if($this-&gt;original_Width &lt; $this-&gt;original_Height)<br />
return &#8216;H&#8217;;<br />
if($this-&gt;original_Width == $this-&gt;original_Height)<br />
return &#8216;WH&#8217;;*/<br />
if($this-&gt;reszie_Type    == &#8216;Hover&#8217;){<br />
if($this-&gt;original_Width &gt; $this-&gt;original_Height)<br />
return &#8216;W&#8217;;<br />
if($this-&gt;original_Width &lt; $this-&gt;original_Height)<br />
return &#8216;H&#8217;;<br />
if($this-&gt;original_Width == $this-&gt;original_Height)<br />
return &#8216;WH&#8217;;<br />
} else {<br />
return &#8216;H&#8217;;<br />
}<br />
}</p>
<p>/**<br />
Based on the Imagetype and width resize the original image<br />
**/</p>
<p>function ResizeImage(){<br />
if($this-&gt;isImageToResize()){<br />
$ImageSizeType    =   $this-&gt;GetImageSizeType();<br />
switch($ImageSizeType){<br />
case &#8216;W&#8217;:<br />
$this-&gt;SetSizeOnWidth();<br />
break;<br />
case &#8216;H&#8217;:<br />
$this-&gt;SetSizeOnHeight();<br />
break;<br />
case &#8216;WH&#8217;:<br />
$this-&gt;SetSizeOnHeight();<br />
break;<br />
}<br />
}else{<br />
$this-&gt;SetToDefault();<br />
}<br />
}</p>
<p>/**<br />
Resize the Image Baesd on width<br />
**/<br />
function SetSizeOnWidth(){<br />
$new_width            =    $this-&gt;base_width;<br />
$reduced_width        =    $this-&gt;original_Width &#8211; $this-&gt;base_width;<br />
$reduced_percentage   =    ($reduced_width/$this-&gt;original_Width)*100;<br />
$height_to_reduce     =    ($this-&gt;original_Height*$reduced_percentage)/100;<br />
$new_height           =    $this-&gt;original_Height-$height_to_reduce;<br />
$this-&gt;New_Height     =    floor($new_height);<br />
$this-&gt;New_Width      =    $new_width;<br />
}</p>
<p>/**<br />
Resize the Image Baesd on Height<br />
**/<br />
function SetSizeOnHeight(){<br />
$new_height            =    $this-&gt;base_height;<br />
$reduced_height        =    $this-&gt;original_Height &#8211; $this-&gt;base_height;<br />
$reduced_percentage    =    ($reduced_height/$this-&gt;original_Height)*100;<br />
$width_to_reduce       =    ($this-&gt;original_Width*$reduced_percentage)/100;<br />
$new_width             =    $this-&gt;original_Width-$width_to_reduce;<br />
$this-&gt;New_Height      =    floor($new_height);<br />
$this-&gt;New_Width       =    floor($new_width);<br />
}</p>
<p>/**<br />
Set the Image size to its default<br />
**/<br />
function SetToDefault(){<br />
$this-&gt;New_Height    =    $this-&gt;original_Height;<br />
$this-&gt;New_Width     =    $this-&gt;original_Width;<br />
}<br />
}<br />
?&gt;</p>
<p>Source Code show_image.php<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
&lt;img src=&#8221;original_image.jpg&#8221; &gt; &lt;br /&gt;<br />
list($width,$height)    =    getimagesize(&#8216;original_image.jpg&#8217;);<br />
//You can choose Small,Thumb,Hover,Large (each set have a predefined dimensions which can be changed in class file</p>
<p>$SmallThumb               =    new Thumbnail($width,$height,&#8217;Small&#8217;);<br />
$SmallThumb-&gt;ResizeImage();<br />
$t_width                       =    $SmallThumb-&gt;New_Width;<br />
$t_height                      =    $SmallThumb-&gt;New_Height;<br />
?&gt;<br />
&lt;img src=&#8221;original_image.jpg&#8221; height=&#8221;" /&gt; &#8221; width=&#8221;"&gt;</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/widewebsolutions.wordpress.com/1/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/widewebsolutions.wordpress.com/1/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/widewebsolutions.wordpress.com/1/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=widewebsolutions.wordpress.com&amp;blog=4998877&amp;post=1&amp;subd=widewebsolutions&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://widewebsolutions.wordpress.com/2008/09/27/hello-world/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/693330ea5c9fc19dc6461a9e2b33327d?s=96&#38;d=identicon" medium="image">
			<media:title type="html">widewebsolutions</media:title>
		</media:content>
	</item>
	</channel>
</rss>
