Skip to content

Instantly share code, notes, and snippets.

View erkattak's full-sized avatar

Erik Straub erkattak

View GitHub Profile
@erkattak
erkattak / JR's CodeIgniter Image Thumb Helper
Created March 2, 2011 19:25
Image thumb helper that keeps the thumbnail once it's created. Must mod Image_lib to account for transparent PNGs.
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
if ( ! function_exists('image_thumb_helper')){
function image_thumb($image_path, $filename, $height, $width){
$filename = preg_replace('/\.png/','_',$filename);
// Get the CodeIgniter super object
$CI =& get_instance();
// Path to image thumbnail
$image_thumb = dirname($image_path) . '/'.$filename . $height . '_' . $width . '.png';
if( ! file_exists($image_thumb)){
// LOAD LIBRARY
<?php
// controller
function wutangclan() {
$this->load->model('odb');
$data['killerbees'] = $this->odb->getThatPaper();
$data['main_content'] = 'report/dashboard'; // main body view, can be whatever
$this->load->view('includes/template', $data);
?>
============