r20150905

Urls is mostly implemented in the yuuno templates, all else will come tomorrow since i'm tired.

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
flash 2015-09-05 01:49:53 +02:00
parent 153e6e132c
commit 57542ac936
25 changed files with 286 additions and 249 deletions

19
CONTRIBUTORS.md Normal file
View file

@ -0,0 +1,19 @@
# Contributors
This is a list of people who have contributed to Sakura and also a list of the libraries that we use.
## People
| Name | Contribution |
| ---- | ------------ |
| Flashwave | Project leader and main developer. |
| MallocNull | Internal advice and pointing out my (Flashwave) stupidity. |
| kamilrakowski | Providing a huge pile of security advice and fixes. |
| RandomGuy | Mostly security advice as well. |
## Libraries
- [Twig](http://twig.sensiolabs.org/)
- [Parsedown](http://parsedown.org/)
- [PHPMailer](https://github.com/PHPMailer/PHPMailer)
- [PayPal API](https://paypal.com/)

View file

@ -56,7 +56,8 @@
"20150830",
"20150831",
"20150902",
"20150903"
"20150903",
"20150904"
]
@ -2420,6 +2421,41 @@
"user": "Flashwave"
}
],
"20150904": [
{
"type": "ADD",
"change": "Added Urls class.",
"user": "Flashwave"
},
{
"type": "REM",
"change": "Removed credits page in favour of a markdown file in the root.",
"user": "Flashwave"
},
{
"type": "REM",
"change": "Removed /contact symlink, use /p/contact instead.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Implemented urls.format across templates.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Moved infopage.php into index.php.",
"user": "Flashwave"
},
{
"type": "REM",
"change": "Removed the special URL case for the messages section.",
"user": "Flashwave"
}
]
}

View file

@ -0,0 +1,88 @@
<?php
/*
* URL management
*/
namespace Sakura;
class Urls {
// Unformatted links [0] = no mod_rewrite, [1] = mod_rewrite
protected $urls = [
// General site sections
'SITE_HOME' => ['/', '/'],
'SITE_NEWS' => ['/news.php', '/news'],
'SITE_NEWS_PAGE' => ['/news.php?page=%u', '/news/p%u'],
'SITE_NEWS_POST' => ['/news.php?id=%u', '/news/%u'],
'SITE_NEWS_RSS' => ['/news.php?xml=true', '/news.xml'],
'SITE_SEARCH' => ['/search.php', '/search'],
'SITE_MEMBERS' => ['/members.php', '/members'],
'SITE_PREMIUM' => ['/support.php', '/support'],
'SITE_FAQ' => ['/faq.php', '/faq'],
'SITE_LOGIN' => ['/authenticate.php', '/login'],
'SITE_REGISTER' => ['/authenticate.php', '/register'],
'CHANGELOG' => ['/changelog.php', '/changelog'],
'INFO_PAGE' => ['/index.php?p=%s', '/p/%s'],
'AUTH_ACTION' => ['/authenticate.php', '/authenticate'],
// Forums
'FORUM_INDEX' => ['/index.php?forum=true', '/forum'],
'FORUM_SUB' => ['/viewforum.php?f=%u', '/forum/%u'],
'FORUM_THREAD' => ['/viewtopic.php?t=%u', '/forum/thread/%u'],
'FORUM_POST' => ['/viewtopic.php?p=%u', '/forum/post/%u'],
'FORUM_REPLY' => ['/posting.php?t=%u', '/forum/thread/%u/reply'],
'FORUM_NEW_THREAD' => ['/posting.php?f=%u', '/forum/%u/new'],
'FORUM_EDIT_POST' => ['/posting.php?p=%1$u&edit=%1$u', '/forum/post/%u/edit'],
'FORUM_DELETE_POST' => ['/posting.php?p=%1$u&delete=%1$u', '/forum/post/%u/delete'],
'FORUM_QUOTE_POST' => ['/posting.php?p=%1$u&quote=%1$u', '/forum/post/%u/quote'],
// Image serve references
'IMAGE_AVATAR' => ['/imageserve.php?m=avatar&u=%u', '/a/%u'],
'IMAGE_BACKGROUND' => ['/imageserve.php?m=background&u=%u', '/bg/%u'],
'IMAGE_HEADER' => ['/imageserve.php?m=header&u=%u', '/u/%u/header'],
// User actions
'USER_LOGOUT' => ['/authenticate.php?mode=logout&time=%u&session=%s&redirect=%s', '/logout?mode=logout&time=%u&session=%s&redirect=%s'],
'USER_PROFILE' => ['/profile.php?u=%s', '/u/%s'],
'USER_REPORT' => ['/report.php?mode=user&u=%u', '/u/%u/report'],
// Settings urls
'SETTINGS_INDEX' => ['/settings.php', '/settings'],
'SETTING_CAT' => ['/settings.php?cat=%s', '/settings/%s'],
'SETTING_MODE' => ['/settings.php?cat=%s&mode=%s', '/settings/%s/%s'],
'MESSAGES_INDEX' => ['/settings.php?cat=messages', '/messages'],
'MESSAGES_MODE' => ['/settings.php?cat=messages&mode=%s', '/messages/%s'],
// Friend Actions
'FRIEND_ACTION' => ['/settings.php?friend-action=true', '/friends'],
'FRIEND_ADD' => ['/settings.php?friend-action=true&add=%u&session=%s&time=%u&redirect=%s', '/friends?add=%u&session=%s&time=%u&redirect=%s'],
'FRIEND_REMOVE' => ['/settings.php?friend-action=true&remove=%u&session=%s&time=%u&redirect=%s', '/friends?remove=%u&session=%s&time=%u&redirect=%s'],
// Manage urls
'MANAGE_INDEX' => ['/manage.php', '/manage']
];
// Get a formatted url
public function format($id, $args = [], $rewrite = null) {
// Check if the requested url exists
if(!array_key_exists($id, $this->urls)) {
return null;
}
// Check if mod_rewrite is enabled
$rewrite = ($rewrite === null ? Configuration::getConfig('url_rewrite') : $rewrite) ? 1 : 0;
// Format urls
$formatted = vsprintf($this->urls[$id][$rewrite], $args);
// Return the formatted url
return $formatted;
}
}

View file

@ -30,7 +30,7 @@ class Users {
'lastunamechange' => 0,
'birthday' => '',
'posts' => 0,
'country' => 'EU',
'country' => 'XX',
'userData' => '[]'
];

View file

@ -35,6 +35,7 @@ require_once ROOT .'_sakura/components/Main.php';
require_once ROOT .'_sakura/components/Hashing.php';
require_once ROOT .'_sakura/components/Configuration.php';
require_once ROOT .'_sakura/components/Database.php';
require_once ROOT .'_sakura/components/Urls.php';
require_once ROOT .'_sakura/components/Templates.php';
require_once ROOT .'_sakura/components/Permissions.php';
require_once ROOT .'_sakura/components/Sessions.php';
@ -71,6 +72,9 @@ ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null);
// Create a user object for the current logged in user
$currentUser = new User(Session::$userId);
// Create the Urls object
$urls = new Urls();
// Prepare the name of the template to load (outside of SAKURA_NO_TPL because it's used in imageserve.php)
$templateName = defined('SAKURA_MANAGE') ? Configuration::getConfig('manage_style') : (
(
@ -163,7 +167,8 @@ if(!defined('SAKURA_NO_TPL')) {
],
'user' => $currentUser
'user' => $currentUser,
'urls' => $urls
];

View file

@ -1,9 +1,9 @@
{% if session.checkLogin %}
<div class="head">Hi, {{ user.data.username }}!</div>
<a href="/settings/appearance/avatar/"><img src="/a/{{ user.data.id }}" class="default-avatar-setting homepage-menu-avatar" /></a>
<a href="{{ urls.format('SETTING_MODE', ['appearance', 'avatar']) }}"><img src="{{ urls.format('IMAGE_AVATAR', [user.data.id]) }}" class="default-avatar-setting homepage-menu-avatar" /></a>
<ul class="panelQuickLinks">
<li><a href="/settings/friends/requests/" title="Pending friend requests"><span class="fa fa-user-plus"></span><span class="count">{{ page.friend_req|length }}</span></a></li>
<li><a href="/messages" title="View private messages"><span class="fa fa-envelope"></span><span class="count">0</span></a></li>
<li><a href="{{ urls.format('SETTING_MODE', ['friends', 'requests']) }}" title="Pending friend requests"><span class="fa fa-user-plus"></span><span class="count">{{ page.friend_req|length }}</span></a></li>
<li><a href="{{ urls.format('MESSAGES_INDEX') }}" title="View private messages"><span class="fa fa-envelope"></span><span class="count">0</span></a></li>
</ul>
<div class="clear"></div>
{% else %}
@ -17,20 +17,20 @@
<div class="head">Welcome!</div>
Welcome to Flashii! This is a site for a bunch of friends to hang out, nothing special. Anyone is pretty much welcome to register so why not have a go?
<div class="indexSidePanelLinks">
<a class="fa fa-magic" href="/register" title="Register" id="indexSidePanelRegister"></a>
<a class="fa fa-sign-in" href="/login" title="Login" id="indexSidePanelLogin"></a>
<a class="fa fa-magic" href="{{ urls.format('SITE_REGISTER') }}" title="Register" id="indexSidePanelRegister"></a>
<a class="fa fa-sign-in" href="{{ urls.format('SITE_LOGIN') }}" title="Login" id="indexSidePanelLogin"></a>
</div>
{% endif %}
{% endif %}
<div class="head">Stats</div>
We have <b>{{ stats.userCount }} user{% if stats.userCount != 1 %}s{% endif %}</b>,
<b><a href="/u/{{ stats.newestUser.data.id }}" class="default">{{ stats.newestUser.data.username }}</a></b> is the newest user,
<b><a href="{{ urls.format('USER_PROFILE', [stats.newestUser.data.id]) }}" class="default">{{ stats.newestUser.data.username }}</a></b> is the newest user,
it has been <b>{{ stats.lastRegDate }}</b> since the last user registered and the forum has <b>{{ stats.topicCount }} thread{% if stats.topicCount != 1 %}s{% endif %}</b> and <b>{{ stats.postCount }} post{% if stats.postCount != 1 %}s{% endif %}</b>.
<div class="head">Online Users</div>
{% if stats.onlineUsers %}
All active users in the past 5 minutes:<br />
{% for amount,onlineUser in stats.onlineUsers %}
<a href="/u/{{ onlineUser.id }}" style="font-weight: bold;" class="default">{{ onlineUser.username }}</a>{% if amount != (stats.onlineUsers|length - 1) %}, {% endif %}
<a href="{{ urls.format('USER_PROFILE', [onlineUser.id]) }}" style="font-weight: bold;" class="default">{{ onlineUser.username }}</a>{% if amount != (stats.onlineUsers|length - 1) %}, {% endif %}
{% endfor %}
{% else %}
There were no online users in the past 5 minutes.

View file

@ -1,9 +1,9 @@
{% if not page.view_post %}<a href="/news/{{ newsPost.id }}" class="news-head" id="n{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %}
{% if not page.view_post %}<a href="{{ urls.format('SITE_NEWS_POST', [newsPost.id]) }}" class="news-head" id="{{ newsPost.category}}_{{ newsPost.id }}">{{ newsPost.title }}</a>{% endif %}
<div class="news-body">
<a class="no-underline" href="/u/{{ newsPost.uid }}">
<a class="no-underline" href="{{ urls.format('USER_PROFILE', [newsPost.uid]) }}">
<div class="news-poster">
<img src="/a/{{ newsPost.uid }}" alt="{{ newsPost.udata.username }}" class="default-avatar-setting" />
<h1 style="color: {{ newsPost.rdata.colour }} !important; text-shadow: 0 0 7px #888; padding: 0 0 10px;">{{ newsPost.udata.username }}</h1>
<img src="{{ urls.format('IMAGE_AVATAR', [newsPost.uid]) }}" alt="{{ newsPost.udata.username }}" class="default-avatar-setting" />
<h1 style="color: {{ newsPost.rdata.colour }}; text-shadow: 0 0 7px {% if newsPost.rdata.colour != 'inherit' %}{{ newsPost.rdata.colour }}{% else %}#222{% endif %};; padding: 0 0 10px;">{{ newsPost.udata.username }}</h1>
</div>
</a>
<div class="markdown">
@ -12,5 +12,5 @@
</div>
<div class="clear"></div>
<div class="news-post-time">
Posted on {{ newsPost.date|date(sakura.dateFormat) }}{% if not page.view_post %} <a class="default" href="/news/{{ newsPost.id }}">View comments</a>{% endif %}
Posted on {{ newsPost.date|date(sakura.dateFormat) }}{% if not page.view_post %} <a class="default" href="{{ urls.format('SITE_NEWS_POST', [newsPost.id]) }}">X comments</a>{% endif %}
</div>

View file

@ -6,7 +6,7 @@
<div>{{ category.title }}</div>
{% for mname,mode in category.modes %}
{% if mode.access %}
<a href="/{% if catname != 'messages' %}settings/{% endif %}{{ catname }}/{{ mname }}/">{{ mode.title }}</a>
<a href="{{ urls.format('SETTING_MODE', [catname, mname]) }}">{{ mode.title }}</a>
{% endif %}
{% endfor %}
{% endfor %}

View file

@ -17,7 +17,7 @@
<li>You were banned on {{ ban.issued|date(sakura.dateFormat) }}.</li>
<li>{% if ban.expires %}This ban expires on {{ ban.expires|date(sakura.dateFormat) }}.{% else %}<b>You are permanently banned.</b>{% endif %}</li>
{% if ban.expires %}
<li>You were banned by <a href="/u/{{ ban.issuer.id }}" class="default">{{ ban.issuer.username }}</a>.</li>
<li>You were banned by <a href="{{ urls.format('USER_PROFILE', [ban.issuer.id]) }}" class="default">{{ ban.issuer.username }}</a>.</li>
{% endif %}
</ul>
</div>

View file

@ -1,11 +1,11 @@
<div class="buttonRow pagination">
<div class="leftSide">
<a href="/forum/{% if board.viewtopic %}{{ topic.forum_id }}/{% endif %}" class="forumbtn"><span class="fa fa-backward"></span> Back</a>
<a href="{% if board.viewtopic %}{{ urls.format('FORUM_SUB', [topic.forum_id]) }}{% else %}{{ urls.format('FORUM_INDEX') }}{% endif %}" class="forumbtn"><span class="fa fa-backward"></span> Back</a>
{% if board.viewtopic %}
<a href="/forum/thread/{{ topic.topic_id }}/reply" class="forumbtn"><span class="fa fa-reply-all"></span> Reply</a>
<a href="{{ urls.format('FORUM_REPLY', [topic.topic_id]) }}" class="forumbtn"><span class="fa fa-reply-all"></span> Reply</a>
{% endif %}
{% if board.viewforum %}
<a href="/forum/{{ board.forums[0].forum.forum_id }}/new" class="forumbtn"><span class="fa fa-pencil-square-o"></span> New Thread</a>
<a href="{{ urls.format('FORUM_NEW_THREAD', [board.forums[0].forum.forum_id]) }}" class="forumbtn"><span class="fa fa-pencil-square-o"></span> New Thread</a>
{% endif %}
</div>
<div class="rightSide">

View file

@ -1,6 +1,6 @@
{% if category.forums|length and category.forum|length %}
<tr class="forumCategory">
<td class="forumCategoryTitleColumn" colspan="4">{% if category.forum.forum_type != 1 %}Subforums{% else %}<a href="/forum/{{ category.forum.forum_id }}/" class="clean">{{ category.forum.forum_name }}</a>{% endif %}</td>
<td class="forumCategoryTitleColumn" colspan="4">{% if category.forum.forum_type != 1 %}Subforums{% else %}<a href="{{ urls.format('FORUM_SUB', [category.forum.forum_id]) }}" class="clean">{{ category.forum.forum_name }}</a>{% endif %}</td>
</tr>
{% for forum in category.forums %}
<tr class="forumForum">
@ -8,14 +8,14 @@
<div class="forumIcon read fa fa-3x {% if forum.forum_icon %}{{ forum.forum_icon }}{% else %}{% if forum.forum_type == 2 %}fa-chevron-circle-right{% elseif forum.forum_type == 1 %}fa-folder{% else %}fa-comments{% endif %}{% endif %}"></div>
</td>
<td class="forumTitleColumn"{% if forum.forum_type == 2 %} colspan="3"{% endif %}>
<div class="name"><a href="{% if forum.forum_type == 2 %}{{ forum.forum_link }}" target="_blank"{% else %}/forum/{{ forum.forum_id }}/"{% endif %} class="default">{{ forum.forum_name }}</a></div>
<div class="name"><a href="{% if forum.forum_type == 2 %}{{ forum.forum_link }}{% else %}{{ urls.format('FORUM_SUB', [forum.forum_id]) }}{% endif %}" class="default">{{ forum.forum_name }}</a></div>
<div class="desc">
{{ forum.forum_desc }}
{% if board.forums[forum.forum_id]|length %}
<div class="subforums" style="margin-top: 3px; margin-left: -5px; font-weight: bold;">
Subforums:
{% for forum in board.forums[forum.forum_id].forums %}
<a href="{% if forum.forum_type == 2 %}{{ forum.forum_link }}" target="_blank"{% else %}/forum/{{ forum.forum_id }}/"{% endif %}" class="default">{{ forum.forum_name }}</a>
<a href="{% if forum.forum_type == 2 %}{{ forum.forum_link }}{% else %}{{ urls.format('FORUM_SUB', [forum.forum_id]) }}{% endif %}" class="default">{{ forum.forum_name }}</a>
{% endfor %}
</div>
{% endif %}
@ -29,7 +29,7 @@
<td class="forumLastColumn">
<div>
{% if forum.last_poster.user.id %}
<a href="/forum/thread/{{ forum.last_poster.post.topic_id }}" class="default">{{ forum.last_poster.post.post_subject }}</a><br /><span title="{{ forum.last_poster.post.post_time|date(sakura.dateFormat) }}">{{ forum.last_poster.elap }}</span> by {% if forum.last_poster.user.id %}<a href="/u/{{ forum.last_poster.user.id }}" class="default" style="color: {% if forum.last_poster.user.name_colour %}{{ forum.last_poster.user.name_colour }}{% else %}{{ forum.last_poster.rank.colour }}{% endif %};">{{ forum.last_poster.user.username }}</a>{% else %}[deleted user]{% endif %} <a href="/forum/post/{{ forum.last_poster.post.post_id }}#p{{ forum.last_poster.post.post_id }}" class="default fa fa-tag"></a>
<a href="{{ urls.format('FORUM_THREAD', [forum.last_poster.post.topic_id]) }}" class="default">{{ forum.last_poster.post.post_subject }}</a><br /><span title="{{ forum.last_poster.post.post_time|date(sakura.dateFormat) }}">{{ forum.last_poster.elap }}</span> by {% if forum.last_poster.user.id %}<a href="{{ urls.format('USER_PROFILE', [forum.last_poster.user.id]) }}" class="default" style="color: {% if forum.last_poster.user.name_colour %}{{ forum.last_poster.user.name_colour }}{% else %}{{ forum.last_poster.rank.colour }}{% endif %};">{{ forum.last_poster.user.username }}</a>{% else %}[deleted user]{% endif %} <a href="{{ urls.format('FORUM_POST', [forum.last_poster.post.post_id]) }}#p{{ forum.last_poster.post.post_id }}" class="default fa fa-tag"></a>
{% else %}
There are no posts in this forum.<br />&nbsp;
{% endif %}

View file

@ -3,11 +3,11 @@
<div class="fa fa-2x fa-{% if topic.topic_status == 1 %}lock{% elseif topic.topic_type == 2 %}exclamation{% elseif topic.topic_type == 1 %}thumb-tack{% else %}navicon{% endif %}"></div>
</td>
<td class="topicTitle">
<a href="/forum/thread/{{ topic.topic_id }}" class="default">{{ topic.topic_title }}</a>
<a href="{{ urls.format('FORUM_THREAD', [topic.topic_id]) }}" class="default">{{ topic.topic_title }}</a>
</td>
<td class="topicAuthor">
{% if topic.first_poster.user.id %}
<a href="/u/{{ topic.first_poster.user.id }}" class="default" style="color: {% if topic.first_poster.user.name_colour %}{{ topic.first_poster.user.name_colour }}{% else %}{{ topic.first_poster.rank.colour }}{% endif %};">{{ topic.first_poster.user.username }}</a>
<a href="{{ urls.format('USER_PROFILE', [topic.first_poster.user.id]) }}" class="default" style="color: {% if topic.first_poster.user.name_colour %}{{ topic.first_poster.user.name_colour }}{% else %}{{ topic.first_poster.rank.colour }}{% endif %};">{{ topic.first_poster.user.username }}</a>
{% else %}
[deleted user]
{% endif %}
@ -18,10 +18,10 @@
</td>
<td class="topicLast">
{% if topic.last_poster.user.id %}
<a href="/u/{{ topic.last_poster.user.id }}" class="default" style="color: {% if topic.last_poster.user.name_colour %}{{ topic.last_poster.user.name_colour }}{% else %}{{ topic.last_poster.rank.colour }}{% endif %};">{{ topic.last_poster.user.username }}</a>
<a href="{{ urls.format('USER_PROFILE', [topic.last_poster.user.id]) }}" class="default" style="color: {% if topic.last_poster.user.name_colour %}{{ topic.last_poster.user.name_colour }}{% else %}{{ topic.last_poster.rank.colour }}{% endif %};">{{ topic.last_poster.user.username }}</a>
{% else %}
[deleted user]
{% endif %} <a href="/forum/post/{{ topic.last_poster.post.post_id }}#p{{ topic.last_poster.post.post_id }}" class="default fa fa-tag"></a><br />
{% endif %} <a href="{{ urls.format('FORUM_POST', [topic.last_poster.post.post_id]) }}#p{{ topic.last_poster.post.post_id }}" class="default fa fa-tag"></a><br />
<span title="{{ topic.last_poster.post.post_time|date(sakura.dateFormat) }}">{{ topic.last_poster.elap }}</span>
</td>
</tr>

View file

@ -7,8 +7,8 @@
{% for post in posts %}
<tr class="post" id="p{{ post.post_id }}">
<td class="userpanel">
{% if post.user.rank_main > 1 %}<a href="/u/{{ post.user.id }}" class="default username" style="color: {% if post.user.name_colour %}{{ post.user.name_colour }}{% else %}{{ post.rank.colour }}{% endif %};" title="Go to {{ post.user.username }}'s profile">{{ post.user.username }}</a>
<img src="/a/{{ post.user.id }}" alt="{{ post.user.username }}" class="avatar" style="box-shadow: 0 3px 7px #{% if post.is_online %}484{% else %}844{% endif %};" />
{% if post.user.rank_main > 1 %}<a href="{{ urls.format('USER_PROFILE', [post.user.id]) }}" class="default username" style="color: {% if post.user.name_colour %}{{ post.user.name_colour }}{% else %}{{ post.rank.colour }}{% endif %};" title="Go to {{ post.user.username }}'s profile">{{ post.user.username }}</a>
<img src="{{ urls.format('IMAGE_AVATAR', [post.user.id]) }}" alt="{{ post.user.username }}" class="avatar" style="box-shadow: 0 3px 7px #{% if post.is_online %}484{% else %}844{% endif %};" />
{% else %}
<a class="username">[deleted user]</a>
{% endif %}
@ -18,14 +18,14 @@
{% if session.checkLogin %}
<div class="actions">
{% if user.data.id == post.user.id %}
<a class="fa fa-pencil-square-o" title="Edit this post" href="/forum/post/{{ post.post_id }}/edit"></a>
<a class="fa fa-trash" title="Delete this post" href="/forum/post/{{ post.post_id }}/delete"></a>
<a class="fa fa-pencil-square-o" title="Edit this post" href="{{ urls.format('FORUM_EDIT_POST', [post.post_id]) }}"></a>
<a class="fa fa-trash" title="Delete this post" href="{{ urls.format('FORUM_DELETE_POST', [post.post_id]) }}"></a>
{% elseif post.user.rank_main > 1 %}
{% if post.is_friend != 0 %}<a class="fa fa-{% if post.is_friend == 2 %}heart{% else %}star{% endif %}" title="You are friends"></a>{% endif %}
<a class="fa fa-user-{% if post.is_friend == 0 %}plus{% else %}times{% endif %} forum-friend-toggle" title="{% if post.is_friend == 0 %}Add {{ post.user.username }} as a friend{% else %}Remove friend{% endif %}" href="/friends?{% if post.is_friend == 0 %}add{% else %}remove{% endif %}={{ post.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/forum/post/{{ post.post_id }}&amp;direct=true"></a>
<a class="fa fa-flag" title="Report {{ post.user.username }}" href="/u/{{ post.user.id }}/report"></a>
<a class="fa fa-user-{% if post.is_friend == 0 %}plus{% else %}times{% endif %} forum-friend-toggle" title="{% if post.is_friend == 0 %}Add {{ post.user.username }} as a friend{% else %}Remove friend{% endif %}" href="{% if post.is_friend == 0 %}{{ urls.format('FRIEND_ADD', [post.user.id, php.sessionid, php.time, sakura.currentPage]) }}{% else %}{{ urls.format('FRIEND_REMOVE', [post.user.id, php.sessionid, php.time, sakura.currentPage]) }}{% endif %}"></a>
<a class="fa fa-flag" title="Report {{ post.user.username }}" href="{{ urls.format('USER_REPORT', [post.user.id]) }}"></a>
{% endif %}
<a class="fa fa-reply" title="Quote this post" href="/forum/post/{{ post.post_id }}/quote"></a>
<a class="fa fa-reply" title="Quote this post" href="{{ urls.format('FORUM_QUOTE_POST', [post.post_id]) }}"></a>
</div>
{% endif %}
</div>
@ -36,7 +36,7 @@
<a href="#p{{ post.post_id }}" class="clean">{{ post.post_subject }}</a>
</div>
<div class="date">
<a href="/forum/post/{{ post.post_id }}#p{{ post.post_id }}" class="clean" title="{{ post.post_time|date(sakura.dateFormat) }}">{{ post.time_elapsed }}</a>
<a href="{{ urls.format('FORUM_POST', [post.post_id]) }}#p{{ post.post_id }}" class="clean" title="{{ post.post_time|date(sakura.dateFormat) }}">{{ post.time_elapsed }}</a>
</div>
<div class="clear"></div>
</div>

View file

@ -2,38 +2,37 @@
{% if not sakura.versionInfo.stable %}
<div style="background: repeating-linear-gradient(-45deg, #000, #000 10px, #FF0 10px, #FF0 20px); text-align: center; color: #FFF; box-shadow: 0px 0px 1em #FF0;">
<div style="background: linear-gradient(90deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .9) 10%, rgba(0, 0, 0, .9) 90%, rgba(0, 0, 0, 0) 100%); display: inline-block; padding: 0 40px;">
<h3><a style="color: inherit; text-decoration: none;" href="/changelog#r{{ sakura.versionInfo.version }}" target="_blank">Sakura Revision {{ sakura.versionInfo.version }} Development</a></h1>
<h3><a style="color: inherit; text-decoration: none;" href="{{ urls.format('CHANGELOG') }}#r{{ sakura.versionInfo.version }}" target="_blank">Sakura Revision {{ sakura.versionInfo.version }} Development</a></h1>
</div>
</div>
{% endif %}
</div>
<div class="footer">
<div class="ftsections">
<div class="copycentre">Copyright &copy; 2013-2015 <a href="//flash.moe/" target="_blank">Flashwave</a> &amp; <a href="http://circlestorm.net/" target="_blank">Circlestorm</a>, <a href="/credits">et al</a>.</div>
<div class="copycentre">&copy; 2013-2015 <a href="//flash.moe/" target="_blank">Flashwave</a>, et al.</div>
<ul class="ftsection">
<li class="fthead">General</li>
<li><a href="/" title="Flashii Frontpage">Home</a></li>
<li><a href="/news" title="Flashii News &amp; Updates">News</a></li>
<li><a href="/search" title="Do full-site search requests">Search</a></li>
<li><a href="/contact" title="Contact our Staff">Contact</a></li>
<li><a href="/changelog" title="All the changes made to Sakura are listed here">Changelog</a></li>
<li><a href="/feedback" target="_blank" title="Give us feedback on what to do">Feedback</a></li>
<li><a href="{{ urls.format('SITE_HOME') }}" title="Flashii Frontpage">Home</a></li>
<li><a href="{{ urls.format('SITE_NEWS') }}" title="Flashii News &amp; Updates">News</a></li>
<li><a href="{{ urls.format('SITE_SEARCH') }}" title="Do full-site search requests">Search</a></li>
<li><a href="{{ urls.format('INFO_PAGE', ['contact']) }}" title="Contact our Staff">Contact</a></li>
<li><a href="{{ urls.format('CHANGELOG') }}" title="All the changes made to Sakura are listed here">Changelog</a></li>
<li><a href="{{ urls.format('SITE_PREMIUM') }}" title="Get Tenshi and help us pay the bills">Support us</a></li>
</ul>
<ul class="ftsection">
<li class="fthead">Community</li>
<li><a href="/forum" title="Read and post on our forums">Forums</a></li>
<li><a href="{{ urls.format('FORUM_INDEX') }}" title="Read and post on our forums">Forums</a></li>
<li><a href="https://twitter.com/_flashii" target="_blank" title="Follow us on Twitter for news messages that are too short for the news page">Twitter</a></li>
<li><a href="https://youtube.com/user/flashiinet" target="_blank" title="Our YouTube page where stuff barely ever gets uploaded, mainly used to archive community creations">YouTube</a></li>
<li><a href="//steamcommunity.com/groups/flashiinet" target="_blank" title="Our Steam group, play games with other members on the site">Steam</a></li>
<li><a href="https://steamcommunity.com/groups/flashiinet" target="_blank" title="Our Steam group, play games with other members on the site">Steam</a></li>
<li><a href="https://bitbucket.org/circlestorm" target="_blank" title="Our Open Source repository thing">BitBucket</a></li>
</ul>
<ul class="ftsection">
<li class="fthead">Information</li>
<li><a href="/faq" title="Questions that get Asked Frequently but not actually">FAQ</a></li>
<li><a href="/p/rules" title="Some Rules and Information kind of summing up the ToS">Rules</a></li>
<li><a href="/credits" title="Here everyone who's helped Flashii get to where it is now is listed">Credits</a></li>
<li><a href="http://status.flashii.net" target="_blank" title="Check the status on our Servers and related services">Server Status</a></li>
<li><a href="/p/terms" title="Our Terms of Service">Terms of Service</a></li>
<li><a href="{{ urls.format('SITE_FAQ') }}" title="Questions that get Asked Frequently but not actually">FAQ</a></li>
<li><a href="{{ urls.format('INFO_PAGE', ['rules']) }}" title="Some Rules and Information kind of summing up the ToS">Rules</a></li>
<li><a href="//fiistat.us" target="_blank" title="Check the status on our Servers and related services">Server Status</a></li>
<li><a href="{{ urls.format('INFO_PAGE', ['terms']) }}" title="Our Terms of Service">Terms of Service</a></li>
</ul>
</div>
</div>

View file

@ -162,31 +162,29 @@
<div class="menu">
<div class="menu-nav fa" id="navMenuSite">
<!-- Navigation menu, displayed on left side of the bar. -->
<a class="menu-item fa-home" href="/" title="Home"></a>
<a class="menu-item fa-newspaper-o" href="/news" title="News"></a>
<a class="menu-item fa-home" href="{{ urls.format('SITE_HOME') }}" title="Home"></a>
<a class="menu-item fa-newspaper-o" href="{{ urls.format('SITE_NEWS') }}" title="News"></a>
<a class="menu-item fa-commenting" href="//chat.{{ sakura.urlMain }}/" title="Chat"></a>
{% if user.checkPermission('FORUM', 'USE_FORUM') %}
<a class="menu-item fa-list" href="/forum" title="Forums"></a>
{% endif %}
<a class="menu-item fa-search" href="/search" title="Search"></a>
<a class="menu-item fa-list" href="{{ urls.format('FORUM_INDEX') }}" title="Forums"></a>
<a class="menu-item fa-search" href="{{ urls.format('SITE_SEARCH') }}" title="Search"></a>
{% if session.checkLogin %}
<a class="menu-item fa-users" href="/members" title="Members"></a>
<a class="menu-item fa-heart" href="/support" title="Support us"></a>
<a class="menu-item fa-users" href="{{ urls.format('SITE_MEMBERS') }}" title="Members"></a>
<a class="menu-item fa-heart" href="{{ urls.format('SITE_PREMIUM') }}" title="Support us"></a>
{% endif %}
</div>
<div class="menu-ucp fa" id="navMenuUser">
<!-- User menu, displayed on right side of the bar. -->
{% if session.checkLogin %}
<a class="menu-item avatar" href="/u/{{ user.data.id }}" title="Logged in as {{ user.data.username }}" style="background-image: url('/a/{{ user.data.id }}'); width: auto; color: {{ user.colour }}; font-weight: 700;"></a>
<a class="menu-item fa-envelope" href="/messages" title="Messages"></a>
<a class="menu-item fa-gavel" href="/manage" title="Manage"></a>
<a class="menu-item fa-cogs" href="/settings" title="Settings"></a>
<a class="menu-item fa-sign-out" href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentPage }}" title="Logout" id="headerLogoutLink"></a>
<a class="menu-item avatar" href="{{ urls.format('USER_PROFILE', [user.data.id]) }}" title="Logged in as {{ user.data.username }}" style="background-image: url('{{ urls.format('IMAGE_AVATAR', [user.data.id]) }}'); width: auto; color: {{ user.colour }}; font-weight: 700;"></a>
<a class="menu-item fa-envelope" href="{{ urls.format('SETTING_CAT', ['messages']) }}" title="Messages"></a>
<a class="menu-item fa-gavel" href="{{ urls.format('MANAGE_INDEX') }}" title="Manage"></a>
<a class="menu-item fa-cogs" href="{{ urls.format('SETTINGS_INDEX') }}" title="Settings"></a>
<a class="menu-item fa-sign-out" href="{{ urls.format('USER_LOGOUT', [php.time, php.sessionid, sakura.currentPage]) }}" title="Logout" id="headerLogoutLink"></a>
{% else %}
{% if sakura.lockAuth %}
<div class="menu-item fa-lock" style="padding-left: 10px; padding-right: 10px;" title="Authentication is locked"></div>
{% else %}
<a class="menu-item fa-sign-in" href="/authenticate" title="Login"></a>
<a class="menu-item fa-sign-in" href="{{ urls.format('SITE_LOGIN') }}" title="Login"></a>
{% endif %}
{% endif %}
</div>
@ -196,10 +194,10 @@
<div id="contentwrapper">
<div id="notifications"></div>
{% if php.self == '/profile.php' ? profile.data.userData.profileBackground : (user.checkPermission('SITE', 'CREATE_BACKGROUND') and user.data.userData.userOptions.profileBackgroundSiteWide and user.data.userData.profileBackground) %}
<div id="userBackground" style="background-image: url('/bg/{{ (php.self == '/profile.php' ? profile : user).data.id }}');"></div>
<div id="userBackground" style="background-image: url('{{ urls.format('IMAGE_BACKGROUND', [(php.self == '/profile.php' ? profile : user).data.id]) }}');"></div>
{% endif %}
{% if not session.checkLogin and php.self != '/authenticate.php' %}
<form method="post" action="/authenticate" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');">
<form method="post" action="{{ urls.format('AUTH_ACTION') }}" id="headerLoginForm" onkeydown="formEnterCatch(event, 'headerLoginButton');">
<input type="hidden" name="redirect" value="{{ sakura.currentPage }}" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
@ -224,7 +222,7 @@
{% if user.checkPermission('SITE', 'RESTRICTED') %}
<div class="headerNotify" style="padding-top: 10px; padding-bottom: 10px; background: repeating-linear-gradient(-45deg, #B33, #B33 10px, #B00 10px, #B00 20px); text-align: center; color: #FFF; border: 1px solid #C00; box-shadow: 0px 0px 3px #C00;">
<h1>Your account is current in <span style="font-width: 700 !important;">restricted mode</span>!</h1>
<div>A staff member has set your account to restricted mode most likely due to violation of the rules. While restricted you won't be able to use most public features of the site. If you think this is a mistake please <a href="/contact" style="color: inherit;">get in touch with one of our staff members</a>.</div>
<div>A staff member has set your account to restricted mode most likely due to violation of the rules. While restricted you won't be able to use most public features of the site. If you think this is a mistake please <a href="{{ urls.format('INFO_PAGE', ['contact']) }}" style="color: inherit;">get in touch with one of our staff members</a>.</div>
</div>
{% endif %}
<noscript>

View file

@ -1,6 +1,6 @@
{% include 'global/header.tpl' %}
{% if sakura.lockAuth %}
<h1 class="stylised" style="line-height: 1.8em; text-align: center;">Authentication is currently disallowed, try again later.</h1>
<h1 class="stylised" style="line-height: 1.8em; text-align: center;">Authentication is currently disallowed, try again later.</h1>
{% else %}
<div class="loginPage">
<div class="loginCont">
@ -8,7 +8,7 @@
<div class="head">
Login to {{ sakura.siteName }}
</div>
<form method="post" action="/authenticate" id="loginForm">
<form method="post" action="{{ urls.format('AUTH_ACTION') }}" id="loginForm">
<input type="hidden" name="redirect" value="{{ auth.redirect }}" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
@ -37,7 +37,7 @@
<div class="head">
Lost Password
</div>
<form method="post" action="/authenticate" id="passwordForm">
<form method="post" action="{{ urls.format('AUTH_ACTION') }}" id="passwordForm">
<input type="hidden" name="mode" value="forgotpassword" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
@ -68,7 +68,7 @@
Register on {{ sakura.siteName }}
</div>
{% if not sakura.disableRegistration %}
<form id="registerForm" method="post" action="/authenticate" style="display:{% if auth.blockRegister.do %}none{% else %}block{% endif %};">
<form id="registerForm" method="post" action="{{ urls.format('AUTH_ACTION') }}" style="display:{% if auth.blockRegister.do %}none{% else %}block{% endif %};">
<input type="hidden" name="mode" value="register" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
@ -97,36 +97,36 @@
<input class="inputStyling" type="password" id="registerConfirmPassword" name="confirmpassword" onkeyup="registerVarCheck(this.id, 'confirmpw', 'registerPassword');" placeholder="Just to make sure" />
</div>
{% if sakura.requireRegCodes %}
<div class="leftAlign">
<label for="registerCode">Registration Code:</label>
</div>
<div class="centreAlign">
<input class="inputStyling" type="text" id="registerCode" name="registercode" placeholder="Ask another member for one" />
</div>
<div class="leftAlign">
<label for="registerCode">Registration Code:</label>
</div>
<div class="centreAlign">
<input class="inputStyling" type="text" id="registerCode" name="registercode" placeholder="Ask another member for one" />
</div>
{% endif %}
{% if sakura.recaptchaEnable %}
<div class="leftAlign">
<label for="recaptcha_response_field">Verification:</label>
</div>
<div class="centreAlign">
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="{{ sakura.recaptchaPublic }}" style="margin: auto; display: inline-block;"></div>
<noscript>
<div style="width: 302px; height: 352px; margin: auto; display: inline-block;">
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k={{ sakura.recaptchaPublic }}" frameborder="0" scrolling="no" style="width: 302px; height:352px; border-style: none;"></iframe>
</div>
<div style="width: 250px; height: 80px; position: absolute; border-style: none; bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 80px; border: 1px solid #c1c1c1; margin: 0px; padding: 0px; resize: none;" value=""></textarea>
<div class="leftAlign">
<label for="recaptcha_response_field">Verification:</label>
</div>
<div class="centreAlign">
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
<div class="g-recaptcha" data-sitekey="{{ sakura.recaptchaPublic }}" style="margin: auto; display: inline-block;"></div>
<noscript>
<div style="width: 302px; height: 352px; margin: auto; display: inline-block;">
<div style="width: 302px; height: 352px; position: relative;">
<div style="width: 302px; height: 352px; position: absolute;">
<iframe src="https://www.google.com/recaptcha/api/fallback?k={{ sakura.recaptchaPublic }}" frameborder="0" scrolling="no" style="width: 302px; height:352px; border-style: none;"></iframe>
</div>
<div style="width: 250px; height: 80px; position: absolute; border-style: none; bottom: 21px; left: 25px; margin: 0px; padding: 0px; right: 25px;">
<textarea id="g-recaptcha-response" name="g-recaptcha-response" class="g-recaptcha-response" style="width: 250px; height: 80px; border: 1px solid #c1c1c1; margin: 0px; padding: 0px; resize: none;" value=""></textarea>
</div>
</div>
</div>
</div>
</noscript>
</div>
</noscript>
</div>
{% endif %}
<div class="subLinks centreAlign">
<input class="inputStyling" name="tos" type="checkbox" class="ignore-css" id="registerToS" /><label for="registerToS">I agree to the <a class="default" href="/p/terms" target="_blank">Terms of Service</a>.
<input class="inputStyling" name="tos" type="checkbox" class="ignore-css" id="registerToS" /><label for="registerToS">I agree to the <a class="default" href="{{ urls.format('INFO_PAGE', ['terms']) }}" target="_blank">Terms of Service</a>.
</div>
<div class="centreAlign">
<input class="inputStyling" type="submit" name="submit" value="Register" id="registerAccBtn" />
@ -142,7 +142,7 @@
<p>If we find out that you already have an account we may question you about it, if you can give a good reason we'll let it slide otherwise we may issue a temporary ban.</p>
</div>
<div class="subLinks centreAlign">
<a href="javascript:;" class="default" onclick="document.getElementById('registerWarn').style.display='none';document.getElementById('registerForm').style.display='block';">Register anyway</a>.
<a href="javascript:void(0);" class="default" onclick="document.getElementById('registerWarn').style.display='none'; document.getElementById('registerForm').style.display='block';">Register anyway</a>.
</div>
</div>
{% endif %}
@ -161,7 +161,7 @@
<div class="head">
Resend Activation E-mail
</div>
<form method="post" action="/authenticate" id="resendForm">
<form method="post" action="{{ urls.format('AUTH_ACTION') }}" id="resendForm">
<input type="hidden" name="mode" value="resendactivemail" />
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />

View file

@ -1,40 +0,0 @@
{% include 'global/header.tpl' %}
<div class="content standalone markdown">
<h1>Credits</h1>
<p>This is the Sakura contributor list.</p>
<h3>People</h3>
<table>
<thead>
<tr>
<th>Name</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for contribname, contributor in contributors %}
<tr>
<td><a href="{{ contributor[1] }}" target="_blank">{{ contribname }}</a></td>
<td>{{ contributor[0] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
<h3>Tools</h3>
<table>
<thead>
<tr>
<th>Service</th>
<th>Description</th>
</tr>
</thead>
<tbody>
{% for thirdName, thirdData in thirdParty %}
<tr>
<td><a href="{{ thirdData[1] }}" target="_blank">{{ thirdName }}</a></td>
<td>{{ thirdData[0] }}</td>
</tr>
{% endfor %}
</tbody>
</table>
</div>
{% include 'global/footer.tpl' %}

View file

@ -1,7 +1,7 @@
{% include 'global/header.tpl' %}
<div class="content news settings">
<div class="head">Forgot Password</div>
<form method="post" action="/authenticate" id="passwordForm">
<form method="post" action="{{ urls.format('AUTH_ACTION') }}" id="passwordForm">
<input type="hidden" name="session" value="{{ php.sessionid }}" />
<input type="hidden" name="time" value="{{ php.time }}" />
<input type="hidden" name="uid" value="{{ auth.userId }}" />

View file

@ -4,7 +4,7 @@
{% include 'elements/indexPanel.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">News <a href="/news.xml" class="fa fa-rss news-rss default"></a></div>
<div class="head">News <a href="{{ urls.format('SITE_NEWS_RSS') }}" class="fa fa-rss news-rss default"></a></div>
{% for newsPost in newsPosts %}
{% include 'elements/newsPost.tpl' %}
{% endfor %}
@ -12,15 +12,4 @@
<div class="clear"></div>
</div>
<script type="text/javascript" src="{{ sakura.resources }}/js/ybabstat.js"></script>
<script type="text/javascript">
var disqus_shortname = 'flashii';
(function () {
var s = document.createElement('script');
s.async = true;
s.type = 'text/javascript';
s.src = '//' + disqus_shortname + '.disqus.com/count.js';
(document.getElementsByTagName('HEAD')[0] || document.getElementsByTagName('BODY')[0]).appendChild(s);
}());
</script>
{% include 'global/footer.tpl' %}

View file

@ -21,13 +21,12 @@ RewriteRule ^login/?$|^logout/?$|^activate/?$|^register/?$|^forgotpassword/?|^au
RewriteRule ^support/?$ support.php [L,QSA]
RewriteRule ^support/tracker/?$ support.php?tracker=true [L,QSA]
RewriteRule ^support/tracker/([0-9]+)/?$ support.php?tracker=true&page=$1 [L,QSA]
RewriteRule ^contact/?$ infopage.php?p=contact [L,QSA]
RewriteRule ^changelog/?$ changelog.php [L,QSA]
RewriteRule ^faq/?$ faq.php [L,QSA]
RewriteRule ^search/?$ search.php [L,QSA]
# Info pages
RewriteRule ^p/([a-z]+)/?$ infopage.php?p=$1 [L,QSA]
RewriteRule ^p/([a-z]+)/?$ index.php?p=$1 [L,QSA]
# News
RewriteRule ^news/?$ news.php [L,QSA]
@ -42,10 +41,6 @@ RewriteRule ^settings/([a-z]+)/([a-z]+)/?$ settings.php?cat=$1&mode=$2 [L,QSA]
RewriteRule ^settings/([a-z]+)/([a-z]+)/p([0-9]+)/?$ settings.php?cat=$1&mode=$2&page=$3 [L,QSA]
RewriteRule ^friends/?$ settings.php?friend-action=true [L,QSA]
# Private Messages
RewriteRule ^messages/?$ settings.php?cat=messages [L,QSA]
RewriteRule ^messages/([a-z]+)/?$ settings.php?cat=messages&mode=$1 [L,QSA]
# Members
RewriteRule ^members/?$ members.php [L,QSA]
RewriteRule ^members/([a-z]+)/?$ members.php?sort=$1 [L,QSA]
@ -75,13 +70,14 @@ RewriteRule ^a/([0-9]+)$|a/([0-9]+).png$ imageserve.php?m=avatar&u=$1 [L,QSA]
RewriteRule ^bg/([0-9]+)$|bg/([0-9]+).png$ imageserve.php?m=background&u=$1 [L,QSA]
# Forum
RewriteRule ^forum/?$ index.php?forums=true [L,QSA]
RewriteRule ^forum/?$ index.php?forum=true [L,QSA]
RewriteRule ^forum/([0-9]+)/?$ viewforum.php?f=$1 [L,QSA]
RewriteRule ^forum/([0-9]+)/new/?$ posting.php?f=$1 [L,QSA]
RewriteRule ^forum/(thread|topic|[0-9+])/([0-9]+)/?$ viewtopic.php?t=$2 [L,QSA]
RewriteRule ^forum/(thread|topic|[0-9+])/([0-9]+)/reply/?$ posting.php?t=$2 [L,QSA]
RewriteRule ^forum/post/([0-9]+)/?$ viewtopic.php?p=$1 [L,QSA]
RewriteRule ^forum/post/([0-9]+)/edit/?$ posting.php?p=$1&edit=$1 [L,QSA]
RewriteRule ^forum/post/([0-9]+)/delete/?$ posting.php?p=$1&delete=$1 [L,QSA]
RewriteRule ^forum/post/([0-9]+)/(quote|reply)/?$ posting.php?p=$1&quote=$1 [L,QSA]
# Management

View file

@ -16,8 +16,8 @@ function hideYourMind(conflictions) {
forMyFriends.setAttribute('type', 'audio/mp3');
whenTheyCome.setAttribute('type', 'audio/ogg');
forMyFriends.setAttribute('src', '//' + sakuraVars.content_path + '/sounds/dicks.mp3');
whenTheyCome.setAttribute('src', '//' + sakuraVars.content_path + '/sounds/dicks.ogg');
forMyFriends.setAttribute('src', sakuraVars.content + '/sounds/dicks.mp3');
whenTheyCome.setAttribute('src', sakuraVars.content + '/sounds/dicks.ogg');
dicksAre.appendChild(forMyFriends);
dicksAre.appendChild(whenTheyCome);
@ -39,8 +39,8 @@ function hideYourMind(conflictions) {
von.setAttribute('type', 'audio/mp3');
schnitzel.setAttribute('type', 'audio/ogg');
von.setAttribute('src', '//' + sakuraVars.content_path + '/sounds/mewow.mp3');
schnitzel.setAttribute('src', '//' + sakuraVars.content_path + '/sounds/mewow.ogg');
von.setAttribute('src', sakuraVars.content + '/sounds/mewow.mp3');
schnitzel.setAttribute('src', sakuraVars.content + '/sounds/mewow.ogg');
noklz.appendChild(von);
noklz.appendChild(schnitzel);

View file

@ -1,42 +0,0 @@
<?php
/*
* Sakura Credits Page
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Add page specific things
$renderData['page'] = [
'title' => 'Sakura Credits'
];
$renderData['contributors'] = [
'Flashwave' => ['Main developer.', 'http://flash.moe'],
'Kurasha244' => ['Writing the base for the old backend.', 'http://saibateku.net'],
'nookls' => ['Being nookls.', 'http://nookls.org'],
'MallocNull' => ['Sock Chat and debug help.', 'http://aroltd.com'],
'kamil' => ['Pointing out mistakes and fixing them and literally writing the entire payments system.', 'http://krakow.pw'],
'RandomGuy' => ['Coming up with cool things to add and security stuff.', 'http://flashii.net/u/12']
];
$renderData['thirdParty'] = [
'ReCAPTCHA' => ['Providing the Captcha system we use.', 'http://recaptcha.net'],
'Twig' => ['The templating engine used by Sakura.', 'http://twig.sensiolabs.org/'],
'Parsedown' => ['A PHP markdown parser.', 'http://parsedown.org/'],
'Defuse' => ['Making the PBKDF2 implementation for PHP', 'http://defuse.ca/'],
'PHPMailer' => ['Writing PHPMailer and making e-mail sending a not pain in the ass', 'https://github.com/PHPMailer/PHPMailer'],
'PayPal' => ['Making a PayPal API', 'https://paypal.com']
];
// Print page contents
print Templates::render('main/credits.tpl', $renderData);

View file

@ -9,8 +9,40 @@ namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Info pages
if(isset($_GET['p'])) {
// Set default variables
$renderData['page'] = [
'title' => 'Info pages',
'content' => Main::mdParse("# Unable to load the requested info page.\r\n\r\nCheck the URL and try again.")
];
// Set page id
$pageId = isset($_GET['p']) ? strtolower($_GET['p']) : '';
// Get info page data from the database
if($ipData = Main::loadInfoPage($pageId)) {
// Assign new proper variable
$renderData['page'] = [
'id' => $pageId,
'title' => $ipData['pagetitle'],
'content' => Main::mdParse($ipData['content'])
];
}
// Print page contents
print Templates::render('main/infopage.tpl', $renderData);
exit;
}
// Are we in forum mode?
$forumMode = isset($_GET['forums']) ? ($_GET['forums'] == true) : false;
$forumMode = isset($_GET['forum']) ? ($_GET['forum'] == true) : false;
// Add page specific things
$renderData['newsPosts'] = ($forumMode ? null : Main::getNewsPosts(Configuration::getConfig('front_page_news_posts')));

View file

@ -1,36 +0,0 @@
<?php
/*
* Sakura Info Page Handler
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Set default variables
$renderData['page'] = [
'title' => 'Info pages',
'content' => Main::mdParse("# Unable to load the requested info page.\r\n\r\nCheck the URL and try again.")
];
// Set page id
$pageId = isset($_GET['p']) ? strtolower($_GET['p']) : '';
// Get info page data from the database
if($ipData = Main::loadInfoPage($pageId)) {
// Assign new proper variable
$renderData['page'] = [
'id' => $pageId,
'title' => $ipData['pagetitle'],
'content' => Main::mdParse($ipData['content'])
];
}
// Print page contents
print Templates::render('main/infopage.tpl', $renderData);

View file

@ -62,7 +62,7 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
$continue = true;
// Referrer
$redirect = isset($_REQUEST['redirect']) ? $_REQUEST['redirect'] : (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/');
$redirect = (isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : '/');
// Compare time and session so we know the link isn't forged
if(!isset($_REQUEST['add']) && !isset($_REQUEST['remove'])) {
@ -196,13 +196,6 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
}
if(isset($_REQUEST['direct']) && $_REQUEST['direct'] && !isset($_REQUEST['ajax'])) {
header('Location: '. $renderData['page']['redirect']);
exit;
}
// Print page contents or if the AJAX request is set only display the render data
print isset($_REQUEST['ajax']) ?
(