[eluser]_just_me[/eluser]
Ooops, sorry - was a long night.
Here's the controller
Code:
function index()
{
$this->load->model('data_model');
$this->load->library('pagination');
$config['per_page'] = '2';
$config['base_url'] = base_url().'index.php/music/';
$config['full_tag_open'] = '<p>';
$config['full_tag_close'] = '</p>';
$getAllMusicRow = $this->data_model->getAllMusic($config['per_page'],$this->uri->segment(3));
$getAllGenresRow = $this->data_model->getAllGenres();
$getAllLocationsRow = $this->data_model->getAllLocations();
$getTopMusicRow = $this->data_model->getTopMusic();
$getLatestSixRow = $this->user_model->getLatestSix();
$totalRows = count($getAllMusicRow);
$config['total_rows'] = $totalRows;
$this->pagination->initialize($config);
$data['pagination'] = $this->pagination->create_links();
$data['getAllMusicRow'] = $getAllMusicRow; ;
$this->template->write('pageTitle', 'Music');
$this->template->write_view('leftContent', 'music/music_view', $data);
$this->template->write_view('midContent', 'common/mid_column_one', $data);
$this->template->write_view('rightContent', 'common/right_column_one', $data);
$this->template->render();
}
and here's the pertinent bit from the view:
Code:
<? echo $pagination; ?>
<? if(is_array($getAllMusicRow)) : ?>
<ol>
<? foreach($getAllMusicRow as $row) : ?>
<div class="musicRow">
<li>
<p class="music_name">"<? echo $row->music_name ;?>"</p>
<p class="user_name">by <? echo anchor ('people/profile/'.$row->user_name_url, $row->user_name, 'class="simple"') ?></p>
<p class="location_name">from <? echo anchor ('places/city/'.$row->location_url_name, $row->location_name, 'class="simple"') ?></p>
<p class="genre_name">genre <? echo anchor ('music/genre/'.$row->genre_url_name, $row->genre_name, 'class="simple"') ?></p>
<div class="play">play</div>
<div class="info"><? echo anchor ('music/track/'.$row->music_url_name.'/'.$row->music_id, 'details') ?></div>
</li>
</div>
<? endforeach; ?>
</ol>
<? else : ?>
<h5>There should always be something here, but just in case...</h5>
<? endif; ?>
Thanks,
Matt