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 [...]
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.
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.
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 …
Comments