r20160104

This commit is contained in:
flash 2016-01-04 21:14:09 +01:00
parent 6fb139324f
commit 023bd805c0
153 changed files with 154 additions and 220 deletions

View file

@ -274,7 +274,7 @@ class Main
$mail->isHTML(true); $mail->isHTML(true);
// Set email contents // Set email contents
$htmlMail = file_get_contents(ROOT . 'templates/htmlEmail.tpl'); $htmlMail = file_get_contents(ROOT . 'templates/htmlEmail.html');
// Replace template tags // Replace template tags
$htmlMail = str_replace('{{ sitename }}', Config::get('sitename'), $htmlMail); $htmlMail = str_replace('{{ sitename }}', Config::get('sitename'), $htmlMail);
@ -303,7 +303,7 @@ class Main
} }
// Cleaning strings // Cleaning strings
public static function cleanString($string, $lower = false, $noSpecial = false) public static function cleanString($string, $lower = false, $noSpecial = false, $replaceSpecial = '')
{ {
// Run common sanitisation function over string // Run common sanitisation function over string
@ -318,7 +318,7 @@ class Main
// If set remove all characters that aren't a-z or 0-9 // If set remove all characters that aren't a-z or 0-9
if ($noSpecial) { if ($noSpecial) {
$string = preg_replace('/[^a-z0-9]/', '', $string); $string = preg_replace('/[^a-z0-9]/', $replaceSpecial, $string);
} }
// Return clean string // Return clean string

View file

@ -19,9 +19,9 @@ class Rank
'rank_id' => 0, 'rank_id' => 0,
'rank_name' => 'Rank', 'rank_name' => 'Rank',
'rank_hierarchy' => 0, 'rank_hierarchy' => 0,
'rank_multiple' => null, 'rank_multiple' => '',
'rank_hidden' => 1, 'rank_hidden' => 1,
'rank_colour' => '#444', 'rank_colour' => 'inherit',
'rank_description' => '', 'rank_description' => '',
'rank_title' => '', 'rank_title' => '',
]; ];

View file

@ -20,7 +20,7 @@ class Template
private $template; private $template;
private $templateName; private $templateName;
private $templateOptions; private $templateOptions;
protected $templateFileExtension = ".tpl"; protected $templateFileExtension = ".twig";
// Initialise templating engine and data // Initialise templating engine and data
public function __construct() public function __construct()

View file

@ -54,6 +54,48 @@ class User
return self::$_userCache[$uid]; return self::$_userCache[$uid];
} }
// Creating a new user
public static function create($username, $password, $email, $ranks = [2])
{
// Set a few variables
$usernameClean = Main::cleanString($username, true);
$emailClean = Main::cleanString($email, true);
$password = Hashing::createHash($password);
// Insert the user into the database
Database::insert('users', [
'username' => $username,
'username_clean' => $usernameClean,
'password_hash' => $password[3],
'password_salt' => $password[2],
'password_algo' => $password[0],
'password_iter' => $password[1],
'email' => $emailClean,
'rank_main' => 0,
'register_ip' => Main::getRemoteIP(),
'last_ip' => Main::getRemoteIP(),
'user_registered' => time(),
'user_last_online' => 0,
'user_country' => Main::getCountryCode(),
'user_data' => '[]',
]);
// Get the last id
$userId = Database::lastInsertID();
// Create a user object
$user = self::construct($userId);
// Assign the default rank
$user->addRanks($ranks);
// Set the default rank
$user->setMainRank($ranks[0]);
// Return the user object
return $user;
}
// Initialise the user object // Initialise the user object
private function __construct($uid) private function __construct($uid)
{ {
@ -90,7 +132,7 @@ class User
// Check if ranks were set // Check if ranks were set
if (empty($this->ranks)) { if (empty($this->ranks)) {
// If not assign the fallback rank // If not assign the fallback rank
$this->ranks[0] = Rank::construct(0); $this->ranks[1] = Rank::construct(1);
} }
// Assign the user's main rank to a special variable since we'll use it a lot // Assign the user's main rank to a special variable since we'll use it a lot
@ -271,11 +313,6 @@ class User
// Set the main rank of this user // Set the main rank of this user
public function setMainRank($rank) public function setMainRank($rank)
{ {
// Only allow this if this rank is actually present in their set of ranks
if (!in_array($rank, $this->ranks())) {
return false;
}
// If it does exist update their row // If it does exist update their row
Database::update('users', [ Database::update('users', [
[ [

View file

@ -221,14 +221,6 @@ class Users
return [0, 'DISABLED']; return [0, 'DISABLED'];
} }
// Check if registration codes are required
if (Config::get('require_registration_code')) {
// Check if the code is valid
if (!self::checkRegistrationCode($regkey)) {
return [0, 'INVALID_REG_KEY'];
}
}
// Check if the user agreed to the ToS // Check if the user agreed to the ToS
if (!$tos) { if (!$tos) {
return [0, 'TOS']; return [0, 'TOS'];
@ -277,45 +269,16 @@ class Users
} }
// Set a few variables // Set a few variables
$usernameClean = Main::cleanString($username, true);
$emailClean = Main::cleanString($email, true);
$password = Hashing::createHash($password);
$requireActive = Config::get('require_activation'); $requireActive = Config::get('require_activation');
$userRank = $requireActive ? [1] : [2]; $ranks = $requireActive ? [1] : [2];
$userRankJson = json_encode($userRank);
// Insert the user into the database // Create the user
Database::insert('users', [ $user = User::create($username, $password, $email, $ranks);
'username' => $username,
'username_clean' => $usernameClean,
'password_hash' => $password[3],
'password_salt' => $password[2],
'password_algo' => $password[0],
'password_iter' => $password[1],
'email' => $emailClean,
'rank_main' => $userRank[0],
'user_ranks' => $userRankJson,
'register_ip' => Main::getRemoteIP(),
'last_ip' => Main::getRemoteIP(),
'user_registered' => time(),
'user_last_online' => 0,
'user_country' => Main::getCountryCode(),
'user_data' => '[]',
]);
// Get userid of the new user
$uid = Database::fetch('users', false, ['username_clean' => [$usernameClean, '=']])['user_id'];
// Check if we require e-mail activation // Check if we require e-mail activation
if ($requireActive) { if ($requireActive) {
// Send activation e-mail to user // Send activation e-mail to user
self::sendActivationMail($uid); self::sendActivationMail($user->id());
}
// Check if registration codes are required
if (Config::get('require_registration_code')) {
// If we do mark the registration code that was used as used
self::markRegistrationCodeUsed($regkey, $uid);
} }
// Return true with a specific message if needed // Return true with a specific message if needed
@ -493,11 +456,11 @@ class Users
$message = "Welcome to " . Config::get('sitename') . "!\r\n\r\n"; $message = "Welcome to " . Config::get('sitename') . "!\r\n\r\n";
$message .= "Please keep this e-mail for your records. Your account intormation is as follows:\r\n\r\n"; $message .= "Please keep this e-mail for your records. Your account intormation is as follows:\r\n\r\n";
$message .= "----------------------------\r\n\r\n"; $message .= "----------------------------\r\n\r\n";
$message .= "Username: " . $user['username'] . "\r\n\r\n"; $message .= "Username: " . $user->username() . "\r\n\r\n";
$message .= "Your profile: http://" . Config::get('url_main') . $urls->format('USER_PROFILE', [$user['user_id']]) . "\r\n\r\n"; $message .= "Your profile: http://" . Config::get('url_main') . $urls->format('USER_PROFILE', [$user->id()]) . "\r\n\r\n";
$message .= "----------------------------\r\n\r\n"; $message .= "----------------------------\r\n\r\n";
$message .= "Please visit the following link in order to activate your account:\r\n\r\n"; $message .= "Please visit the following link in order to activate your account:\r\n\r\n";
$message .= "http://" . Config::get('url_main') . $urls->format('SITE_ACTIVATE') . "?mode=activate&u=" . $user['user_id'] . "&k=" . $activate . "\r\n\r\n"; $message .= "http://" . Config::get('url_main') . $urls->format('SITE_ACTIVATE') . "?mode=activate&u=" . $user->id() . "&k=" . $activate . "\r\n\r\n";
$message .= "Your password has been securely stored in our database and cannot be retrieved. "; $message .= "Your password has been securely stored in our database and cannot be retrieved. ";
$message .= "In the event that it is forgotten, you will be able to reset it using the email address associated with your account.\r\n\r\n"; $message .= "In the event that it is forgotten, you will be able to reset it using the email address associated with your account.\r\n\r\n";
$message .= "Thank you for registering.\r\n\r\n"; $message .= "Thank you for registering.\r\n\r\n";
@ -506,7 +469,7 @@ class Users
// Send the message // Send the message
Main::sendMail( Main::sendMail(
[ [
$user['email'] => $user['username'], $user->email() => $user->username(),
], ],
Config::get('sitename') . ' Activation Mail', Config::get('sitename') . ' Activation Mail',
$message $message
@ -568,71 +531,6 @@ class Users
return [1, 'SUCCESS']; return [1, 'SUCCESS'];
} }
// Check if registration code is valid
public static function checkRegistrationCode($code)
{
// Get registration key
$keyRow = Database::fetch('regcodes', true, ['code' => [$code, '='], 'key_used' => [0, '=']]);
// Check if it exists and return it
return count($keyRow) ? $keyRow[0]['id'] : false;
}
// Mark registration code as used
public static function markRegistrationCodeUsed($code, $uid = 0)
{
// Check if the code exists
if (!$id = self::checkRegistrationCode($code)) {
return false;
}
// Mark it as used
Database::update('regcodes', [
[
'used_by' => $uid,
'key_used' => 1,
],
[
'id' => [$id, '='],
],
]);
// Return true because yeah
return true;
}
// Create new registration code
public static function createRegistrationCode($userId)
{
// Check if we're logged in
if (!self::checkLogin()) {
return false;
}
// Check if the user is not exceeding the maximum registration key amount
if (Database::count(
'regcodes',
true,
['uid' => [$userId, '=']]
)[0] >= Config::get('max_reg_keys')) {
return false;
}
// Generate a code by MD5'ing some random bullshit
$code = md5('SAKURA' . rand(0, 99999999) . $userId . 'NOOKLSISGOD');
// Insert the key into the database
Database::insert('regcodes', [
'code' => $code,
'created_by' => $userId,
'used_by' => 0,
'key_used' => 0,
]);
// Return the code
return $code;
}
// Check if a user exists // Check if a user exists
public static function userExists($user, $id = true) public static function userExists($user, $id = true)
{ {

View file

@ -644,7 +644,7 @@ a.default:active {
display: block; display: block;
margin: 10px auto; margin: 10px auto;
text-align: center; text-align: center;
padding: 2px; padding: 2px 3px;
border: 1px solid #9475B2; border: 1px solid #9475B2;
box-shadow: 0 0 3px #9475B2; box-shadow: 0 0 3px #9475B2;
border-radius: 3px; border-radius: 3px;

View file

@ -43,14 +43,14 @@ if ($profile->id() == 0) {
'message' => 'The user this profile belongs to changed their username, you are being redirected.', 'message' => 'The user this profile belongs to changed their username, you are being redirected.',
'redirect' => $urls->format('USER_PROFILE', [$check['user_id']]), 'redirect' => $urls->format('USER_PROFILE', [$check['user_id']]),
]; ];
// Set parse variables
$template->setVariables($renderData);
// Print page contents
echo $template->render('global/information');
exit;
} }
// Set parse variables
$template->setVariables($renderData);
// Print page contents
echo $template->render('global/information');
exit;
} }
// Set parse variables // Set parse variables

View file

@ -8,7 +8,7 @@
namespace Sakura; namespace Sakura;
// Define Sakura version // Define Sakura version
define('SAKURA_VERSION', '20160103'); define('SAKURA_VERSION', '20160104');
define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_COLOUR', '#6C3082');
@ -159,7 +159,6 @@ if (!defined('SAKURA_NO_TPL')) {
'disableRegistration' => Config::get('disable_registration'), 'disableRegistration' => Config::get('disable_registration'),
'lockAuth' => Config::get('lock_authentication'), 'lockAuth' => Config::get('lock_authentication'),
'requireRegCodes' => Config::get('require_registration_code'),
'requireActivation' => Config::get('require_activation'), 'requireActivation' => Config::get('require_activation'),
'minPwdEntropy' => Config::get('min_entropy'), 'minPwdEntropy' => Config::get('min_entropy'),
'minUsernameLength' => Config::get('username_min_length'), 'minUsernameLength' => Config::get('username_min_length'),

View file

@ -1,4 +1,4 @@
{% include 'global/header.tpl' %} {% include 'global/header.twig' %}
<div class="mioboards"> <div class="mioboards">
<h3 class="miotitle" style="margin: 0;">Welcome!</h3> <h3 class="miotitle" style="margin: 0;">Welcome!</h3>
<br /> <br />
@ -12,7 +12,7 @@
<h3 class="miotitle" style="margin: 0;">Latest News Posts<span class="windowbutton-container" onclick="hidePageSection('latestnewsposts',1);"><img class="minbutton" src="/content/pixel.png" alt="_"></span></h3> <h3 class="miotitle" style="margin: 0;">Latest News Posts<span class="windowbutton-container" onclick="hidePageSection('latestnewsposts',1);"><img class="minbutton" src="/content/pixel.png" alt="_"></span></h3>
<div class="mioboxcontent sub" style="margin: 0;"> <div class="mioboxcontent sub" style="margin: 0;">
{% for post in news.getPosts(0, newsCount) %} {% for post in news.getPosts(0, newsCount) %}
{% include 'elements/newsPost.tpl' %} {% include 'elements/newsPost.twig' %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>
@ -33,4 +33,4 @@
</table> </table>
</div> </div>
</div> </div>
{% include 'global/footer.tpl' %} {% include 'global/footer.twig' %}

View file

@ -8,12 +8,12 @@
<div class="forumCategoryDescription">{{ forum.description }}</div> <div class="forumCategoryDescription">{{ forum.description }}</div>
</div> </div>
{% for forum in forum.forums %} {% for forum in forum.forums %}
{% include 'forum/forumEntry.tpl' %} {% include 'forum/forumEntry.twig' %}
{% endfor %} {% endfor %}
</div> </div>
{% endif %} {% endif %}
{% else %} {% else %}
{% include 'forum/forumEntry.tpl' %} {% include 'forum/forumEntry.twig' %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>

View file

@ -1,10 +1,10 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Forum Listing{% endblock %} {% block title %}Forum Listing{% endblock %}
{% block content %} {% block content %}
<div class="homepage forums"> <div class="homepage forums">
{% include 'elements/statsHeader.tpl' %} {% include 'elements/statsHeader.twig' %}
{% include 'forum/forum.tpl' %} {% include 'forum/forum.twig' %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Information{% endblock %} {% block title %}Information{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Restricted{% endblock %} {% block title %}Restricted{% endblock %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1,8 +1,8 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block content %} {% block content %}
<div class="homepage"> <div class="homepage">
{% include 'elements/statsHeader.tpl' %} {% include 'elements/statsHeader.twig' %}
<div class="onlineUsers platform"> <div class="onlineUsers platform">
{% if stats.onlineUsers %} {% if stats.onlineUsers %}
{% for amount,onlineUser in stats.onlineUsers %} {% for amount,onlineUser in stats.onlineUsers %}
@ -14,7 +14,7 @@
</div> </div>
<div class="frontNews platform"> <div class="frontNews platform">
{% for post in news.getPosts(0, newsCount) %} {% for post in news.getPosts(0, newsCount) %}
{% include 'elements/newsPost.tpl' %} {% include 'elements/newsPost.twig' %}
{% endfor %} {% endfor %}
</div> </div>
</div> </div>

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %} {% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %} {% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
@ -217,7 +217,7 @@
{% endif %} {% endif %}
<div class="userPage profilePlatform"> <div class="userPage profilePlatform">
<div class="inner"> <div class="inner">
{% include 'profile/' ~ profileView ~ '.tpl' %} {% include 'profile/' ~ profileView ~ '.twig' %}
</div> </div>
</div> </div>
</div> </div>

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Search{% endblock %} {% block title %}Search{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}{{ page.category }} / {{ page.mode }}{% endblock %} {% block title %}{{ page.category }} / {{ page.mode }}{% endblock %}
@ -13,5 +13,5 @@
{% endfor %} {% endfor %}
</h3> </h3>
</div> </div>
{% include 'settings/' ~ current ~ '.tpl' %} {% include 'settings/' ~ current ~ '.twig' %}
{% endblock %} {% endblock %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -23,7 +23,7 @@
</div> </div>
<ul> <ul>
{% for comment in comment.comment_replies %} {% for comment in comment.comment_replies %}
{% include 'elements/comment.tpl' %} {% include 'elements/comment.twig' %}
{% endfor %} {% endfor %}
</ul> </ul>
</li> </li>

View file

@ -26,7 +26,7 @@
<ul class="comments-list"> <ul class="comments-list">
{% if comments %} {% if comments %}
{% for comment in comments %} {% for comment in comments %}
{% include 'elements/comment.tpl' %} {% include 'elements/comment.twig' %}
{% endfor %} {% endfor %}
{% else %} {% else %}
<h1 class="stylised" style="text-align: center; padding: 10px 0">There are no comments yet!</h1> <h1 class="stylised" style="text-align: center; padding: 10px 0">There are no comments yet!</h1>

View file

@ -7,11 +7,11 @@
{% if forum.type != 1 %}Subforums{% else %}<a href="{{ urls.format('FORUM_SUB', [forum.id]) }}" class="clean">{{ forum.name }}</a>{% endif %} {% if forum.type != 1 %}Subforums{% else %}<a href="{{ urls.format('FORUM_SUB', [forum.id]) }}" class="clean">{{ forum.name }}</a>{% endif %}
</div> </div>
{% for forum in forum.forums %} {% for forum in forum.forums %}
{% include 'forum/forumEntry.tpl' %} {% include 'forum/forumEntry.twig' %}
{% endfor %} {% endfor %}
{% endif %} {% endif %}
{% else %} {% else %}
{% include 'forum/forumEntry.tpl' %} {% include 'forum/forumEntry.twig' %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
</div> </div>
@ -21,7 +21,7 @@
{% set paginationPages = threads %} {% set paginationPages = threads %}
{% set paginationUrl %}{{ urls.format('FORUM_SUB', [forum.id]) }}{% endset %} {% set paginationUrl %}{{ urls.format('FORUM_SUB', [forum.id]) }}{% endset %}
{% include 'forum/forumBtns.tpl' %} {% include 'forum/forumBtns.twig' %}
{% if forum.threads %} {% if forum.threads %}
<table class="topicList"> <table class="topicList">
<thead> <thead>
@ -44,12 +44,12 @@
</tfoot> </tfoot>
<tbody> <tbody>
{% for thread in threads[get.page|default(1) - 1] %} {% for thread in threads[get.page|default(1) - 1] %}
{% include 'forum/topicEntry.tpl' %} {% include 'forum/topicEntry.twig' %}
{% endfor %} {% endfor %}
</tbody> </tbody>
</table> </table>
{% else %} {% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">There are no posts in this forum!</h1> <h1 class="stylised" style="margin: 2em auto; text-align: center;">There are no posts in this forum!</h1>
{% endif %} {% endif %}
{% include 'forum/forumBtns.tpl' %} {% include 'forum/forumBtns.twig' %}
{% endif %} {% endif %}

View file

@ -16,6 +16,6 @@
<a href="{{ forumMarkRead }}" class="forumbtn"><span class="fa fa-check-square-o"></span> Mark as Read</a> <a href="{{ forumMarkRead }}" class="forumbtn"><span class="fa fa-check-square-o"></span> Mark as Read</a>
{% endif %} {% endif %}
</div> </div>
{% include 'elements/pagination.tpl' %} {% include 'elements/pagination.twig' %}
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set title = 'Forums' %} {% set title = 'Forums' %}
@ -9,11 +9,11 @@
{% block content %} {% block content %}
<div class="content homepage forum"> <div class="content homepage forum">
<div class="content-right content-column"> <div class="content-right content-column">
{% include 'elements/indexPanel.tpl' %} {% include 'elements/indexPanel.twig' %}
</div> </div>
<div class="content-left content-column"> <div class="content-left content-column">
{% include 'forum/forum.tpl' %} {% include 'forum/forum.twig' %}
{% include 'forum/forumBtns.tpl' %} {% include 'forum/forumBtns.twig' %}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set bbcode = {'b': ['Bold', 'bold'], 'i': ['Italic', 'italic'], 'u': ['Underline', 'underline'], 's': ['Strikethrough', 'strikethrough'], 'header': ['Header', 'header'], 'url': ['URL', 'chain'], 'code': ['Code', 'code'], 'spoiler': ['Spoiler', 'minus'], 'box': ['Spoiler box', 'folder', true], 'list': ['List', 'list-ul'], 'img': ['Image', 'picture-o'], 'youtube': ['YouTube video', 'youtube-play']} %} {% set bbcode = {'b': ['Bold', 'bold'], 'i': ['Italic', 'italic'], 'u': ['Underline', 'underline'], 's': ['Strikethrough', 'strikethrough'], 'header': ['Header', 'header'], 'url': ['URL', 'chain'], 'code': ['Code', 'code'], 'spoiler': ['Spoiler', 'minus'], 'box': ['Spoiler box', 'folder', true], 'list': ['List', 'list-ul'], 'img': ['Image', 'picture-o'], 'youtube': ['YouTube video', 'youtube-play']} %}
@ -11,7 +11,7 @@
{% block content %} {% block content %}
<div class="content"> <div class="content">
<div class="content-column forum posting"> <div class="content-column forum posting">
{% include 'elements/editor.tpl' %} {% include 'elements/editor.twig' %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set title %}Forums / {{ forum.name }}{% endset %} {% set title %}Forums / {{ forum.name }}{% endset %}
@ -11,7 +11,7 @@
{% block content %} {% block content %}
<div class="content homepage forum viewforum"> <div class="content homepage forum viewforum">
<div class="content-column"> <div class="content-column">
{% include 'forum/forum.tpl' %} {% include 'forum/forum.twig' %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set forumBackLink %}{{ urls.format('FORUM_SUB', [forum.id]) }}{% endset %} {% set forumBackLink %}{{ urls.format('FORUM_SUB', [forum.id]) }}{% endset %}
{% set forumReplyLink %}{{ urls.format('FORUM_REPLY', [thread.id]) }}{% endset %} {% set forumReplyLink %}{{ urls.format('FORUM_REPLY', [thread.id]) }}{% endset %}
@ -37,7 +37,7 @@
<div class="content homepage forum viewtopic"> <div class="content homepage forum viewtopic">
<div class="content-column"> <div class="content-column">
<div class="head"><a href="{{ forumBackLink }}" class="clean">{{ forum.name }}</a> / <a href="{{ paginationUrl }}" class="clean">{{ thread.title }}</a></div> <div class="head"><a href="{{ forumBackLink }}" class="clean">{{ forum.name }}</a> / <a href="{{ paginationUrl }}" class="clean">{{ thread.title }}</a></div>
{% include 'forum/forumBtns.tpl' %} {% include 'forum/forumBtns.twig' %}
<table class="posts"> <table class="posts">
{% for post in posts[get.page|default(1) - 1] %} {% for post in posts[get.page|default(1) - 1] %}
<tr class="post" id="p{{ post.id }}"> <tr class="post" id="p{{ post.id }}">
@ -90,7 +90,7 @@
</tr> </tr>
{% endfor %} {% endfor %}
</table> </table>
{% include 'forum/forumBtns.tpl' %} {% include 'forum/forumBtns.twig' %}
</div> </div>
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Confirmation{% endblock %} {% block title %}Confirmation{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Information{% endblock %} {% block title %}Information{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Restricted{% endblock %} {% block title %}Restricted{% endblock %}

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Authentication{% endblock %} {% block title %}Authentication{% endblock %}
@ -113,7 +113,7 @@
<label for="recaptcha_response_field">Verification:</label> <label for="recaptcha_response_field">Verification:</label>
</div> </div>
<div class="centreAlign"> <div class="centreAlign">
{% include 'elements/captcha.tpl' %} {% include 'elements/captcha.twig' %}
</div> </div>
{% endif %} {% endif %}
<div class="subLinks centreAlign"> <div class="subLinks centreAlign">

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}You are banned!{% endblock %} {% block title %}You are banned!{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Frequently Asked Questions{% endblock %} {% block title %}Frequently Asked Questions{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Forgot Password{% endblock %} {% block title %}Forgot Password{% endblock %}

View file

@ -1,14 +1,14 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block content %} {% block content %}
<div class="content homepage"> <div class="content homepage">
<div class="content-right content-column"> <div class="content-right content-column">
{% include 'elements/indexPanel.tpl' %} {% include 'elements/indexPanel.twig' %}
</div> </div>
<div class="content-left content-column"> <div class="content-left content-column">
<div class="head">News</div> <div class="head">News</div>
{% for post in news.posts|batch(newsCount)[0] %} {% for post in news.posts|batch(newsCount)[0] %}
{% include 'elements/newsPost.tpl' %} {% include 'elements/newsPost.twig' %}
{% endfor %} {% endfor %}
</div> </div>
<div class="clear"></div> <div class="clear"></div>

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %} {% block title %}{% if page.title %}{{ page.title }}{% else %}Not found!{% endif %}{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set rankTitle %} {% set rankTitle %}
{% if page.notfound %}Not found{% else %}{% if not page.active %}All members{% else %}{{ page.ranks[page.active].name(true) }}{% endif %}{% endif %} {% if page.notfound %}Not found{% else %}{% if not page.active %}All members{% else %}{{ page.ranks[page.active].name(true) }}{% endif %}{% endif %}
@ -106,7 +106,7 @@
</div> </div>
{% endif %} {% endif %}
{% if users|length > 1 %} {% if users|length > 1 %}
{% include 'elements/pagination.tpl' %} {% include 'elements/pagination.twig' %}
{% endif %} {% endif %}
</div> </div>
{% endblock %} {% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set newsPosts = viewPost and postExists ? [news.posts[postExists]] : news.posts|batch(postsPerPage)[get.page|default(1) - 1] %} {% set newsPosts = viewPost and postExists ? [news.posts[postExists]] : news.posts|batch(postsPerPage)[get.page|default(1) - 1] %}
@ -30,14 +30,14 @@
<div class="head">{{ title }}</div> <div class="head">{{ title }}</div>
{% if (viewPost ? postExists : newsPosts|length) %} {% if (viewPost ? postExists : newsPosts|length) %}
{% for post in newsPosts %} {% for post in newsPosts %}
{% include 'elements/newsPost.tpl' %} {% include 'elements/newsPost.twig' %}
{% if viewPost and postExists %} {% if viewPost and postExists %}
{% include 'elements/comments.tpl' %} {% include 'elements/comments.twig' %}
{% endif %} {% endif %}
{% endfor %} {% endfor %}
{% if not (viewPost and postExists) and news.posts|batch(postsPerPage)|length > 1 %} {% if not (viewPost and postExists) and news.posts|batch(postsPerPage)|length > 1 %}
<div> <div>
{% include 'elements/pagination.tpl' %} {% include 'elements/pagination.twig' %}
<div class="clear"></div> <div class="clear"></div>
</div> </div>
{% endif %} {% endif %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% block title %}Purchase complete!{% endblock %} {% block title %}Purchase complete!{% endblock %}

View file

@ -1,4 +1,4 @@
{% extends 'global/master.tpl' %} {% extends 'global/master.twig' %}
{% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %} {% set profileHidden = profile.permission(constant('Sakura\\Perms\\Site::DEACTIVATED')) or (profile.permission(constant('Sakura\\Perms\\Site::RESTRICTED')) and (user.id != profile.id and not user.permission(constant('Sakura\\Perms\\Manage::USE_MANAGE'), constant('Sakura\\Perms::MANAGE')))) %}
@ -128,7 +128,7 @@
</div> </div>
</div> </div>
<div class="content-left content-column"> <div class="content-left content-column">
{% include 'profile/' ~ profileView ~ '.tpl' %} {% include 'profile/' ~ profileView ~ '.twig' %}
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View file

@ -1 +0,0 @@
{% extends 'global/master.tpl' %}

View file

@ -0,0 +1 @@
{% extends 'global/master.twig' %}

Some files were not shown because too many files have changed in this diff Show more