diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 81f9fab..1c7c1ae 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -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; + + } + } diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index e4a31bf..8aa7e26 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -60,7 +60,7 @@ class Users { } - // Get all users + // Get all groups public static function getAllGroups() { // Execute query diff --git a/_sakura/templates/yuuno/main/index.tpl b/_sakura/templates/yuuno/main/index.tpl index 5eb2455..2a3c074 100644 --- a/_sakura/templates/yuuno/main/index.tpl +++ b/_sakura/templates/yuuno/main/index.tpl @@ -13,7 +13,9 @@
diff --git a/main/index.php b/main/index.php index 5f5500a..9a6b82a 100644 --- a/main/index.php +++ b/main/index.php @@ -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);