diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 64bf8c7..8396d75 100755 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -690,7 +690,7 @@ class Main } // Time elapsed - public static function timeElapsed($timestamp, $append = ' ago', $none = 'Just now') + public static function timeElapsed($timestamp, $append = ' ago', $none = 'Just now', $floor = false) { // Subtract the entered timestamp from the current timestamp @@ -717,7 +717,7 @@ class Main if ($calc >= 1) { // Round the number - $round = round($calc); + $round = floor($calc); // Return the string return $round . ' ' . $times[$secs] . ($round == 1 ? '' : 's') . $append; diff --git a/_sakura/components/Rank.php b/_sakura/components/Rank.php index 457a6cf..795205b 100755 --- a/_sakura/components/Rank.php +++ b/_sakura/components/Rank.php @@ -12,14 +12,23 @@ namespace Sakura; class Rank { // Rank data - private $data = []; + private $data = [ + 'rank_id' => 0, + 'rank_name' => 'Rank', + 'rank_hierarchy' => 0, + 'rank_multiple' => null, + 'rank_hidden' => 1, + 'rank_colour' => '#444', + 'rank_description' => '', + 'rank_title' => '', + ]; // Initialise the rank object public function __construct($rid) { // Get the rank database row - $this->data = Database::fetch( + $getRank = Database::fetch( 'ranks', false, [ @@ -28,9 +37,9 @@ class Rank ); // Check if the rank actually exists - if (empty($this->data)) { + if (!empty($getRank)) { // If not assign as the fallback rank - $this->data = Users::$emptyRank; + $this->data = $getRank; } } diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index b9c043d..292a81b 100755 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -11,18 +11,6 @@ namespace Sakura; */ class Users { - // Empty rank template - public static $emptyRank = [ - 'rank_id' => 0, - 'rank_name' => 'Rank', - 'rank_hierarchy' => 0, - 'rank_multiple' => null, - 'rank_hidden' => 1, - 'rank_colour' => '#444', - 'rank_description' => '', - 'rank_title' => '', - ]; - // Check if a user is logged in public static function checkLogin($uid = null, $sid = null) { diff --git a/_sakura/sakura.php b/_sakura/sakura.php index e5cd8e9..983f594 100755 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20151111'); +define('SAKURA_VERSION', '20151112'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_STABLE', false); @@ -39,8 +39,8 @@ require_once ROOT . '_sakura/components/Permissions.php'; require_once ROOT . '_sakura/components/Session.php'; require_once ROOT . '_sakura/components/User.php'; require_once ROOT . '_sakura/components/Rank.php'; -require_once ROOT . '_sakura/components/Users.php'; //< -require_once ROOT . '_sakura/components/Forums.php'; //< +require_once ROOT . '_sakura/components/Users.php'; +require_once ROOT . '_sakura/components/Forums.php'; require_once ROOT . '_sakura/components/News.php'; require_once ROOT . '_sakura/components/Comments.php'; require_once ROOT . '_sakura/components/Manage.php'; diff --git a/_sakura/templates/yuuno/forum/viewtopic.tpl b/_sakura/templates/yuuno/forum/viewtopic.tpl index 83a568b..1d57a0b 100755 --- a/_sakura/templates/yuuno/forum/viewtopic.tpl +++ b/_sakura/templates/yuuno/forum/viewtopic.tpl @@ -18,17 +18,17 @@ {% endif %}
{% if not post.user.userTitle %}{{ post.rank.title }}{% else %}{{ post.user.userTitle }}{% endif %}
- Tenshi {{ post.user.country.long }} + Tenshi {{ post.user.country.long }} {% if session.checkLogin %}
{% if user.id == post.user.id %} {% elseif not post.user.checkPermission('SITE', 'DEACTIVATED') or post.user.checkPermission('SITE', 'RESTRICTED') %} - {% if post.user.checkFriends(user.id) != 0 %} - + {% if user.isFriends(post.user.id) != 0 %} + {% endif %} - + {% endif %} diff --git a/_sakura/templates/yuuno/main/profile.tpl b/_sakura/templates/yuuno/main/profile.tpl index 603daee..36713e7 100755 --- a/_sakura/templates/yuuno/main/profile.tpl +++ b/_sakura/templates/yuuno/main/profile.tpl @@ -28,7 +28,7 @@ {% if profile.mainRank > 1 and profile.checkBan|length < 1 %} {{ profile.userTitle }}

{{ profile.username }}

- {% if profile.checkPremium[0] %}Tenshi {% endif %}{{ profile.country.short }} {{ profile.country.long }} + {% if profile.isPremium[0] %}Tenshi {% endif %}{{ profile.country.short }} {{ profile.country.long }} {% if session.checkLogin %}