a few quick fixes

This commit is contained in:
flash 2016-03-26 19:03:35 +01:00
parent a0805cc29b
commit 9c42b6d722
4 changed files with 19 additions and 13 deletions

View file

@ -10,7 +10,7 @@ namespace Sakura\BBcodeDefinitions;
use JBBCode\CodeDefinition; use JBBCode\CodeDefinition;
use JBBCode\ElementNode; use JBBCode\ElementNode;
use Sakura\Router; use Sakura\Router;
use Sakura\User; use Sakura\User as SakuraUser;
use Sakura\Utils; use Sakura\Utils;
/** /**
@ -47,7 +47,7 @@ class User extends CodeDefinition
$content .= Utils::cleanString($child->getAsText(), true); $content .= Utils::cleanString($child->getAsText(), true);
} }
$user = User::construct($content); $user = SakuraUser::construct($content);
$profile = Router::route('user.profile', $user->id); $profile = Router::route('user.profile', $user->id);
return "<a class='default username' href='{$profile} style='color: {$user->colour}; return "<a class='default username' href='{$profile} style='color: {$user->colour};

View file

@ -106,7 +106,9 @@ class ForumController extends Controller
->orderByRaw('COUNT(*) DESC') ->orderByRaw('COUNT(*) DESC')
->limit(1) ->limit(1)
->get(['poster_id']); ->get(['poster_id']);
$activePoster = User::construct($activePosterId[0]->poster_id); $activePoster = User::construct(
$activePosterId ? $activePosterId[0]->poster_id : 0
);
// Create the forum object // Create the forum object
$forum = new Forum; $forum = new Forum;

View file

@ -1084,8 +1084,8 @@ class User
->insert([ ->insert([
'change_time' => time(), 'change_time' => time(),
'user_id' => $this->id, 'user_id' => $this->id,
'username_new_clean' => $username, 'username_new' => $username,
'new_clean' => $username_clean, 'username_new_clean' => $username_clean,
'username_old' => $this->username, 'username_old' => $this->username,
'username_old_clean' => $this->usernameClean, 'username_old_clean' => $this->usernameClean,
]); ]);

View file

@ -45,15 +45,19 @@
</div> </div>
<div id="forumMostActivePoster"> <div id="forumMostActivePoster">
<div class="head">Today's most active poster</div> <div class="head">Today's most active poster</div>
<a class="clean" href="{{ route('user.profile', activePoster.id) }}"> {% if not activePoster.id %}
<div class="user-container" style="background-image: url({{ route('user.header', activePoster.id) }});"> <a class="clean" href="{{ route('user.profile', activePoster.id) }}">
<div class="default-avatar-setting user-container-avatar" style="background-image: url({{ route('file.avatar', activePoster.id) }}); box-shadow: 0 0 5px #{% if activePoster.isOnline %}484{% else %}844{% endif %};"></div> <div class="user-container" style="background-image: url({{ route('user.header', activePoster.id) }});">
<div class="user-container-info"> <div class="default-avatar-setting user-container-avatar" style="background-image: url({{ route('file.avatar', activePoster.id) }}); box-shadow: 0 0 5px #{% if activePoster.isOnline %}484{% else %}844{% endif %};"></div>
<h1 style="color: {{ activePoster.colour }}; text-shadow: 0 0 7px {% if activePoster.colour != 'inherit' %}{{ activePoster.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;" {% if activePoster.getUsernameHistory %} title="Known as {{ activePoster.getUsernameHistory[0].username_old }} before {{ activePoster.getUsernameHistory[0].change_time|date(sakura.dateFormat) }}." {% endif %}>{{ activePoster.username }}</h1> <div class="user-container-info">
{% if activePoster.isPremium[0] %}<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi" style="vertical-align: middle;" /> {% endif %}<img src="{{ sakura.contentPath }}/images/flags/{{ activePoster.country|lower }}.png" alt="{{ activePoster.country }}" style="vertical-align: middle;" title="{{ activePoster.country(true) }}" /> <span style="font-size: .8em;">{{ activePoster.title }}</span> <h1 style="color: {{ activePoster.colour }}; text-shadow: 0 0 7px {% if activePoster.colour != 'inherit' %}{{ activePoster.colour }}{% else %}#222{% endif %}; padding: 0 0 2px;" {% if activePoster.getUsernameHistory %} title="Known as {{ activePoster.getUsernameHistory[0].username_old }} before {{ activePoster.getUsernameHistory[0].change_time|date(sakura.dateFormat) }}." {% endif %}>{{ activePoster.username }}</h1>
{% if activePoster.isPremium[0] %}<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi" style="vertical-align: middle;" /> {% endif %}<img src="{{ sakura.contentPath }}/images/flags/{{ activePoster.country|lower }}.png" alt="{{ activePoster.country }}" style="vertical-align: middle;" title="{{ activePoster.country(true) }}" /> <span style="font-size: .8em;">{{ activePoster.title }}</span>
</div>
</div> </div>
</div> </a>
</a> {% else %}
<h1 class="stylised" style="margin: 1em 0; text-align: center;">No one yet!</h1>
{% endif %}
</div> </div>
</div> </div>
<div class="content-left content-column"> <div class="content-left content-column">