is this going to work
This commit is contained in:
parent
906e85afe3
commit
39634829a9
4 changed files with 16 additions and 2 deletions
|
@ -144,4 +144,15 @@ class Main {
|
|||
|
||||
}
|
||||
|
||||
// Getting news posts
|
||||
public static function getNewsPosts($limit = null) {
|
||||
|
||||
// Get news posts
|
||||
$newsPosts = Database::fetch('news', true, null, ['id', true], ($limit ? [$limit] : null));
|
||||
|
||||
// Return posts
|
||||
return $newsPosts;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class Users {
|
|||
|
||||
}
|
||||
|
||||
// Get all users
|
||||
// Get all groups
|
||||
public static function getAllGroups() {
|
||||
|
||||
// Execute query
|
||||
|
|
|
@ -13,7 +13,9 @@
|
|||
</div>
|
||||
<div class="content-left content-column">
|
||||
<div class="head">News <a href="/news.xml" class="fa fa-rss news-rss default"></a></div>
|
||||
{{ users.1.username }}
|
||||
{% for newsPost in newsPosts %}
|
||||
{% include 'elements/newsPost.tpl' %}
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
|
|
@ -13,6 +13,7 @@ require_once '/var/www/flashii.net/_sakura/sakura.php';
|
|||
$renderData['page'] = [
|
||||
'title' => 'Flashii Dev'
|
||||
];
|
||||
$renderData['newsPosts'] = Main::getNewsPosts(3);
|
||||
|
||||
// Print page contents
|
||||
print Main::$_TPL->render('main/index.tpl', $renderData);
|
||||
|
|
Reference in a new issue