[eluser]yusufdestina[/eluser]
In my view I have this:
Code:
<img src="'.base_url().'serve/thumb/'.$gallery->gallery_id.'/'.$pic->pic_id.'" alt="" title="" />
Then in controller Serve:
Code:
<?php
class Serve extends Controller {
var $img;
function Serve()
{
parent::Controller();
$this->load->model('Gallery_model');
}
function thumb(){
$gid = $this->uri->segment(3);
$pid = $this->uri->segment(4);
$gallery = $this->Gallery_model->get_gallery($gid);
$pic = $this->Gallery_model->getPic($pid,$this->session->userdata('id'));
$this->img = 'gallery/'.$gallery->gallery_dir.'/thumb/'.$pic->pic_link;
if(is_file($this->img)){
Header("Content-Type: image/jpeg");
print file_get_contents($this->img);
}else{
Header("Content-Type: image/jpeg");
print file_get_contents('public/gfx/thumbnotset.jpg');
}
}
}
?>
$this->img is defined and the path to the image is correct, can't figure out what I'm missing here. tnx for ur help.