r20151122
Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
parent
e5a8c1131c
commit
891ba36485
15 changed files with 42 additions and 38 deletions
|
@ -1,16 +0,0 @@
|
||||||
<?php
|
|
||||||
/*
|
|
||||||
* BBcode parser
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Sakura;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Class BBcode
|
|
||||||
* @package Sakura
|
|
||||||
*/
|
|
||||||
class BBcode
|
|
||||||
{
|
|
||||||
// Array containing bbcodes
|
|
||||||
private static $bbcodes = [];
|
|
||||||
}
|
|
0
_sakura/components/database/mysql.php → _sakura/components/DBWrapper/mysql.php
Executable file → Normal file
0
_sakura/components/database/mysql.php → _sakura/components/DBWrapper/mysql.php
Executable file → Normal file
|
@ -3,7 +3,7 @@
|
||||||
* Forum class
|
* Forum class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Sakura\Board;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\Database;
|
use Sakura\Database;
|
||||||
|
|
2
_sakura/components/Forums.php → _sakura/components/Forum/Forums.php
Executable file → Normal file
2
_sakura/components/Forums.php → _sakura/components/Forum/Forums.php
Executable file → Normal file
|
@ -3,7 +3,7 @@
|
||||||
* Discussion Board
|
* Discussion Board
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Sakura\Board;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\Main;
|
use Sakura\Main;
|
||||||
use Sakura\Database;
|
use Sakura\Database;
|
|
@ -3,7 +3,7 @@
|
||||||
* Post class
|
* Post class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Sakura\Board;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\Main;
|
use Sakura\Main;
|
||||||
use Sakura\Database;
|
use Sakura\Database;
|
|
@ -3,7 +3,7 @@
|
||||||
* Thread class
|
* Thread class
|
||||||
*/
|
*/
|
||||||
|
|
||||||
namespace Sakura\Board;
|
namespace Sakura\Forum;
|
||||||
|
|
||||||
use Sakura\Database;
|
use Sakura\Database;
|
||||||
|
|
|
@ -191,7 +191,7 @@ class User
|
||||||
// Get user's forum statistics
|
// Get user's forum statistics
|
||||||
public function forumStats()
|
public function forumStats()
|
||||||
{
|
{
|
||||||
return Board\Forums::getUserStats($this->data['user_id']);
|
return Forum\Forums::getUserStats($this->data['user_id']);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get amount of time since user events using the same format as dates()
|
// Get amount of time since user events using the same format as dates()
|
||||||
|
|
|
@ -8,7 +8,7 @@
|
||||||
namespace Sakura;
|
namespace Sakura;
|
||||||
|
|
||||||
// Define Sakura version
|
// Define Sakura version
|
||||||
define('SAKURA_VERSION', '20151121');
|
define('SAKURA_VERSION', '20151122');
|
||||||
define('SAKURA_VLABEL', 'Eminence');
|
define('SAKURA_VLABEL', 'Eminence');
|
||||||
define('SAKURA_COLOUR', '#6C3082');
|
define('SAKURA_COLOUR', '#6C3082');
|
||||||
define('SAKURA_STABLE', false);
|
define('SAKURA_STABLE', false);
|
||||||
|
@ -31,12 +31,32 @@ if (version_compare(phpversion(), '5.4.0', '<')) {
|
||||||
require_once ROOT . '_sakura/vendor/autoload.php';
|
require_once ROOT . '_sakura/vendor/autoload.php';
|
||||||
|
|
||||||
// Include components
|
// Include components
|
||||||
foreach (glob(ROOT . '_sakura/components/*.php') as $component) {
|
require_once ROOT . '_sakura/components/Bans.php';
|
||||||
require_once $component;
|
require_once ROOT . '_sakura/components/Comments.php';
|
||||||
}
|
require_once ROOT . '_sakura/components/Config.php';
|
||||||
|
require_once ROOT . '_sakura/components/Database.php';
|
||||||
|
require_once ROOT . '_sakura/components/File.php';
|
||||||
|
require_once ROOT . '_sakura/components/Hashing.php';
|
||||||
|
require_once ROOT . '_sakura/components/Main.php';
|
||||||
|
require_once ROOT . '_sakura/components/Manage.php';
|
||||||
|
require_once ROOT . '_sakura/components/News.php';
|
||||||
|
require_once ROOT . '_sakura/components/Payments.php';
|
||||||
|
require_once ROOT . '_sakura/components/Permissions.php';
|
||||||
|
require_once ROOT . '_sakura/components/Rank.php';
|
||||||
|
require_once ROOT . '_sakura/components/Session.php';
|
||||||
|
require_once ROOT . '_sakura/components/Template.php';
|
||||||
|
require_once ROOT . '_sakura/components/Trick.php';
|
||||||
|
require_once ROOT . '_sakura/components/Urls.php';
|
||||||
|
require_once ROOT . '_sakura/components/User.php';
|
||||||
|
require_once ROOT . '_sakura/components/Users.php';
|
||||||
|
require_once ROOT . '_sakura/components/Whois.php';
|
||||||
|
require_once ROOT . '_sakura/components/Forum/Forum.php';
|
||||||
|
require_once ROOT . '_sakura/components/Forum/Forums.php';
|
||||||
|
require_once ROOT . '_sakura/components/Forum/Post.php';
|
||||||
|
require_once ROOT . '_sakura/components/Forum/Thread.php';
|
||||||
|
|
||||||
// Include database extensions
|
// Include database extensions
|
||||||
foreach (glob(ROOT . '_sakura/components/database/*.php') as $driver) {
|
foreach (glob(ROOT . '_sakura/components/DBWrapper/*.php') as $driver) {
|
||||||
require_once $driver;
|
require_once $driver;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
{% set paginationSeparator %}{% if '?' in pagination.page %}&{% else %}?{% endif %}{% endset %}
|
{% set paginationSeparator %}{% if '?' in paginationUrl %}&{% else %}?{% endif %}{% endset %}
|
||||||
{% set paginationPage = get.page|default(1) %}
|
{% set paginationPage = get.page|default(1) %}
|
||||||
|
|
||||||
<div class="pagination{% if paginationClass %} {{ paginationClass }}{% endif %}">
|
<div class="pagination{% if paginationClass %} {{ paginationClass }}{% endif %}">
|
||||||
|
|
|
@ -26,7 +26,7 @@
|
||||||
{% endif %}
|
{% endif %}
|
||||||
<div class="userdata">
|
<div class="userdata">
|
||||||
<div class="usertitle">{{ post.poster.userTitle }}</div>
|
<div class="usertitle">{{ post.poster.userTitle }}</div>
|
||||||
<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi"{% if not post.poster.isPremium[0] %} style="opacity: 0;"{% endif %} /> <img src="{{ sakura.contentPath }}/images/flags/{{ post.poster.country.short|lower }}.png" alt="{{ post.poster.country.long }}" />
|
<img src="{{ sakura.contentPath }}/images/tenshi.png" alt="Tenshi"{% if not post.poster.isPremium[0] %} style="opacity: 0;"{% endif %} /> <img src="{{ sakura.contentPath }}/images/flags/{{ post.poster.country.short|lower }}.png" alt="{{ post.poster.country.long }}" />{% if post.poster.id == (thread.posts|first).poster.id %} <img src="{{ sakura.contentPath }}/images/op.png" alt="OP" title="Original Poster" />{% endif %}
|
||||||
{% if session.checkLogin %}
|
{% if session.checkLogin %}
|
||||||
<div class="actions">
|
<div class="actions">
|
||||||
{% if user.id == post.poster.id %}
|
{% if user.id == post.poster.id %}
|
||||||
|
|
BIN
public/content/images/op.png
Normal file
BIN
public/content/images/op.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1 KiB |
|
@ -50,7 +50,7 @@ $renderData['news'] = ($forumMode ? null : (new News(Config::getConfig('site_new
|
||||||
|
|
||||||
$renderData['newsCount'] = Config::getConfig('front_page_news_posts');
|
$renderData['newsCount'] = Config::getConfig('front_page_news_posts');
|
||||||
|
|
||||||
$renderData['forum'] = ($forumMode ? (new Board\Forum()) : null);
|
$renderData['forum'] = ($forumMode ? (new Forum\Forum()) : null);
|
||||||
|
|
||||||
$renderData['stats'] = [
|
$renderData['stats'] = [
|
||||||
'userCount' => Database::count('users', ['password_algo' => ['nologin', '!='], 'rank_main' => ['1', '!=']])[0],
|
'userCount' => Database::count('users', ['password_algo' => ['nologin', '!='], 'rank_main' => ['1', '!=']])[0],
|
||||||
|
|
|
@ -20,13 +20,13 @@ $topicId = isset($_GET['t']) ?
|
||||||
$_GET['t'] :
|
$_GET['t'] :
|
||||||
(
|
(
|
||||||
isset($_GET['p']) ?
|
isset($_GET['p']) ?
|
||||||
Board\Forums::getTopicIdFromPostId($_GET['p']) :
|
Forum\Forums::getTopicIdFromPostId($_GET['p']) :
|
||||||
0
|
0
|
||||||
);
|
);
|
||||||
|
|
||||||
$forumId = isset($_GET['f']) ?
|
$forumId = isset($_GET['f']) ?
|
||||||
$_GET['f'] :
|
$_GET['f'] :
|
||||||
Board\Forums::getForumIdFromTopicId($topicId);
|
Forum\Forums::getForumIdFromTopicId($topicId);
|
||||||
|
|
||||||
$mode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) ? 't' : (isset($_GET['p']) ? 'p' : null));
|
$mode = isset($_GET['f']) ? 'f' : (isset($_GET['t']) ? 't' : (isset($_GET['p']) ? 'p' : null));
|
||||||
|
|
||||||
|
@ -39,7 +39,7 @@ $posting = [
|
||||||
// Check if we're in reply mode
|
// Check if we're in reply mode
|
||||||
if ($mode != 'f') {
|
if ($mode != 'f') {
|
||||||
// Attempt to get the topic
|
// Attempt to get the topic
|
||||||
$thread = Board\Forums::getTopic($topicId, true);
|
$thread = Forum\Forums::getTopic($topicId, true);
|
||||||
|
|
||||||
// Prompt an error if the topic doesn't exist
|
// Prompt an error if the topic doesn't exist
|
||||||
if (!$thread) {
|
if (!$thread) {
|
||||||
|
@ -120,7 +120,7 @@ if ($mode != 'f') {
|
||||||
]);
|
]);
|
||||||
|
|
||||||
// Reload the topic
|
// Reload the topic
|
||||||
$thread = Board\Forums::getTopic($topicId, true);
|
$thread = Forum\Forums::getTopic($topicId, true);
|
||||||
|
|
||||||
// If there's no more posts left in the topic delete it as well
|
// If there's no more posts left in the topic delete it as well
|
||||||
if (!count($thread['posts'])) {
|
if (!count($thread['posts'])) {
|
||||||
|
@ -173,7 +173,7 @@ if ($mode != 'f') {
|
||||||
// Check if a post is being made
|
// Check if a post is being made
|
||||||
if (isset($_POST['post'])) {
|
if (isset($_POST['post'])) {
|
||||||
// Attempt to make the post
|
// Attempt to make the post
|
||||||
$makePost = Board\Forums::createPost($currentUser->id(), $_POST['subject'], $_POST['text'], $forumId, $topicId, 1, 1, 1);
|
$makePost = Forum\Forums::createPost($currentUser->id(), $_POST['subject'], $_POST['text'], $forumId, $topicId, 1, 1, 1);
|
||||||
|
|
||||||
// Add page specific things
|
// Add page specific things
|
||||||
$renderData['page'] = [
|
$renderData['page'] = [
|
||||||
|
|
|
@ -10,7 +10,7 @@ namespace Sakura;
|
||||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
|
||||||
|
|
||||||
// Get the forum's data
|
// Get the forum's data
|
||||||
$forum = new Board\Forum(isset($_GET['f']) ? $_GET['f'] : -1);
|
$forum = new Forum\Forum(isset($_GET['f']) ? $_GET['f'] : -1);
|
||||||
|
|
||||||
// Initialise templating engine
|
// Initialise templating engine
|
||||||
$template = new Template();
|
$template = new Template();
|
||||||
|
|
|
@ -10,14 +10,14 @@ namespace Sakura;
|
||||||
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
|
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) . '_sakura/sakura.php';
|
||||||
|
|
||||||
// Attempt to get the thread
|
// Attempt to get the thread
|
||||||
$thread = new Board\Thread(
|
$thread = new Forum\Thread(
|
||||||
isset($_GET['p'])
|
isset($_GET['p'])
|
||||||
? Board\Forums::getTopicIdFromPostId($_GET['p'])
|
? Forum\Forums::getTopicIdFromPostId($_GET['p'])
|
||||||
: (isset($_GET['t']) ? $_GET['t'] : 0)
|
: (isset($_GET['t']) ? $_GET['t'] : 0)
|
||||||
);
|
);
|
||||||
|
|
||||||
// And attempt to get the forum
|
// And attempt to get the forum
|
||||||
$forum = new Board\Forum($thread->forum);
|
$forum = new Forum\Forum($thread->forum);
|
||||||
|
|
||||||
// Initialise templating engine
|
// Initialise templating engine
|
||||||
$template = new Template();
|
$template = new Template();
|
||||||
|
|
Reference in a new issue