<?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>Design strike &#187; Development</title>
	<atom:link href="http://designstrike.net/category/development/feed" rel="self" type="application/rss+xml" />
	<link>http://designstrike.net</link>
	<description>Striking with the latest design info</description>
	<lastBuildDate>Fri, 18 Jun 2010 13:51:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>How to create a peel ad in a WordPress blog</title>
		<link>http://designstrike.net/development/how-to-create-a-peel-ad-in-a-wordpress-blog.html</link>
		<comments>http://designstrike.net/development/how-to-create-a-peel-ad-in-a-wordpress-blog.html#comments</comments>
		<pubDate>Wed, 07 Oct 2009 19:26:39 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[page peel]]></category>
		<category><![CDATA[peel ad]]></category>
		<category><![CDATA[wordpress peel]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1309</guid>
		<description><![CDATA[A peel ad is often a great way to advertise a chosen product. It doesn&#8217;t matter if it&#8217;s your own product or a affiliate product. This type of ad is one of the most successful when it comes to get the users attention. The installation is fairly simple and it can be set up in [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-create-a-peel-ad-in-a-wordpress-blog.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-create-a-peel-ad-in-a-wordpress-blog.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A peel ad is often a great way to advertise a chosen product. It doesn&#8217;t matter if it&#8217;s your own product or a affiliate product. This type of ad is one of the most successful when it comes to get the users attention. The installation is fairly simple and it can be set up in just 5 min.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/page-peel.jpg" alt="page-peel" title="page-peel" width="500" height="285" class="alignnone size-full wp-image-1311" /></p>
<p>If you are the lazy type just like me, go ahead and <a href="http://wordpress.org/extend/plugins/page-peel/" rel='nofollow'>download this plugin</a>, it does the same thing. If you would like to find out how to code your peel ad here is how to do it:<br />
<span id="more-1309"></span><br />
<strong>Download the source files</strong></p>
<p>In order for the ad to work you will need <a href='http://designstrike.net/wp-content/uploads/2009/10/peel.zip'>the peel files</a>, that you need to upload to your web server. The best place to upload the peel file is <strong>wp-content/themes/your_current_theme/</strong>.</p>
<p><strong>Edit the javascript file</strong></p>
<p>Now we need to edit the <strong>peel.js</strong> javascript file. Open it in your favourite text editor and change the following files:</p>
<p>   1. jaaspeel.ad_url – URL you intend to point the ad.<br />
   2. jaaspeel.small_path – Path to small.swf<br />
   3. jaaspeel.small_image – Path to small.jpg<br />
   4. jaaspeel.big_path – Path to large.swf<br />
   5. jaaspeel.big_image – Path to large.jpg</p>
<p>Here you have a actual example of how it can be done.</p>

<div class="wp_syntax"><div class="code"><pre class="java" style="font-family:monospace;">jaaspeel.<span style="color: #006633;">ad_url</span> <span style="color: #339933;">=</span> escape<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.designstrike.net'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
jaaspeel.<span style="color: #006633;">small_path</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.designstrike.net/wp-content/themes/simplified/peel/small.swf'</span><span style="color: #339933;">;</span> 
jaaspeel.<span style="color: #006633;">small_image</span> <span style="color: #339933;">=</span> escape<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.designstrike.net/wp-content/themes/simplified/peel/small.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
jaaspeel.<span style="color: #006633;">big_path</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'http://www.designstrike.net/wp-content/themes/simplified/peel/large.swf'</span><span style="color: #339933;">;</span> 
jaaspeel.<span style="color: #006633;">big_image</span> <span style="color: #339933;">=</span> escape<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'http://www.designstrike.net/wp-content/themes/simplified/peel/large.jpg'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>What files you need to edit</strong></p>
<p>The small image file is the image that the users sees when no hover is applied. You can change this according to your background.</p>
<p>The large image file is the actual ad image that the user sees when it hovers the ad and the peel is released. This can be edited accordingly.</p>
<p><strong>Upload</strong></p>
<p>Upload the entire peel folder inside your theme file. Be shure to specify the paths correctly.</p>
<p><strong>Code insertion inside your theme</strong></p>
<p>Ok, we need to add a little javascript call in your head section of the theme. To do this navigate to your <strong>header.php</strong> file and insert the following code before the ending <strong>head</strong> tag.</p>

<div class="wp_syntax"><div class="code"><pre class="xhtml" style="font-family:monospace;">&lt;script src=&quot;&lt;strong&gt;http://www.domain.com/peel.js&lt;/strong&gt;&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;</pre></div></div>

<p>And there you go, instant peel ads without the help of any plugin.  </p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-create-a-peel-ad-in-a-wordpress-blog.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make a author box in WordPress</title>
		<link>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html</link>
		<comments>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html#comments</comments>
		<pubDate>Tue, 06 Oct 2009 19:22:17 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[author box]]></category>
		<category><![CDATA[bio]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1288</guid>
		<description><![CDATA[This simple technique will allow your article authors to display a bio and a Twitter link at the end of every article they write. The process is fully automatic, and the authors only need to fill in the required fields on their registration. This is a simple and effective way to give authors that link [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-a-author-box-in-wordpress.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-a-author-box-in-wordpress.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>This simple technique will allow your article authors to display a bio and a Twitter link at the end of every article they write. The process is fully automatic, and the authors only need to fill in the required fields on their registration.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/result.gif" alt="result" title="result" width="600" height="164" class="alignnone size-full wp-image-1301" /></p>
<p>This is a simple and effective way to give authors that link love that they deserve for writing on your blog. The tutorial include some simple steps and code to set up. The tutorial is about setting up a author description and bio along with a Twitter link, and finally showing them inside a author box in WordPress.<br />
<span id="more-1288"></span></p>
<h2>Let`s get to work</h2>
<p>Open up your <strong>functions.php</strong> and paste in the following code. This code will make a Twitter field that authors need to fill inside the user edit screen of WordPress.</p>

<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;tr&gt;
    &lt;th&gt;&lt;label for=&quot;twitter&quot;&gt;Twitter&lt;/label&gt;&lt;/th&gt;
&nbsp;
    &lt;td&gt;
        &lt;input type=&quot;text&quot; name=&quot;twitter&quot; id=&quot;twitter&quot; value=&quot;&lt;?php echo esc_attr( get_the_author_meta( 'twitter', $user-&gt;ID ) ); ?&gt;&quot; class=&quot;regular-text&quot; /&gt;&lt;br /&gt;
        &lt;span class=&quot;description&quot;&gt;Please enter your Twitter misname.&lt;/span&gt;
    &lt;/td&gt;
&lt;/tr&gt;</pre></div></div>

<p>And this is the actual result</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/twitter-area.gif" alt="twitter-area" title="twitter-area" width="600" height="164" class="alignnone size-full wp-image-1296" /></p>
<p>Keep in mind that if you want to display something else besides the Tiwtter link, the only thing you need to do is to copy the Twitter code and change every <strong>twitter</strong> instance inside the code into something unique.</p>
<p><strong>Now we need to save the links</strong></p>
<p>To allow wordpress to save your Twitter link you need to pop this code inside the functions.php file just below the Twitter code we inserted before.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'personal_options_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_save_extra_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
add_action<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user_profile_update'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'my_save_extra_profile_fields'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> my_save_extra_profile_fields<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> <span style="color: #339933;">!</span>current_user_can<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'edit_user'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$user_id</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* Copy and paste this line for additional fields. Make sure to change 'twitter' to the field ID. */</span>
    update_usermeta<span style="color: #009900;">&#40;</span> <span style="color: #000088;">$user_id</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'twitter'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'twitter'</span><span style="color: #009900;">&#93;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now, we need to set up the actual author box we will display at the end of every post that author writes. Here is how you can achieve this:</p>
<p>Paste in the following code inside the <strong>functions.php</strong> file.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">function my_author_box() { ?&gt;
    &lt;div class=&quot;author-profile vcard&quot;&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">echo</span> get_avatar<span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'user_email'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'96'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
        &lt;h4 class=&quot;author-name fn n&quot;&gt;Written by <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_posts_link<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h4&gt;
&nbsp;
        &lt;p class=&quot;author-description author-bio&quot;&gt;
            <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'description'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;/p&gt;
&nbsp;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span> get_the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twitter'</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
            &lt;p class=&quot;twitter clear&quot;&gt;
                &lt;a href=&quot;http://twitter.com/<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'twitter'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot; title=&quot;Follow <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'display_name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> on Twitter&quot;&gt;Follow <span style="color: #000000; font-weight: bold;">&lt;?php</span> the_author_meta<span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'display_name'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span> on Twitter&lt;/a&gt;
            &lt;/p&gt;
        <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #009900;">&#125;</span> <span style="color: #666666; font-style: italic;">// End check for twitter ?&gt;</span>
    &lt;/div&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next, let`s add the code inside our <strong>single.php</strong> file for our author box to show. So open up your single.php and paste the following code just before the comments code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> my_author_box<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>And that is the whole thing. Furthermore you can stylize the author box by adding some extra CSS code inside your style.css. This is my actual code and you can customize it to fit your own needs.</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #6666ff;">.author-profile</span>    <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">padding</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#c5ecfb</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #cc00cc;">#0c529b</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-profile</span> img    <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">float</span><span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-right</span><span style="color: #00AA00;">:</span> <span style="color: #933;">15px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-name</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.9em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>Georgia<span style="color: #00AA00;">,</span><span style="color: #ff0000;">&quot;Times New Roman&quot;</span><span style="color: #00AA00;">,</span>Times<span style="color: #00AA00;">,</span><span style="color: #993333;">serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-bottom</span><span style="color: #00AA00;">:</span><span style="color: #933;">2px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.author-description</span> <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#333333</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #3333ff;">:Verdana</span><span style="color: #00AA00;">,</span>Geneva<span style="color: #00AA00;">,</span><span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">13px</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">5px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
&nbsp;
<span style="color: #6666ff;">.twitter</span> a <span style="color: #00AA00;">&#123;</span>
<span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">1.4em</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#005ec1</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">text-decoration</span><span style="color: #00AA00;">:</span><span style="color: #993333;">underline</span><span style="color: #00AA00;">;</span>
<span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>And this is the actual result:</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/10/result.gif" alt="result" title="result" width="600" height="164" class="alignnone size-full wp-image-1301" /></p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-make-a-author-box-in-wordpress.html/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How to debug for IE6 with multiple IE instances</title>
		<link>http://designstrike.net/development/how-to-debug-for-ie-with-multiple-ie-instances.html</link>
		<comments>http://designstrike.net/development/how-to-debug-for-ie-with-multiple-ie-instances.html#comments</comments>
		<pubDate>Sun, 27 Sep 2009 21:19:08 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[instances]]></category>
		<category><![CDATA[multiple]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1185</guid>
		<description><![CDATA[Often when I find myself developing a new &#8220;something&#8221; for anyone, I have serious problems in IE, especially in IE6. As much as I would want IE6 to die in excruciating pain, I still have to develop and provide support for it. Here is how you can have multiple instances of IE installed on the [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-debug-for-ie-with-multiple-ie-instances.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-debug-for-ie-with-multiple-ie-instances.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Often when I find myself developing a new &#8220;something&#8221; for anyone, I have serious problems in IE, especially in IE6. As much as I would want <a href="http://davidwalsh.name/6-reasons-why-ie6-must-die" rel='nofollow'>IE6 to die</a> in excruciating pain, I still have to develop and provide support for it.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/IE6.jpg" alt="IE6" title="IE6" width="600" height="401" class="alignnone size-full wp-image-1186" /></p>
<p>Here is how you can have multiple instances of IE installed on the same machine, without the lack of productivity from IE8.<br />
<span id="more-1185"></span><br />
<strong>How can I get that darn thing?</strong><br />
IE6 was released in 2001, a long long time ago, so if you are probably a developer you upgraded to IE8. There is a little tool out there that can install multiple instances of Internet Explorer on the same machine. This means that you will have IE6 and IE7 and IE8 on the same computer.</p>
<p><a href="http://tredosoft.com/files/multi-ie/multiple-ie-setup.exe" rel='nofollow'>Download Multiple IE installer</a></p>
<p><strong>Do you want to run it inside vista?</strong><br />
Here is a  <a href="http://tredosoft.com/IE6_For_Vista_Part_1" rel='nofollow'>post</a> that details the current progress in making Internet Explorer 6 run native under Windows Vista.</p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-debug-for-ie-with-multiple-ie-instances.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to make your very own CAPTCHA</title>
		<link>http://designstrike.net/development/how-to-make-your-very-own-captcha.html</link>
		<comments>http://designstrike.net/development/how-to-make-your-very-own-captcha.html#comments</comments>
		<pubDate>Thu, 24 Sep 2009 20:32:41 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[captcha]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[tutorial]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1141</guid>
		<description><![CDATA[CAPTCHA &#8211; a familiar term to some of us but also a weird word for others, nonetheless CAPTCHA is one of those thing everybody comes in contact somehow. Like the name tells it CAPTCHA is a acronym for Completely Automated Public Turing test to tell Computers and Humans Apart. Basically it`s whole purpose is to [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-your-very-own-captcha.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-make-your-very-own-captcha.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>CAPTCHA &#8211; a familiar term to some of us but also a weird word for others, nonetheless CAPTCHA is one of those thing everybody comes in contact somehow. Like the name tells it CAPTCHA is a acronym for Completely Automated Public Turing test to tell Computers and Humans Apart. Basically it`s whole purpose is to tell if you are a human or a bot.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/captcha-thumb.jpg" alt="captcha-thumb" title="captcha-thumb" width="492" height="324" class="alignnone size-full wp-image-1152" /></p>
<p>The system is a security feature first implemented by Yahoo, and soon spreaded on a big number of systems to improve security. The CAPTCHA is a representative image containing squiggly words that asks the user to type the word inside a form. A thing that a machine cannot possibly do.<br />
<span id="more-1141"></span><br />
<strong>How can CAPTCHA protect you?</strong><br />
There is a number of ways that it can protect you. Here are some of the places that users tend to come across squiggly images:</p>
<ul>
<li>Protecting a web registration form from automated registrations</li>
<li>Preventing automatic posting of advertising comments by robots on blogs or other similar applications.</li>
<li>Protection of voting systems from robots that try to fraud the results.</li>
<li>Preventing spam on contact forms.</li>
</ul>
<p>At the moment, there are a vast variety of free or commercial solutions to a CAPTCHA system, but the down side is that because of the variety of the forms, the easier is for the bots to adapt. Sometimes the images are to similar, the letters are to understandable and the list can go on. We will make a simple system, that makes robot adaptation as hard as possible, so your system is protected at all times.</p>
<p><strong>Server requirements</strong> </p>
<ul>
<li>PHP 4.1.0 or recent (PHP 5.x.x for blur)</li>
<li>FreeType library</li>
<li>GD 2.0.1 or recent</li>
</ul>
<p>In the config file, we will define the paths to the image and font used by the CAPTCHA system, you can specify your own images and font. Note: all of the fonts used in this tutorial are free fonts.</p>
<p><a href='http://designstrike.net/wp-content/uploads/2009/09/fonts.zip'>Fonts used in this tutorial</a><br />
<a href='http://designstrike.net/wp-content/uploads/2009/09/images.zip'>Images used in this tutorial</a></p>
<h2>Let`s build the form</h2>
<p><strong>First step, creating the config file</strong></p>
<p>We will create a config file (config.php) in which we will define the parameters of the code. The generated code must be available to the script that renders the user`s input of the form.</p>
<p>You can use a variety of systems like temp files, sessions or databases. In this tutorial we will use sessions, because they are the easiest to implement.</p>
<p>Thus we will first define the variable name in witch we will keep the code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$sessionVar</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'myCaptcha'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next step is to define the allowed characters</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$allowedChars</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Note that we skiped the number 0 (zero) to avoid confusion between zero and the letter &#8220;O&#8221; (capital o).</p>
<p>Now, we will make the lenght random, thus creating a more secure form.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$minCodeLength</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$maxCodeLength</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">6</span><span style="color: #339933;">;</span></pre></div></div>

<p>We know that a same letter size captcha is cracked more easily, so in the next markup we will randomize the letter height. The size will be measured in pixels.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$minFontSize</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">24</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$maxFontSize</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">32</span><span style="color: #339933;">;</span></pre></div></div>

<p>Another thing that influences CAPTCHA recognition for robots is the linear placement of the letters, so we will move them around the middle line.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$maxVerticalDisplacement</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, we will rotate the letters a bit.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$maxRotationLeft</span>  <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$maxRotationRight</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">15</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, we will be adjusting the padding of the letters</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$textPadding</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">5</span><span style="color: #339933;">;</span></pre></div></div>

<p>Ok, now we will change the colours of the background</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$bgColor</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">255</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, we will define an array on the allowed color hex tags for the letters</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$textColor</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>    
        <span style="color: #0000ff;">'200, 0, 0'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'30, 200, 0'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'150, 0, 200'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'150, 150, 0'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'100, 100, 100'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'ff0099'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'99ff00'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Different fonts for each letter? Never been so easy. Here is how you can do it. Keep in mind that you need the FreeType library fr the GD to work. You can find free fonts on the <a href="http://www.dafont.com/" rel='nofollow'>DaFont website</a>.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$fontsFolder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'my_fonts/'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$fontFiles</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>  
        <span style="color: #0000ff;">'elektra.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'episode1.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'lcd2bold.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'optimusprinceps.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'sams_town.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'steinerlight.ttf'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'turn_table.ttf'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now let`s set up the background images</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$backgroundsFolder</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'my_backgrounds/'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$backgrounds</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
        <span style="color: #0000ff;">'bg_1.png'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'bg_2.png'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'bg_3.png'</span><span style="color: #339933;">,</span>
        <span style="color: #0000ff;">'bg_4.png'</span>
        <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p><strong>Don&#8217;t forget to replace the paths and names of the fonts and images with your own.</strong></p>
<p>Enough with the config, lets create something. Create a new php file, let`s say <em>show_code.php</em> that we will call like an ordinary image call.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;show_code.php&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;myCaptcha&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></div>

<p>Next, include the starting command and the config file:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">session_start</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">include_once</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$sessionVar</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">''</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, we will need a function that will return the occupied space of a letter:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> getCharSize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$fontFile</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #339933;">,</span> <span style="color: #000088;">$size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$angle</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #990000;">is_file</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fontFile</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">1</span> <span style="color: #339933;">&amp;&amp;</span> <span style="color: #000088;">$size</span> <span style="color: #339933;">&gt;</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$corners</span> <span style="color: #339933;">=</span> <span style="color: #339933;">@</span><span style="color: #990000;">imagettfbbox</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$angle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$fontFile</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$left</span>    <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">6</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$right</span>   <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$top</span>     <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">7</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$bottom</span>  <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">&gt;</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span>?<span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">:</span><span style="color: #000088;">$corners</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$width</span>   <span style="color: #339933;">=</span> <span style="color: #000088;">$right</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$left</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$height</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$top</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$bottom</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">+</span> <span style="color: #cc66cc;">4</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$return</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
                                <span style="color: #0000ff;">'width'</span>  <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'height'</span> <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$height</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'bottom'</span> <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$bottom</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'right'</span>  <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$right</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'top'</span>    <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$top</span><span style="color: #339933;">,</span>
                                <span style="color: #0000ff;">'left'</span>   <span style="color: #339933;">=&gt;</span><span style="color: #000088;">$left</span>
                                <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$return</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">false</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$return</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next we will need a functions that will return values in a single form, regardless of the hexadecimal colors of the letters:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">function</span> hex2decColor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">substr_count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">','</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$red</span><span style="color: #339933;">,</span> <span style="color: #000088;">$green</span><span style="color: #339933;">,</span> <span style="color: #000088;">$blue</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array_map</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'trim'</span><span style="color: #339933;">,</span> <span style="color: #990000;">explode</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">','</span><span style="color: #339933;">,</span> <span style="color: #000088;">$color</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #000088;">$red</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$green</span> <span style="color: #339933;">=</span> <span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">3</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
                <span style="color: #000088;">$blue</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">hexdec</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">4</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">.</span><span style="color: #000088;">$color</span><span style="color: #009900;">&#91;</span><span style="color: #cc66cc;">5</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #009900;">&#125;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'red'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$red</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'green'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$green</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'blue'</span><span style="color: #339933;">=&gt;</span><span style="color: #000088;">$blue</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Now we will set the image size to 0 and generate code lenght based on the configured maximum and minimum lenght.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$imgWidth</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imgHeight</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$codeLength</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$minCodeLength</span><span style="color: #339933;">,</span> <span style="color: #000088;">$maxCodeLength</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next, we will generate $codeLength times a character and it`s properties.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$c</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$codeLength</span><span style="color: #339933;">;</span> <span style="color: #000088;">$c</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'char'</span><span style="color: #009900;">&#93;</span>   <span style="color: #339933;">=</span> <span style="color: #000088;">$allowedChars</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">strlen</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$allowedChars</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> hex2decColor<span style="color: #009900;">&#40;</span><span style="color: #000088;">$textColor</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$textColor</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'displacement'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$maxVerticalDisplacement</span><span style="color: #339933;">*</span><span style="color: #cc66cc;">2</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$maxVerticalDisplacement</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'font'</span><span style="color: #009900;">&#93;</span>   <span style="color: #339933;">=</span> <span style="color: #000088;">$fontsFolder</span><span style="color: #339933;">.</span><span style="color: #000088;">$fontFiles</span><span style="color: #009900;">&#91;</span><span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$fontFiles</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span> <span style="color: #009900;">&#41;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span>   <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$minFontSize</span><span style="color: #339933;">,</span> <span style="color: #000088;">$maxFontSize</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'angle'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$maxRotationLeft</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$maxRotationRight</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$maxRotationRight</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'space'</span><span style="color: #009900;">&#93;</span>  <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$minLetterSpacing</span><span style="color: #339933;">,</span> <span style="color: #000088;">$maxLetterSpacing</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We find out the dimensions of the current character, using one of the functions defined earlier.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$properties</span> <span style="color: #339933;">=</span> getCharSize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'font'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'char'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'angle'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$width</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$properties</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'width'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$properties</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'height'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>After we found the width of the character, we add it to the image total width along with the distance to the next character.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$imgWidth</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$width</span><span style="color: #339933;">;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span> <span style="color: #339933;">!=</span> <span style="color: #000088;">$codeLength</span><span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$imgWidth</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'space'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>

<p>If the image height is smaller than the current character height, then we set it the correct height.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$height</span> <span style="color: #339933;">+</span> <span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'displacement'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">&gt;</span> <span style="color: #000088;">$imgHeight</span> <span style="color: #009900;">&#41;</span>
                <span style="color: #000088;">$imgHeight</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$height</span> <span style="color: #339933;">+</span> <span style="color: #990000;">abs</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'displacement'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We add the current character to the row that forms our code</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">        <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$sessionVar</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">.=</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'char'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Next we add the padding</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$imgWidth</span>  <span style="color: #339933;">+=</span> <span style="color: #000088;">$textPadding</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$imgHeight</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$textPadding</span> <span style="color: #339933;">*</span> <span style="color: #cc66cc;">2</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$maxVerticalDisplacement</span><span style="color: #339933;">;</span></pre></div></div>

<p>Now, that we set the dimensions, let&#8217;s create the image and calculate the background image position. The images can be different textures or landscapes on a higher resolution than our image, so we will need only a portion defined randomly:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$img</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatetruecolor</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$imgWidth</span><span style="color: #339933;">,</span> <span style="color: #000088;">$imgHeight</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We choose a random image and read the dimensions:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$bg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #990000;">count</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$backgrounds</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-</span><span style="color: #cc66cc;">1</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">list</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bgWidth</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgHeight</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getimagesize</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$backgroundsFolder</span><span style="color: #339933;">.</span><span style="color: #000088;">$backgrounds</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$bg</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We set position where the portion of the image begins to be used as background and copy it in our image:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$bgX</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgWidth</span><span style="color: #339933;">-</span><span style="color: #000088;">$imgWidth</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$bgY</span> <span style="color: #339933;">=</span> <span style="color: #990000;">rand</span><span style="color: #009900;">&#40;</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgHeight</span><span style="color: #339933;">-</span><span style="color: #000088;">$imgHeight</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$bgImg</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreatefrompng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$backgroundsFolder</span><span style="color: #339933;">.</span><span style="color: #000088;">$backgrounds</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$bg</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagecopy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgImg</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgX</span><span style="color: #339933;">,</span> <span style="color: #000088;">$bgY</span><span style="color: #339933;">,</span> <span style="color: #000088;">$imgWidth</span><span style="color: #339933;">,</span> <span style="color: #000088;">$imgHeight</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$bgImg</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Next is the code markup inside the image</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$cursor</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$textPadding</span><span style="color: #339933;">;</span></pre></div></div>

<p>We set the previously generated color for the current character:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">for</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$c</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span> <span style="color: #000088;">$c</span> <span style="color: #339933;">&lt;=</span> <span style="color: #000088;">$codeLength</span><span style="color: #339933;">;</span> <span style="color: #000088;">$c</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #000088;">$color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecolorallocate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'red'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'green'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'color'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'blue'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>We calculate the vertical character, depending on its size and the amount of displacement from the center generated for him:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">  <span style="color: #000088;">$properties</span> <span style="color: #339933;">=</span> getCharSize<span style="color: #009900;">&#40;</span><span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'font'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'char'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'angle'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$width</span>  <span style="color: #339933;">=</span> <span style="color: #000088;">$properties</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'width'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$properties</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'height'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$bottom</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$properties</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'bottom'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
        <span style="color: #000088;">$y</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'displacement'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$maxVerticalDisplacement</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$height</span> <span style="color: #339933;">-</span> <span style="color: #000088;">$bottom</span><span style="color: #339933;">;</span></pre></div></div>

<p>We write the current character and move the cursor to the right:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'size'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'angle'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$cursor</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #339933;">,</span> <span style="color: #000088;">$color</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'font'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'char'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$cursor</span> <span style="color: #339933;">+=</span> <span style="color: #000088;">$width</span> <span style="color: #339933;">+</span> <span style="color: #000088;">$char</span><span style="color: #009900;">&#91;</span><span style="color: #000088;">$c</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'space'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>We have left but to apply the Gaussian Blur filter, if the system allows:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">function_exists</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'imagefilter'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #990000;">imagefilter</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #339933;">,</span> IMG_FILTER_GAUSSIAN_BLUR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>At this point, our image is ready and we have to only serve it to a browser, and specify that the image should not be cached by the headers and the format is PNG (can be as good GIF, JPEG or any other format supported by the GD library), then release the resources on the server:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Cache-Control: no-store, no-cache, must-revalidate'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Cache-Control: post-check=0, pre-check=0'</span><span style="color: #339933;">,</span> <span style="color: #009900; font-weight: bold;">false</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Pragma: no-cache'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">'Content-type: image/png'</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagepng</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagedestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$img</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Verify! Inside the file that the POST data is sent, we need to open the session using session_start(); and verify that our input data is exactly the same with the saved data. This goes something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'REQUEST_METHOD'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">'POST'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'myCaptcha'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #000088;">$_SESSION</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'myCaptcha'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">// The rest of the data is being processed</span>
        <span style="color: #009900;">&#125;</span><span style="color: #b1b100;">else</span><span style="color: #009900;">&#123;</span>
                <span style="color: #666666; font-style: italic;">// Wrong Code! Try Again or Go Away!</span>
        <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<h2>God, I`m finished</h2>
<p><strong>Tips&#038;Triks</strong><br />
To give visitors the opportunity to generate another code without needing to reload the entire page, display the image using the following code:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span>img src<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;show_code.php&quot;</span> alt<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;myCaptcha&quot;</span> onclick<span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;javascript:this.src += '?';&quot;</span> <span style="color: #339933;">/&gt;</span></pre></div></div>

<p>And this is how to create a simple captcha using PHP inside your system. </p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-make-your-very-own-captcha.html/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How to set up a hotel reservation form in a WordPress page</title>
		<link>http://designstrike.net/development/cms-development/how-to-set-up-a-hotel-reservation-form-in-a-wordpress-page.html</link>
		<comments>http://designstrike.net/development/cms-development/how-to-set-up-a-hotel-reservation-form-in-a-wordpress-page.html#comments</comments>
		<pubDate>Sun, 20 Sep 2009 05:00:22 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CMS Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[custom template]]></category>
		<category><![CDATA[hotel reservation]]></category>
		<category><![CDATA[how to]]></category>
		<category><![CDATA[wordpress  page]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=1063</guid>
		<description><![CDATA[A few days back I was asked by a client to set up a hotel reservation form in his WordPress powered website. The problem is easy to solve and implement. This tutorial consists of setting up a WordPress custom page template and some php for a Hotel reservation page. By the end of this tutorial [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fcms-development%2Fhow-to-set-up-a-hotel-reservation-form-in-a-wordpress-page.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fcms-development%2Fhow-to-set-up-a-hotel-reservation-form-in-a-wordpress-page.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>A few days back I was asked by a client to set up a hotel reservation form in his WordPress powered website. The problem is easy to solve and implement. This tutorial consists of setting up a WordPress custom page template and some php for a Hotel reservation page.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Result-reservation1.gif" alt="Result-reservation" title="Result-reservation" width="600" height="235" class="alignnone size-full wp-image-1088" style="border: 1px solid #ccc; padding:5px;" /></p>
<p>By the end of this tutorial you will know hot to set up a hotel reservation page, a restaurant reservation page or anything that requires a reservation inside WordPress.<br />
<span id="more-1063"></span><br />
<strong>Step #1 &#8211; Set up a WordPress custom page template</strong></p>
<p>This is fairly easy to do. Go inside your WP theme root and simply duplicate the page.php file and name it anything you want. I renamed my file<strong> reservation.php</strong>.</p>
<p>Next you need to delete everything in the page loop. So head over open up your reservations.php and delete this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> the_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
		&lt;div class=&quot;post&quot; id=&quot;post-<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_ID<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&quot;&gt;
		&lt;h2&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/h2&gt;
			&lt;div class=&quot;entry&quot;&gt;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_content<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'&lt;p class=&quot;serif&quot;&gt;Read the rest of this page &amp;raquo;&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
				<span style="color: #000000; font-weight: bold;">&lt;?php</span> wp_link_pages<span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'before'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;p&gt;&lt;strong&gt;Pages:&lt;/strong&gt; '</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'after'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'next_or_number'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'number'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
			&lt;/div&gt;
		&lt;/div&gt;
		<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span> <span style="color: #b1b100;">endif</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
	<span style="color: #000000; font-weight: bold;">&lt;?php</span> edit_post_link<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Edit this entry.'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;p&gt;'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'&lt;/p&gt;'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>The next thing to do is to tell WordPress there is a custom page template named reservations.php. To do this simply copy and paste the following before the <strong>get_header();</strong> tag.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #666666; font-style: italic;">/*
    Template Name: RESERVATION
&nbsp;
    */</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>So you got something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">    <span style="color: #000000; font-weight: bold;">&lt;?php</span>
    <span style="color: #666666; font-style: italic;">/*
    Template Name: REZERVARI
&nbsp;
    */</span>
    <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> get_header<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Next go inside your WordPress dashboard and add a new page, on the right you will have a option to select a custom page template. Select RESERVATIONS like in the image below.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Custom-template-select.gif" alt="Custom-template-select" title="Custom-template-select" width="600" height="235" class="alignnone size-full wp-image-1075" style="border: 1px solid #ccc; padding:5px;"  /></p>
<p><strong>Step #2 Setting up the reservation php code</strong></p>
<p>Now the only place you will need to work is the reservation php file. Go and edit the file and copy/paste this code where the page loop was.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;script&gt;
function checkform2 ( form )
{
&nbsp;
  if (form.nume.value == &quot;&quot;) {
    alert( &quot;Va rugam completati campul: Nume!&quot; );
    form.nume.focus();
    return false ;
  }
&nbsp;
  if (form.prenume.value == &quot;&quot;) {
    alert( &quot;Va rugam completati campul: Prenume!&quot; );
    form.prenume.focus();
    return false ;
  }
&nbsp;
  if (form.telefon.value == &quot;&quot;) {
    alert( &quot;Va rugam completati campul: Telefon!&quot; );
    form.telefon.focus();
    return false ;
  }
&nbsp;
&nbsp;
&nbsp;
  return true ;
}
&lt;/script&gt;
		&lt;h2&gt;Online Reservation&lt;/h2&gt; 
&lt;form name=&quot;tstest&quot; method=&quot;post&quot; action=&quot;/reservation&quot; onsubmit=&quot;return checkform2(this)&quot;&gt;
&nbsp;
&nbsp;
To make a online reservation to one of our hotel rooms please fill out the form below:
&nbsp;
&nbsp;
                    &lt;table class=&quot;BodyTXT&quot; border=&quot;0&quot; cellpadding=&quot;1&quot; cellspacing=&quot;1&quot; width=&quot;100%&quot;&gt;
&nbsp;
                      &lt;tbody&gt;&lt;tr&gt;
&nbsp;
                        &lt;td width=&quot;22%&quot;&gt;&lt;div align=&quot;left&quot;&gt;First Name:*&lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;input name=&quot;nume&quot; id=&quot;nume&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
&nbsp;
                        &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Last Name:*&lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;input name=&quot;prenume&quot; id=&quot;prenume&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Phone:*&lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;input name=&quot;telefon&quot; id=&quot;telefon&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;E-mail:&lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;input name=&quot;email&quot; id=&quot;email&quot; type=&quot;text&quot;&gt;&lt;/td&gt;
                      &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Room number:&lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;
&nbsp;
						&lt;select name=&quot;nr_camere&quot; id=&quot;nr_camere&quot;&gt;
							&lt;option selected=&quot;selected&quot; value=&quot;1&quot;&gt;1&lt;/option&gt;
							&lt;option value=&quot;2&quot;&gt;2&lt;/option&gt;
							&lt;option value=&quot;3&quot;&gt;3&lt;/option&gt;
							&lt;option value=&quot;4&quot;&gt;4&lt;/option&gt;
						&lt;/select&gt;						&lt;/td&gt;
                      &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Room: &lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;
						&lt;select name=&quot;camera&quot;&gt;
							&lt;option value=&quot;Double&quot;&gt;Double&lt;/option&gt;
							&lt;option value=&quot;Matrimoniala&quot;&gt;Apartment&lt;/option&gt;
							&lt;option value=&quot;Matrimoniala cu jacuzzi&quot;&gt;Apartment with jacuzzi&lt;/option&gt;
						&lt;/select&gt;						&lt;/td&gt;
                      &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Arrival date: &lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td width=&quot;47%&quot;&gt;&lt;input name=&quot;data_intrare&quot; id=&quot;data_intrare&quot; type=&quot;text&quot;&gt;&lt;script language=&quot;JavaScript&quot;&gt;
	var o_cal = new tcal ({
		// form name
		'formname': 'tstest',
		// input name
		'controlname': 'data_intrare'
	});
&nbsp;
	// individual template parameters can be modified via the calendar variable
	o_cal.a_tpl.yearscroll = false;
	o_cal.a_tpl.weekstart = 1;
&nbsp;
	&lt;/script&gt;&lt;/td&gt;
                        &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Departure Date: &lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td width=&quot;47%&quot;&gt;&lt;input name=&quot;data_iesire&quot; id=&quot;data_iesire&quot; type=&quot;text&quot;&gt;&lt;script language=&quot;JavaScript&quot;&gt;
	var o_cal = new tcal ({
		// form name
		'formname': 'tstest',
		// input name
		'controlname': 'data_iesire'
	});
&nbsp;
	// individual template parameters can be modified via the calendar variable
	o_cal.a_tpl.yearscroll = false;
	o_cal.a_tpl.weekstart = 1;
&nbsp;
	&lt;/script&gt;&lt;/td&gt;
                        &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;div align=&quot;left&quot;&gt;Other comments: &lt;/div&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;textarea name=&quot;observatii&quot; cols=&quot;40&quot; rows=&quot;4&quot; id=&quot;observatii&quot;&gt;&lt;/textarea&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                      &lt;tr&gt;
                        &lt;td&gt;&amp;nbsp;&lt;/td&gt;
                        &lt;td&gt;* required fields&lt;/td&gt;
                        &lt;/tr&gt;
&nbsp;
                      &lt;tr&gt;
&nbsp;
                        &lt;td&gt;&lt;/td&gt;
&nbsp;
                        &lt;td&gt;&lt;input name=&quot;trimitecontact&quot; id=&quot;trimitecontact&quot; value=&quot;yes&quot; type=&quot;hidden&quot;&gt;
&nbsp;
&nbsp;
                            &lt;input name=&quot;Submit&quot; class=&quot;RedButton&quot; value=&quot;Send&quot; type=&quot;submit&quot;&gt;&lt;/td&gt;
                        &lt;/tr&gt;
                    &lt;/tbody&gt;&lt;/table&gt;
&nbsp;
&nbsp;
      &lt;/form&gt;
&nbsp;
&nbsp;
 <span style="color: #000000; font-weight: bold;">&lt;?</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'trimitecontact'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">==</span> <span style="color: #0000ff;">&quot;yes&quot;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
	<span style="color: #000088;">$nume</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nume'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$prenume</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'prenume'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$telefon</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'telefon'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$email</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'email'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$cam</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'nr_camere'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$tip</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'camera'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$di</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'data_intrare'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$die</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'data_intrare'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$mesaj</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_POST</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'observatii'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
	<span style="color: #000088;">$message</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;This reservation is from:<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;------------------------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;First Name: <span style="color: #006699; font-weight: bold;">$nume</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Last Name: <span style="color: #006699; font-weight: bold;">$prenume</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Phone: <span style="color: #006699; font-weight: bold;">$telefon</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Email : <span style="color: #006699; font-weight: bold;">$email</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Room Number: <span style="color: #006699; font-weight: bold;">$cam</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Room: <span style="color: #006699; font-weight: bold;">$tip</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Arrival Date: <span style="color: #006699; font-weight: bold;">$di</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Departure Date: <span style="color: #006699; font-weight: bold;">$die</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;Other Comments : <span style="color: #006699; font-weight: bold;">$mesaj</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span><span style="color: #339933;">.</span>
	<span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span><span style="color: #000099; font-weight: bold;">\n</span>------------------------------------------------------------<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">;</span>
	<span style="color: #000088;">$uself</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span>
	<span style="color: #000088;">$subject</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;New room reservation at your hotel&quot;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$headersep</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span> <span style="color: #000088;">$uself</span> <span style="color: #009900;">&#41;</span> <span style="color: #339933;">||</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$uself</span> <span style="color: #339933;">==</span> <span style="color: #cc66cc;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\r</span><span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">:</span> <span style="color: #0000ff;">&quot;<span style="color: #000099; font-weight: bold;">\n</span>&quot;</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$http_referrer</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span> <span style="color: #0000ff;">&quot;HTTP_REFERER&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$mailto</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'CHANGE@THIS.TOYOUREMAIL'</span> <span style="color: #339933;">;</span>
<span style="color: #000088;">$ip</span> <span style="color: #339933;">=</span> <span style="color: #990000;">getenv</span><span style="color: #009900;">&#40;</span>REMOTE_ADDR<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">mail</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$mailto</span><span style="color: #339933;">,</span> <span style="color: #000088;">$subject</span><span style="color: #339933;">,</span> <span style="color: #000088;">$message</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">&quot;From: <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$nume</span><span style="color: #000099; font-weight: bold;">\&quot;</span> &lt;<span style="color: #006699; font-weight: bold;">$email</span>&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$headersep</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;Reply-To: <span style="color: #000099; font-weight: bold;">\&quot;</span><span style="color: #006699; font-weight: bold;">$nume</span><span style="color: #000099; font-weight: bold;">\&quot;</span> &lt;<span style="color: #006699; font-weight: bold;">$email</span>&gt;&quot;</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$headersep</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;X-Mailer: chfeedback.php 2.08&quot;</span> <span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'&lt;strong&gt; Quote sent&lt;/strong&gt;'</span><span style="color: #339933;">;</span>				
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
   &lt;span class=&quot;text_contact&quot;&gt;
&nbsp;
The reservation will be considered after receiving payment.
                  &lt;/span&gt;</pre></div></div>

<p>And this is the result:</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Result-reservation.gif" alt="Result-reservation" title="Result-reservation" width="600" height="235" class="alignnone size-full wp-image-1087" style="border: 1px solid #ccc; padding:5px;"  /></p>
<p>Note: You must set the <strong>action=&#8221;/reservation&#8221;</strong> of the form imput to match your custom page php name. Ex. if I have a custom page php called joomla.php i would rename the action to action=&#8221;/joomla&#8221;. </p>
<p>Remember to chage the <strong>$mailto = &#8216;CHANGE@THIS.TOYOUREMAIL&#8217; ;</strong> to your desiered email where the messages will come.</p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/cms-development/how-to-set-up-a-hotel-reservation-form-in-a-wordpress-page.html/feed</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>The 3 godlike design books you must read</title>
		<link>http://designstrike.net/development/the-3-godlike-design-books-you-must-read.html</link>
		<comments>http://designstrike.net/development/the-3-godlike-design-books-you-must-read.html#comments</comments>
		<pubDate>Mon, 14 Sep 2009 05:00:07 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[best book]]></category>
		<category><![CDATA[design books]]></category>
		<category><![CDATA[money making books]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=883</guid>
		<description><![CDATA[Some really devoted design people are ready to take it up to the next level, and write a on-line or off-line resource to help others in the quest for the perfect design. The costs are very low in addition to the valuable knowledge the books offer so, head on over and preorder/order/download the best design [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fthe-3-godlike-design-books-you-must-read.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fthe-3-godlike-design-books-you-must-read.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>Some really devoted design people are ready to take it up to the next level, and write a on-line or off-line resource to help others in the quest for the perfect design.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Book-thumb.png" alt="Book-thumb" title="Book-thumb" width="472" height="322" class="alignnone size-full wp-image-901" style="border: 1px solid #cccccc; padding:5px;" /></p>
<p>The costs are very low in addition to the valuable knowledge the books offer so, head on over and preorder/order/download the best design books the community has to offer.<br />
<span id="more-883"></span></p>
<h2>SmashingMag design book</h2>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Smashing-book.png" alt="Smashing-book" title="Smashing-book" width="369" height="352" class="alignnone size-full wp-image-884" style="border: 1px solid #cccccc; padding:5px;" /></p>
<p>The book has 300 paperback pages, full-color images on coated paper, free shipping to the US and Germany, reduced shipping costs to other countries, 30-day 100% money-back guarantee and you can<a href="http://shop.smashingmagazine.com/smashingbook-dispatcher.php?utm_source=Smashing%2BMagazibe&#038;utm_medium=banner&#038;utm_content=Badge%2Bdesbook3&#038;utm_campaign=Smashing%2BBook" rel='nofollow'> preorder now and save 20%</a>.</p>
<p><strong>What are the books main topics?</strong></p>
<p>The book covers these particular topics:</p>
<ul>
<li>The Art And Science Of CSS Layouts</li>
<li>User Interface Design In Modern Applications</li>
<li>Web Typography: Rules, Guidelines And Common Mistakes</li>
<li>Usability Principles For Modern Websites</li>
<li>The Guide to Fantastic Color Usage In Web Design and Usability</li>
<li>Performance Optimization For Websites</li>
<li>Design To Sell: Increasing Conversion Rates</li>
<li>How To Turn A Site Into A Remarkable Brand</li>
<li>Learning From Experts: Interviews And Insights</li>
<li>The Smashing Story</li>
</ul>
<p>These being said, head on over and <a href="http://shop.smashingmagazine.com/smashingbook-dispatcher.php?utm_source=Smashing%2BMagazibe&#038;utm_medium=banner&#038;utm_content=Badge%2Bdesbook3&#038;utm_campaign=Smashing%2BBook" rel='nofollow'>preorder the SmashingBook now and save 20% of the price</a>. This is a great off-line design resource and if you are a web developer you don&#8217;t want to miss this one.</p>
<h2>31 days to build a better blog</h2>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/31dbbb2.png" alt="31dbbb2" title="31dbbb2" width="250" height="327" class="alignnone size-full wp-image-894" style="border: 1px solid #cccccc; padding:5px;" /></p>
<p>This is a must have ebook. Written by the founder of problogger.net Darren Rowse, he can guarantee that in 31 days you will have a better blog.</p>
<p>This book is about completing dayli tasks on your blog to increase it`s readers, popularity and interaction. You are to complete 1 task a day for 31 days.</p>
<p><strong>By the end of the 31 day period of reading the book you have</strong>:</p>
<p>    * written a variety of different types and styles of posts<br />
    * learned techniques for coming up with new post ideas<br />
    * promoted your blog in a variety of ways<br />
    * built relationships with readers<br />
    * reached out to and developed working relationships with other bloggers<br />
    * developed an editorial calendar for your blog going forward<br />
    * discovered ways to be more connected to your niche/topic<br />
    * designed a plan for the next month of your blogging</p>
<p>This book is perfect for those who have just started a blog but who don’t know what to do next, those who have had a blog for a while but it’s stalled in its growth and bloggers with bloggers block and lacking inspiration.</p>
<p>Go on and <a href="http://www.problogger.net/31dbbb-workbook/" rel='nofollow'>download the book for a small price of $19.95</a>.</p>
<h2>Free Report: How To Make Money From The Envato Marketplace</h2>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/reportboxart.jpg" alt="reportboxart" title="reportboxart" width="260" height="140" class="alignnone size-full wp-image-900" /></p>
<p>This is a free book that covers how can you make money using a affiliate network with wordpress. This is more a free report than a book, ut it covers the main concepts clearly. If found it as one of the best money making books around.</p>
<p>You can find out how can you make thousands of dollars in commissions using few simple steps. You can <a href="http://www.jeffhendricksondesign.com/wp-content/plugins/download-monitor/download.php?id=how-to-make-money-from-the-envato-marketplace.pdf" rel='nofollow'>download the ebook here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/the-3-godlike-design-books-you-must-read.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to increase RSS readers and social networking exposure</title>
		<link>http://designstrike.net/development/cms-development/how-to-increase-rss-readers-and-social-networking-exposure.html</link>
		<comments>http://designstrike.net/development/cms-development/how-to-increase-rss-readers-and-social-networking-exposure.html#comments</comments>
		<pubDate>Sun, 13 Sep 2009 05:00:58 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[CMS Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[wordpress plugins]]></category>
		<category><![CDATA[wordpress rss]]></category>
		<category><![CDATA[WP greet box plugin]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=859</guid>
		<description><![CDATA[When you develop a new blog, often, the big question that comes in to the mind is where and how can you get readers and trusted visitors to read your blog posts. Well, recently I found a great plugin for WordPress that helps you achieve and increase your blog readers. WP Greet Box is a [...]]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fcms-development%2Fhow-to-increase-rss-readers-and-social-networking-exposure.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fcms-development%2Fhow-to-increase-rss-readers-and-social-networking-exposure.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>When you develop a new blog, often, the big question that comes in to the mind is where and how can you get readers and trusted visitors to read your blog posts. Well, recently I found a great plugin for WordPress that helps you achieve and increase your blog readers.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Smashing-mag-greetbox.png" alt="Smashing-mag-greetbox" title="Smashing-mag-greetbox" width="600" height="533" class="alignnone size-full wp-image-877" style="border: 1px solid #cccccc; padding:5px;" /></p>
<p>WP Greet Box is a wordpress plugin that greets your blog visitors on every post page based on what place they are coming from.<br />
<span id="more-859"></span><br />
<strong>This is how it works</strong>: let`s say a visitor comes from google on one of your blog posts, then the plugin enables a message to be displayed informing the google user to subscribe to the RSS feed to stay updated.</p>
<p><strong>Here is one of the messages for a Google visitor:</strong><br />
<img src="http://designstrike.net/wp-content/uploads/2009/09/Googler.png" alt="Googler" title="Googler" width="608" height="86" class="alignnone size-full wp-image-862" /></p>
<p>There are different types of greeting messages based on the place that the visitor is coming from. For example if a visitor comes from Twitter, the message is asking the visitor if it would like to retweet the post just like in the image below:</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Twitter-WP-Greet.png" alt="Twitter-WP-Greet" title="Twitter-WP-Greet" width="608" height="86" class="alignnone size-full wp-image-866" /></p>
<p>The great thing about the plugin is that it really increase blog exposure and readers, so it`s a new must on my wordpress plugin list.</p>
<h2>Customizing and configuration</h2>
<p>There are plenti of customization options for this plugin. You can disable/enable greeting messages on posts/pages, you can detect the visitor’s search keywords from major search engines and automatically display related posts under the greeting message and many more.</p>
<p><a href="http://omninoggin.com/projects/wordpress-plugins/wp-greet-box-wordpress-plugin/" rel='nofollow'>Here is a list of all the plugin`s features</a></p>
<h2>Also, you can create new greeting messages</h2>
<p>You can personalize your greeting message by creating a new one for any referrer you like just like in the picture below:</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Creat-new-greet.png" alt="Creat-new-greet" title="Creat-new-greet" width="600" height="533" class="alignnone size-full wp-image-871" /></p>
<p>Enough said, just go ahead and <a href="http://wordpress.org/extend/plugins/wp-greet-box/" rel='nofollow'>download the plugin</a>. Also you can find the <a href="http://omninoggin.com/projects/wordpress-plugins/wp-greet-box-wordpress-plugin/" rel='nofollow'>documentation for the plugin</a> on the developer`s page and if you would like to donate a coffe for this amazing plugin just make your way <a href="https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&#038;business=thaya.kareeson@gmail.com&#038;currency_code=USD&#038;amount=&#038;return=&#038;item_name=Donate+a+cup+of+coffee+or+two+for+WP+Greet+Box+plugin." rel='nofollow'>here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/cms-development/how-to-increase-rss-readers-and-social-networking-exposure.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to embed Google Wave inside WordPress</title>
		<link>http://designstrike.net/development/how-to-embed-google-wave-inside-wordpress.html</link>
		<comments>http://designstrike.net/development/how-to-embed-google-wave-inside-wordpress.html#comments</comments>
		<pubDate>Tue, 08 Sep 2009 21:54:24 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[google wave]]></category>
		<category><![CDATA[wordpress wave plugin]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=793</guid>
		<description><![CDATA[Simply as this, Google Wave will redefine the concept of email and world communication]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-embed-google-wave-inside-wordpress.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fhow-to-embed-google-wave-inside-wordpress.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>First off, I was thinking of writing a short tutorial on how to embed Google Wave inside a WordPress blog using a simple developer plugin. Well, then I checked the Google competitors on that actual keyword &#8230;. and I was amazed.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/google-wave.png" alt="google-wave" title="google-wave" width="600" height="235" class="alignnone size-full wp-image-811" /></p>
<p>The Google feature is not even released to the world and already a few smart bloggers wrote about it. This calls for actual thinking ahead of things, and this is how to write stuff. Think ahead of what others will be searching and start writing.<br />
<span id="more-793"></span></p>
<h1>What is that damn Google Wave everyone is talking about?</h1>
<p>Simply as this, Google Wave will redefine the concept of email and world communication. Think of it as this:</p>
<div id="attachment_797" class="wp-caption alignnone" style="width: 630px"><a href="http://designstrike.net/wp-content/uploads/2009/09/Google_Wave_snapshots_inbox1.png" rel='nofollow'><img class="size-large wp-image-797" title="Google_Wave_snapshots_inbox" src="http://designstrike.net/wp-content/uploads/2009/09/Google_Wave_snapshots_inbox-1023x668.png" alt="Google_Wave_snapshots_inbox" width="620" height="404" /></a><p class="wp-caption-text">Click for HD</p></div>
<h2> An this is the Wiki article</h2>
<blockquote><p><em>It is a web based service, computing platform, and communications protocol designed to merge e-mail, instant messaging, wiki, and social networking. It has a strong collaborative and real-time focus supported by extensions that can provide, for example, robust spelling/grammar checking, automated translation between 40 languages, and numerous other extensions.</em>
</p></blockquote>
<h3>OK, I am still going to write about how to embed Google Wave inside WordPress, nonetheless. This is how you can do it.</h3>
<p>Simply go and install <a href="http://wordpress.org/extend/plugins/wavr/" rel='nofollow'>Wavr</a>, a plugin created using the <a href="http://code.google.com/apis/wave/embed/index.html" rel='nofollow'>Google Wave Embed API</a> and it officially works on WordPress. Note that you must have a <a href="http://mashable.com/2009/07/21/google-wave-invites/" rel='nofollow'>Wave developer account</a> for testing purposes. The plugin has a variety of options that you can use like editing the wave&#8217;s colors and more.</p>
<p>The feature is still on the development page so changes will occur, bugs are present and there is nothing much to see.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/v_UyVmITiYQ&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><param name="allowScriptAccess" value="always"></param><embed src="http://www.youtube.com/v/v_UyVmITiYQ&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" allowScriptAccess="always" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/how-to-embed-google-wave-inside-wordpress.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>5 tips on how to get your wordpress theme inside the wordpress theme directory</title>
		<link>http://designstrike.net/development/5-tips-on-how-to-get-your-wordpress-theme-inside-the-wordpress-theme-directory.html</link>
		<comments>http://designstrike.net/development/5-tips-on-how-to-get-your-wordpress-theme-inside-the-wordpress-theme-directory.html#comments</comments>
		<pubDate>Sat, 05 Sep 2009 18:19:47 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Wordpress]]></category>
		<category><![CDATA[developers]]></category>
		<category><![CDATA[theme directory]]></category>
		<category><![CDATA[wordpress theme]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=756</guid>
		<description><![CDATA[Here are some small but effective tips on how to get on the WTD more quickly and with fewer updates.]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2F5-tips-on-how-to-get-your-wordpress-theme-inside-the-wordpress-theme-directory.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2F5-tips-on-how-to-get-your-wordpress-theme-inside-the-wordpress-theme-directory.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>I know quite a few WordPress theme developers that want to share their work freely to the world trough the WordPress theme directory community. Here are some small but effective tips on how to get on the WTD more quickly and with fewer updates.</p>
<p><img src="http://designstrike.net/wp-content/uploads/2009/09/Theme-development-wp-directory.png" alt="Theme-development-wp-directory" title="Theme-development-wp-directory" width="492" height="368" class="alignnone size-full wp-image-757" /></p>
<p>These tips are personally tried out after many theme version rejects. Also it`s a good idea to read  the <a href="http://wordpress.org/extend/themes/about/" rel='nofollow'>theme information page</a> and <a href="http://codex.wordpress.org/Theme_Development_Checklist" rel='nofollow'>theme development checklist</a> before uploading a theme.<br />
<span id="more-756"></span><br />
<strong>Tip #1</strong>. Most of the theme developers make their themes based on sample texts and media. I recommend developing for the actual sample data that the publishers previews themes on the directory. There are a lot of stuff that we can miss like abbr, acronym, pre, code, sub, sup. Simply go, preview a theme, and use firebug to discover those tags that need special attention.</p>
<p><strong>Tip #2</strong>. Keep you functions.php clean and code compliant, note that the directory doesn&#8217;t accept <? starting tags or other stuff that can get messy. Simply revise the code and make shure it`s working perfectly. It could save you a few updates.</p>
<p><strong>Tip #3</strong>. Always keep your CSS and XHTML in order, any discrepancies can make the publisher to request another update of the theme. Note that actual people are reviewing the submission so make your themes for people.</p>
<p><strong>Tip #4</strong>. Don&#8217;t hard code Twitter links, adsense or other type of media or social stuff without including them inside a <a href="http://designstrike.net/wordpress/theme-options-for-a-wordpress-template.html" rel='nofollow'>theme options page</a>. They ask one thing to be fixed at a time so additional theme updates may be needed.</p>
<p><strong>Tip #5</strong>. The most important THING!. If you want to include a link in the footer, please see to what website it leads to. Disable any wordpress affiliate links, paid wordpress theme, spammy content. Your theme WILL be rejected.</p>
<p>I got one theme rejected because the footer link was pointing to a website that &#8220;looked&#8221; spammy, and that was the actual review comment from the publisher.</p>
<p>What I do is include a dummy landing page with a 301 redirect inside the footer (You set up the redirect after the theme has been approved).</p>
]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/5-tips-on-how-to-get-your-wordpress-theme-inside-the-wordpress-theme-directory.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress post related hacks to improve your template</title>
		<link>http://designstrike.net/development/wordpress-post-related-hacks-to-improve-your-template.html</link>
		<comments>http://designstrike.net/development/wordpress-post-related-hacks-to-improve-your-template.html#comments</comments>
		<pubDate>Tue, 01 Sep 2009 05:00:17 +0000</pubDate>
		<dc:creator>Alex</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[hacks]]></category>
		<category><![CDATA[post]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://designstrike.net/?p=721</guid>
		<description><![CDATA[In this article you will find various ways of improving your theme by adding various wordpress post hacks like showing related posts, setting up and showing scheduled posts or showing a featured post]]></description>
			<content:encoded><![CDATA[<div class="tweetmeme_button" style="float: left; margin-right: 10px;">
			<a href="http://api.tweetmeme.com/share?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fwordpress-post-related-hacks-to-improve-your-template.html"><br />
				<img src="http://api.tweetmeme.com/imagebutton.gif?url=http%3A%2F%2Fdesignstrike.net%2Fdevelopment%2Fwordpress-post-related-hacks-to-improve-your-template.html&amp;source=designstrike&amp;style=normal" height="61" width="50" /><br />
			</a>
		</div>
<p>In this article you will find various ways of improving your theme by adding various wordpress post hacks like showing related posts, setting up and showing scheduled posts or showing a featured post. All of these hacks can optimize your wordpress blog by increasing time on site, bounce rate and other SEO issues.<br />
<span id="more-721"></span></p>
<h2>How to show related posts based on keywords</h2>
<p>First up <a href="http://www.neato.co.nz/plugins/UTWfinWP2.zip" rel='nofollow'>Download</a>, install, and activate the &#8220;Ultimate Tag Warrior fin&#8221; plugin. After this open up your <strong>single.php</strong> and before the comments template:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> comments_template<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>insert this code snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;">&lt;div class=&quot;relatedposts&quot;&gt;
&lt;h2&gt;Related Posts&lt;/h2&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> UTW_ShowRelatedPostsForCurrentPost<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;posthtmllist&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;&quot;</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;4&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;&lt;/php&gt;</pre></div></div>

<p>You can set up the number of related posts by increasing the number &#8220;4&#8243;. Save the single.php and refresh your website. The posts will be shown based on the related keywords other posts have. You can also further stylize your snippet by creating a class entry &#8220;relatedposts&#8221; inside your style.css file.</p>
<h2>How to list scheduled posts</h2>
<p>Sometimes, you schedule posts instead of stuffing them all together at one time. This can be useful if you have much to write about and if you want to let your readers know what to expect for the future. This encourages the reader to visit you again and read that great post you scheduled for another day.</p>
<p>Ok, this snippet is easy to install, just paste the following code anywhere inside your theme files that you want the scheduled post to appear:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000088;">$my_query</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> WP_Query<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'post_status=future&amp;order=DESC&amp;showposts=5'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #b1b100;">while</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">have_posts</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000088;">$my_query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">the_post</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
        <span style="color: #000088;">$do_not_duplicate</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$post</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">ID</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
        &lt;li&gt;<span style="color: #000000; font-weight: bold;">&lt;?php</span> the_title<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>&lt;/li&gt;
    <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">endwhile</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<h2>How to show a random featured post</h2>
<p>This hack is useful for a number of reasons like SEO optimization, reader engagement, low bounce rate or having something to show-off. And here is how you can do it:</p>
<p>First you need to <a href="http://wordpress.org/extend/plugins/random-featured-post-plugin/" rel='nofollow'>download this plugin</a>, install and activate it.</p>
<p>Next thing is to open up your index.php file, and right after this tag</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>insert this tag</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> <span style="color: #000000; font-weight: bold;">&lt;?php</span> show_featured_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>You can customize this further by wrapping the tag within a css style like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"> &lt;div style=&quot;padding:10px; border:5px solid #ccc; margin-top:10px;&quot;&gt;
<span style="color: #000000; font-weight: bold;">&lt;?php</span> show_featured_post<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/div&gt;</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://designstrike.net/development/wordpress-post-related-hacks-to-improve-your-template.html/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
