Thaana date formatting for PHP 5

Sunday, May 11. 2008
Here is a PHP 5 class that provides a drop-in function replacement/equivalent for the built-in PHP date() function to output formatted dates in Thaana/Dhivehi. It follows the standard method of writing Gregorian dates in Thaana by using transliterations of the English month names and using the native Dhivehi names for the week days. It accepts all the usual formatting arguments permitted by the original date() function thus allowing the same degree of formatting freedom as the original. The output returned from the function uses ASCII Thaana and, if needed, can then be converted to Unicode/UTF-8 by using the Thaana Conversions class. This class does not support Hijri dates (yet).

The class is being released under the Open Source MIT License.

Functions exposed:
format()
Returns a Dhivehi date string formatted according to the given format string using the given integer timestamp

Usage:
$thaanatoday = Thaana_Date::format('j M Y', time());

Download:
- Thaana_Date.zip (v0.2, 1.4KB)

Drop me a line if you have comments/queries. Enjoy :-)

Thaana conversions class for PHP 5 - v0.2

Wednesday, May 7. 2008
Here is an update to the Thaana conversions class I released in Nov 2007. This new version 0.2 release expands the varieties of conversions available and should be more than adequate for almost all uses. This version, most importantly, adds solid UTF-8 conversion functions allowing for more flexibility in PHP-based Unicode/UTF-8 Thaana handling. Further, the class is now licensed under the pretty liberal Open Source MIT License. The code still relies solely on core PHP 5 functions and does not demand any extra PHP extensions to be installed.

Functions exposed by the class:
- convertUtf8ToUnicodeIntegers()
Convert UTF-8 data to Unicode character integer representations

- convertUtf8ToAscii()
Convert UTF-8 data to Ascii

- convertEntitiesToUnicodeIntegers()
Convert HTML Unicode entitied string to Unicode Integer characters array

- convertEntitiesToUtf8
Convert HTML Unicode entities to UTF-8

- convertEntitiesToAscii()
Convert HTML Unicode entities to Dhivehi Ascii equivalents

- convertUnicodeIntegersToUtf8()
Convert Unicode Integer array to UTF

- convertUnicodeIntegersToEntities()
Convert Unicode char integers to HTML entities

- convertUnicodeIntegersToAscii()
Convert Unicode char integers to Ascii

- convertAsciiToUtf8()
Convert Ascii Thaana to UTf-8

- convertAsciiToUnicodeEntities()
Convert Ascii Thaana to Unicode HTML entities

- convertAsciiToUnicodeIntegers()
Convert Ascii Thaana to an array of Unicode integers

Usage:
<?php
$thaana 
= new Thaana_Conversions();
echo 
$thaana->convertUnicodeToAscii('&#1931;&#1960;&#1928;&#1964;&#1920;&#1960;');
echo 
$thaana->convertAsciiToUnicode('rWacje');
?>

Download:
- Thaana_Conversions.zip (v0.2, 3KB)

Drop me a line if you run into trouble with any of the functionality or have comments/queries. Enjoy :-)

Thaana Unicode<->Ascii conversions PHP class

Monday, November 26. 2007
Here is something that would probably be very handy to Maldivian web developers dabbling with Dhivehi sites. This PHP class addresses the need for converting text to and from Thaana in Ascii and Thaana in Unicode.

The class makes it easy to standardize text into one format irrespective of how it was/is written. This means that you can take text written in Accent, MS Word 97 (and prior) or written using Unicode as featured on recent MS Word editions and use the class to present output in the format of your choice without the need for imposing restrictions on the people who write the text. The class comes in even more handy when you have a form submission that takes input in Unicode but needs to be stored in the database or presented later as Ascii, or vice versa.

The class was something I originally wrote around 2001 and was used in the free Online Document Converter that featured on maldivianunderground.net. I rewrote it for PHP 5 recently for use in a project I am working on. The original class had support for Letin dhivehi -> Unicode/Ascii conversions as well which I haven't included in this release but will add it a future update.

Usage should be pretty straightforward but here is an example just to illustrate:

Example:
<?php
$thaana 
= new Thaana_Conversions();
echo 
$thaana->convertUnicodeToAscii('&#1931;&#1960;&#1928;&#1964;&#1920;&#1960;');
echo 
$thaana->convertAsciiToUnicode('rWacje');
?>


Download:
- Thaana_Conversions.zip (v0.1, 2KB)

Enjoy :-)

Updated: PHP script for Hulhule flight info

Saturday, November 24. 2007
I'm releasing an update to the Hulhule FlightInfo PHP class I released late last year as a response to a feature request I received recently. The update adds support for flight information for all the days as available on the Flight Information Services site rather than the current-day-only mode that the original script supported. A small demo script is packaged in the download to highlight the usage details.

The Hulhule Flight Info class simplifies access to the flight information by doing the dirty work of grabbing the HTML page from the FIS site, parsing it, extracting the required information and making it accessible as a multidimensional array. It supports grabbing both the arrival and departure information and is easy to use. It has since been integrated into a few sites by different people.

- Download the flightinfo class v0.2

Enjoy :-)

Blobsy 2 RC 8 released

Tuesday, June 6. 2006
Blobsy 2 just had another release checked out today. This latest release - Blobsy 2 RC8 - is, as usual, available at the Blobsy website.

I've fixed a few bugs in this latest release that hindered optimal performance and a few more that prevented desired functionality - including one that prevented the bot from starting conversations by itself. I have also updated the included Demo handler and added another handler to demonstrate the conversation starting abilities more clearly. This has been something that users have been whining for quite a while. Good that I got around to doing this finally :-P

Microsoft has recently allowed bots on its network. It is even running a bot development competition called Invasion of the Robots. They are offering cool cash prizes for the best bots. This is probably a move to promote the new Live Messenger series.

Anyway, I intend on updating Blobsy to the functionality introduced/updated in Windows Live Messenger. Blobsy will be updated/rewritten to be compatible with MSN P13, the communications protocol used by Live Messenger. The rewrite will probably see day light as Blobsy 3 sometime next month.