張惠妹 A-Mei – 心事誰人知
Awesome Hokkien Song by A-mei !!!
Since PHP 5.3 was released to the public, its introduces two new error levels: E_DEPRECATED and E_USER_DEPRECATED.
The E_DEPRECATED error level is used to indicate that a function or feature has been deprecated. The E_USER_DEPRECATED level is intended for indicating deprecated features in user code, similarly to the E_USER_ERROR and E_USER_WARNING levels.
Henceforth, a lot of old PHP 4 functions are being deprecated, superseded by newer functions. Apparently, CodeIgniter 1.7.2 or older faced this irritating notice errors.
You may faced errors like such in the following:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | Deprecated: Assigning the return value of new by reference is deprecated in C:\XXXXX.php on line 130 Deprecated: Assigning the return value of new by reference is deprecated in C:\XXXX.php on line 136 A PHP Error was encountered Severity: 8192 Message: Function set_magic_quotes_runtime() is deprecated Filename: codeigniter/CodeIgniter.php Line Number: 60 A PHP Error was encountered Severity: 8192 Message: Assigning the return value of new by reference is deprecated Filename: libraries/Loader.php Line Number: 255 |
To resolve these issues, just get the latest version of CodeIgniter (still version 1.7.2) from the SVN or re-download it @ the downloads page. Somehow, those deprecated functions were being replaced/fixed.
The original and the perception that this is the only stock paintwork of NSR 150:

No! This is NOT the only one. There is another one too!

However, I have yet to see this stock paintwork in Singapore yet. Maybe Singapore doesn’t import this paintwork of NSR 150. If my memory did not failed me, I saw this paintwork before at some Taiwan and Hong Kong websites.
This is very disappointing despite the sales of NSR 150 in Singapore was very good during the 90s. One old friend of mine even told me that NSR 150 SP was so hot and popular during the 90s such that every car-park has at least two NSR 150! When he was still studying at Singapore Polytechnic during year 2000, there were about 30 ++ NSR 150 in the car-park!
Now on the road, we could still see quite a number of NSR 150 alive. Its reliable engine and low costs maintenance still makes it a popular choice among youths. Even some uncles are still riding it, with the mounting of rack and box! Hope the spirit of NSR does not die!
unlink in CakePHP 1.3 doesn’t seem to work perfectly. You will always receive Warning error (2) due to “No such file or directories”.
Fret not! Allow me to introduce the class File in CakePHP 1.3
Apparently, little documentation, examples or tutorials have surfaced for this File Class. But, we shall make use of this to delete file/directories in CakePHP 1.3
For instance, you would like to delete butterfly.jpg under YOURWEBROOT/img folder. First, you construct a File object:
$file = new File(WWW_ROOT ."/img/butterfly.jpg");
As you can see, we make use of CakePHP WWW_ROOT to define the directory instead of using $this->webroot. This is because the file are store using system directories. By using webroot directories, CakePHP will output “No such file or directories” error again.
Example output of WWW_ROOT: E:\xampp\htdocs\cake13\app\webroot\
Example output of $this->webroot: \cake13\
Last but not least, to delete butterfly.jpg, we do the following:
if($file->delete()){ echo "file deleted successfully"; }else{ echo "file failed to be delete"; }
$file->delete() return true when the file has successfully been deleted. Hence, we check for successions of file deletion using the if statement as shown above.
I hope this tutorial helps !
The newly updated version of CakePHP in version 1.3 packs a punch! It is now more easier to code as the Helper methods are better organized now.
For instance, linking external javascript in CakePHP 1.2 is quite an hassle as Javascript itself has Javascript Helper. However, The Javascript Helper is deprecated in 1.3 and will be removed in future versions of CakePHP. Henceforth, lets look at how HTML Helper load javascript.
In CakePHP 1.2, to load an external javascript, we do this:
<?php echo $javascript->link("jquery", true); ?>
Now in CakePHP 1.3, we can make use of HTML Helper, we do the following:
<?php echo $html->script("jquery"); ?>
Nevertheless, if you have multiple external js file to load, you can load it into an array:
<?php echo $html->script(array('jquery','wysiwyg','scripts')); ?>
Easy and more organized now eh? External CSS files were all along being load using HTML Helper. Now with the loading of Js files through HTML helper instead of invoking Javascript Helper, it is much more convenient! Moreover, you will only need to load one helper which is HTML Helper instead of loading 2.
Recently, got into accident again. My NSR takes much of the damage due to the nature of being a fairing bike (sports bike). As this time round I can’t didn’t claim insurance, all the repair works have to be D-I-Y by me alone.
I noticed from experience that once NSR fairing(s) absorb the damages, caused from the accident, the frame “leg” holding the fairing together tends to get crooked. Rather to buy and waste your precious time looking through Honda Distributor for a new one, might as well you KNOCK it with hammer.
Yes, knocking the frame leg hard enough can get it back to shape. But you can’t expect it to 100% fit the fairings. You need to squeeze before you can really tighten the farings together.
In the mean time, I will go take some pictures of how the frame leg looks like. Do bookmark!
As your wordpress ages on, the archives list is getting longer and longer. This doesn’t look neat and tidy at all. Hence, just replace the following code:
Original:
1 2 3 | <ul> <?php wp_get_archives('type=monthly'); ?> </ul> |
Replace with:
1 2 3 4 | <select name="archive-dropdown" onChange='document.location.href=this.options[this.selectedIndex].value;'> <option value=""><?php echo attribute_escape(__('Select Month')); ?></option> <?php wp_get_archives('type=monthly&format=option&show_post_count=1'); ?> </select> |
Disclaimer :: The original archive code should be written in most wordpress theme. Just replace it and you will get:

For more template tags and regarding archives, do refer to http://codex.wordpress.org/Template_Tags/wp_get_archives