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

<channel>
	<title>[ mkhairul.com ] &#187; Tips</title>
	<atom:link href="http://mkhairul.com/category/tips/feed/" rel="self" type="application/rss+xml" />
	<link>http://mkhairul.com</link>
	<description>Musings of a web ninja</description>
	<pubDate>Tue, 06 Jan 2009 09:57:07 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.1</generator>
	<language>en</language>
			<item>
		<title>Adding confirm dialogue box for delete links with jQuery</title>
		<link>http://mkhairul.com/2008/11/15/adding-confirm-dialogue-box-for-delete-links-with-jquery/</link>
		<comments>http://mkhairul.com/2008/11/15/adding-confirm-dialogue-box-for-delete-links-with-jquery/#comments</comments>
		<pubDate>Fri, 14 Nov 2008 17:15:33 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[blog]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=776</guid>
		<description><![CDATA[I use this all the time. Its simple, clean and gracefully degrades. Even though its simple some people might miss it. So I post it here.

$('.delete').click(function(){
    if(!confirm('Are you sure you want to delete?'))
    {
        return false;
    }
})

By returning false [...]]]></description>
			<content:encoded><![CDATA[<p>I use this all the time. Its simple, clean and <a href="http://www.digital-web.com/articles/fluid_thinking/">gracefully degrades</a>. Even though its simple some people might miss it. So I post it here.</p>
<pre class="javascript" name="code">
$('.delete').click(function(){
    if(!confirm('Are you sure you want to delete?'))
    {
        return false;
    }
})
</pre>
<p>By returning false you stop any action from the link (redirecting you to the url)</p>
<p>You can see the demo <a href="http://mkhairul.com/experiments/delete_demo.html">here</a>. </p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/11/15/adding-confirm-dialogue-box-for-delete-links-with-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Debugging an SQL Query</title>
		<link>http://mkhairul.com/2008/11/12/debugging-sql-query/</link>
		<comments>http://mkhairul.com/2008/11/12/debugging-sql-query/#comments</comments>
		<pubDate>Wed, 12 Nov 2008 15:57:26 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Troubleshoot]]></category>

		<category><![CDATA[blog]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=765</guid>
		<description><![CDATA[So, I debugged an error for a good friend recently. Only certain kind of item would be displayed, everything else was not found in the search. The first thing I suspect is the SQL Query. I printed out the SQL Query and tried to debug it.
The first thing I did is to arrange the SQL [...]]]></description>
			<content:encoded><![CDATA[<p>So, I debugged an error for a good friend recently. Only certain kind of item would be displayed, everything else was not found in the search. The first thing I suspect is the SQL Query. I printed out the SQL Query and tried to debug it.</p>
<p>The first thing I did is to arrange the SQL Query in a readable manner.</p>
<div align="center"><a href="http://mkhairul.com/wp-content/uploads/2008/11/debug1.jpg"><img height="288" width="300" class="aligncenter size-medium wp-image-766" title="debug1" src="http://mkhairul.com/wp-content/uploads/2008/11/debug1-300x288.jpg" /></a></div>
<p>Since I do not have the time to follow the trail from the SQL Query manually, I just comment out 3 conditions at a time, and add a condition each time until the item was found. In the above picture, I&#8217;ve found the culprit its the one below the commented out line.</p>
<p>When I commented out the line, the results for the keyword appeared as follow. </p>
<div align="center"><a href="http://mkhairul.com/wp-content/uploads/2008/11/debug2.jpg"><img height="80" width="300" src="http://mkhairul.com/wp-content/uploads/2008/11/debug2-300x80.jpg" title="debug2" class="alignnone size-medium wp-image-767" /></a></div>
<p>So thats the divide and conquer part. So now I know the problem is with the commented out criteria and the one below it. I traced it back to its table (products_to_categories) and found out that the category_id value is empty. Thats why it can&#8217;t join in with the categories table and thus there&#8217;s no result.</p>
<div align="center"><a href="http://mkhairul.com/wp-content/uploads/2008/11/debug3.jpg"><img height="260" width="267" class="alignnone size-medium wp-image-769" title="debug3" src="http://mkhairul.com/wp-content/uploads/2008/11/debug3.jpg" /></a></div>
<p>So what did I do? I told my friend about the problem, explained it to him (I gave him a couple of screenshots to explain the problem) and gives him a solution. <em>UPDATE products_to_categories SET categories_id = xx</em>. So that all the item have a category and will be displayed when it is searched by the application.</p>
<p>Erm, yeah. Thats about it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/11/12/debugging-sql-query/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Retrieve the content of FCKEditor</title>
		<link>http://mkhairul.com/2008/09/10/retrieve-the-content-of-fckeditor/</link>
		<comments>http://mkhairul.com/2008/09/10/retrieve-the-content-of-fckeditor/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 02:34:28 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://mkhairul.com/?p=610</guid>
		<description><![CDATA[Here&#8217;s an interesting problem that I faced few days ago on MyQuotes. I wanted to apply a lightbox kind of preview for the content the user put in. I use FCKEditor for the textarea. I have no idea how to retrieve the contents from the textarea (to put it into the lightbox).
After googling around ( [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an interesting problem that I faced few days ago on <a href="http://mkhairul.com/quotes">MyQuotes</a>. I wanted to apply a lightbox kind of preview for the content the user put in. I use FCKEditor for the textarea. I have no idea how to retrieve the contents from the textarea (to put it into the lightbox).</p>
<p>After googling around ( I forgot the keyword that I used ), I found it, it can be retrieved using FCKEditor&#8217;s API.</p>
<pre name="code" class="javascript">oEditor = FCKeditorAPI.GetInstance('quote'); 	
myValue = oEditor.GetXHTML(oEditor.FormatOutput);
</pre>
<p>The FCKEditor is using BBCode, to minimize abuse (hope it works! LOL). Since I don&#8217;t know how to convert the bbcode values retrieved from the content into HTML tags, I use the next best thing. Send it to be converted and tagged up using jQuery&#8217;s $.post().</p>
<div>
  <a title="MyQuotes Screenshot" href="http://www.flickr.com/photos/25768438@N07/2840776933/"><br />
  <img alt="MyQuotes Screenshot" src="http://farm4.static.flickr.com/3176/2840776933_89f5e4e1ab.jpg" /><br />
  </a>
</div>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/09/10/retrieve-the-content-of-fckeditor/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Focus on first input text in jQuery</title>
		<link>http://mkhairul.com/2008/09/04/focus-on-first-input-text-in-jquery/</link>
		<comments>http://mkhairul.com/2008/09/04/focus-on-first-input-text-in-jquery/#comments</comments>
		<pubDate>Wed, 03 Sep 2008 17:40:46 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[code]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/09/04/focus-on-first-input-text-in-jquery/</guid>
		<description><![CDATA[I&#8217;m doing a little bit of polishing while finishing up some forms. I got this fade-in effect and wants to get the first input text to be focused when the animation ends.

function show_form(formname)
{
    hide_all();
	$('#' + formname).css('opacity', 0).parent().show();
    $('#' + formname).animate({opacity: 1}, 'normal', function(){

		// focus on the first input in [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m doing a little bit of polishing while finishing up some forms. I got this fade-in effect and wants to get the first input text to be focused when the animation ends.</p>
<p><pre name="code" class="javascript">
function show_form(formname)
{
    hide_all();
	$('#' + formname).css('opacity', 0).parent().show();
    $('#' + formname).animate({opacity: 1}, 'normal', function(){

		// focus on the first input in the form
		$('#'+formname+' input:text:first').focus();

		offset = $('#add_new').offset().top;
		$('html, body').animate({
                 scrollTop: offset }, 2000);
	});

    return false;
}
</pre>
</p>
<p>&nbsp;There&#8217;s an additional effect in that function. It&#8217;ll scroll down to the form because there&#8217;s a list above the form, so, it&#8217;ll just scroll right pass it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/09/04/focus-on-first-input-text-in-jquery/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On Estimation&#8230;</title>
		<link>http://mkhairul.com/2008/08/04/on-estimation/</link>
		<comments>http://mkhairul.com/2008/08/04/on-estimation/#comments</comments>
		<pubDate>Mon, 04 Aug 2008 03:56:31 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Notes]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/08/04/on-estimation/</guid>
		<description><![CDATA[Here&#8217;s an entry on the wiki on Estimation. Since we got a few new guys (some are trainee), I thought it might help them. Below is an example of an estimation writeup.

What is Online Trial Exam Form?
A small application to allow users to register (to participate in an online trial exam) and the admin to [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s an entry on the wiki on Estimation. Since we got a few new guys (some are trainee), I thought it might help them. Below is an example of an estimation writeup.<br />
</p>
<p><strong>What is Online Trial Exam Form?</strong></p>
<p>A small application to allow users to register (to participate in an online trial exam) and the admin to process the registrants.<br />
</p>
<p><span style="color: rgb(255, 0, 0);"><strong>Important:</strong></span> <em>If asked to give an estimate on the spot, please, tell them you&#8217;ll comeback later. Take at least 1-2 hours in breaking down tasks and estimation.</em><br />
</p>
<div>
<div align="center">
<a href="http://mkhairul.com/wp-content/uploads/2008/08/estimate.jpg" title="estimate.jpg"><img src="http://mkhairul.com/wp-content/uploads/2008/08/estimate.jpg" alt="estimate.jpg" /></a></div>
</div>
<p></p>
<p>The user (we will use the term <strong>admin</strong> here, the person who request the application) requires the following function (<strong>user requirements</strong>) :</p>
<ul>
<li>The user (potential students) can enter in their information to participate in a trial exam.
<ul>
<li>Get the fields required. Ask which field is mandatory and why if it is not obvious (one of the obvious field is <strong>email</strong>, of course email is mandatory or else how do the system inform the user how to participate in the trial exam). <strong>30 minutes.</strong><br />
</li>
<li>Each registration have a time-frame. i.e. Each day starts from 5am to 5pm. If a user registers on 30th August 2008 @ 5.01pm, it will count as the user registers on 31st August 2008.<strong>1 hour</strong><br />
</li>
</ul>
</li>
<li>The admin can view list of dates (or we can call a <strong>time-frame</strong>, as each day starts from 5am to 5pm, beyond that will spill into the following day&#8217;s date) and total of registration for each date.<strong>30 minutes</strong><br />
</li>
<li>The admin can view list of students in a given date. <strong>30 minutes</strong><br />
</li>
<li>The admin can process a given date.
<ul>
<li>The system will iterate through list of registrant and send an email containing the details required to use the online examination system. <strong>1 hour</strong><br />
</li>
<li>The admin can reprocess a given date (skips users who have been processed). <strong>30 minutes</strong><br />
</li>
</ul>
</li>
</ul>
<p><span id="more-575"></span></p>
<p>Ok thats all I can remember for now. Add it all up, 30 + 60 + 30 + 30 + 60 + 30 = <strong>240 minutes = 4 hours</strong><br />
</p>
<p>Here we will apply the rule <strong>&quot;When estimating a task, take your first estimate, double it, and add 50%.&quot;</strong> Double it to 8 hours, and add 50%, which results in <strong>12 hours</strong>.</p>
<p></p>
<p>I would like to add an additional calculation to this. The number of people required to finish the task. In my case:<br />
</p>
<ul>
<li>
<strong>System Analyst,</strong> 10%</p>
<ul>
<li>The one who requests the system, I have to get his feedback alot.</li>
</ul>
</li>
<li>
<strong>Solution Architect,</strong> 5%</p>
<ul>
<li>Required to sign deployment forms</li>
</ul>
</li>
<li>
<strong>Web Master,</strong> 3%</p>
<ul>
<li>Required to put it into the main website.</li>
</ul>
</li>
<li>
<strong>System Engineer,</strong> 2%</p>
<ul>
<li>Troubleshoot network problem<br />
</li>
</ul>
</li>
</ul>
<p>4 people, each person have a percentage. It depends on the person actually on how fast he does things (or how busy he is). Add it all up, <strong>14 hours and 20 minutes</strong>. This calculation is just a hunch on what I&#8217;ve gone through.<br />
</p>
<p>The estimated time, from building the application to deploying (encountered problems with the server which does not relay certain connections from certain servers), is nearly accurate. Have to collect more information on it.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/08/04/on-estimation/feed/</wfw:commentRss>
		</item>
		<item>
		<title>On forgetting passwords..</title>
		<link>http://mkhairul.com/2008/07/25/on-forgetting-passwords/</link>
		<comments>http://mkhairul.com/2008/07/25/on-forgetting-passwords/#comments</comments>
		<pubDate>Fri, 25 Jul 2008 03:27:59 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/07/25/on-forgetting-passwords/</guid>
		<description><![CDATA[I have lots of web applications that I installed to try out and evaluate. Sometimes I come back to them to look up on some flows that are getting me stumped. And when that time comes, I usually forget the password and all that I can see in the tables is just hashes. All is [...]]]></description>
			<content:encoded><![CDATA[<p>I have lots of web applications that I installed to try out and evaluate. Sometimes I come back to them to look up on some flows that are getting me stumped. And when that time comes, I usually <strong>forget the password</strong> and all that I can see in the tables is just hashes. All is lost? No. There is hope!</p>
<div style="float: right; margin-left: 5px;">
<a href="http://mkhairul.com/wp-content/uploads/2008/07/sc_7-25-2008-112808-am.jpg" title="sc_7-25-2008-112808-am.jpg"><img style="width: 259px; height: 225px;" src="http://mkhairul.com/wp-content/uploads/2008/07/sc_7-25-2008-112808-am.jpg" alt="sc_7-25-2008-112808-am.jpg" /></a>
</div>
<p><strong>So, what to do with the hash?</strong> Most probably your local application is using simple default password. If you still can&#8217;t remember, just head over to <a href="http://gdataonline.com/">GData: An Online MD5 Hash Database</a> and put in your hash and it&#8217;ll retrieve the original string.  Easy.</p>
<p>If the hash is not stored in GData, you could always overwrite the hash by creating your own hash. For me I use PHP, and I use phpinteractive as a shell. Type in the commands for md5 and there it is, the hash. Copy the hash and replace it in the table field. New password!</p>
<p><strong>Be aware that some application uses salt for creating passwords</strong> and you have to know how the password is salted, whether it uses the last 3 characters of the password and some stuff like that.<br /></p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/07/25/on-forgetting-passwords/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to open .docx file in OpenOffice 2.3? (in Windows)</title>
		<link>http://mkhairul.com/2008/06/05/how-to-open-docx-file-in-openoffice-23-in-windows/</link>
		<comments>http://mkhairul.com/2008/06/05/how-to-open-docx-file-in-openoffice-23-in-windows/#comments</comments>
		<pubDate>Thu, 05 Jun 2008 12:28:33 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/06/05/how-to-open-docx-file-in-openoffice-23-in-windows/</guid>
		<description><![CDATA[As I was trying to resume my work, I realized I have a .docx that I needed to open, most of the info is in there. The problem is I don&#8217;t use Microsoft Office, I&#8217;m using OpenOffice 2.3. Googled around a bit and found, Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File [...]]]></description>
			<content:encoded><![CDATA[<p>As I was trying to resume my work, I realized I have a <strong>.docx</strong> that I needed to open, most of the info is in there. The problem is I don&#8217;t use <strong>Microsoft Office</strong>, I&#8217;m using <strong>OpenOffice 2.3</strong>. Googled around a bit and <a href="http://www.oooforum.org/forum/viewtopic.phtml?p=212519&amp;sid=a944484d7defe41418b7191517a1f3ab#212519">found</a>, <a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=941b3470-3ae9-4aee-8f43-c6bb74cd1466&amp;DisplayLang=en"><strong>Microsoft Office Compatibility Pack for Word, Excel, and PowerPoint 2007 File Formats</strong></a>.</p>
<p>Installed it without any problems, there&#8217;s no shortcut or anything to run the program. I double-clicked the .docx file and it runs the Microsoft Open XML Converter and I can save it to .doc format. After saving it, I double-clicked the .doc file and the converter runs again, trying to convert it into another format. </p>
<p>Went to the properties of the file and change the <em>Opens with</em> to OpenOffice Writer. Finally, I can resume my work.</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/06/05/how-to-open-docx-file-in-openoffice-23-in-windows/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Cannot delete folder: Access is denied</title>
		<link>http://mkhairul.com/2008/05/20/cannot-delete-access-is-denied/</link>
		<comments>http://mkhairul.com/2008/05/20/cannot-delete-access-is-denied/#comments</comments>
		<pubDate>Mon, 19 May 2008 23:59:40 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Troubleshoot]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/05/20/cannot-delete-access-is-denied/</guid>
		<description><![CDATA[Ever stumble upon this message while trying to delete a file or a folder?

  Cannot delete folder: Access is denied
  
  Make sure the disk is not full or write-protected and that the file is not currently in use






Most probably you have, and most probably doesn&#8217;t know how to handle this.


There&#8217;s a [...]]]></description>
			<content:encoded><![CDATA[<p>Ever stumble upon this message while trying to delete a file or a folder?</p>
<blockquote><p>
  Cannot delete folder: Access is denied<br />
  <br />
  Make sure the disk is not full or write-protected and that the file is not currently in use
</p></blockquote>
<div>
<div align="center">
<a href="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115311-am.jpg" title="sc_5-15-2008-115311-am.jpg"><img src="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115311-am.jpg" alt="sc_5-15-2008-115311-am.jpg" /></a></div>
</div>
<p></p>
<p>Most probably you have, and most probably doesn&#8217;t know how to handle this.</p>
<p><span id="more-545"></span></p>
<p></p>
<p>There&#8217;s a cool program that I use to solve this problem, called <a href="http://technet.microsoft.com/en-us/sysinternals/bb896653.aspx">Process Explorer</a></p>
<blockquote><p>
Ever wondered which program has a particular file or directory open? Now you can find out. Process Explorer shows you information about which handles and DLLs processes have opened or loaded.
</p></blockquote>
<p>
Once the program is downloaded, run it. At the main interface, click on the Find -> Find Handle or DLL.
</p>
<div>
<div align="center">
<a title="sc_5-15-2008-115633-am.jpg" href="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115633-am.jpg"><img width="400" alt="sc_5-15-2008-115633-am.jpg" src="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115633-am.jpg" /></a></div>
</div>
<p>
Find the folder or file name that you can&#8217;t delete.
</p>
<div>
<div align="center">
<a title="sc_5-15-2008-115656-am.jpg" href="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115656-am.jpg"><img style="width: 419px; height: 228px;" alt="sc_5-15-2008-115656-am.jpg" src="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115656-am.jpg" /></a></div>
</div>
<p>
When the process thats folding your folder or file is found, close it!
</p>
<div>
<div align="center">
<a title="sc_5-15-2008-115731-am.jpg" href="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115731-am.jpg"><img style="width: 451px; height: 289px;" alt="sc_5-15-2008-115731-am.jpg" src="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115731-am.jpg" /></a></div>
</div>
<p></p>
<div>
<div align="center">
<a title="sc_5-15-2008-115744-am.jpg" href="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115744-am.jpg"><img style="width: 447px; height: 57px;" alt="sc_5-15-2008-115744-am.jpg" src="http://mkhairul.com/wp-content/uploads/2008/05/sc_5-15-2008-115744-am.jpg" /></a></div>
</div>
<p>
Now I can delete the folder (or file)! Yeay!</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/05/20/cannot-delete-access-is-denied/feed/</wfw:commentRss>
		</item>
		<item>
		<title>phpMyFAQ, arabic display problem</title>
		<link>http://mkhairul.com/2008/05/14/phpmyfaq-arabic-display-problem/</link>
		<comments>http://mkhairul.com/2008/05/14/phpmyfaq-arabic-display-problem/#comments</comments>
		<pubDate>Wed, 14 May 2008 13:21:49 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/05/14/phpmyfaq-arabic-display-problem/</guid>
		<description><![CDATA[I&#8217;ve been using phpMyFAQ for the past few days. The drawback is the unicode support (which is probably a problem for most PHP application) but everything else is ok and well designed and implemented. I have no trouble going through the code, tinkering with the inner workings and stuffs unlike KOHA (documentation very poor) which [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using <a href="http://www.phpmyfaq.de/">phpMyFAQ</a> for the past few days. The drawback is the unicode support (which is probably a problem for most PHP application) but everything else is ok and well designed and implemented. I have no trouble going through the code, tinkering with the inner workings and stuffs unlike <a href="http://www.koha.org/">KOHA</a> (documentation very poor) which is a horror to go through. Everytime I see KOHA I would like to cry. Or maybe the version we&#8217;re currently using is horrible. </p>
<div style="border: 1px solid rgb(201, 201, 201); padding: 2px; float: right; margin-left: 3px;">
<a href="http://mkhairul.com/wp-content/uploads/2008/05/phpmyfaq2.jpg" title="phpMyFAQ"><img src="http://mkhairul.com/wp-content/uploads/2008/05/phpmyfaq2.jpg" alt="phpMyFAQ" /></a>
</div>
<p>Ok, one of the other drawback is the encoding. I know there&#8217;s lots of languages that they try to support and I have come to learn very well that it is not an easy task. Recently I worked my way around trying to implement English/Arabic content for the system. Seperate CSS for each of the language (English is left to right, Arabic is right to left), to make the layout consistent.</p>
</p>
<p>The rest of the site displays perfectly in arabic (from the language file), but when I insert some content, it displays as html entities representation of the characters instead of the characters itself. I modified (real-time) the content a little bit by using firebug by adding a space (and removing it again), automagically it displays the arabic characters. After a refresh it is back to the entities.</p>
<p>Since this is the first time I&#8217;m handling unicode characters I&#8217;m not very familiar with the functions related to it. I noticed that everything that looks like it requires encoding it is passed to PMF_htmlentities, which runs it through <a href="http://my.php.net/htmlspecialchars">htmlspecialchars</a>. There&#8217;s some data inside that gets run through the function twice which ultimately results in &amp;amp; instead of &amp; needed to display the html entity. Data that doesn&#8217;t display correctly I pass it through <a href="http://my.php.net/html_entity_decode">html_entity_decode</a> which makes it display all the characters correctly.</p>
<p>I still don&#8217;t get it why it doesn&#8217;t display the characters correctly, the html entities printed are all correct. It just doesn&#8217;t display it correctly unless I use html_entity_decode. *shrugs*<br />
I&#8217;d have to investigate this further in order to contribute.</p>
</p>
<p><strong>References for Handling UTF-8 in PHP.</strong></p>
<p><a href="http://www.phpwact.org/php/i18n/utf-8">Handling UTF-8 with PHP</a></p>
<p><a href="http://www.phpwact.org/php/i18n/charsets">Character Sets / Character Encoding Issues</a></p>
</p>
<p><a href="http://www.phpwact.org/php/i18n/charsets#common_problem_areas_with_utf-8">Common Problem Areas with UTF-8</a></p>
<p><a href="http://randomchaos.com/documents/?source=php_and_unicode">How to develop multilingual, Unicode applications with PHP</a></p>
</p>
<p>Can&#8217;t wait for <a href="http://www.ibm.com/developerworks/opensource/library/os-php-future/?S_TACT=105AGX54&amp;S_CMP=B0508&amp;ca=dnw-918">PHP 6</a>, more unicode support! Yeay! </p>
</p></p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/05/14/phpmyfaq-arabic-display-problem/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Useful Applications &#038; Websites</title>
		<link>http://mkhairul.com/2008/04/23/useful-applications-websites/</link>
		<comments>http://mkhairul.com/2008/04/23/useful-applications-websites/#comments</comments>
		<pubDate>Wed, 23 Apr 2008 02:39:44 +0000</pubDate>
		<dc:creator>mkhairul</dc:creator>
		
		<category><![CDATA[Tips]]></category>

		<category><![CDATA[blog]]></category>

		<guid isPermaLink="false">http://mkhairul.com/2008/04/23/useful-applications-websites/</guid>
		<description><![CDATA[I have no idea why the edit timestamp doesn&#8217;t work. I set the date, and when the time past, its still not viewable on the mainpage. The status is on publish. *Shrug* Does it have something to do with a cron?
Moving on here&#8217;s some lists, 100 Useful Open Source Applications and 101 Most Useful Websites. [...]]]></description>
			<content:encoded><![CDATA[<p>I have no idea why the edit timestamp doesn&#8217;t work. I set the date, and when the time past, its still not viewable on the mainpage. The status is on publish. *Shrug* Does it have something to do with a cron?</p>
<p>Moving on here&#8217;s some lists, <a href="http://ubuntulinuxhelp.com/top-100-of-the-best-useful-opensource-applications/">100 Useful Open Source Applications</a> and <a href="http://www.telegraph.co.uk/connected/main.jhtml?xml=/connected/2008/03/30/sv_101websites.xml">101 Most Useful Websites</a>. Ok, not all of those are useful but a good list nonetheless. &nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://mkhairul.com/2008/04/23/useful-applications-websites/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
