diff --git a/_sakura/changelog.json b/_sakura/changelog.json index 0466374..e4966dc 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -27,7 +27,9 @@ "20150628", "20150629", "20150630", - "20150701" + "20150701", + "20150702", + "20150703" ] @@ -1407,6 +1409,28 @@ "change": "Added basic API handler." } + ], + + "20150702": [ + + { + "type": "FIX", + "change": "Fixed a mistake in the stylesheet causing the support page to deform when resized." + }, + { + "type": "FIX", + "change": "Made the sitename config variable shown on the title of the suport page instead of just Flashii" + } + + ], + + "20150703": [ + + { + "type": "ADD", + "change": "Add basic example of the version 1 API framework." + } + ] } diff --git a/_sakura/components/Forum.php b/_sakura/components/Forum.php index 90a351e..35b5e94 100644 --- a/_sakura/components/Forum.php +++ b/_sakura/components/Forum.php @@ -16,9 +16,7 @@ class Forum { 'forum_category' => 0, 'forum_type' => 1, 'forum_posts' => 0, - 'forum_topics' => 0, - 'forum_last_post_id' => 0, - 'forum_last_poster_id' => 0 + 'forum_topics' => 0 ]; // Getting the forum list @@ -48,9 +46,14 @@ class Forum { // For link and reg. forum add it to the category $return[$forum['forum_category']]['forums'][$forum['forum_id']] = $forum; + // Get last post in forum + $lastPost = Database::fetch('posts', false, [ + 'forum_id' => [$forum['forum_id'], '='] + ], ['post_id', true]); + // Add last poster data and the details about the post as well $return[$forum['forum_category']]['forums'][$forum['forum_id']]['last_poster'] = [ - 'user' => ($_LAST_POSTER = Users::getUser($forum['forum_last_poster_id'])), + 'user' => ($_LAST_POSTER = Users::getUser($lastPost['poster_id'])), 'rank' => Users::getRank($_LAST_POSTER['rank_main']) ]; @@ -105,8 +108,13 @@ class Forum { // Get the userdata related to last posts foreach($forum['forums'] as $key => $sub) { + // Get last post in forum + $lastPost = Database::fetch('posts', false, [ + 'forum_id' => [$sub['forum_id'], '='] + ], ['post_id', true]); + $forum['forums'][$key]['last_poster'] = [ - 'user' => ($_LAST_POSTER = Users::getUser($sub['forum_last_poster_id'])), + 'user' => ($_LAST_POSTER = Users::getUser($lastPost['poster_id'])), 'rank' => Users::getRank($_LAST_POSTER['rank_main']) ]; @@ -120,8 +128,13 @@ class Forum { // Get the userdata related to first and last posts foreach($forum['topics'] as $key => $topic) { + // Get last post in forum + $firstPost = Database::fetch('posts', false, [ + 'topic_id' => [$topic['topic_id'], '='] + ]); + $forum['topics'][$key]['first_poster'] = [ - 'user' => ($_FIRST_POSTER = Users::getUser($topic['topic_first_poster_id'])), + 'user' => ($_FIRST_POSTER = Users::getUser($firstPost['topic_first_poster_id'])), 'rank' => Users::getRank($_FIRST_POSTER['rank_main']) ]; diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 2e4e424..7c66198 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -584,7 +584,7 @@ class Main { } // Indent JSON - public static function jsonIndent($json) { + public static function jsonPretty($json) { // Defines $tab = ' '; diff --git a/_sakura/sakura.php b/_sakura/sakura.php index f41ef20..02be734 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20150701'); +define('SAKURA_VERSION', '20150703'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_STABLE', false); define('SAKURA_COLOUR', '#6C3082'); diff --git a/_sakura/templates/yuuno/main/support.tpl b/_sakura/templates/yuuno/main/support.tpl index 40446be..07656ec 100644 --- a/_sakura/templates/yuuno/main/support.tpl +++ b/_sakura/templates/yuuno/main/support.tpl @@ -6,7 +6,7 @@ {% endif %}
In order to keep the site, its services and improvements on it going I need money but I'm not that big of a fan of asking for money without giving anything special in return thus Tenshi exists. Tenshi is the name for our supporter rank which gives you access to an extra set of features (which are listed further down on this page). With your help we can keep adding new stuff, get new hardware and keep the site awesome!