<?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>RAGARD &#187; Tutorials</title>
	<atom:link href="http://www.ragard-jp.com/tutorials/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ragard-jp.com</link>
	<description>Simple Themes &#38; Tutorials</description>
	<lastBuildDate>Sat, 04 Jul 2009 06:25:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Useful .htaccess Tricks for Webmasters</title>
		<link>http://www.ragard-jp.com/tutorials/useful-htaccess-tricks-for-webmasters/</link>
		<comments>http://www.ragard-jp.com/tutorials/useful-htaccess-tricks-for-webmasters/#comments</comments>
		<pubDate>Mon, 15 Sep 2008 16:42:24 +0000</pubDate>
		<dc:creator>ne-design</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[.htaccess]]></category>

		<guid isPermaLink="false">http://www.ragard-jp.com/?p=157</guid>
		<description><![CDATA[I just did a little google search and found a lot of  .htaccess tricks that you might want to use for your websites. Those who are new to .htaccess Password Robot Blog has a good quick introduction. There&#8217;s also a online .htaccess editor that can be useful available in English, French, Spanish, Chinese and [...]]]></description>
			<content:encoded><![CDATA[<p>I just did a little google search and found a lot of  .htaccess tricks that you might want to use for your websites. Those who are new to .htaccess <a href="http://passwordrobot.com/blog">Password Robot Blog</a> has a good <a href="http://passwordrobot.com/blog/a-quick-introduction-to-htaccess/">quick introduction</a>. There&#8217;s also a <a href="http://www.htaccesseditor.com/en.shtml">online .htaccess editor</a> that can be useful available in English, French, Spanish, Chinese and more.<span id="more-157"></span></p>
<p>Don&#8217;t forget that if you or the person you know is working on the server has a root access to the server you could do the same thing without using .htaccess, which is recommended.</p>
<h4>Custom 404 Error Pages</h4>
<p>Whenever your visitors access to the page on your site that doesn&#8217;t exist, they get an error saying &#8220;Page Cannot be Found&#8221; which is not user-friendly. Here&#8217;s a sample on how to use your custom page:</p>
<pre name="code" class="xml">
ErrorDocument 404 /404.html
</pre>
<p>You could make it like this too:</p>
<pre name="code" class="xml">
ErrorDocument 404 http://www.ragard-jp.com/404.html
</pre>
<p>Need some ideas on how to design a 404 error pages? <a href="http://www.smashingmagazine.com/">Smashing Magazine</a> has some <a href="http://www.smashingmagazine.com/2007/07/25/wanted-your-404-error-pages/">smashing 404 error pages</a> listed.</p>
<h4>Redirect Visitors</h4>
<p>Sometimes you don&#8217;t want your visitors to see you working on the website. Instead you would like to show them a page telling that you are updating or still under construction. Here&#8217;s the code that can let you do that:</p>
<pre name="code" class="xml">
order deny,allow
deny from all
allow from 123.456.789.101

ErrorDocument 403 /update.html

<Files update.html>
allow from all
</Files>
</pre>
<p>Make sure to change <strong>123.456.789.101</strong> to your IP address and change <strong>update.html</strong> to the file name you would like to display to your visitors.</p>
<h4>Change Home Directory</h4>
<p>Usually when visitors types in the url to your site, by default they will land on index.html, index.php, or index.htm. You could actually change the file you would like to display:</p>
<pre name="code" class="xml">
DirectoryIndex new.html
</pre>
<p>Change <strong>new.html</strong> to any file you would like to have as your home directory.</p>
<h4>Prevent Directory Browsing</h4>
<p>When you don&#8217;t have any index pages in your directory, visitors can easily see what you have inside. To prevent this you could simply make a blank index.html on every single directory or just set up using .htaccess:</p>
<pre name="code" class="xml">
Options All -Indexes
</pre>
<h4>Protecting Data Files</h4>
<p>If your using a script that saves data or log you need to make sure that it is secured. If you have information about your customers, people can download the data or log file by just accessing  from the browser. You can protect it easily:</p>
<pre name="code" class="xml">
<Files ~ "\.(dat|log|csv)$">
deny from all
</Files>
</pre>
<p>Not to worry, your cgi or php can access the data files like before.</p>
<h4>Force To Download Files</h4>
<p>Have you ever had a problem visitors streaming your media files instead of downloading? With this code you can force your visitors to download even when they left click. Just try it and you will see how sweet this is:</p>
<pre name="code" class="xml">
AddType application/octet-stream .avi
AddType application/octet-stream .mpg
AddType application/octet-stream .mov
AddType application/octet-stream .mp3
AddType application/octet-stream .wma
AddType application/octet-stream .pdf
</pre>
<p>It even works for pdf files!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ragard-jp.com/tutorials/useful-htaccess-tricks-for-webmasters/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>PHP Tricks for Non-Programmer</title>
		<link>http://www.ragard-jp.com/tutorials/php-tricks-for-non-programmer/</link>
		<comments>http://www.ragard-jp.com/tutorials/php-tricks-for-non-programmer/#comments</comments>
		<pubDate>Wed, 20 Aug 2008 03:13:23 +0000</pubDate>
		<dc:creator>ne-design</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.ragard-jp.com/?p=54</guid>
		<description><![CDATA[There are several PHP tricks you can use easily on your websites. I do recommend reading Jeffery Way&#8217;s &#8220;Learn PHP from Scratch: A Training Regimen&#8221; at NETUTS. These tricks will make it easy for you to maintain your website. If you have used a CMS like WordPress before this might be nothing new.
Automatic Copyrights
Most of [...]]]></description>
			<content:encoded><![CDATA[<p>There are several PHP tricks you can use easily on your websites. I do recommend reading Jeffery Way&#8217;s &#8220;<a href="http://nettuts.com/php/learn-php-from-scratch-a-training-regimen/">Learn PHP from Scratch: A Training Regimen</a>&#8221; at <a href="http://nettuts.com/">NETUTS</a>. These tricks will make it easy for you to maintain your website. If you have used a CMS like WordPress before this might be nothing new.<span id="more-54"></span></p>
<h4>Automatic Copyrights</h4>
<p>Most of us have our copyrights on the bottom with the year labeled. Let&#8217;s make this year label dynamic so you don&#8217;t have to keep on changing it every year.</p>
<pre name="code" class="php">©  &lt;?php echo date(&#39;Y&#39;); ?&gt; RAGARD. All Rights Reserved.</pre>
<p>Pretty simple. Basically date(&#8217;Y') prints out the year in 4 digit. The outcome would be like:</p>
<p><strong>© 2008 RAGARD. All Rights Reserved.</strong></p>
<h4>Easy Template</h4>
<p>You don&#8217;t want to keep changing each file when you have a common header, sidebar or footer. Let&#8217;s make it a template so we don&#8217;t have to go over every single page to change a menu.</p>
<p>First, let&#8217;s start off cutting out the common part and make a new file. In this example we will use the heading as our common part.</p>
<pre name="code" class="php">
&lt;!DOCTYPE html PUBLIC &quot;-//W3C//DTD XHTML 1.0 Transitional//EN&quot; &quot;http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd&quot;&gt;
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; dir=&quot;ltr&quot; lang=&quot;en-US&quot;&gt;
&lt;head profile=&quot;http://gmpg.org/xfn/11&quot;&gt;

&lt;title&gt;Site Title&lt;/title&gt;

&lt;div id=&quot;header&quot;&gt;
&lt;h1&gt;Site Title&lt;/h1&gt;
&lt;ul id=&quot;menu&quot;&gt;
	&lt;li&gt;&lt;a href=&quot;/&quot;&gt;Home&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/about/&quot;&gt;About&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;&lt;a href=&quot;/contact/&quot;&gt;Contact&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;</pre>
<p>We will save this file as <strong>header.php</strong>. Next we write this php script on the page where the header will be needed.</p>
<pre name="code" class="php">&lt;?php include(&#39;header.php&#39;); ?&gt;</pre>
<p>You&#8217;re done! Same thing will apply for sidebar, footer and any other parts you have in common.</p>
<h4>Manage Information in One File</h4>
<p>Sometimes you might have a same kind of information in a different parts or pages. Some example could be like e-mail address, phone number, address and name. Have you ever thought having these information in one file to make changes easier?</p>
<p>Start making a file name <strong>information.php</strong> with the php script like this:</p>
<pre name="code" class="php">&lt;?php
$name = &#39;ne-design&#39;;
$tel = &#39;(000) 000-0000&#39;;
$email = &#39;sample@ragard-jp.com&#39;;
?&gt;</pre>
<p>Now that we have some information we could use, insert the following code on every page you might use this information.</p>
<pre name="code" class="php">&lt;?php include(&#39;information.php&#39;); ?&gt;</pre>
<p>Everything is now ready to go. All we need is to write a script to echo the information. Here&#8217;s the sample of echo.</p>
<pre name="code" class="php">&lt;?php echo $email; ?&gt;</pre>
<p>From now on you will just need to change your <strong>information.php</strong> to change your e-mail. This is actually the basic of how PHP works.</p>
<h4>Example</h4>
<p>Some people were getting confused on how the echo would be used. In this example, you will see the purpose for echo is to tell where you want the certain information to be displayed. Instead of writing <strong>ne-design</strong>, I would write <strong>&lt;?php echo $name; ?&gt;</strong>.</p>
<p>Here is an example of my index.php:</p>
<pre name="code" class="php">
&lt;?php include(&#39;information.php&#39;); ?&gt;

&lt;p&gt;Hi my name is &lt;?php echo $name; ?&gt;!&lt;br /&gt;
Need any help? You could contact me by calling &lt;?php echo $tel; ?&gt; or email me to &lt;?php echo $email; ?&gt;.&lt;/p&gt;
</pre>
<p>The outcome for this would be:</p>
<pre name="code" class="php">
&lt;p&gt;Hi my name is ne-design!&lt;br /&gt;
Need any help? You could contact me by calling (000) 000-0000 or email me to sample@ragard-jp.com.&lt;/p&gt;
</pre>
<p>I will be revising this php trick post to help you guys.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ragard-jp.com/tutorials/php-tricks-for-non-programmer/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Localize WordPress Theme</title>
		<link>http://www.ragard-jp.com/tutorials/localize-wordpress-theme/</link>
		<comments>http://www.ragard-jp.com/tutorials/localize-wordpress-theme/#comments</comments>
		<pubDate>Wed, 07 May 2008 04:43:04 +0000</pubDate>
		<dc:creator>ne-design</dc:creator>
				<category><![CDATA[Tutorials]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://www.ragard-jp.com/?p=7</guid>
		<description><![CDATA[Did you ever wanted to have the WordPress theme you liked to be in your language? or did you ever wanted to make a theme that is available for translation? In this tutorial I will cover on how to make any WordPress themes to be localized.
You will need to know a little about php to [...]]]></description>
			<content:encoded><![CDATA[<p>Did you ever wanted to have the WordPress theme you liked to be in your language? or did you ever wanted to make a theme that is available for translation? In this tutorial I will cover on how to make any WordPress themes to be localized.</p>
<p>You will need to know a little about php to understand this tutorial. Just the basic would be fine.<span id="more-7"></span></p>
<h4>Step 1 &#8211; Choose a domain</h4>
<p>This would be the name for your translation. Usually I use the theme name as a domain. In this tutorial I will use my theme &#8220;Vanilla Globe&#8221; as in example. So the domain would be &#8220;vanillaglobe&#8221;.</p>
<h4>Step 2 &#8211; Replace text with function</h4>
<p>Inside the themes you will see text like</p>
<pre name="code" class="html">
<h2>404 Error: Not Found</h2>
</pre>
<p>change the text into a function like this</p>
<pre name="code" class="php">&lt;h2&gt;&lt;?php _e('404 Error: Not Found','vanillaglobe'); ?&gt;&lt;/h2&gt;</pre>
<p>As you can see you will need to replace the text that you would like to translate with the function </p>
<pre name="code" class="php">&lt;?php _e('text','domain'); ?&gt;</pre>
<h4>Step 3 &#8211; Add __</h4>
<p>Not only text, you would also want to have some parameters within the template tag to be translated. Example would be like</p>
<pre name="code" class="php">&lt;?php the_content('Read more...'); ?&gt;</pre>
<p>add __ and the domain</p>
<pre name="code" class="php">&lt;?php the_content(__('Read more...','vanillaglobe')); ?&gt;</pre>
<p>if there is more then one parameter, sample would be like this</p>
<pre name="code" class="php">&lt;?php comments_number(__('No Responses','vanillaglobe'), __('One Response','vanillaglobe'), __('% Responses','vanillaglobe'));?&gt;</pre>
<h4>Step 4 &#8211; Include the function</h4>
<p>Open the header.php and at the very top include the code below</p>
<pre name="code" class="php">&lt;?php load_theme_textdomain ('vanillaglobe'); ?&gt;</pre>
<p>This code is needed for WordPress to understand to use the language file that is inside the theme folder.</p>
<h4>Step 5 &#8211; Build .po and .mo</h4>
<p>Lastly, build the translation file in your language! You can look <a href="http://weblogtoolscollection.com/archives/2007/08/27/localizing-a-wordpress-plugin-using-poedit/">here</a> to learn how to translate using <a href="http://sourceforge.net/projects/poedit/">poEdit</a>. Make sure you have the files inside <em>wp-content/themes/themename/</em>. The name of the file should be the <a href="http://codex.wordpress.org/Localization">name of the language</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ragard-jp.com/tutorials/localize-wordpress-theme/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
