ANIL KUMAR PANIGRAHI 's Blog

File for ‘CodeIgniter’ Category

Codeigniter multi language support using google translate API

Posted by: Anil Kumar Panigrahi in: ● May 29, 2010

Hi friends,
This is  my own contribution in Codeigniter framework. With using google translate API it is developed.  Mainly 2 advantage are there using this contribution.

Uses of this contribution:

1) No Need to maintain all text in different languages in our application.

Clarification: In the multilingual support sites – we have text in
English language. If we want [...]

Create thumbnail images in codeIgniter

Posted by: Anil Kumar Panigrahi in: ● January 22, 2010

In the following function will create thumbnails in codeigniter.
function _createThumbnail($fileName) {
$config['image_library'] = ‘gd2′;
$config['source_image'] = ‘uploads/’ . $fileName;
$config['create_thumb'] = TRUE;
$config['maintain_ratio'] = TRUE;
$config['width'] = 75;
$config['height'] = 75;
$this->load->library(‘image_lib’, $config);
if(!$this->image_lib->resize()) echo $this->image_lib->display_errors();
}
Call the above function like :
$this->_createThumbnail($fInfo['file_name']);
After creation of thumbnail clear the caches.
$this->image_lib->clear();
Hope that it will be useful.

How to set the pagination in CodeIgniter?

Posted by: Anil Kumar Panigrahi in: ● September 3, 2009

See the code below: to set the pagination in CodeIgniter
In the controller: add the below code
$this->load->library(‘pagination’);
$config['total_rows'] = $this->db->count_all(‘code_image’);
$config['per_page'] = ‘3′;
$config['full_tag_open'] = ‘<p>’;
$config['full_tag_close'] = ‘</p>’;
$config['base_url'] = base_url().’upload/list_images/’;
$this->pagination->initialize($config);
//echo base_url();
$this->load->model(‘code_image’);
$data['images'] = $this->code_image->get_images($config['per_page'],$this->uri->segment(3));
In the View: add the below code

<?php echo $this->pagination->create_links(); ?>

It will only display the 3 images per page.

How to configure the baseurl in CodeIgniter

Posted by: Anil Kumar Panigrahi in: ● September 3, 2009

See the code:
In the application\config\ in that folder we have list of files., in that we have to modify the file is config.php

$config['base_url'] = “http://localhost/CodeIgniter/”;

and helpers :
appication \ config\ autoload.php file we have to modify.

$autoload['libraries'] = array();
to
$autoload['libraries'] = array(‘database’, ’session’);
$autoload['helper'] = array(‘form’, ‘url’);

Hope that it will be useful …


About Me

  Anil Kumar Panigrahi
  Software Engineer (PHP)
  Blogger & Founder of Anil Labs
  Baruva, India

You can share with me . . .

My Own Contributions

1) First contribution for codeigniter framework ( multi language support using google translate API ). we can get files from http://github.com/nyros/codeigniter_multilanguage


2) Audio and Video Streaming using FFMpeg and PHP -complete doc file : http://www.docstoc.com/docs/8300349/Audio-and-Video-Streaming

Twitter Updates

Follow me @anil2u
  • We will always be thankful to our teacher for all the hard work and efforts they have put in, for educating us.- Happy teachers Day . . . :) - posted on 05/09/2010 05:39:13
  • Working on shipping cost functionality (UPS and USPS) for oscommerce shopping cart - posted on 01/09/2010 09:40:03
  • If your freedom hurts others, you are not free. You must not hurt others. - Vivekananda - posted on 31/08/2010 06:02:49
  • Another day starts with full of energy . Good Morning - posted on 31/08/2010 02:54:12
  • Nice explanation about php oops concept : http://youropensource.com/projects/182-OOPS-Concepts-in-PHP - posted on 30/08/2010 19:56:17