[eluser]thinkigniter[/eluser]
Does this help ?
Code:
<?php
function tag() {
//Blogitem gegevens laden
$this->load->model('Show');
$gegevens['query'] = $this->Show->blog_tag();
// what does this first model do?
// Does it retrieve your blogs
$this->load->model('Count');
$gegevens['ctag'] = $this->Count->tag_count();
$this->load->view('blogtag_view', $gegevens);
//Stuur naar view file
}
Code:
<?php
if($ctag == NULL) {
?>
<div class="post">
<div class="post_top">
<div class="post_title"><h2>Oeps!</h2></div>
</div>
<div class="post_body">
<p>Er zijn geen blogs met deze tag gevonden.</p>
</div>
</div>
<?php
} else {
foreach($query as $row):
?>
<div class="post">
<div class="post_top">
<div class="post_title"><h2><?php echo anchor('blog/item/'.$row['id'], $row['titel']);?></h2></div>
<div class="post_date">Gepost op <?php echo date('D - M - Y, H:i:s', $row['datum']);?>, door <b><?php echo $row['poster'];?></b></div>
<div class="post_date">Deze blog heeft <b><?php echo $row['tag'];?></b> als tag</div>
</div>
<div class="post_body">
<p><?=nl2br($row['bericht']);?></p>
</div>
<div class="post_metadata">
<div class="content">
<span class="comment"><a href="#">0 Reacties</a></span>
</div>
</div>
</div>
<?php endforeach;
} ?>
Code:
<?php
class Count extends Model {
function Count() {
parent::Model();
}
function tag_count() {
$this->db->where('tag', $this->uri->segment(3) );
$results = $this->db->query('SELECT * FROM blogs ');
Return $results;
}
}
?>
Let me know of any error messages you get