$value) { if($name!="page") $pageURL .= $name.'='.$value.'&'; } $total_pages = ($total_articles - ($total_articles %$itemsPerPage)) / $itemsPerPage; if ($total_articles%$itemsPerPage>0) $total_pages+=1; echo 'Page: '; if($page-2>1){ echo anchor($pageURL.'page=1',1);echo ' '; } if($page-3>1){ echo ' .. '; } for($i=$page-2;$i<=$page+2;$i++){ if($i>0&&$i<=$total_pages){ echo anchor($pageURL.'page='.$i,$i).' '; }; } if($page+3<$total_pages){ echo ' .. '; } if($page+2<$total_pages){ echo ' '.anchor($pageURL.'page='.$total_pages,$total_pages); } echo '
'; if($total_articles>0){ echo ($startItem+1).'-'; if ($page*$itemsPerPage>$total_articles) echo $total_articles; else echo ($page*$itemsPerPage); echo ' from '.$total_articles.' article(s)'; } else { echo 'no result found'; } echo ''; }load->library('image_lib'); $newpath = dirname(FCPATH).'/asset/public/articles/images/'.$post['title'].$upload['file_ext']; $config['image_library'] = 'gd2'; $config['source_image'] = $upload['full_path']; $config['new_image'] = $newpath; $config['maintain_ratio'] = TRUE; $config['width'] = 600; $config['height'] = 400; $this->image_lib->initialize($config); if ( ! $this->image_lib->resize()) { echo $this->image_lib->display_errors(); } $newpath_thumb = dirname(FCPATH).'/assets/shop/thumbs/'.$post['title'].$upload['file_ext']; unset($config); $this->image_lib->clear(); $this->make_thumb($upload['full_path']); } function make_thumb($tempimage) { $configthumb['image_library'] = 'gd2'; $configthumb['source_image'] = $tempimage; $configthumb['maintain_ratio'] = TRUE; $configthumb['create_thumb'] = TRUE; $configthumb['thumb_marker'] = "_thumb"; $configthumb['quality'] = '100'; $configthumb['width'] = 120; $configthumb['height'] = 120; $this->image_lib->initialize($configthumb); if ( ! $this->image_lib->resize()) { echo $this->image_lib->display_errors(); } unset($configthumb); } //ddhewitte //create thumbnail image from event function select_thumb_img($id_event){ $CI = get_instance(); $CI->load->model('fotovideo_model'); $img_list = $CI->fotovideo_model->select_thumb_img($id_event); foreach($img_list->result() as $row){ echo ''; } } //check user session menu member function menu_member(){ $CI = get_instance(); $CI->load->library('session'); if($CI->session->userdata('logged_in')) { echo 'My Profile | Logout'; }else{ echo ' Login |Register'; } } function check_login() { $CI = get_instance(); $CI->load->library('session'); if($CI->session->userdata('logged_in')) { return TRUE; }else{ redirect('fotovideo/login'); } } //img kategori function img_kategori($category){ $CI = get_instance(); $CI->load->model('fotovideo_model'); $cat = explode("," , $category); foreach($cat as $row => $val){ $img_cat = $CI->fotovideo_model->get_f_fotovideo_category_by_id($val); $cat_val = $img_cat->row(); if($cat_val){ echo $cat_val->category_name; echo ','; } } } //profile pic function profile_pic($id_user){ $CI = get_instance(); $CI->load->model('fotovideo_model'); $member_detail = $CI->fotovideo_model->get_member_detail_by_id($id_user); if($member_detail->num_rows()>0) $img = $member_detail->row()->profile_picture; else $img = NULL; if(!empty($img)){ echo ''; }else{ echo ''; } } //profile pic function get_user($id_user){ $CI = get_instance(); $CI->load->model('fotovideo_model'); $member_detail = $CI->fotovideo_model->get_member_detail_by_id($id_user); if($member_detail->num_rows()>0) $username = $member_detail->row()->user_name; else $username = 'Anonymous'; echo $username; } //profile pic function participant_pic($id_user){ $CI = get_instance(); $CI->load->model('fotovideo_model'); $img = $CI->fotovideo_model->get_member_detail_by_id($id_user)->row()->chip_user_pic; if(!empty($img)){ echo ''; }else{ echo ''; } } function set_status_nominee_winner($exist){ if($exist == 0){ $stat =' '; }elseif($exist == 1){ $stat =' '; }else{ $stat =' '; } return $stat; } ?>