[eluser]eokorie[/eluser]
Well I am actually trying to set the code up and so far, I am not having much luck. This is what I have so far. Not very sure if I an doing the right thing or doing things the right way.
code in model
Code:
function _display_photo($user, $album_id, $photo_id, $limit='', $offset='')
{
$user = trim($user);
$this->db->select('*');
$this->db->where('id_pho',$photo_id);
$this->db->where('id_usr',$user);
$this->db->where('id_alb',$album_id);
$this->db->limit($limit);
$query = $this->db->get('bp_photos');
if ($query->num_rows() == 1)
{
return $query->row();
} else {
return false;
}
// return $user . " " . $album_id . " " . $photo_id;
}
code in controller
Code:
function photo($user, $album_id, $photo_id, $limit='', $offset='')
{
if ($user)
{
$data = array();
$template_skin = "templates/bamboo";
$limit = 1;
$total = $this->profile_model->get_total_photos($this->uri->segment(2), $this->uri->segment(3));
$offset = $this->uri->segment(4);
$config['base_url'] = base_url().'members/photos/'.$user.'/'.$album_id.'/'.$photo_id;
$config['total_rows'] = $total;
$config['per_page'] = $limit;
$config['uri_segment'] = 4;
$this->pagination->initialize($config);
$data['page_links'] = $this->pagination->create_links();
$data['site_name'] = "Beep CI";
$data['page_title'] = "'s photo";
$data['meta'] = array('description' => 'welcome to codeigniter',
'keywords' => 'welcome, codeigniter, ci',
);
$data['photo'] = $this->profile_model->_display_photo($this->uri->segment(2), $this->uri->segment(3), $this->uri->segment(4), $limit, $offset);
$data['content'] = $this->load->view('display_photo', $data , TRUE);
$this->load->view($template_skin . '/template_inc', $data);
} else {
echo "This member does not exist";
}
code in view file:
Code:
<?php if (!defined('BASEPATH')) exit('No direct script access allowed'); ?>
<h1><?php echo "TEST"; ?></h1>
<?php echo anchor(base_url() .'members/photos/' . $this->uri->segment(2) . '/' . $this->uri->segment(3), '« Return to photos'); ?>
<p> </p>
<p>[ Photo Navigation Links ]</p>
<p><?php echo $page_links; ?></p>
<div class="photo_details" style="width: 620px; margin: 0 auto">
<img style="display:block; position:relative; top:-3px; left:-3px; border:10px solid #ccc;">uri->segment(2) . '/' . $this->uri->segment(3) . '/' . $photo->filename_pho; ?>" alt="photo_<?php echo $photo->id_pho; ?>"/>
<p> </p>
<p>[ Add Photo Details ]</p>
<p>[ Add Rating System ]</p>
<p>[ Add Photo Comment System ]</p>
</div>
When I view the page in he browser, it displays the links but not the way I am hoping they should. I just want to display Next and Previous buttons but at the moment, I am getting
First < 8 9 10.
Is there something I can do to sort this?
Thanks