PinoyTech.org

CodeIgniter, Kohana, Mootools, jQuery and CSS

The Right Way to Get a File Extension in PHP

Posted by teejay on November 29, 2009

I made a recent search on retrieving file extensions in PHP.

I found out that a lot have been re-inventing the wheel. They have been creating code for functionality that PHP already has. This is one example of re-inventing the wheel

function get_file_extension($file_name) 
{
    return substr(strrchr($file_name,'.'),1);
}

Another example was this:

function file_extension($filename)
{
    return end(explode(".", $filename));
}

PHP already has a function that does the same thing and more.

How to Disable Image Caching

Posted by teejay on November 28, 2009

Browser caching is useful. It lets you load pages faster by storing cache-able files on your computer. If you have a slower internet connection, this will most likely be helpful to you.

However, the problem arises if you a programmer that needs images to be fresh. I've recently creating a image manipulation program and needed to the images NOT to cache. Here's a trick to do this:

PHP Delete Function

Posted by teejay on November 28, 2009

There is actually no delete function in PHP. However, there is a PHP function that does the function of a delete if there was one.

Welcome unlink, the PHP delete function.

PHP Unlink function usage

unlink('/uploads/my_photo.gif');

Check One Check All Using jQuery

Posted by teejay on November 25, 2009

an image of a table with checkboxes

Today, we will be writing a jQuery Example of our Check One Check All functionality using Mootools

Check One Check All Using Mootools

Posted by teejay on November 24, 2009

an image of a table with checkboxes

Imagine going through a 25 item per page application and you need to check them all. Wouldn't it be a good thing if you have the functionality of a check one/check all for checking all those checkboxes? If yes, you would agree that this should be on every appropriate web application.

Online Tools For Choosing Color Schemes

Posted by teejay on November 18, 2009

I feel the need to share Online tools for choosing color schemes due to the my need for color-management tools.

Color Scheme Designer

colorschemedesigner.gif

Color Scheme Designer is a beautiful application that helps you create your own color scheme in a matter of minutes.

Mootools Tabs Classes You Should Know About

Posted by teejay on November 18, 2009

I've been playing around with Mootools again and was looking into working with some tabbed content. A little research comes a long way as I discovered new Mootools-based tabs.

MGFX Tabs

Usage


<ul id="tabs">
    <li><a class="tab" href="#" id="one">One</a></li>
    <li><a class="tab" href="#" id="two">Two</a></li>
    <li><a class="tab" href="#" id="three">Three</a></li>
</ul>
<div id="home">
    <div class="feature">
        <img src="img/mgfxtabs1.jpg" alt="" />
    </div>
    <div class="feature"">
        <img src="img/mgfxtabs2.jpg" alt="" />
    </div>
    <div class="feature">
        <img src="img/mgfxtabs3.jpg" alt="" />
    </div>
</div>
// Javascript
var tabs = new MGFX.Tabs('#tabs li a', '#tabs div');

Add Icons to External Links with Mootools and CSS

Posted by teejay on November 17, 2009

A trend going on around on websites are putting icons on links that point to web pages externally. If you want that on your site, this simple script will dynamically take care of that for you with the help of Mootools, a compact Javascript Framework and some CSS.