laptop
This commit is contained in:
parent
1d4801f9a8
commit
ed8d512977
6 changed files with 39 additions and 2 deletions
|
@ -2025,6 +2025,11 @@
|
||||||
"type": "FIX",
|
"type": "FIX",
|
||||||
"change": "Fixed urls in Misaki.",
|
"change": "Fixed urls in Misaki.",
|
||||||
"user": "Flashwave"
|
"user": "Flashwave"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "ADD",
|
||||||
|
"change": "Add username shadow based on the user's username colour.",
|
||||||
|
"user": "Flashwave"
|
||||||
}
|
}
|
||||||
|
|
||||||
]
|
]
|
||||||
|
|
28
_sakura/components/User.php
Normal file
28
_sakura/components/User.php
Normal 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, '=']]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -31,6 +31,7 @@ require_once ROOT .'_sakura/components/Database.php';
|
||||||
require_once ROOT .'_sakura/components/Templates.php';
|
require_once ROOT .'_sakura/components/Templates.php';
|
||||||
require_once ROOT .'_sakura/components/Permissions.php';
|
require_once ROOT .'_sakura/components/Permissions.php';
|
||||||
require_once ROOT .'_sakura/components/Sessions.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/Users.php';
|
||||||
require_once ROOT .'_sakura/components/Forum.php';
|
require_once ROOT .'_sakura/components/Forum.php';
|
||||||
require_once ROOT .'_sakura/components/Manage.php';
|
require_once ROOT .'_sakura/components/Manage.php';
|
||||||
|
|
|
@ -78,5 +78,4 @@
|
||||||
</script>
|
</script>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{% include 'global/footer.tpl' %}
|
{% include 'global/footer.tpl' %}
|
||||||
|
|
|
@ -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 />
|
<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 %}
|
{% if profile.user.rank_main > 1 and profile.ban_check|length < 1 %}
|
||||||
<span style="font-size: .8em;">{{ profile.ranktitle }}</span>
|
<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 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 %}
|
{% if user.checklogin %}
|
||||||
<div class="user-actions">
|
<div class="user-actions">
|
||||||
|
|
|
@ -9,6 +9,10 @@ namespace Sakura;
|
||||||
// Include components
|
// Include components
|
||||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
|
||||||
|
|
||||||
|
$meow = new User(2);
|
||||||
|
|
||||||
|
print_r($meow->user);
|
||||||
|
|
||||||
// Are we in forum mode?
|
// Are we in forum mode?
|
||||||
$forumMode = isset($_GET['forums']) ? ($_GET['forums'] == true) : false;
|
$forumMode = isset($_GET['forums']) ? ($_GET['forums'] == true) : false;
|
||||||
|
|
||||||
|
|
Reference in a new issue