From ed8d51297788f7c19d5b6d6664901172629edac1 Mon Sep 17 00:00:00 2001 From: flashwave Date: Wed, 19 Aug 2015 01:29:45 +0200 Subject: [PATCH] laptop --- _sakura/changelog.json | 5 +++++ _sakura/components/User.php | 28 ++++++++++++++++++++++++ _sakura/sakura.php | 1 + _sakura/templates/yuuno/main/news.tpl | 1 - _sakura/templates/yuuno/main/profile.tpl | 2 +- main/index.php | 4 ++++ 6 files changed, 39 insertions(+), 2 deletions(-) create mode 100644 _sakura/components/User.php diff --git a/_sakura/changelog.json b/_sakura/changelog.json index ae7aef4..80b29bb 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -2025,6 +2025,11 @@ "type": "FIX", "change": "Fixed urls in Misaki.", "user": "Flashwave" + }, + { + "type": "ADD", + "change": "Add username shadow based on the user's username colour.", + "user": "Flashwave" } ] diff --git a/_sakura/components/User.php b/_sakura/components/User.php new file mode 100644 index 0000000..96cdb8b --- /dev/null +++ b/_sakura/components/User.php @@ -0,0 +1,28 @@ +user = Database::fetch('users', false, ['id' => [$id, '=']]); + + // Decode the ranks json array + $ranks = json_decode($this->user['ranks'], true); + + // Get the rows for all the ranks + $this->ranks[] = Database::fetch('ranks', false, ['id' => [$id, '=']]); + + } + +} diff --git a/_sakura/sakura.php b/_sakura/sakura.php index 36a177a..1a47efc 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -31,6 +31,7 @@ require_once ROOT .'_sakura/components/Database.php'; require_once ROOT .'_sakura/components/Templates.php'; require_once ROOT .'_sakura/components/Permissions.php'; require_once ROOT .'_sakura/components/Sessions.php'; +require_once ROOT .'_sakura/components/User.php'; require_once ROOT .'_sakura/components/Users.php'; require_once ROOT .'_sakura/components/Forum.php'; require_once ROOT .'_sakura/components/Manage.php'; diff --git a/_sakura/templates/yuuno/main/news.tpl b/_sakura/templates/yuuno/main/news.tpl index 68b48a5..6e811dd 100644 --- a/_sakura/templates/yuuno/main/news.tpl +++ b/_sakura/templates/yuuno/main/news.tpl @@ -78,5 +78,4 @@ {% endif %} - {% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/main/profile.tpl b/_sakura/templates/yuuno/main/profile.tpl index 58c79d3..2710f9f 100644 --- a/_sakura/templates/yuuno/main/profile.tpl +++ b/_sakura/templates/yuuno/main/profile.tpl @@ -18,7 +18,7 @@ {{ profile.user.username }}'s Avatar
{% if profile.user.rank_main > 1 and profile.ban_check|length < 1 %} {{ profile.ranktitle }} -

{{ profile.user.username }}

+

{{ profile.user.username }}

{% if profile.is_premium %}Tenshi {% endif %}{{ profile.user.country }} {{ profile.country }} {% if user.checklogin %}
diff --git a/main/index.php b/main/index.php index 5f3712b..f8eb64a 100644 --- a/main/index.php +++ b/main/index.php @@ -9,6 +9,10 @@ namespace Sakura; // Include components require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php'; +$meow = new User(2); + +print_r($meow->user); + // Are we in forum mode? $forumMode = isset($_GET['forums']) ? ($_GET['forums'] == true) : false;