This commit is contained in:
Pachira 2015-08-19 01:29:45 +02:00
parent 1d4801f9a8
commit ed8d512977
6 changed files with 39 additions and 2 deletions

View file

@ -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"
}
]

View file

@ -0,0 +1,28 @@
<?php
/*
* Everything you'd ever need from a specific user
*/
namespace Sakura;
class User {
// User data
public $user = [];
private $ranks = [];
// Initialise the user
function __contruct($id) {
// Get the user database row
$this->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, '=']]);
}
}

View file

@ -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';

View file

@ -78,5 +78,4 @@
</script>
{% endif %}
</div>
{% include 'global/footer.tpl' %}

View file

@ -18,7 +18,7 @@
<img src="/a/{{ profile.user.id }}" alt="{{ profile.user.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.is_online %}484{% else %}844{% endif %};" /><br />
{% if profile.user.rank_main > 1 and profile.ban_check|length < 1 %}
<span style="font-size: .8em;">{{ profile.ranktitle }}</span>
<h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px #888; padding: 0 0 2px;">{{ profile.user.username }}</h1>
<h1 style="color: {{ profile.colour }}; text-shadow: 0 0 7px {% if profile.colour != 'inherit' %}{{ profile.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;">{{ profile.user.username }}</h1>
{% if profile.is_premium %}<img src="{{ sakura.content_path }}/images/tenshi.png" alt="Tenshi" /> {% endif %}<img src="{{ sakura.content_path }}/images/flags/{% if profile.user.country|lower == 'eu' %}europeanunion{% else %}{{ profile.user.country|lower }}{% endif %}.png" alt="{{ profile.user.country }}" /> <span style="font-size: .9em; line-height: 11px;">{{ profile.country }}</span>
{% if user.checklogin %}
<div class="user-actions">

View file

@ -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;