Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <div class="latestNewsHolder">
- <?php
- $getLatest = $dbw->prepare('SELECT * FROM cms_news WHERE published = "1" ORDER BY id DESC LIMIT 3')->execute();
- $latestTitle = "";
- $latestImage = "ts_generic_23.gif";
- $latestLink = "#";
- if($getLatest->rowCount() < 1)
- {
- // Nothing shows
- }
- else
- {
- $news = $getLatest->fetchAll();
- foreach($news as $n):
- $latestImage = $n['image'];
- $latestTitle = $n['title'];
- $latestLink = "/news.php?aid=".$n['id'];
- ?>
- <div class="newsSeparator col-4">
- <div class="newsImage" style="background: url('/tpl/assets/topstory/<?php echo $latestImage; ?>') center no-repeat; background-size:cover;">
- <div class="latestNewsTitle">
- <a href="<?php echo $latestLink; ?>"><?php echo $latestTitle; ?></a>
- </div>
- </div>
- </div>
- <?php
- endforeach;
- }
- ?>
- </div>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement