August 8, 2012

Current Week No. PHP Function

Current Week No. PHP Function if(!function_exists(‘current_week_no’)) { function current_week_no() { $current_date = date(‘Y-m-d’); $date_part = explode(‘-‘, $current_date); $date_part[2] = ’01’; $start_of_month = implode(‘-‘, $date_part); $day_for_first = date(‘N’, strtotime($start_of_month)); $day_for_month = date(‘j’, strtotime($current_date)); $current_month_current_week = floor(($day_for_first + $day_for_month – 1) / 7) + 1; $last_month = (date(‘m’)-1); $week_limit_of_last_month = $last_month*4; $return = $week_limit_of_last_month+$current_month_current_week; return $return; } […]

June 15, 2012

Codeigniter Error Reporting – Intelligent Fix

Codeigniter Error Reporting – Intelligent Fix Description: This little fix will help you to manage the error reporting automatically that if you ever will go online so error reporting will be disabled and when you will import you database in localhost and development phase will be continued so no headache of changing this ENVIRONMENT constant […]

February 22, 2012

Codeigniter Session not working with IE

Solution in online is: user “native session” class instead of CI_Session class Download (Courtesy of http://codeigniter.com/wiki/Native_session) Details: There are many articles on this issue and many solutions suggest but the problem is the same that codeigniter is using mixture of session and cookies. Sometimes it is suggested that go to internet options and reduce privacy […]

December 8, 2011

PHP Explode, PHP End, File Name, File Extension

PHP Explode, PHP End, File Name, File Extension if ( ! function_exists(‘file_parts’)) { function file_parts($url,$params=’ext’) { if($params==’ext’) { $parts = explode(‘.’,$url); return end($parts); } elseif($params==’name’) { $parts = explode(‘/’,$url); return end($parts); } else { $parts = explode(‘/’,$url); $file_name_ext = explode(‘.’,end($parts)); $file_name = array_pop($file_name_ext); return implode(‘.’,$file_name); } } }

Cufon MouseOver Effect Works!!! With CodeIgniter Helper & JS Function

Cufon MouseOver Effect With CodeIgniter Helper Function This helper function can help in mouseover and mouseout effect when you are using cufon for fonts on web pages. if ( ! function_exists(‘link_hover’)) { function link_hover($title, $class=’anchor’, $tag = ‘span’, $url) { $CI =& get_instance(); $time = time(); $active_url = ‘link_’.$time; $inactive_url = ‘link_’.$time.’_over’; if($tag != ”) […]

December 2, 2011

codeigniter recursive function return problem

codeigniter recursive function return problem If you are stuck too in recursive call of a function and not getting the value as return as expected so be sure about your instances. Because whenever a function being called either independently or recursively so it should be linked to the parent function to which it should report […]