Originariamente inviato da Ranma2
Non conoscendo cosa fa il tuo script e non vedendo il codice difficile dare una risposta.
Questo è il metodo del controller : il codice lo so può essere ottimizzato ... ma al dilà di questo

Codice PHP:
public function enter($chat_id,$filename) {
            
$this->load->helper('url');
            
$data['chat_id'] = $chat_id;
            
$this->session->set_userdata('chat_id',$chat_id);
            
$data['user_id'] = $this->session->userdata('user_id') ;
            
$user_id$this->session->userdata('user_id') ;
            
$subject $this->chats_model->get_subject_by_chat_id($chat_id);
            
$data['subject'] = $subject;
            
$explodeexplode("-",$subject);
                
/*$this->session->user_data('user_id');*/
            
$language $this->chats_model->get_language_by_chat_id($chat_id);
            
$data['language'] = $language;
            
            
$user_id $this->session->userdata('user_id');
            
$this->users_model->set_current_chat_by_id($user_id,$this->session->userdata('chat_id'));
            if (
$filename == 'false'){
                
$subject trim(end($explode));
                
$path $this->advertisements_model->get_path_by_language_and_subject($language,$subject);
                
$data['title'] = 'Safe Memoirs';
                
$data['error'] = $this->session->userdata('error');
                
$this->load->helper('html');
                
/* src = './uploads/base/image_load.jpg' */
                
$data ['image_properties'] = array('src' => $path,
                        
'alt' => 'Image Max resolution 1024 x 768. 5 Mb. jpeg,.gif,.jpg,.png',
                        
'class' => 'post_images',
                        
'width' => '650',
                        
'height' => '400',
                        
'title' => '1024 x 768. 4,5 Mb. jpeg, gif, png ,jpg',
                        
'rel' => 'lightbox',
                        
'align' => 'center',
                        );
                
$this->chats_model->add_chat_message($chat_id,$user_id,"Hello, I just joined");
                
$this->load->view('templates/header'$data);
                
$this->load->view('pages/chat_view'$data);
                
$this->load->view('templates/footer');
            }else{
                
$data['error'] = '';
                
$config['image_library'] = 'gd2';
                
$config['source_image'] = '/uploads/'.$chat_id.'/'.$filename;
                
$config['create_thumb'] = TRUE;
                
$config['maintain_ratio'] = TRUE;
                
$config['width'] = 200;
                
$config['height'] = 100;
                
$this->load->library('image_lib'$config);
                
$this->image_lib->resize();
                
$this->load->helper('html');
                
$data['title'] = 'Safe Memoirs';
                
$data ['image_properties'] = array(
                           
'src' => 'uploads/'.$chat_id.'/'.$filename,
                           
'alt' => 'Max resolution 1024 x 768, 4,5 Mb , jpeg, gif, jpg, png',
                           
'class' => 'post_images',
                           
'width' => '650',
                           
'height' => '400',
                           
'title' => 'That was quite a night',
                           
'rel' => 'lightbox',
                );
             
$this->load->view('templates/header'$data);
             
$this->load->view('pages/chat_view'$data);
             
$this->load->view('templates/footer');
            }
        }