Adding a third party class to CodeIgniter library

You can find many php classes at http://www.phpclasses.org/.
This time I’d like to add a new class called BBQQ calendar to library. I know that there is a calendar class for CodeIgniter, but this will show you how simple is to add a third party php class to CI.

Files

Download a zip file from http://www.phpclasses.org/browse/package/5743.html#download. You need to register and sign-in in order to see a download link. Unzip it somewhere in your desktop.
Open calendar.php and replace <?php with the following code at the top and save it as BBQQ_Calendar.php in application/libraries/ directory.

<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

Continue reading Adding a third party class to CodeIgniter library

Testing CodeIgniter Image Manipulation Class

CodeIgniter has a class called Image Manipulation Class. This class enables you to manipulate the followings.
* Image Resizing
* Thumbnail Creation
* Image Cropping
* Image Rotating
* Image Watermarking

I read an artticle at http://d.hatena.ne.jp/dix3/20081021/1224552638 and I translated its notes to English.
This will show you how to use Image Manipulation Class. It covers all the functions and some of preferences in the user guide.
I changed a font, image and some of details from the original article. All the credit goes to the author dix3.

Environment

I am using XAMPP for this and there is no .htaccess file. My application directory is the same level as system directory.

Font

I downloaded a free TTF font called Aller from http://www.fontsquirrel.com/. Unzip it and I saved the font in system/fonts directory.

Image

If you don’t have image directory, then create it as the same level as system and application. I call it img. Add a sample image called photo.png. The size is 700 x 466px, but it does not matter.
Continue reading Testing CodeIgniter Image Manipulation Class

How to solve the problem of a path to css and images in Codeigniter

If you have a problem with linking to your css and images in view file, this may help you.

Firstly you need to check your applications/config/config.php and make it sure you have a proper path in your Base Site URL.

$config['base_url']= “http://127.0.0.1/ci/”;

Then go to your view file and add followings in the [...]

How to use Codeigniter captcha plug-in Part 1

DOWN LOAD FILES

(updated: 2 November 2009)

I have read a note in Codeigniter captcha_pi.php. You can find this file in system/plugins.
However this does not explain well. This post hopefully explains how to use this plugin. And I will show a bit different way in the next post.

I found the following two articles are very helpful and credits should go to them.

http://d.hatena.ne.jp/dix3/20080925 and http://www.blog.valenticabd.com/2008/05/23/captcha-plugin-in-codeigniter.html

The first one is in Japanese. But don’t be disappointed with it. You can find the controll code and view code at the end of the blog. These two have English notes as well.

The first step is following what a note in captcha_pi.php is telling.

Environment

I am using XAMPP for my development.
I freshly installed a codeigniter1.7.2 in hdocs and renamed as ci_captcha.
I have not added a .htaccess file nor moving application out of system folder.

Preparation

captcha folder

You need to create a folder called captcha. I created it in the same level as system folder.
ci_captcha/captcha
When you create captcha images, this is the place where all the images are saved.
Continue reading How to use Codeigniter captcha plug-in Part 1