<?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/"
	>

<channel>
	<title>BlueJavax</title>
	<atom:link href="http://www.bluejavax.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.bluejavax.com</link>
	<description>Coding Can Be Fun</description>
	<lastBuildDate>Tue, 24 Jan 2012 16:34:44 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Hide Firebug ajax calls</title>
		<link>http://www.bluejavax.com/hide-firebug-ajax-calls/</link>
		<comments>http://www.bluejavax.com/hide-firebug-ajax-calls/#comments</comments>
		<pubDate>Sun, 15 Jan 2012 15:26:40 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=531</guid>
		<description><![CDATA[Finally i got some time to post a new post. I have been thinking how can I ajax calls from being displayed in firebug console. I can sound foolish being a developer I never read about firebug api, used firebug addon for best of my development practices. In the api there is an api function [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft" style="float: left; padding-right: 5px;" title="Firebug" src="http://getfirebug.com/doc/breakpoints/slides/images/firebug-large.png" alt="" width="264" height="211" />Finally i got some time to post a new post. I have been thinking how can I ajax calls from being displayed in firebug console.</p>
<p>I can sound foolish being a developer I never read about firebug api, used firebug addon for best of my development practices.</p>
<p>In the api there is an api function for firebug,</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><a  href="http://www.bluejavax.com/wp-content/uploads/2012/01/Selection_011.png" rel="thumbnail" class="thickbox no_icon" title="Selection_011"><img class="alignleft size-full wp-image-542" title="Selection_011" src="http://www.bluejavax.com/wp-content/uploads/2012/01/Selection_011.png" alt="" width="483" height="93" /></a></p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
</pre>
<pre><span class="js"><span class="js-comment">// detect if firebug is open
</span>

<span class="js-reserved-keyword">if</span> <span class="js-bracket">(</span><span class="js-client-keyword">window</span>.console <span class="js-operator">|</span><span class="js-operator">|</span> <span class="js-client-keyword">window</span>.console.firebug<span class="js-bracket">)</span> <span class="js-bracket">{</span>
console.clear<span class="js-bracket">(</span><span class="js-bracket">)</span>; <span class="js-comment">// clear the console
</span>
<span class="js-bracket">}</span></span></pre>
</div>
<p>You can use this after every ajax call example.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
</pre>
<pre><span class="js"><span class="js-comment">// create a function
</span>

<span class="js-function-keyword">function</span> clearConsole<span class="js-bracket">(</span><span class="js-bracket">)</span>

<span class="js-bracket">{</span>

<span class="js-reserved-keyword">if</span> <span class="js-bracket">(</span><span class="js-client-keyword">window</span>.console <span class="js-operator">|</span><span class="js-operator">|</span> <span class="js-client-keyword">window</span>.console.firebug<span class="js-bracket">)</span> <span class="js-bracket">{</span>
console.clear<span class="js-bracket">(</span><span class="js-bracket">)</span>; <span class="js-comment">// clear the console
</span>
<span class="js-bracket">}</span>

<span class="js-bracket">}</span>

jQuery.ajax<span class="js-bracket">(</span><span class="js-bracket">{</span>
type<span class="js-operator">:</span> <span class="js-string">&quot;GET&quot;</span>,<span class="js-comment">// can be GET OR POST
</span>
url<span class="js-operator">:</span> urlx,
cache<span class="js-operator">:</span> <span class="js-reserved-keyword">false</span>,
error<span class="js-operator">:</span> <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span>
<span class="js-bracket">{</span>
<span class="js-client-keyword">alert</span><span class="js-bracket">(</span><span class="js-string">'error try again!!'</span><span class="js-bracket">)</span>; <span class="js-comment">// show error or whatever
</span>
clearConsole<span class="js-bracket">(</span><span class="js-bracket">)</span>;<span class="js-comment">// call the function
</span>
<span class="js-bracket">}</span>,
success<span class="js-operator">:</span> <span class="js-function-keyword">function</span><span class="js-bracket">(</span>html<span class="js-bracket">)</span>
<span class="js-bracket">{</span>
clearConsole<span class="js-bracket">(</span><span class="js-bracket">)</span>;
<span class="js-comment">//--- you code----
</span>
<span class="js-bracket">}</span>
<span class="js-bracket">}</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span>;</span></pre>
</div>
<p>&nbsp;</p>
<p>as you can see the function has been called on <strong><em>error</em></strong> as well as on <strong><em>success, </em></strong>since you would need to hide the call even when there is an error.<br />
Creating a function would make it easy for you to comments the things at the time of development.<br />
<strong><a  href="http://jsfiddle.net/xZPa3/" target="_blank">Try At Js Fiddle</a><em><br />
</em></strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/hide-firebug-ajax-calls/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>IE force compatibility view</title>
		<link>http://www.bluejavax.com/ie-force-compatibility-view/</link>
		<comments>http://www.bluejavax.com/ie-force-compatibility-view/#comments</comments>
		<pubDate>Thu, 15 Sep 2011 05:30:13 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Miscellaneous]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=510</guid>
		<description><![CDATA[Alright.. so we all are aware of the browser compatibility issues.  Specially when it come to any of those Internet explorers. Most of the times I have faced issues that a website works perfectly in in IE8 but not in IE9 which is weird. Her is a small trick to enable back word compatibility from [...]]]></description>
			<content:encoded><![CDATA[<p>Alright.. so we all are aware of the browser compatibility issues.  Specially when it come to any of those Internet explorers. Most of the times I have faced issues that a website works perfectly in in IE8 but not in IE9 which is weird.</p>
<p>Her is a small trick to enable back word compatibility from IE9 to IE7.</p>
<pre class="prettyprint linenumstrigger linenums">&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE7&quot; /&gt;</pre>
<p>you can replace  the <strong>&#8220;EmulateIE[<em>version</em>]&#8220;</strong></p>
<p>usage</p>
<pre class="prettyprint linenumstrigger linenums">
&lt;!-- if you want ie8 to work as ie7, you ca replace the versions as per you needs. --&gt;

&lt;!--[if IE 8]&gt;
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE7&quot; /&gt;
&lt;![endif]--&gt;
&lt;!--if you want to enforce ie9 to be as ie8--&gt;
&lt;!--[if IE 9]&gt;
&lt;meta http-equiv=&quot;X-UA-Compatible&quot; content=&quot;IE=EmulateIE8&quot; /&gt;
&lt;![endif]--&gt;
</pre>
<p>hope it helps you guys. but i hate microsoft..</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/ie-force-compatibility-view/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Charlie Chaplin final speech in &#8220;The Great Dictator&#8221;</title>
		<link>http://www.bluejavax.com/charlie-chaplin-final-speech-in-the-great-dictator/</link>
		<comments>http://www.bluejavax.com/charlie-chaplin-final-speech-in-the-great-dictator/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 22:02:44 +0000</pubDate>
		<dc:creator>Mahmoud Tantawy</dc:creator>
				<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=503</guid>
		<description><![CDATA[This is my first post at my friend Harpreet&#8217;s Blog, so i thought about writing about any common interests between me and him, may be about open source, may be about revolutions, but then i watched this GREAT speech on Youtube, and i instantly took the decision to make this speech my first post in his [...]]]></description>
			<content:encoded><![CDATA[<p>This is my first post at my friend Harpreet&#8217;s Blog, so i thought about writing about any common interests between me and him, may be about open source, may be about revolutions, but then i watched this GREAT speech on Youtube, and i instantly took the decision to make this speech my first post in his blog, may it be a message heard by all human beings!</p>
<p>We all know Charlie Chaplin, the COMEDIAN, who has always made us laugh so hard even without saying a thing, his face expressions were enough.<br />
I never thought that such a touching-speech can be well told by a comedian, NEVER!</p>
<p>So, i&#8217;ll leave you with the speech, and the subtitles are below the video here in the post.<br />
I almost forgot! the video has 2 copies, one copy just ripped off the movie &#8220;The Great Dictator&#8221; where you can see his AMAZING facial expressions, and the other copy which is a fan-made video with images &amp; videos relating the topics in the speech to our lives.</p>
<p>The movie copy</p>
<p><object width="500" height="400"><param name="movie" value="http://www.youtube.com/v/QcvjoWOwnn4?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/QcvjoWOwnn4?version=3" type="application/x-shockwave-flash" width="500" height="400" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The fan-made copy</p>
<p><object width="500" height="306"><param name="movie" value="http://www.youtube.com/v/WibmcsEGLKo?version=3"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/WibmcsEGLKo?version=3" type="application/x-shockwave-flash" width="500" height="306" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>The Subtitles</p>
<blockquote><p>I&#8217;m sorry, but I don&#8217;t want to be an emperor. That&#8217;s not my business. I don&#8217;t want to rule or conquer anyone. I should like to help everyone if possible; Jew, Gentile, black man, white.<br />
We all want to help one another. Human beings are like that. We want to live by each other&#8217;s happiness, not by each other&#8217;s misery. We don&#8217;t want to hate and despise one another. In this world there is room for everyone, and the good earth is rich and can provide for everyone. The way of life can be free and beautiful, but we have lost the way.</p>
<p>Greed has poisoned men&#8217;s souls, has barricaded the world with hate, has goose-stepped us into misery and bloodshed. We have developed speed, but we have shut ourselves in. Machinery that gives abundance has left us in want. Our knowledge has made us cynical; our cleverness, hard and unkind.<br />
We think too much and feel too little. More than machinery, we need humanity. More than cleverness, we need kindness and gentleness.<br />
Without these qualities, life will be violent and all will be lost.</p>
<p>The airplane and the radio have brought us closer together. The very nature of these inventions cries out for the goodness in men; cries out for universal brotherhood; for the unity of us all.<br />
Even now my voice is reaching millions throughout the world, millions of despairing men, women, and little children, victims of a system that makes men torture and imprison innocent people.</p>
<p>To those who can hear me, I say, do not despair. The misery that is now upon us is but the passing of greed, the bitterness of men who fear the way of human progress. The hate of men will pass, and dictators die, and the power they took from the people will return to the people.<br />
And so long as men die, liberty will never perish.</p>
<p>Soldiers! Don&#8217;t give yourselves to brutes, men who despise you, enslave you; who regiment your lives, tell you what to do, what to think and what to feel! Who drill you, diet you, treat you like cattle, use you as cannon fodder.<br />
Don&#8217;t give yourselves to these unnatural men &#8211; machine men with machine minds and machine hearts! You are not machines, you are not cattle, you are men!<br />
You have the love of humanity in your hearts! You don&#8217;t hate! Only the unloved hate; the unloved and the unnatural.<br />
Soldiers! Don&#8217;t fight for slavery! Fight for liberty!</p>
<p>In the seventeenth chapter of St. Luke, it is written that the kingdom of God is within man, not one man nor a group of men, but in all men! In you!<br />
You, the people, have the power, the power to create machines, the power to create happiness!<br />
You, the people, have the power to make this life free and beautiful, to make this life a wonderful adventure.</p>
<p>Then in the name of democracy, let us use that power. Let us all unite.<br />
Let us fight for a new world, a decent world that will give men a chance to work, that will give youth a future and old age a security.</p>
<p>By the promise of these things, brutes have risen to power. But they lie! They do not fulfill that promise. They never will!<br />
Dictators free themselves but they enslave the people.<br />
Now let us fight to fulfill that promise. Let us fight to free the world! To do away with national barriers! To do away with greed, with hate and intolerance! Let us fight for a world of reason, a world where science and progress will lead to all men&#8217;s happiness.<br />
Soldiers, in the name of democracy, let us all unite!</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/charlie-chaplin-final-speech-in-the-great-dictator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating a simple auto suggest</title>
		<link>http://www.bluejavax.com/creating-a-simple-auto-suggest/</link>
		<comments>http://www.bluejavax.com/creating-a-simple-auto-suggest/#comments</comments>
		<pubDate>Mon, 01 Aug 2011 14:08:21 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=464</guid>
		<description><![CDATA[Hello everyone. After a long time i posting this new tutorial. I created it for my friend who needed this  auto suggest feature. This is a simple feature that can be used when u need to type city, so you can suggest previously saved cities. Even can be used where you need to put suggestion [...]]]></description>
			<content:encoded><![CDATA[<p>Hello everyone. After a long time i posting this new tutorial. I created it for my friend who needed this  auto suggest feature. This is a simple feature that can be used when u need to type city, so you can suggest previously saved cities.<br />
Even can be used where you need to put suggestion for search keywords, names, places etc.</p>
<p>&nbsp;</p>
<p><a  href="http://www.bluejavax.com/wp-content/uploads/2011/08/DEMO-2011-08-01-19-34-50.png" rel="thumbnail" class="thickbox no_icon" title="DEMO 2011-08-01 19-34-50"><img class="alignleft size-large wp-image-468" title="DEMO 2011-08-01 19-34-50" src="http://www.bluejavax.com/wp-content/uploads/2011/08/DEMO-2011-08-01-19-34-50-1024x558.png" alt="" width="584" height="318" /></a></p>
<p><a  title="Auto Suggest Demo" href="http://demo.bluejavax.com/autoSuggest" target="_blank">VIEW DEMO</a></p>

<p>Let&#8217;s start&#8230; first you need to create an index page with a field</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
<pre><span class="html"><span class="html-form-element">&lt;input type=<span class="html-attribute">&quot;text&quot;</span> name=<span class="html-attribute">&quot;text&quot;</span>  onkeyup=<span class="html-attribute">&quot;getAutoSuggest(document.getElementById('key'))&quot;</span> id=<span class="html-attribute">&quot;key&quot;</span>&gt;</span>

<span class="html-comment">&lt;!-- and yes the auto suggest box--&gt;</span>

<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;autobox&quot;</span>&gt;</span>
<span class="html-other-element">&lt;ul&gt;</span>
<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
<p>as u can see there is a function called up on key up. This function takes the input text  and calls a php file that uses the input to display results.<br />
The function</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
</pre>
<pre><span class="php"><span class="php-function">function</span> getAutoSuggest<span class="php-brackets">(</span>element<span class="php-brackets">)</span> <span class="php-comment">//---- a global common function to call sub categories
</span>
<span class="php-brackets">{</span>
<span class="php-var-type">string</span> <span class="php-operator">=</span> element<span class="php-operator">.</span>value
<span class="php-keyword">var</span> dataString <span class="php-operator">=</span> <span class="php-string">'text='</span><span class="php-operator">+</span><span class="php-var-type">string</span>; <span class="php-comment">// sending the category id
</span>
<span class="php-comment">//alert(dataString);
</span>
jQuery<span class="php-operator">.</span>ajax<span class="php-brackets">(</span><span class="php-brackets">{</span>
type<span class="php-operator">:</span> <span class="php-string">&quot;POST&quot;</span>,
url<span class="php-operator">:</span> <span class="php-string">&quot;getList.php&quot;</span>, <span class="php-comment">//--the file to call--
</span>
data<span class="php-operator">:</span> dataString,
cache<span class="php-operator">:</span> <span class="php-keyword">false</span>,
success<span class="php-operator">:</span> <span class="php-function">function</span><span class="php-brackets">(</span>html<span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span>html <span class="php-operator">!</span><span class="php-operator">=</span> <span class="php-string">&quot;&quot;</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox ul'</span><span class="php-brackets">)</span><span class="php-operator">.</span><span class="php-keyword">empty</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox ul'</span><span class="php-brackets">)</span><span class="php-operator">.</span>append<span class="php-brackets">(</span>html<span class="php-brackets">)</span>;<span class="php-comment">// appending to the auto-suggest box
</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideDown<span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">else</span>
<span class="php-brackets">{</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox ul'</span><span class="php-brackets">)</span><span class="php-operator">.</span><span class="php-keyword">empty</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideUp<span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span></span></pre>
</div>
<p>The php file</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-var">$string</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'text'</span><span class="php-brackets">]</span>;<span class="php-comment">//-- id got via post--
</span>
<span class="php-comment">/*
* run the sql and generate the result in the format below
*/</span>

<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$string</span><span class="php-operator">!</span><span class="php-operator">=</span><span class="php-string">&quot;&quot;</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>

<span class="php-keyword">for</span><span class="php-brackets">(</span><span class="php-var">$x</span><span class="php-operator">=</span><span class="php-number">0</span>;<span class="php-var">$x</span><span class="php-operator">&lt;</span><span class="php-operator">=</span><span class="php-number">5</span>;<span class="php-var">$x</span><span class="php-operator">+</span><span class="php-operator">+</span><span class="php-brackets">)</span><span class="php-comment">//
</span>
<span class="php-brackets">{</span>
<span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;li id=<span class="html-attribute">&quot;pro</span></span></span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">&quot;  onclick=&quot;setValue(</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">)&quot;&gt;
String = &quot;</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$string</span><span class="php-script-tag">?&gt;<span class="html">&quot; Click to set value as </span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;/li&gt;</span>
</span>&lt;?</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>

<span class="php-comment">// as u can see the LI generated calls a function &quot;setValue&quot;
</span>

<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>The &#8220;setValue &#8221; function takes the value parameter and when u click on the result generated, its closes the the suggestion box and saves the value in the textbox.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
</pre>
<pre><span class="php"><span class="php-function">function</span> setValue<span class="php-brackets">(</span>value<span class="php-brackets">)</span>
<span class="php-brackets">{</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox ul'</span><span class="php-brackets">)</span><span class="php-operator">.</span><span class="php-keyword">empty</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'#autobox'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideUp<span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'[name = text]'</span><span class="php-brackets">)</span><span class="php-operator">.</span>val<span class="php-brackets">(</span>value<span class="php-brackets">)</span>;
<span class="php-brackets">}</span></span></pre>
</div>
<p>thats all and yeah some styling too</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
</pre>
<pre><span class="css">#autobox
{
<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #FFFDF7</span></span>;
<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> #EDED00 1px solid</span></span>;
}

#autobox ul li
{
<span class="css-property">list-style<span class="css-selector">:</span><span class="css-value"> none</span></span>;
<span class="css-property">cursor<span class="css-selector">:</span><span class="css-value"> pointer</span></span>;
<span class="css-property">padding<span class="css-selector">:</span><span class="css-value"> 3px</span></span>;
}</span></pre>
</div>
<p><a  title="Auto Suggest Demo" href="http://demo.bluejavax.com/autoSuggest" target="_blank">VIEW DEMO</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/creating-a-simple-auto-suggest/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>jQuery-Ajax:Category &amp; Product in sliding panels</title>
		<link>http://www.bluejavax.com/jquery-ajaxcategory-product-in-sliding-panels/</link>
		<comments>http://www.bluejavax.com/jquery-ajaxcategory-product-in-sliding-panels/#comments</comments>
		<pubDate>Sat, 29 Jan 2011 18:58:19 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=408</guid>
		<description><![CDATA[Hello everyone. Its been a long time i haven&#8217;t poted. I was busy with my career and finally opened my own firm named SparkIgniter. Its going great till now. This blog will always continue to run. Ok so here is a small code i created for a friend of mine who is a java developer. [...]]]></description>
			<content:encoded><![CDATA[<p><a href="../wp-content/uploads/2011/01/localhost-2011-1-29-203425.png" rel="thumbnail"><img title="ajax-jquery-slider" src="../wp-content/uploads/2011/01/localhost-2011-1-29-203425-600x150.png" alt="" width="600" height="150" /></a></p>
<p>Hello everyone. Its been a long time i haven&#8217;t poted. I was busy with my career and finally opened my own firm named <a  href="http://www.sparkigniter.com">SparkIgniter</a>. Its going great till now. This blog will always continue to run.</p>
<p>Ok so here is a small code i created for a friend of mine who is a java developer.</p>
<p><strong>Scenario:</strong> He wanted the panels to from left to right. On right it had <em>main categories</em>, then the <em>sub-categories</em> and on most right the <em>products</em>.</p>
<p>When we click on the category another panel slides down on the right with the matching sub categories. As we click on the sub-category another panel drops down with the final products.</p>

<p>here is the <a  href="http://demo.bluejavax.com/slider/" target="_blank">DEMO</a> | <a  href="http://demo.bluejavax.com/slider/slider.tar.gz">FILES</a></p>
<p>The demo may seem you static but its not. we call different files to generate the results.</p>
<blockquote><p>the files that you need to include your index.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre><span class="html"><span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/jquery.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/jquery.easing.1.3.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span></span></pre>
</div>
<p>Basic elements you need to startup.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
</pre>
<pre><span class="html"><span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;panel&quot;</span>&gt;</span>
<span class="html-other-element">&lt;ul id=<span class="html-attribute">&quot;list_items&quot;</span>&gt;</span>
<span class="html-other-element">&lt;?
/*
* put the sql queries to get the categores with parent as
* run the result loop below to generate the &lt;li&gt;</span>
*
*/
for($x=0;$x<span class="html-other-element">&lt;=5;$x++)//
{

// replace the your record id with the $x below

?&gt;</span>
<span class="html-other-element">&lt;li id=<span class="html-attribute">&quot;cat&lt;?=$x?</span>&gt;</span>&quot;&gt;
Cat<span class="html-other-element">&lt;?=$x?&gt;</span>
<span class="html-other-element">&lt;/li&gt;</span>
<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">
jQuery<span class="js-bracket">(</span><span class="js-string">'#cat&lt;?=$x?&gt;'</span><span class="js-bracket">)</span>.<span class="js-client-keyword">click</span><span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span>
<span class="js-bracket">{</span>
getSubCats<span class="js-bracket">(</span><span class="js-operator">&lt;</span><span class="js-operator">?</span><span class="js-operator">=</span>$x<span class="js-operator">?</span><span class="js-operator">&gt;</span><span class="js-bracket">)</span>; <span class="js-comment">//-- passing the value to the function--
</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span>;
</span></span>&lt;/script&gt;</span>
<span class="html-other-element">&lt;?
}
?&gt;</span>
<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!--     panel to append your  sub category name  --&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;panel&quot;</span>&gt;</span>
<span class="html-other-element">&lt;ul id=<span class="html-attribute">&quot;list_items&quot;</span>&gt;</span>

<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span>
<span class="html-comment">&lt;!--     panel to append your  product name  --&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;panel&quot;</span>&gt;</span>
<span class="html-other-element">&lt;ul id=<span class="html-attribute">&quot;list_items&quot;</span>&gt;</span>

<span class="html-other-element">&lt;/ul&gt;</span>
<span class="html-other-element">&lt;/div&gt;</span></span></pre>
</div>
</blockquote>
<p>What we need now are the javascript universal function to call on each click of the categories generated above.</p>
<blockquote><div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
</pre>
<pre><span class="php">Remember you need to put this all in the <span class="php-operator">&lt;</span>head<span class="php-operator">&gt;</span> so they may get prepared <span class="php-keyword">as</span> the page is called

<span class="php-operator">&lt;</span>script type<span class="php-operator">=</span><span class="php-string">&quot;text/javascript&quot;</span><span class="php-operator">&gt;</span>
<span class="php-function">function</span> getSubCats<span class="php-brackets">(</span>id<span class="php-brackets">)</span> <span class="php-comment">//---- a global common function to call sub categories, takes a category id as parameter
</span>
<span class="php-brackets">{</span>
<span class="php-keyword">var</span> dataString <span class="php-operator">=</span> <span class="php-string">'id='</span><span class="php-operator">+</span>id; <span class="php-comment">// sending the category id
</span>
<span class="php-comment">//alert(dataString);
</span>
jQuery<span class="php-operator">.</span>ajax<span class="php-brackets">(</span><span class="php-brackets">{</span>
type<span class="php-operator">:</span> <span class="php-string">&quot;POST&quot;</span>,
url<span class="php-operator">:</span> <span class="php-string">&quot;getSubCats.php&quot;</span>, <span class="php-comment">//--the file to handle request and generate the sub categories--
</span>
data<span class="php-operator">:</span> dataString,
cache<span class="php-operator">:</span> <span class="php-keyword">false</span>,
success<span class="php-operator">:</span> <span class="php-function">function</span><span class="php-brackets">(</span>html<span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-brackets">{</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'.subcats'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideUp<span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.subcats #list_items'</span><span class="php-brackets">)</span><span class="php-operator">.</span><span class="php-keyword">empty</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.subcats #list_items'</span><span class="php-brackets">)</span><span class="php-operator">.</span>append<span class="php-brackets">(</span>html<span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.subcats'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideDown<span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.products'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideUp<span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>

<span class="php-function">function</span> getProductUnderCat<span class="php-brackets">(</span>id<span class="php-brackets">)</span> <span class="php-comment">//---- a global common function to call products under sub categories, takes a subcategory id as parameter
</span>
<span class="php-brackets">{</span>
<span class="php-keyword">var</span> dataString <span class="php-operator">=</span> <span class="php-string">'id='</span><span class="php-operator">+</span>id; <span class="php-comment">//-- sending the category id
</span>
<span class="php-comment">//alert(dataString);
</span>
jQuery<span class="php-operator">.</span>ajax<span class="php-brackets">(</span><span class="php-brackets">{</span>
type<span class="php-operator">:</span> <span class="php-string">&quot;POST&quot;</span>,
url<span class="php-operator">:</span> <span class="php-string">&quot;getProducts.php&quot;</span>, <span class="php-comment">//--the file to handle request and generate the products--
</span>
data<span class="php-operator">:</span> dataString,
cache<span class="php-operator">:</span> <span class="php-keyword">false</span>,
success<span class="php-operator">:</span> <span class="php-function">function</span><span class="php-brackets">(</span>html<span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-brackets">{</span>
jQuery<span class="php-brackets">(</span><span class="php-string">'.products'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideUp<span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.products #list_items'</span><span class="php-brackets">)</span><span class="php-operator">.</span><span class="php-keyword">empty</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.products #list_items'</span><span class="php-brackets">)</span><span class="php-operator">.</span>append<span class="php-brackets">(</span>html<span class="php-brackets">)</span>;
jQuery<span class="php-brackets">(</span><span class="php-string">'.products'</span><span class="php-brackets">)</span><span class="php-operator">.</span>slideDown<span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>
<span class="php-brackets">}</span>
<span class="php-brackets">}</span><span class="php-brackets">)</span>;
<span class="php-keyword">return</span> <span class="php-keyword">false</span>;
<span class="php-brackets">}</span>
<span class="php-operator">&lt;</span><span class="php-operator">/</span>script<span class="php-operator">&gt;</span></span></pre>
</div>
</blockquote>
<p>So above we have created the basic functions that would handle the request and call other scripts and get response.</p>
<p>Lets jump to other two files. The first is the file to generate the sub-categories</p>
<blockquote><p>getSubCAts.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>
<span class="php-comment">/*
* file to get the sub categories
* you need to catch the parent category id
* run the sql query to get the subcategories with parent id as the POST id you got here
*/</span>

<span class="php-var">$id</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'id'</span><span class="php-brackets">]</span>;<span class="php-comment">//-- id got via post--
</span>
<span class="php-comment">/*
* run the sql and generate the result in the format below
*/</span>
<span class="php-keyword">for</span><span class="php-brackets">(</span><span class="php-var">$x</span><span class="php-operator">=</span><span class="php-number">0</span>;<span class="php-var">$x</span><span class="php-operator">&lt;</span><span class="php-operator">=</span><span class="php-function">rand</span><span class="php-brackets">(</span><span class="php-number">1</span>, <span class="php-number">1</span><span class="php-number">0</span><span class="php-brackets">)</span>;<span class="php-var">$x</span><span class="php-operator">+</span><span class="php-operator">+</span><span class="php-brackets">)</span><span class="php-comment">//
</span>
<span class="php-brackets">{</span>
<span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;li id=<span class="html-attribute">&quot;sub</span></span></span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">&quot;&gt;
Sub Cat</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;/li&gt;</span>
<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;</span>
jQuery('#sub</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">').click(function()
{
getProductUnderCat(</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">); //-- passing the value to the function--
});
<span class="html-script-element">&lt;/script&gt;</span>
</span>&lt;?</span>
<span class="php-brackets">}</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>getProducts.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?</span>
<span class="php-comment">/*
* file to get the categories
* you need to catch the parent category id
* run the sql query to get the products under the category id
*/</span>

<span class="php-var">$id</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'id'</span><span class="php-brackets">]</span>;<span class="php-comment">//-- id got via post--
</span>
<span class="php-comment">/*
* run the sql and generate the result in the format below
*/</span>
<span class="php-keyword">for</span><span class="php-brackets">(</span><span class="php-var">$x</span><span class="php-operator">=</span><span class="php-number">0</span>;<span class="php-var">$x</span><span class="php-operator">&lt;</span><span class="php-operator">=</span><span class="php-function">rand</span><span class="php-brackets">(</span><span class="php-number">1</span>, <span class="php-number">1</span><span class="php-number">0</span><span class="php-brackets">)</span>;<span class="php-var">$x</span><span class="php-operator">+</span><span class="php-operator">+</span><span class="php-brackets">)</span><span class="php-comment">//
</span>
<span class="php-brackets">{</span>
<span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;li id=<span class="html-attribute">&quot;pro</span></span></span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">&quot;&gt;
product</span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$x</span><span class="php-script-tag">?&gt;<span class="html">
<span class="html-other-element">&lt;/li&gt;</span>
</span>&lt;?</span>
<span class="php-brackets">}</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
</blockquote>
<p><a  href="http://demo.bluejavax.com/slider/" target="_blank">DEMO</a> | <a  href="http://demo.bluejavax.com/slider/slider.tar.gz">FILES</a></p>
<p>Please do comment</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/jquery-ajaxcategory-product-in-sliding-panels/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dynamic Thumbnail on the fly.</title>
		<link>http://www.bluejavax.com/dynamic-thumbnail-on-the-fly/</link>
		<comments>http://www.bluejavax.com/dynamic-thumbnail-on-the-fly/#comments</comments>
		<pubDate>Thu, 26 Aug 2010 19:07:05 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Php]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=388</guid>
		<description><![CDATA[Hello there people, Its been a long time I have not posted anything. Did you ever thought of why to create thumbnail and saving them to server, or even you databases. keeping you mind throuh the complete script that uploads and then generates a thumbnail, Then you save the path to database.. aaaah&#8230; Well i [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.bluejavax.com/wp-content/uploads/2010/08/localhost-2010-8-26-217.png" rel="lightbox" class="thickbox no_icon" title="localhost 2010-8-26 21:7"><img class="alignleft size-medium wp-image-390" title="localhost 2010-8-26 21:7" src="http://www.bluejavax.com/wp-content/uploads/2010/08/localhost-2010-8-26-217-300x153.png" alt="" width="300" height="153" /></a>Hello there people, Its been a long time I have not posted anything.</p>
<p>Did you ever thought of why to create thumbnail and saving them to server, or even you databases. keeping you mind throuh the complete script that uploads and then generates a thumbnail, Then you save the path to database.. aaaah&#8230; Well i was tired. after searching internet i got a script.. Thank god.</p>
<p>Ok here is the script that i have been using for a while now. The best part is, that it created an image in buffer only. I mean it does not save an image to a folder. its just resizes your image temporarily where as you actual image remains same.</p>

<p>here is a</p>
<h2><a  title="fly Thumbz" href="http://demo.bluejavax.com/fly_thumbz" target="_blank">demo</a>.</h2>
<p>The code goes here</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-function">set_time_limit</span><span class="php-brackets">(</span><span class="php-number">1</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-number">0</span><span class="php-brackets">)</span>; <span class="php-comment">//--- need to do this for larger images in case the server stops..
</span>

<span class="php-function">error_reporting</span><span class="php-brackets">(</span><span class="php-constant">E_ALL</span> <span class="php-operator">^</span> <span class="php-constant">E_NOTICE</span><span class="php-brackets">)</span>;

<span class="php-keyword">include</span> <span class="php-string">'resize.image.class.php'</span>; <span class="php-comment">//---- include the class file
</span>

<span class="php-var">$resize_image</span> <span class="php-operator">=</span> <span class="php-keyword">new</span> Resize_Image; <span class="php-comment">//---- class instance
</span>

<span class="php-comment">// Folder where the (original) images are located with trailing slash at the end
</span>
<span class="php-var">$images_dir</span> <span class="php-operator">=</span> <span class="php-string">''</span>; <span class="php-comment">// you can leave it empty. Only if you are providing the original image with its path (see next syntax). Its good to use when you have images from different locations and you are using this file only.
</span>

<span class="php-comment">// Image to resize
</span>
<span class="php-var">$image</span> <span class="php-operator">=</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'image'</span><span class="php-brackets">]</span>; <span class="php-comment">// This is the image name... You can provide path with it.
</span>
<span class="php-comment">//echo $image;
</span>
<span class="php-function">list</span><span class="php-brackets">(</span><span class="php-var">$width</span>, <span class="php-var">$height</span>, <span class="php-var">$type</span>, <span class="php-var">$attr</span><span class="php-brackets">)</span> <span class="php-operator">=</span> <span class="php-function">getimagesize</span><span class="php-brackets">(</span><span class="php-var">$image</span><span class="php-brackets">)</span>; <span class="php-comment">//--- get dimensions of the oirginal image
</span>
<span class="php-comment">/* Some validation */</span>
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-operator">!</span>@<span class="php-function">file_exists</span><span class="php-brackets">(</span><span class="php-var">$images_dir</span><span class="php-operator">.</span><span class="php-var">$image</span><span class="php-brackets">)</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-function">exit</span><span class="php-brackets">(</span><span class="php-string">'The requested image does not exist.'</span><span class="php-brackets">)</span>;
<span class="php-brackets">}</span>

<span class="php-comment">// Get the new with &amp; height --[The parameter given in html with image name... will be covered below]
</span>
<span class="php-comment">//echo $width .&quot; | &quot;. $height;
</span>
<span class="php-var">$new_width</span> <span class="php-operator">=</span> <span class="php-brackets">(</span><span class="php-var-type">int</span><span class="php-brackets">)</span><span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'new_width'</span><span class="php-brackets">]</span>;
<span class="php-var">$new_height</span> <span class="php-operator">=</span> <span class="php-brackets">(</span><span class="php-var-type">int</span><span class="php-brackets">)</span><span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'new_height'</span><span class="php-brackets">]</span>;

<span class="php-comment">// --------the code below makes a decision on the basis of priority.
</span>

<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$width</span><span class="php-operator">&gt;</span><span class="php-var">$height</span><span class="php-brackets">)</span> <span class="php-comment">//--if width is greater than the image you be reduced first, by with specified (with aspect ratio).
</span>
<span class="php-brackets">{</span>
<span class="php-var">$resize_image</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>new_width <span class="php-operator">=</span> <span class="php-var">$new_width</span>;
<span class="php-brackets">}</span>
<span class="php-keyword">else</span> <span class="php-comment">//--any other contition like height is greater or both are of same ratio will be resized (with aspect ratio).
</span>
<span class="php-brackets">{</span>
<span class="php-var">$resize_image</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>new_height <span class="php-operator">=</span> <span class="php-var">$new_height</span>;

<span class="php-brackets">}</span>
<span class="php-comment">//--the above conditions can be changed as per user need....
</span>

<span class="php-var">$resize_image</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>image_to_resize <span class="php-operator">=</span> <span class="php-var">$images_dir</span><span class="php-operator">.</span><span class="php-var">$image</span>; <span class="php-comment">// Full Path to the file
</span>

<span class="php-var">$resize_image</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>ratio <span class="php-operator">=</span> <span class="php-keyword">true</span>; <span class="php-comment">// Keep aspect ratio
</span>
<span class="php-comment">//$image-&gt;save_folder = &quot;thumbs/&quot;;
</span>
<span class="php-var">$process</span> <span class="php-operator">=</span> <span class="php-var">$resize_image</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>resize<span class="php-brackets">(</span><span class="php-brackets">)</span>; <span class="php-comment">// Output image
</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>In the above code you will see that we have not saved thumbnail to any folder. So its just gives output to browser.</p>
<p>Here is how you will you use it</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre>
<pre><span class="html"><span class="html-special-char">&amp;lt;</span>img src=&quot;resize_image.php?image=products/my_image.jpg<span class="html-special-char">&amp;amp;</span>new_width=150<span class="html-special-char">&amp;amp;</span>new_height=100&quot; <span class="html-special-char">&amp;gt;</span>

<span class="html-special-char">&amp;lt;</span>!--------------------

in the above code you can see that we have passed 3 parameters

1) the image with relative path....

2) New desired width

3) New desired height

--<span class="html-special-char">&amp;gt;</span></span></pre>
</div>
<p>Thats all, you are done.</p>
<h2><a  href="http://demo.bluejavax.com/fly_thumbz" target="_blank">Demo</a> | <a  href="http://demo.bluejavax.com/fly_thumb.zip">Files</a></h2>
<p>Enjoy</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/dynamic-thumbnail-on-the-fly/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Gmail/Facebook like Chat With CodeIgniter</title>
		<link>http://www.bluejavax.com/gmailfacebook-like-chat-with-codeigniter/</link>
		<comments>http://www.bluejavax.com/gmailfacebook-like-chat-with-codeigniter/#comments</comments>
		<pubDate>Mon, 05 Jul 2010 17:23:30 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[chat]]></category>
		<category><![CDATA[codeigniter]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=379</guid>
		<description><![CDATA[Hey to all my CodeIgniter friends. SO you all have been waiting for a Gmail and Facebook like chat  to be implemented in Codeigniter. NOW WITH VIDEO TUTORIAL AND FULLY INTEGRATED DOWNLOADS SCRIPTS Well this is an extended version of this chat. &#160; Demo that i made can be found Here (demo is done on [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.bluejavax.com/wp-content/uploads/2010/07/chat.png" rel="lightbox" class="thickbox no_icon" title="chat"><img class="alignleft size-medium wp-image-380" title="chat" src="http://www.bluejavax.com/wp-content/uploads/2010/07/chat-300x238.png" alt="" width="300" height="238" /></a></p>
<p>Hey to all my CodeIgniter friends. SO you all have been waiting for a Gmail and Facebook like chat  to be implemented in Codeigniter.<br />
NOW WITH VIDEO TUTORIAL AND FULLY INTEGRATED DOWNLOADS SCRIPTS</p>
<p><span id="more-379"></span> Well this is an extended version of<br />
<a  href="http://anantgarg.com/2009/05/13/gmail-facebook-style-jquery-chat/" target="_blank">this chat</a>.</p>
<p>&nbsp;</p>
<p>Demo that i made can be found <a  href="http://demo.bluejavax.com/chat/" target="_blank">Here</a> (demo is done on raw php)</p>
<p><iframe src="http://www.youtube.com/embed/P_ZBpvjxJ7E" frameborder="0" width="420" height="315"></iframe></p>
<p>[View in HD]</p>
<p>Download the files from the link  and do the following things.</p>
<p>Before doing the setup below. Please configure your database settings first.</p>
<p>The fact is that you need to to change the chat.js file</p>
<p>&nbsp;</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
</pre>
<pre><span class="php"><span class="php-keyword">var</span> baseUrl <span class="php-operator">=</span> <span class="php-string">&quot;http://yourURl.com/chatfolder&quot;</span>;

<span class="php-comment">// or your ip address incase you are using over intranet.</span></span></pre>
</div>
<p>Change all your URls in th script from</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php">url<span class="php-operator">:</span> <span class="php-string">&quot;chat.php?action=chatheartbeat&quot;</span>,</span></pre>
</div>
<p>to</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php">url<span class="php-operator">:</span> baseUrl<span class="php-operator">+</span><span class="php-string">&quot;chat.php?action=chatheartbeat&quot;</span>,</span></pre>
</div>
<p>open samplea.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-function">session_start</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-var">$me</span> <span class="php-operator">=</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'me'</span><span class="php-brackets">]</span>;
<span class="php-var">$you</span><span class="php-operator">=</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'u'</span><span class="php-brackets">]</span>;

<span class="php-var">$_SESSION</span><span class="php-brackets">[</span><span class="php-string">'username'</span><span class="php-brackets">]</span> <span class="php-operator">=</span> <span class="php-var">$me</span>; <span class="php-comment">// Must be already set
</span>
<span class="php-script-tag">?&gt;<span class="html">

<span class="html-other-element">&lt;!DOCTYPE HTML PUBLIC <span class="html-attribute">&quot;-//W3C//DTD HTML 4.01//EN&quot;</span> <span class="html-attribute">&quot;http://www.w3.org/TR/html4/loose.dtd&quot;</span> &gt;</span>

<span class="html-other-element">&lt;html&gt;</span>
<span class="html-other-element">&lt;head&gt;</span>
<span class="html-other-element">&lt;title&gt;</span>Sample Chat Application<span class="html-other-element">&lt;/title&gt;</span>
<span class="html-style-element">&lt;style&gt;<span class="css"><span class="css">
body {
<span class="css-property">background-color<span class="css-selector">:</span><span class="css-value"> #eeeeee</span></span>;
<span class="css-property">padding<span class="css-selector">:</span><span class="css-value">0</span></span>;
<span class="css-property">margin<span class="css-selector">:</span><span class="css-value">0 auto</span></span>;
<span class="css-property">font-family<span class="css-selector">:</span><span class="css-value"><span class="css-string">&quot;Lucida Grande&quot;</span>,Verdana,Arial,<span class="css-string">&quot;Bitstream Vera Sans&quot;</span>,sans-serif</span></span>;
<span class="css-property">font-size<span class="css-selector">:</span><span class="css-value">11px</span></span>;
}
</span></span>&lt;/style&gt;</span>

<span class="html-other-element">&lt;link type=<span class="html-attribute">&quot;text/css&quot;</span> rel=<span class="html-attribute">&quot;stylesheet&quot;</span> media=<span class="html-attribute">&quot;all&quot;</span> href=<span class="html-attribute">&quot;css/chat.css&quot;</span> /&gt;</span>
<span class="html-other-element">&lt;link type=<span class="html-attribute">&quot;text/css&quot;</span> rel=<span class="html-attribute">&quot;stylesheet&quot;</span> media=<span class="html-attribute">&quot;all&quot;</span> href=<span class="html-attribute">&quot;css/screen.css&quot;</span> /&gt;</span>

<span class="html-comment">&lt;!--[if lte IE 7]&gt;
&lt;link type=&quot;text/css&quot; rel=&quot;stylesheet&quot; media=&quot;all&quot; href=&quot;css/screen_ie.css&quot; /&gt;
&lt;![endif]--&gt;</span>

<span class="html-other-element">&lt;/head&gt;</span>
<span class="html-other-element">&lt;body&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;main_container&quot;</span>&gt;</span>

<span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;javascript:void(0)&quot;</span> onclick=<span class="html-attribute">&quot;javascript:chatWith('</span></span></span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$you</span><span class="php-script-tag">?&gt;<span class="html">')&quot;&gt;Chat With </span>&lt;?</span><span class="php-operator">=</span><span class="php-var">$you</span><span class="php-script-tag">?&gt;<span class="html"><span class="html-anchor-element">&lt;/a&gt;</span>
<span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;javascript:void(0)&quot;</span> onclick=<span class="html-attribute">&quot;javascript:chatWith('babydoe')&quot;</span>&gt;</span>Chat With Baby Doe<span class="html-anchor-element">&lt;/a&gt;</span>
<span class="html-comment">&lt;!-- YOUR BODY HERE --&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span>

<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/jquery.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/chat.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>

<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></span></span></pre>
</div>
<p>Copy the code to your CodeIgniter View and make necessary changes like &lt;?=base_url()?&gt; inclusion and other stuff.</p>
<p>At the top of the file you see the following code</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-function">session_start</span><span class="php-brackets">(</span><span class="php-brackets">)</span>;
<span class="php-var">$me</span> <span class="php-operator">=</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'me'</span><span class="php-brackets">]</span>;
<span class="php-var">$you</span><span class="php-operator">=</span> <span class="php-var">$_GET</span><span class="php-brackets">[</span><span class="php-string">'u'</span><span class="php-brackets">]</span>;

<span class="php-var">$_SESSION</span><span class="php-brackets">[</span><span class="php-string">'username'</span><span class="php-brackets">]</span> <span class="php-operator">=</span> <span class="php-var">$me</span>; <span class="php-comment">// Must be already set
</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>To change that code to Codeigniter do the following steps.</p>
<p>In your controller (the one that calls your view), either use session or pass names as parameters.</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-function">function</span> chat<span class="php-brackets">(</span><span class="php-var">$me</span>, <span class="php-var">$you</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-var">$data</span><span class="php-brackets">[</span><span class="php-string">'me'</span><span class="php-brackets">]</span> <span class="php-operator">=</span> <span class="php-var">$me</span>;
<span class="php-var">$data</span><span class="php-brackets">[</span><span class="php-string">'you'</span><span class="php-brackets">]</span> <span class="php-operator">=</span> <span class="php-var">$you</span>;
<span class="php-var">$this</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>load<span class="php-operator">-</span><span class="php-operator">&gt;</span>view<span class="php-brackets">(</span><span class="php-string">'chat'</span>, <span class="php-var">$data</span><span class="php-brackets">)</span>;
<span class="php-brackets">}</span>

<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<p>I use two parameters because one is for your name and other is the name for the person you want to chat with.</p>
<p>Make sure names should not have any spaces or dotz. It should be just words or underscores.</p>
<p>ok so.</p>
<p>change the following code</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php"><span class="php-operator">&lt;</span>a href<span class="php-operator">=</span><span class="php-string">&quot;javascript:void(0)&quot;</span> onclick<span class="php-operator">=</span><span class="php-string">&quot;javascript:chatWith('babydoe')&quot;</span><span class="php-operator">&gt;</span>Chat With Baby Doe<span class="php-operator">&lt;</span><span class="php-operator">/</span>a<span class="php-operator">&gt;</span></span></pre>
</div>
<p>to this</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
</pre>
<pre><span class="php"><span class="php-operator">&lt;</span>a href<span class="php-operator">=</span><span class="php-string">&quot;javascript:void(0)&quot;</span> onclick<span class="php-operator">=</span><span class="php-string">&quot;javascript:chatWith('&lt;?=$you?&gt;')&quot;</span><span class="php-operator">&gt;</span>Chat With <span class="php-script-tag">&lt;?</span><span class="php-operator">=</span><span class="php-var">$you</span><span class="php-script-tag">?&gt;<span class="html"><span class="html-anchor-element">&lt;/a&gt;</span>

//---make it dynamic.</span></span></span></pre>
</div>
<p>Open two of your browser  and open the link. be sure either using localhost or the ip address. depending on what you have used in your chat.js</p>
<p>In Firefox open this link http://localhost/gchat/welcome/chat/misha/rahul and in the other browser open this</p>
<p>http://localhost/gchat/welcome/chat/rahul/misha. Click the first link.</p>
<p>Then you should have your chat working fine.</p>
<h2><a  href="http://demo.bluejavax.com/chat/" target="_blank">DEMO</a> (demo is done on raw php)<br />
<a  href="http://demo.bluejavax.com/ciChat.zip">Download(with Coddeigniter 2.0.3) </a></h2>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/gmailfacebook-like-chat-with-codeigniter/feed/</wfw:commentRss>
		<slash:comments>44</slash:comments>
		</item>
		<item>
		<title>Facebook Like Link Sharing</title>
		<link>http://www.bluejavax.com/facebook-like-link-sharing/</link>
		<comments>http://www.bluejavax.com/facebook-like-link-sharing/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 17:43:33 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Php]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=361</guid>
		<description><![CDATA[View Demo Its been so long, after switching from windows to Ubuntu.Things are more easy, attractive ans secure. This Tutorial is for creating a FACEBOOK LINK LINK SHARING INTERFACE. The script used php, javascript expressions, jquery and some css too. Ok, lets start Lets us create an Interface First call the file index.php&#8230; Why.. well [...]]]></description>
			<content:encoded><![CDATA[<p><a  rel="lightbox" href="http://www.bluejavax.com/wp-content/uploads/2010/07/share_fb.png" class="thickbox no_icon" title="share_fb"><img class="alignleft size-thumbnail wp-image-372" title="share_fb" src="http://www.bluejavax.com/wp-content/uploads/2010/07/share_fb-555x150.png" alt="" width="555" height="150" /></a></p>
<h2><a  href="http://www.demo.bluejavax.com/share_fb/" target="_blank">View Demo </a></h2>
<p>Its been so long, after switching from windows to Ubuntu.Things are more easy, attractive ans secure.<br />
This Tutorial is for creating a FACEBOOK LINK LINK SHARING INTERFACE.<br />
The script used php, javascript expressions, jquery and some css too.<span id="more-361"></span><br />
Ok, lets start</p>
<p>Lets us create an Interface First<br />
call the file index.php&#8230; Why.. well you can have Index.html also. Incase you are not loading any data from database&#8230;<br />
Since I&#8217;m loading the previously shared links so its index.php</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
</pre>
<pre><span class="php">Facebook Like Links Sharing
<span class="php-operator">&lt;</span><span class="php-operator">!</span><span class="php-operator">-</span><span class="php-operator">-</span>Loading Jquery Below<span class="php-operator">-</span><span class="php-operator">-</span><span class="php-operator">&gt;</span>
<span class="php-operator">&lt;</span>script src<span class="php-operator">=</span><span class="php-string">&quot;http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js&quot;</span> type<span class="php-operator">=</span><span class="php-string">&quot;text/javascript&quot;</span><span class="php-operator">&gt;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>script<span class="php-operator">&gt;</span></span></pre>
</div>
<p> Next you need a Textbox and a publish button. Here we go
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
</pre>
<pre><span class="html"><span class="html-form-element">&lt;textarea id=<span class="html-attribute">&quot;contentbox&quot;</span>&gt;</span><span class="html-form-element">&lt;/textarea&gt;</span>
 <span class="html-form-element">&lt;input id=<span class="html-attribute">&quot;submit&quot;</span> onclick=<span class="html-attribute">&quot;saveLink()&quot;</span> name=<span class="html-attribute">&quot;Publish&quot;</span> type=<span class="html-attribute">&quot;Submit&quot;</span> value=<span class="html-attribute">&quot;Publish&quot;</span> /&gt;</span></span></pre>
</div>
<p>  Ok Now we need a Script that Fetches whatever you write and then process it, to show you. Guess what&#8230; It uses jquery.
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
</pre>
<pre><span class="php"><span class="php-var">$</span><span class="php-brackets">(</span>document<span class="php-brackets">)</span><span class="php-operator">.</span>ready<span class="php-brackets">(</span><span class="php-function">function</span><span class="php-brackets">(</span><span class="php-brackets">)</span> <span class="php-brackets">{</span>      <span class="php-var">$</span><span class="php-brackets">(</span><span class="php-string">&quot;#contentbox&quot;</span><span class="php-brackets">)</span><span class="php-operator">.</span>keyup<span class="php-brackets">(</span><span class="php-function">function</span><span class="php-brackets">(</span><span class="php-brackets">)</span><span class="php-comment">//--the script catches all your written text as you type     {         var content=$(this).val();         var urlRegex = /(\b(https?|ftp|file):\/\/[-A-Z0-9+&amp;amp;@#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;amp;@#\/%=~_|])/ig;         var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&amp;amp;%@!\-\/]))?/;         var url= content.match(urlRegex); //---Filtering URL from the content using regular expressions------          if(url.length&amp;gt;0)//--check for length-----         {              $(&quot;#linkbox&quot;).slideDown('show');             $(&quot;#linkbox&quot;).html(&quot;&lt;img src=&quot;link_loader.gif&quot; alt=&quot;&quot; /&gt; Loading Data.....&quot;);             $.get(&quot;urlget.php?url=&quot;+url,function(response)//---sending your url as parameter to &quot;urlget.php&quot; and fetching the response----             {                  var title=(/(.*?)&amp;lt;\/title&amp;gt;/m).exec(response)[1]; // Loading &amp;lt;title&amp;gt;data                 var logo=(/&lt;img src=&quot;(.*?)&quot; alt=&quot;&quot; /&gt;&lt;img class=&quot;img&quot; src=&quot;&amp;quot;+logo+&amp;quot;&quot; alt=&quot;&quot; /&gt;
</span>

<span class="php-operator">&lt;</span>div<span class="php-operator">&gt;</span><span class="php-operator">&lt;</span>strong<span class="php-operator">&gt;</span><span class="php-string">&quot;+title+&quot;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>strong<span class="php-operator">&gt;</span> <span class="php-string">&quot;+url)             });          }         return false;     });  });</span></span></pre>
</div>
<p>  So that one will do nothing.. You need thet urlget.php so here we go
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php"></span></pre>
</div>
<p>  Using the Above code will show the logo or any first image and the url details. Next would be saving the data in database.. when you click on PUBLISH. here is the table
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php">CREATE TABLE <span class="php-operator">`</span>links<span class="php-operator">`</span> <span class="php-brackets">(</span>    <span class="php-operator">`</span>link_id<span class="php-operator">`</span> <span class="php-var-type">int</span><span class="php-brackets">(</span><span class="php-number">1</span><span class="php-number">1</span><span class="php-brackets">)</span> NOT NULL AUTO_INCREMENT,    <span class="php-operator">`</span><span class="php-function">link</span><span class="php-operator">`</span> varchar<span class="php-brackets">(</span><span class="php-number">2</span><span class="php-number">5</span><span class="php-number">0</span><span class="php-brackets">)</span> NOT NULL,    PRIMARY KEY <span class="php-brackets">(</span><span class="php-operator">`</span>link_id<span class="php-operator">`</span><span class="php-brackets">)</span>  <span class="php-brackets">)</span></span></pre>
</div>
<p> Now the script to insert the data.
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
</pre>
<pre><span class="php"><span class="php-function">function</span> saveLink<span class="php-brackets">(</span><span class="php-brackets">)</span>     <span class="php-brackets">{</span>         <span class="php-keyword">var</span> content<span class="php-operator">=</span><span class="php-var">$</span><span class="php-brackets">(</span><span class="php-string">'#contentbox'</span><span class="php-brackets">)</span><span class="php-operator">.</span>val<span class="php-brackets">(</span><span class="php-brackets">)</span>;         <span class="php-keyword">var</span> urlRegex <span class="php-operator">=</span> <span class="php-operator">/</span><span class="php-brackets">(</span>\b<span class="php-brackets">(</span>https<span class="php-operator">?</span><span class="php-operator">|</span>ftp<span class="php-operator">|</span><span class="php-function">file</span><span class="php-brackets">)</span><span class="php-operator">:</span>\<span class="php-operator">/</span>\<span class="php-operator">/</span><span class="php-brackets">[</span><span class="php-operator">-</span>A<span class="php-operator">-</span>Z<span class="php-number">0</span><span class="php-operator">-</span><span class="php-number">9</span><span class="php-operator">+</span><span class="php-operator">&amp;</span>amp;@<span class="php-comment">#\/%?=~_|!:,.;]*[-A-Z0-9+&amp;amp;@#\/%=~_|])/ig;         var regexp = /(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&amp;amp;%@!\-\/]))?/          var url= content.match(urlRegex);         if(url.length&amp;gt;0)         {             $.get(&quot;saveurl.php?url=&quot;+url,function(response)             {                 var title=(/(.*?)&amp;lt;\/title&amp;gt;/m).exec(response)[1];                 var logo=(/&lt;img src=&quot;(.*?)&quot; alt=&quot;&quot; /&gt;
</span>
 

	<span class="php-operator">&lt;</span>li id<span class="php-operator">=</span><span class="php-string">&quot;updates&quot;</span><span class="php-operator">&gt;</span>
<span class="php-operator">&lt;</span>div id<span class="php-operator">=</span><span class="php-string">&quot;lft&quot;</span><span class="php-operator">&gt;</span><span class="php-operator">&lt;</span>img <span class="php-keyword">class</span><span class="php-operator">=</span><span class="php-string">&quot;img&quot;</span> src<span class="php-operator">=</span><span class="php-string">&quot;&amp;quot;+logo+&amp;quot;&quot;</span> alt<span class="php-operator">=</span><span class="php-string">&quot;&quot;</span> <span class="php-operator">/</span><span class="php-operator">&gt;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span>
<span class="php-operator">&lt;</span>div id<span class="php-operator">=</span><span class="php-string">&quot;rt&quot;</span><span class="php-operator">&gt;</span><span class="php-operator">&lt;</span>strong<span class="php-operator">&gt;</span><span class="php-string">&quot;+title+&quot;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>strong<span class="php-operator">&gt;</span> <span class="php-string">&quot;+url+&quot;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span><span class="php-operator">&lt;</span><span class="php-operator">/</span>li<span class="php-operator">&gt;</span>

<span class="php-string">&quot;);                  $(&quot;</span><span class="php-comment">#linkbox&quot;).fadeOut();             });         }         return false;     }</span></span></pre>
</div>
<p>  The Script seems similar the difference is that it calls another php Script saveurl.php . That captures and saves data. Here is the code
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php"></span></pre>
</div>
<p>  The Above Script Uses a config file config.php
<div class="fvch-code">
<pre class="fvch-line-numbers">1
</pre>
<pre><span class="php"><span class="php-var">$mysql_hostname</span> <span class="php-operator">=</span> <span class="php-string">&quot;localhost&quot;</span>; <span class="php-var">$mysql_user</span> <span class="php-operator">=</span> <span class="php-string">&quot;root&quot;</span>; <span class="php-var">$mysql_password</span> <span class="php-operator">=</span> <span class="php-string">&quot;root&quot;</span>; <span class="php-var">$mysql_database</span> <span class="php-operator">=</span> <span class="php-string">&quot;fb&quot;</span>;  <span class="php-var">$cn</span> <span class="php-operator">=</span> <span class="php-function">mysql_connect</span><span class="php-brackets">(</span><span class="php-var">$mysql_hostname</span>, <span class="php-var">$mysql_user</span>, <span class="php-var">$mysql_password</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span><span class="php-brackets">(</span><span class="php-string">&quot;Opps some thing went wrong&quot;</span><span class="php-brackets">)</span>; <span class="php-function">mysql_select_db</span><span class="php-brackets">(</span><span class="php-var">$mysql_database</span>, <span class="php-var">$cn</span><span class="php-brackets">)</span><span class="php-operator"> or </span><span class="php-function">die</span><span class="php-brackets">(</span><span class="php-string">&quot;Opps some thing went wrong&quot;</span><span class="php-brackets">)</span>;</span></pre>
</div>
<p>  Thats it now Now If you want to load the the previous shared links use this in you index.php file. Just paste this code below your publish button
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
</pre>
<pre><span class="php"><span class="php-operator">&lt;</span>script type<span class="php-operator">=</span><span class="php-string">&quot;text/javascript&quot;</span><span class="php-operator">&gt;</span><span class="php-comment">// &lt;![CDATA[
</span>
             <span class="php-function">function</span> lods<span class="php-brackets">(</span><span class="php-brackets">)</span>             <span class="php-brackets">{</span>             window<span class="php-operator">.</span>onload <span class="php-operator">=</span> loadHistory<span class="php-brackets">(</span><span class="php-string">&quot;&quot;</span><span class="php-brackets">)</span>;<span class="php-comment">/****javascript method that takes a parameter ans uses it to extract and load data ****/</span>         <span class="php-comment">//              }             window.onload = lods();
</span>
<span class="php-comment">// ]]&gt;&lt;/script&gt;
</span>

<span class="php-operator">&lt;</span><span class="php-operator">/</span>div<span class="php-operator">&gt;</span></span></pre>
</div>
<p>Thats All.Below are the links to Download and Demo</p>
<h2><a  href="http://www.demo.bluejavax.com/share_fb/" target="_blank">View Demo </a></h2>
<h2><a  href="http://www.demo.bluejavax.com/share_fb/share_fb.zip" target="_blank">Download the Script</a></h2>
<p>Comments will be appreciated.</p>
<p>Thank you</p>
<p><a  rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/in/"><img style="border-width: 0pt;" src="http://creativecommons.org/images/public/somerights20.png" alt="Creative Commons License" /></a><br />
<span> </span>By <a  rel="cc:attributionURL" href="http://www.demo.bluejavax.com/motion/">bluejavax</a> is licensed under a <a  rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/in/">Creative Commons Attribution-Share Alike 2.5 India License</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/facebook-like-link-sharing/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Journals United</title>
		<link>http://www.bluejavax.com/journals-united/</link>
		<comments>http://www.bluejavax.com/journals-united/#comments</comments>
		<pubDate>Wed, 26 May 2010 17:14:24 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Featured]]></category>
		<category><![CDATA[Portfolio]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=344</guid>
		<description><![CDATA[A content sharing website, where users can register and write journals, news, hacks, poery etc. Specifications: User can register and can search and write content. User can follow there friends. User gets comment updates. The admin section allows to edit user profiles and complete archives Site uses ajax and jquery, for quick updates and editing. [...]]]></description>
			<content:encoded><![CDATA[<p><a  rel="lightbox" href="http://www.bluejavax.com/wp-content/uploads/2010/05/junited.png" class="thickbox no_icon" title="Journals United"><img class="alignleft size-thumbnail wp-image-348" title="Journals United" src="http://www.bluejavax.com/wp-content/uploads/2010/05/junited-600x150.png" alt="" width="588" height="147" /></a></p>
<p>A content sharing website, where users can register and write journals, news, hacks, poery etc.<img title="More..." src="http://www.bluejavax.com/wp-includes/js/tinymce/plugins/wordpress/img/trans.gif" alt="" /></p>
<p><strong>Specifications:</strong></p>
<ul>
<li>User can register and can search and write content.</li>
<li>User can follow there friends.</li>
<li>User gets comment updates.</li>
<li>The admin section allows to edit user profiles and complete archives</li>
<li>Site uses ajax and jquery, for quick updates and editing.</li>
</ul>
<p><span style="color: #ff0000;">THE SITE HAS BEEN REMOVED BY ME DUE TO PAYMENT ISSUES.</span></p>
<p><span style="color: #99cc00;"><strong>THE SCRIPT WILL BE SOON AVAILABLE FOR SELLING</strong>.</span></p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/journals-united/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Lightbox To Ajax Images</title>
		<link>http://www.bluejavax.com/lightbox-to-ajax-images/</link>
		<comments>http://www.bluejavax.com/lightbox-to-ajax-images/#comments</comments>
		<pubDate>Sat, 01 May 2010 19:52:12 +0000</pubDate>
		<dc:creator>bluepicaso</dc:creator>
				<category><![CDATA[Demo]]></category>
		<category><![CDATA[Featured]]></category>
		<category><![CDATA[JQuery]]></category>
		<category><![CDATA[Portfolio]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[images]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[lightbox]]></category>
		<category><![CDATA[problem]]></category>
		<category><![CDATA[solution]]></category>

		<guid isPermaLink="false">http://www.bluejavax.com/?p=336</guid>
		<description><![CDATA[Hey all, This tutorial is for the problem that occurs, when lightbox doesn&#8217;t work with images called with ajax. The problem usually occurs when you are using many javascript frameworks together. Since i faced one, so felt it to share with you all. The tutorial is simple and easy to implement. The trick is to [...]]]></description>
			<content:encoded><![CDATA[<p><a  href="http://www.bluejavax.com/wp-content/uploads/2010/05/FireShot-capture-010-Using-lightbox-with-ajax-localhost_ajax_lightbox.png" rel="lightbox" class="thickbox no_icon" title="FireShot capture #010 - 'Using lightbox with ajax' - localhost_ajax_lightbox"><img class="alignleft size-medium wp-image-337" title="FireShot capture #010 - 'Using lightbox with ajax' - localhost_ajax_lightbox" src="http://www.bluejavax.com/wp-content/uploads/2010/05/FireShot-capture-010-Using-lightbox-with-ajax-localhost_ajax_lightbox-300x160.png" alt="" width="300" height="160" /></a>Hey all, This tutorial is for the problem that occurs, when lightbox doesn&#8217;t work with images called with ajax.</p>
<p>The problem usually occurs when you are using many javascript frameworks together. Since i faced one, so felt it to share with you all.</p>
<p>The tutorial is simple and easy to implement. The trick is to load lighbox.js with jQuery when you want it.<span id="more-336"></span></p>
<p>Here is the simple code.</p>
<blockquote><p>code for index.html</p></blockquote>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
</pre>
<pre><span class="html"><span class="html-other-element">&lt;!DOCTYPE html PUBLIC <span class="html-attribute">&quot;-//W3C//DTD XHTML 1.0 Strict//EN&quot;</span>
<span class="html-attribute">&quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd&quot;</span>&gt;</span>
<span class="html-other-element">&lt;html xmlns=<span class="html-attribute">&quot;http://www.w3.org/1999/xhtml&quot;</span> lang=<span class="html-attribute">&quot;en&quot;</span>&gt;</span>
<span class="html-other-element">&lt;head&gt;</span>

<span class="html-other-element">&lt;title&gt;</span>Using lightbox with ajax<span class="html-other-element">&lt;/title&gt;</span>

<span class="html-other-element">&lt;link rel=<span class="html-attribute">&quot;stylesheet&quot;</span> href=<span class="html-attribute">&quot;css/lightbox.css&quot;</span> type=<span class="html-attribute">&quot;text/css&quot;</span> media=<span class="html-attribute">&quot;screen&quot;</span> /&gt;</span>
<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span> src=<span class="html-attribute">&quot;js/jquery.js&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>

<span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;js/prototype.js&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
<span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;js/scriptaculous.js?load=effects,builder&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>
<span class="html-script-element">&lt;script src=<span class="html-attribute">&quot;js/lightbox.js&quot;</span> type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js"></span></span>&lt;/script&gt;</span>

<span class="html-style-element">&lt;style type=<span class="css-string">&quot;text/css&quot;</span>&gt;<span class="css"><span class="css">
body{ <span class="css-property">color<span class="css-selector">:</span><span class="css-value"> #333</span></span>; <span class="css-property">font<span class="css-selector">:</span><span class="css-value"> 13px <span class="css-string">'Lucida Grande'</span>, Verdana, sans-serif</span></span>;    }
#update
{
<span class="css-property">margin-top<span class="css-selector">:</span><span class="css-value"> 10px</span></span>;
}
#update a img
{
<span class="css-property">border<span class="css-selector">:</span><span class="css-value"> #202020 3px solid</span></span>;
}
</span></span>&lt;/style&gt;</span>

<span class="html-other-element">&lt;/head&gt;</span>
<span class="html-other-element">&lt;body&gt;</span>

<span class="html-other-element">&lt;h1&gt;</span>Using <span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;http://www.lokeshdhakar.com/projects/lightbox2/&quot;</span>&gt;</span>Lightbox JS <span class="html-other-element">&lt;em&gt;</span>with ajax<span class="html-other-element">&lt;/em&gt;</span><span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/h1&gt;</span>
<span class="html-other-element">&lt;p&gt;</span><span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;http://www.lokeshdhakar.com&quot;</span>&gt;</span>by Harpreet BHatia<span class="html-anchor-element">&lt;/a&gt;</span><span class="html-other-element">&lt;/p&gt;</span>

<span class="html-other-element">&lt;h2&gt;</span>Example<span class="html-other-element">&lt;/h2&gt;</span>

<span class="html-form-element">&lt;select name=<span class="html-attribute">&quot;imageOption&quot;</span> id=<span class="html-attribute">&quot;imgOptn&quot;</span>&gt;</span>
<span class="html-form-element">&lt;option value=<span class="html-attribute">&quot;xxx&quot;</span>&gt;</span>----Select Image Type-----<span class="html-form-element">&lt;/option&gt;</span>
<span class="html-form-element">&lt;option value=<span class="html-attribute">&quot;1&quot;</span>&gt;</span>Type 1<span class="html-form-element">&lt;/option&gt;</span>
<span class="html-form-element">&lt;option value=<span class="html-attribute">&quot;2&quot;</span>&gt;</span>Type 2<span class="html-form-element">&lt;/option&gt;</span>
<span class="html-form-element">&lt;/select&gt;</span>

<span class="html-script-element">&lt;script type=<span class="html-attribute">&quot;text/javascript&quot;</span>&gt;<span class="js"><span class="js">

jQuery<span class="js-bracket">(</span><span class="js-string">&quot;[name=imageOption]&quot;</span><span class="js-bracket">)</span>.change<span class="js-bracket">(</span><span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span>
<span class="js-bracket">{</span>

<span class="js-comment">//------loading lightbox script using jquery-----
</span>

jQuery.getScript<span class="js-bracket">(</span><span class="js-string">&quot;js/lightbox.js&quot;</span>, <span class="js-function-keyword">function</span><span class="js-bracket">(</span><span class="js-bracket">)</span>
<span class="js-bracket">{</span>
cat <span class="js-operator">=</span> jQuery<span class="js-bracket">(</span><span class="js-string">'[name=imageOption]'</span><span class="js-bracket">)</span>.val<span class="js-bracket">(</span><span class="js-bracket">)</span>;
<span class="js-reserved-keyword">if</span><span class="js-bracket">(</span>cat <span class="js-operator">!</span><span class="js-operator">=</span> <span class="js-string">&quot;xxx&quot;</span><span class="js-bracket">)</span>
<span class="js-bracket">{</span>
<span class="js-reserved-keyword">var</span> dataString <span class="js-operator">=</span> <span class="js-string">'cat='</span> <span class="js-operator">+</span> cat;
<span class="js-bracket">{</span>
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#flash&quot;</span><span class="js-bracket">)</span>.show<span class="js-bracket">(</span><span class="js-bracket">)</span>;
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#flash&quot;</span><span class="js-bracket">)</span>.fadeIn<span class="js-bracket">(</span><span class="js-number">4</span><span class="js-number">0</span><span class="js-number">0</span><span class="js-bracket">)</span>.html<span class="js-bracket">(</span><span class="js-string">'&lt;span&gt;Loading Image, Please wait...&lt;/span&gt;'</span><span class="js-bracket">)</span>;

<span class="js-comment">//----calling the php file to get images ------
</span>
jQuery.ajax<span class="js-bracket">(</span>
<span class="js-bracket">{</span>
type<span class="js-operator">:</span> <span class="js-string">&quot;POST&quot;</span>,
url<span class="js-operator">:</span> <span class="js-string">&quot;getImages.php&quot;</span>,
data<span class="js-operator">:</span> dataString,
cache<span class="js-operator">:</span> <span class="js-reserved-keyword">false</span>,
success<span class="js-operator">:</span> <span class="js-function-keyword">function</span><span class="js-bracket">(</span>html<span class="js-bracket">)</span>
<span class="js-bracket">{</span>
<span class="js-bracket">{</span>
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#update&quot;</span><span class="js-bracket">)</span>.empty<span class="js-bracket">(</span><span class="js-bracket">)</span>;
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#update&quot;</span><span class="js-bracket">)</span>. append<span class="js-bracket">(</span>html<span class="js-bracket">)</span>;
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#update&quot;</span><span class="js-bracket">)</span>.fadeIn<span class="js-bracket">(</span><span class="js-string">&quot;slow&quot;</span><span class="js-bracket">)</span>;
jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#flash&quot;</span><span class="js-bracket">)</span>.hide<span class="js-bracket">(</span><span class="js-bracket">)</span>;
<span class="js-comment">//jQuery(&quot;#update&quot;).fadeOut(7000);
</span>
<span class="js-bracket">}</span>
<span class="js-bracket">}</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span>;
<span class="js-reserved-keyword">return</span> <span class="js-reserved-keyword">false</span>;
<span class="js-bracket">}</span>
<span class="js-bracket">}</span>
<span class="js-reserved-keyword">else</span>
<span class="js-bracket">{</span>

jQuery<span class="js-bracket">(</span><span class="js-string">&quot;#update&quot;</span><span class="js-bracket">)</span>.fadeOut<span class="js-bracket">(</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span>
<span class="js-bracket">}</span><span class="js-bracket">)</span>;
<span class="js-bracket">}</span><span class="js-bracket">)</span>;
</span></span>&lt;/script&gt;</span>

<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;flash&quot;</span>&gt;</span><span class="html-other-element">&lt;/div&gt;</span>
<span class="html-other-element">&lt;div id=<span class="html-attribute">&quot;update&quot;</span>&gt;</span>

<span class="html-other-element">&lt;/div&gt;</span>

<span class="html-other-element">&lt;/body&gt;</span>
<span class="html-other-element">&lt;/html&gt;</span></span></pre>
</div>
<p>Code for php file</p>
<div class="fvch-code">
<pre class="fvch-line-numbers">1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
</pre>
<pre><span class="php"><span class="php-script-tag">&lt;?php</span>
<span class="php-var">$t</span> <span class="php-operator">=</span> <span class="php-var">$_POST</span><span class="php-brackets">[</span><span class="php-string">'cat'</span><span class="php-brackets">]</span>;
<span class="php-keyword">if</span><span class="php-brackets">(</span><span class="php-var">$t</span> <span class="php-operator">=</span><span class="php-operator">=</span> <span class="php-number">1</span><span class="php-brackets">)</span>
<span class="php-brackets">{</span>
<span class="php-script-tag">?&gt;<span class="html">
<span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;images/hat_big.jpg&quot;</span> rel=<span class="html-attribute">&quot;lightbox[roadtrip]&quot;</span>&gt;</span>
<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;images/hat.jpg&quot;</span> width=<span class="html-attribute">&quot;200&quot;</span> height=<span class="html-attribute">&quot;200&quot;</span> alt=<span class="html-attribute">&quot;&quot;</span> /&gt;</span>
<span class="html-anchor-element">&lt;/a&gt;</span>
<span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;images/glow_big.jpg&quot;</span> rel=<span class="html-attribute">&quot;lightbox[roadtrip]&quot;</span>&gt;</span>
<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;images/glow.jpg&quot;</span> width=<span class="html-attribute">&quot;200&quot;</span> height=<span class="html-attribute">&quot;200&quot;</span> alt=<span class="html-attribute">&quot;&quot;</span> /&gt;</span>
<span class="html-anchor-element">&lt;/a&gt;</span>
</span>&lt;?</span>
<span class="php-brackets">}</span>
<span class="php-keyword">else</span>
<span class="php-brackets">{</span>
<span class="php-script-tag">?&gt;<span class="html">
<span class="html-anchor-element">&lt;a href=<span class="html-attribute">&quot;images/roof_big.jpg&quot;</span> rel=<span class="html-attribute">&quot;lightbox&quot;</span>&gt;</span>
<span class="html-image-element">&lt;img src=<span class="html-attribute">&quot;images/roof.jpg&quot;</span> width=<span class="html-attribute">&quot;200&quot;</span> height=<span class="html-attribute">&quot;200&quot;</span> alt=<span class="html-attribute">&quot;&quot;</span> /&gt;</span>
<span class="html-anchor-element">&lt;/a&gt;</span>
</span>&lt;?</span>
<span class="php-brackets">}</span>
<span class="php-script-tag">?&gt;<span class="html"></span></span></span></pre>
</div>
<h2><span style="color: #000000;"><a  href="http://demo.bluejavax.com/ajax_lightbox" target="_blank"><strong>View Demo</strong></a></span></h2>
<p><a  href="http://up.servut.us/23040">Download source</a></p>
<p>Hope you like it&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.bluejavax.com/lightbox-to-ajax-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

