1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63
| <!-------------- menu ------------------>
<div id="menu">
<ul>
<li><a href="http://www.crea-corp.com/index.php" >Accueil</a></li>
<li><a href="http://www.crea-corp.com/index.php/portfolio">Portfolio</a></li>
<li><a href="http://www.crea-corp.com/index.php/news" class="active">Blog</a></li>
<li><a href="http://www.crea-corp.com/index.php/ressources">Ressources</a></li>
<li><a href="http://www.crea-corp.com/index.php/contact">Contact</a></li>
</ul>
</div>
<!-------------- fin menu ------------------>
<!-------------- Contenu ------------------>
<div id="content_second">
<div class="content" class="cb_last">
<?php foreach ($news as $news_item): ?>
<h2><?php echo $news_item['title'] ?></h2>
<p class="news_meta"><?php echo date('d/m/Y H:i', strtotime($news_item['date'])) ; ?></p>
<p align="justify"><?php echo substr($news_item['text'],0,250) ?></p>
<p class="news_meta">
<?php
//On récupère le nombre de commentaires pour un article et on l'affiche
$count = $this->db->select('id')->from('commentaires')->where('news_id',$news_item['id']);
$count = $this->db->count_all_results();
if ($count > 1)
{
echo '('.$count.' commentaires)';
} else
{
echo '('.$count.' commentaire)';
}?>
</p>
<div class="btn_more image_fr"><a href="news/<?php echo $news_item['slug'] ?>">Lire l'article <span>»</span></a></div>
<div class="cleaner"></div>
<?php endforeach ?>
</div>
</div>
<!-------------- fin contenu ------------------>
<!-------------- side bar ------------------>
<div id="sideBar">
<h2>Catégories</h2>
<ul>
<!--On affiche les catégories-->
<?php foreach ($news as $news_item): ?>
<li><a href=""><?php echo $news_item['categories'] ?></a></li>
<?php endforeach ?>
</ul>
</div>
<!-------------- side bar ------------------> |
Partager