bunch of unstable shit

This commit is contained in:
Pachira 2015-08-24 00:08:36 +02:00
parent 731c3f4cda
commit 15ec4b04c7
49 changed files with 891 additions and 423 deletions

View file

@ -47,7 +47,8 @@
"20150819",
"20150820",
"20150821",
"20150822"
"20150822",
"20150823"
]
@ -2191,6 +2192,66 @@
"user": "Flashwave"
}
],
"20150823": [
{
"type": "REM",
"change": "Removed a reference to the legacy password hashing method in Users::checkLogin().",
"user": "Flashwave"
},
{
"type": "ADD",
"change": "Added repeated linear gradient to the JavaScript message because I could.",
"user": "Flashwave"
},
{
"type": "FIX",
"change": "Fixed broken reference to current page variable in the logout link.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Rewrite settings page handling.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Merge messages.php and settings.php.",
"user": "Flashwave"
},
{
"type": "ADD",
"change": "Add special cases for restricted users.",
"user": "Flashwave"
},
{
"type": "UPD",
"change": "Restructured the startup process.",
"user": "Flashwave"
},
{
"type": "FIX",
"change": "Fixed checkboxes not working properly in the AJAX submission function.",
"user": "Flashwave"
},
{
"type": "ADD",
"change": "Add user controlled ability to switch to Misaki.",
"user": "Flashwave"
},
{
"type": "FIX",
"change": "Fix profiles on Misaki.",
"user": "Flashwave"
},
{
"type": "ADD",
"change": "Quickly backport the required templates to switch back to the Yuuno template.",
"user": "Flashwave"
}
]
}

View file

@ -10,16 +10,9 @@ use PHPMailer;
class Main {
public static $_MD; // Markdown class container
public static $_MANAGE_MODE = false; // Management mode
// Constructor
public static function init($config) {
// Stop the execution if the PHP Version is older than 5.4.0
if(version_compare(phpversion(), '5.4.0', '<'))
trigger_error('Sakura requires at least PHP 5.4.0, please upgrade to a newer PHP version.');
// Configuration Management and local configuration
Configuration::init($config);
@ -32,35 +25,12 @@ class Main {
// Create new session
Session::init();
// Check if management mode was requested
self::$_MANAGE_MODE = defined('SAKURA_MANAGE');
// Templating engine
if(!defined('SAKURA_NO_TPL')) {
Templates::init(self::$_MANAGE_MODE ? Configuration::getConfig('manage_style') : Configuration::getConfig('site_style'));
}
// Assign servers file to whois class
Whois::setServers(ROOT .'_sakura/'. Configuration::getLocalConfig('data', 'whoisservers'));
// Markdown Parser
self::initMD();
}
// Initialise Parsedown
private static function initMD() {
self::$_MD = new Parsedown();
}
// Parse markdown
public static function mdParse($text) {
return self::$_MD->text($text);
return (new Parsedown())->text($text);
}

View file

@ -40,7 +40,7 @@ class Permissions {
'CHANGE_USERNAME' => 4096, // Can change their username
'CHANGE_USERTITLE' => 8192, // Can change their usertitle
'CHANGE_PASSWORD' => 16384, // Can change their password
'CHANGE_DEFAULT_RANK' => 32768, // Can change their default rank
'ALTER_RANKS' => 32768, // Can change their ranks
'MANAGE_SESSIONS' => 65536, // Can manage their sessions
'CREATE_REGKEYS' => 131072, // Can create registration keys
'DEACTIVATE_ACCOUNT' => 262144, // Can deactivate their account
@ -52,7 +52,7 @@ class Permissions {
'CREATE_GROUP' => 16777216, // Can create a group
'MULTIPLE_GROUPS' => 33554432, // Can create multiple groups (requires single group perm)
'CHANGE_NAMECOLOUR' => 67108864, // Can change their username colour
'STATIC_PREMIUM' => 134217728 // Can change their username colour
'STATIC_PREMIUM' => 134217728 // User has static premium status
],

View file

@ -26,16 +26,22 @@ class Templates {
$confPath = ROOT .'_sakura/templates/'. self::$_TPL .'/template.ini';
// Check if the configuration file exists
if(!file_exists($confPath))
if(!file_exists($confPath)) {
trigger_error('Template configuration does not exist', E_USER_ERROR);
}
// Parse and store the configuration
self::$_CFG = parse_ini_file($confPath, true);
// Make sure we're not using a manage template for the main site or the other way around
if((bool)self::$_CFG['manage']['mode'] != (bool)Main::$_MANAGE_MODE)
if(defined('SAKURA_MANAGE') && (bool)self::$_CFG['manage']['mode'] != (bool)SAKURA_MANAGE) {
trigger_error('Incorrect template type', E_USER_ERROR);
}
// Start Twig
self::twigLoader();

View file

@ -134,6 +134,13 @@ class User {
}
// Get all the friend of this user
public function getFriends() {
return Users::getFriends($this->data['id']);
}
// Check if the user is banned
public function checkBan() {

View file

@ -47,13 +47,19 @@ class Users {
public static function checkLogin($uid = null, $sid = null, $bypassCookies = false) {
// Set $uid and $sid if they're null
if($uid == null)
if($uid == null) {
$uid = Session::$userId;
}
// ^
if($sid == null)
if($sid == null) {
$sid = Session::$sessionId;
}
// Check if cookie bypass is false
if(!$bypassCookies) {
@ -92,10 +98,6 @@ class Users {
// Update the premium meta
Users::updatePremiumMeta($uid);
// Redirect people that need to change their password to the new format
if(self::getUser($uid)['password_algo'] == 'legacy' && $_SERVER['PHP_SELF'] != '/authenticate.php' && $_SERVER['PHP_SELF'] != '/imageserve.php')
header('Location: /authenticate.php?legacy=true');
// If everything went through return true
return true;

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150822');
define('SAKURA_VERSION', '20150823');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_COLOUR', '#6C3082');
define('SAKURA_STABLE', false);
@ -22,6 +22,13 @@ error_reporting(SAKURA_STABLE ? 0 : -1);
// Set internal encoding method
mb_internal_encoding('utf-8');
// Stop the execution if the PHP Version is older than 5.4.0
if(version_compare(phpversion(), '5.4.0', '<')) {
trigger_error('Sakura requires at least PHP 5.4.0, please upgrade to a newer PHP version.');
}
// Include libraries
require_once ROOT .'_sakura/vendor/autoload.php';
require_once ROOT .'_sakura/components/Main.php';
@ -53,6 +60,9 @@ set_error_handler(array('Sakura\Main', 'errorHandler'));
// Initialise Main Class
Main::init(ROOT .'_sakura/config/config.ini');
// Assign servers file to whois class
Whois::setServers(ROOT .'_sakura/'. Configuration::getLocalConfig('data', 'whoisservers'));
// Start output buffering
ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null);
@ -61,6 +71,20 @@ $currentUser = new User(Session::$userId);
if(!defined('SAKURA_NO_TPL')) {
// Initialise templating engine
Templates::init(
defined('SAKURA_MANAGE') ?
Configuration::getConfig('manage_style') : (
(
isset($currentUser->data['userData']['userOptions']['useMisaki']) &&
$currentUser->data['userData']['userOptions']['useMisaki'] &&
$currentUser->checkPermission('SITE', 'ALTER_PROFILE')
) ?
'misaki' :
Configuration::getConfig('site_style')
)
);
// Set base page rendering data
$renderData = [

View file

@ -0,0 +1 @@
<h2><a href="/settings/general/options">Go to Site Options</a></h2>

View file

@ -0,0 +1,8 @@
{% include 'global/header.tpl' %}
<div class="content standalone">
<h1 class="sectionHeader">Information</h1>
<hr class="default" />
{{ page.message }}
{% if page.redirect %}<br /><a href="{{ page.redirect }}" class="default">Click here if you aren't being redirected.</a>{% endif %}
</div>
{% include 'global/footer.tpl' %}

View file

@ -4,8 +4,8 @@
<div class="inner">
<div class="ft-logo"></div>
<div class="ft-text">
<div>Copyright &copy; 2013-2015 <a href="http://flash.moe/" target="_blank">Flashwave</a> &amp; <a href="http://circlestorm.net/" target="_blank">Circlestorm</a>, <a href="//{{ sakura.urls.main }}/credits">et al</a>.</div>
<div><a href="//{{ sakura.urls.main }}/r/terms">Terms of Service</a> | <a href="//{{ sakura.urls.main }}/contact">Contact</a> | <a href="//{{ sakura.urls.main }}/faq">FAQ</a> | <a href="//{{ sakura.urls.main }}/feedback">Feedback</a> | <a href="//{{ sakura.urls.main }}/r/rules">Rules</a> | <a href="//{{ sakura.urls.main }}/changelog">Changelog</a> | <a href="http://status.flashii.net/">Status</a></div>
<div>Copyright &copy; 2013-2015 <a href="http://flash.moe/" target="_blank">Flashwave</a> &amp; <a href="http://circlestorm.net/" target="_blank">Circlestorm</a>, <a href="/credits">et al</a>.</div>
<div><a href="/r/terms">Terms of Service</a> | <a href="/contact">Contact</a> | <a href="/faq">FAQ</a> | <a href="/feedback">Feedback</a> | <a href="/p/rules">Rules</a> | <a href="/changelog">Changelog</a> | <a href="http://status.flashii.net/">Status</a></div>
</div>
<div class="clear"></div>
</div>

View file

@ -7,9 +7,26 @@
<meta name="description" content="{{ sakura.sitedesc }}" />
<meta name="keywords" content="{{ sakura.sitetags }}" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="msapplication-TileColor" content="#fbeeff" />
<meta name="msapplication-TileImage" content="/content/images/icons/ms-icon-144x144.png" />
<meta name="theme-color" content="#9475B2" />
{% if page.redirect %}
<meta http-equiv="refresh" content="3; URL={{ page.redirect }}" />
{% endif %}
<link rel="apple-touch-icon" sizes="57x57" href="/content/images/icons/apple-icon-57x57.png" />
<link rel="apple-touch-icon" sizes="60x60" href="/content/images/icons/apple-icon-60x60.png" />
<link rel="apple-touch-icon" sizes="72x72" href="/content/images/icons/apple-icon-72x72.png" />
<link rel="apple-touch-icon" sizes="76x76" href="/content/images/icons/apple-icon-76x76.png" />
<link rel="apple-touch-icon" sizes="114x114" href="/content/images/icons/apple-icon-114x114.png" />
<link rel="apple-touch-icon" sizes="120x120" href="/content/images/icons/apple-icon-120x120.png" />
<link rel="apple-touch-icon" sizes="144x144" href="/content/images/icons/apple-icon-144x144.png" />
<link rel="apple-touch-icon" sizes="152x152" href="/content/images/icons/apple-icon-152x152.png" />
<link rel="apple-touch-icon" sizes="180x180" href="/content/images/icons/apple-icon-180x180.png" />
<link rel="icon" type="image/png" sizes="192x192" href="/content/images/icons/android-icon-192x192.png" />
<link rel="icon" type="image/png" sizes="32x32" href="/content/images/icons/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="96x96" href="/content/images/icons/favicon-96x96.png" />
<link rel="icon" type="image/png" sizes="16x16" href="/content/images/icons/favicon-16x16.png" />
<link rel="manifest" href="/manifest.json" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="{{ sakura.resources }}/css/misaki.css" />
{% if page.style %}
@ -25,6 +42,41 @@
{% endif %}
<!-- JS -->
<script type="text/javascript" src="{{ sakura.resources }}/js/misaki.js"></script>
<script type="text/javascript">
// Create an object so we can access certain settings from remote JavaScript files
var sakuraVars = {
"cookie": {
"prefix": "{{ sakura.cookie.prefix }}",
"domain": "{{ sakura.cookie.domain }}",
"path": "{{ sakura.cookie.path }}"
},
"urlMain": "{{ sakura.urlMain }}",
"content": "{{ sakura.contentPath }}",
"resources": "{{ sakura.resources }}",
"recaptchaEnabled": "{{ sakura.recaptchaEnabled }}",
"minUserLen": {{ sakura.minUsernameLength }},
"maxUserLen": {{ sakura.maxUsernameLength }},
"minPwdEntropy": {{ sakura.minPwdEntropy }},
"checkLogin": {% if session.checkLogin %}true{% else %}false{% endif %}
};
// Space for things that need to happen onload
window.addEventListener("load", function() {
{% 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) %}
initialiseParallax('userBackground');
{% endif %}
});
</script>
</head>
<body>
<div id="container">
@ -48,15 +100,15 @@
</div>
</div>
<div id="wrapper">
{% if profile.user.userData.profileBackground %}
<div id="userBackground"></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>
{% endif %}
<div id="content">
<div id="navigation">
<ul class="nav-left floatLeft">
<li><a href="/">Home</a></li>
<li><a href="/news">News</a></li>
<li><a href="//chat.{{ sakura.url_main }}/">Chat</a></li>
<li><a href="//chat.{{ sakura.urlMain }}/">Chat</a></li>
<li><a href="/forum">Forum</a></li>
<li><a href="/members">Members</a></li>
<li><a href="/search">Search</a></li>
@ -64,21 +116,21 @@
</ul>
<ul class="nav-right floatRight">
<li class="nav-usermenu">
<a href="#"{% if user.checklogin %} style="color: {{ user.colour }};"{% endif %}>{% if user.checklogin %}{{ user.data.username }}{% else %}Guest{% endif %}</a>
<a href="#"{% if session.checkLogin %} style="color: {{ user.colour }};"{% endif %}>{% if session.checkLogin %}{{ user.data.username }}{% else %}Guest{% endif %}</a>
<ul>
{% if user.checklogin %}
{% if session.checkLogin %}
<li><a href="/u/{{ user.data.id }}">My Profile</a></li>
<li><a href="/messages">View Messages</a></li>
<li><a href="/messages">Private Messages</a></li>
<li><a href="/settings">User Settings</a></li>
<li><a href="/manage">Site Management</a></li>
<li><a href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentpage }}">Logout</a></li>
<li><a href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentPage }}">Logout</a></li>
{% else %}
<li><a href="/login">Login</a></li>
<li><a href="/register">Register</a></li>
{% endif %}
</ul>
</li>
<li><a href="#" class="ignore"><img src="{{ sakura.content_path }}/pixel.png" alt="{{ user.data.username }}" style="background-image: url('/a/{{ user.data.id }}');" class="nav-avatar" /></a></li>
<li><a href="/u/{{ user.data.id }}" class="ignore"><img src="{{ sakura.contentPath }}/pixel.png" alt="{{ user.data.username }}" style="background-image: url('/a/{{ user.data.id }}');" class="nav-avatar" /></a></li>
</ul>
<div class="clear"></div>
</div>

View file

@ -1,50 +1,67 @@
{% include 'global/header.tpl' %}
{% if profile.notset or profile.user.id == 0 or profile.user.password_algo == 'nologin' %}
user not found, don't forget to make this sexy
{% if profile.checkPermission('SITE', 'DEACTIVATED') or profile.data.password_algo == 'nologin' or (profile.checkPermission('SITE', 'RESTRICTED') and (user.data.id != profile.data.id and not user.checkPermission('MANAGE', 'USE_MANAGE'))) %}
<div class="userNotFound">
<h1 class="sectionHead">user not found!</h1>
There are a few possible reasons for this:
<ul>
<li>They changed their username.</li>
<li>They may have been <a href="/faq#abyss" class="default">abyss'd</a>.</li>
<li>You made a typo.</li>
<li>They never existed.</li>
</ul>
</div>
{% else %}
<div class="profile" id="u{{ profile.user.id }}">
<div class="profileHeader" style="background-image: url('/u/{{ profile.user.id }}/header');">
<div class="profile" id="u{{ profile.data.id }}">
<div class="profileHeader" style="background-image: url('/u/{{ profile.data.id }}/header');">
<div class="profileFade"></div>
<div class="headerLeft">
<img class="userAvatar" src="/a/{{ profile.user.id }}" alt="{{ profile.user.username }}'s Avatar" />
<img class="userAvatar" src="/a/{{ profile.data.id }}" alt="{{ profile.data.username }}'s Avatar" />
<div class="userData">
<div class="profileUsername" style="color: {{ profile.colour }};">
{{ profile.user.username }}
{{ profile.data.username }}
</div>
<div class="profileUsertitle">
{{ profile.ranktitle }}
{{ profile.userTitle }}
</div>
</div>
</div>
<div class="joinedLast">
<div>Joined {{ profile.user.regdate|date("l Y-m-d H:i T") }}</div>
<div>{% if profile.user.lastdate == 0 %}User hasn't logged in yet.{% else %}Last Active {{ profile.user.lastdate|date("l Y-m-d H:i T") }}{% endif %}</div>
<div>Joined {{ profile.data.regdate|date(sakura.dateFormat) }}</div>
<div>{% if profile.data.lastdate == 0 %}User hasn't logged in yet.{% else %}Last Active {{ profile.data.lastdate|date(sakura.dateFormat) }}{% endif %}</div>
</div>
<div class="clear"></div>
</div>
<div class="profileContent">
<div class="userDataBar">
{% if profile.user.rank_main > 1 %}
{% if not profile.checkPermission('SITE', 'DEACTIVATED') and (profile.checkPremium[0] or profile.checkPermission('MANAGE', 'USE_MANAGE')) %}
<div class="profilePlatform hierarchyContainer">
<div class="inner">
<ul class="hierarchies">
{% if profile.checkPremium[0] %}
<li class="tenshi">Tenshi</li>
{% endif %}
{% if profile.checkPermission('MANAGE', 'USE_MANAGE') %}
<li class="staff">Staff</li>
{% endif %}
{% if false %}
<li class="developer">Developer</li>
{% endif %}
{% if false %}
<li class="alumnii">Alumnii</li>
{% endif %}
</ul>
</div>
</div>
<div class="profilePlatform userAccounts">
<div class="inner">
{% if user.checklogin %}
{% if profile.fields %}
{% for name,field in profile.fields %}
{% if session.checkLogin %}
{% if profile.profileFields %}
{% for name,field in profile.profileFields %}
<div class="field">
<div>{{ field.name }}</div>
<div>
{% if name == 'youtube' %}
<a href="https://youtube.com/{% if field.youtubetype == 1 %}channel{% else %}user{% endif %}/{{ field.value }}">{% if field.youtubetype == 1 %}{{ profile.user.username }}'s Channel{% else %}{{ field.value }}{% endif %}</a>
<a href="https://youtube.com/{% if field.youtubetype == 'true' %}channel{% else %}user{% endif %}/{{ field.value }}" class="default">{% if field.youtubetype == 'true' %}{{ profile.data.username }}'s Channel{% else %}{{ field.value }}{% endif %}</a>
{% else %}
{% if field.islink %}
<a href="{{ field.link }}">
@ -61,7 +78,7 @@ user not found, don't forget to make this sexy
{% else %}
<div class="noAccounts">
<div class="fa fa-question"></div>
<div class="notif">This user has not set any accounts yet.</div>
<div class="notif">This user has not set any links yet.</div>
</div>
{% endif %}
{% else %}
@ -76,35 +93,35 @@ user not found, don't forget to make this sexy
<div class="profilePlatform accountStanding">
<div class="inner">
<div class="title">Account Standing</div>
<div class="standing" style="color:
{% if profile.user.rank_main < 2 %}
#888;">Deactivated
{% if profile.checkPermission('SITE', 'DEACTIVATED') %}
<div class="standing" style="color: #800;">Deactivated</div>
{% elseif profile.checkBan %}
<h2 class="standing" style="color: #222;">Banned</h2>
{% else %}
{% if profile.warnings %}
#F22;">Bad
{% if profile.getWarnings %}
<div class="standing" style="color: #A22;">Bad</div>
{% else %}
#2F2;">Good
<div class="standing" style="color: #2A2;">Good</div>
{% endif %}
{% endif %}
</div>
{% if profile.warnings %}
<div>This user has <b>{{ profile.warnings|length }}</b> warning{% if profile.warnings|length != 1 %}s{% endif %}!</div>
{% if profile.getWarnings %}
<div>This user has <b>{{ profile.getWarnings|length }}</b> warning{% if profile.getWarnings|length != 1 %}s{% endif %}!</div>
<div>After <b>10 warnings</b> a user may be permanently banned.</div>
{% endif %}
</div>
</div>
</div>
<div class="userPage">
{% if profile.user.rank_main > 1 %}
{% if not profile.checkPermission('SITE', 'DEACTIVATED') %}
<div class="statsRow">
<div class="profilePlatform">
<a class="inner" href="/u/{{ profile.user.id }}/friends">
<a class="inner" href="/u/{{ profile.data.id }}/friends">
<div>Friends</div>
<div class="count">n/a</div>
<div class="count">{{ profile.getFriends|length }}</div>
</a>
</div>
<div class="profilePlatform">
<a class="inner" href="/u/{{ profile.user.id }}/groups">
<a class="inner" href="/u/{{ profile.data.id }}/groups">
<div>Groups</div>
<div class="count">n/a</div>
</a>
@ -113,26 +130,21 @@ user not found, don't forget to make this sexy
<div class="inner">
<div class="forumStatTitle">Forum stats</div>
<div class="forumStatCount">
<a class="posts" href="/u/{{ profile.user.id }}/posts">{{ profile.forum_stats.posts }} post{% if profile.forum_stats.posts != 1 %}s{% endif %}</a>
<a class="threads" href="/u/{{ profile.user.id }}/threads">{% if profile.forum_stats.topics %}{{ profile.forum_stats.topics }}{% else %}0{% endif %} thread{% if profile.forum_stats.topics != 1 %}s{% endif %}</a>
<a class="posts" href="/u/{{ profile.data.id }}/posts">{{ profile.forumStats.posts }} post{% if profile.forumStats.posts != 1 %}s{% endif %}</a>
<a class="threads" href="/u/{{ profile.data.id }}/threads">{% if profile.forumStats.topics %}{{ profile.forumStats.topics }}{% else %}0{% endif %} thread{% if profile.forumStats.topics != 1 %}s{% endif %}</a>
</div>
<div class="clear"></div>
</div>
</div>
<div class="clear"></div>
</div>
<div class="profilePage profilePlatform markdown{% if profile.profilePage|length < 1 %} hidden{% endif %}">
<div class="inner">{{ profile.profilePage|raw }}</div>
<div class="userPage profilePlatform markdown{% if profile.userPage|length < 1 %} hidden{% endif %}">
<div class="inner">{{ profile.userPage|raw }}</div>
</div>
{% endif %}
</div>
<div class="clear"></div>
</div>
</div>
{% if profile.user.userData.profileBackground %}
<script type="text/javascript">
initialiseParallax('userBackground');
</script>
{% endif %}
{% endif %}
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,19 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNavigation.tpl' %}
</div>
<div class="content-left content-column">
<div class="head">
{{ page.title }}
</div>
<div class="settings-explanation">
{% for descline in page.description %}
<div>{{ include(template_from_string(descline)) }}</div>
{% endfor %}
</div>
{% include 'settings/' ~ current ~ '.tpl' %}
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -0,0 +1,2 @@
<h1 class="stylised">READ THIS BEFORE PUKING</h1>
These template files were quickly thrown into place to allow switching between the development style and the stable one. You can switch in the Site Options section.

View file

@ -0,0 +1,26 @@
{% if options.fields %}
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="optionsForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="options" />
{% for field in options.fields %}
<div class="profile-field">
<div>
<h2>{{ field.name }}</h2>
<div style="font-size: .8em; line-height: 110%;">
{{ field.description }}
</div>
</div>
<div style="padding: 8px 0;">
<input type="{{ field.formtype }}" name="option_{{ field.id }}" class="inputStyling"{% if options.user[field.id] %}{% if field.formtype == 'checkbox' and options.user[field.id] %} checked="checked" value="option_{{ field.id }}"{% else %} value="{{ options.user[field.id] }}"{% endif %}{% endif %} />
</div>
</div>
{% endfor %}
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
</div>
</form>
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">There are currently no changeable options.</h1>
{% endif %}

View file

@ -2,40 +2,12 @@
Navigation
</div>
<div class="right-menu-nav">
<div>General</div>
<a href="/settings/">Home</a>
<a href="/settings/profile">Edit Profile</a>
<a href="/settings/options">Site Options</a>
<a href="/settings/groups">Groups</a>
<div>Friends</div>
<a href="/settings/friendlisting">List</a>
<a href="/settings/friendrequests">Requests</a>
<div>Messages</div>
<a href="/messages/inbox">Inbox</a>
<a href="/messages/sent">Sent</a>
<a href="/messages/compose">Compose</a>
<div>Notifications</div>
<a href="/settings/notifications">History</a>
{% if ((user.data.userData.userPage is defined and user.checkPermission('SITE', 'CHANGE_USERPAGE')) or user.checkPermission('SITE', 'CREATE_USERPAGE')) or user.checkPermission('SITE', 'CHANGE_AVATAR') or ((user.data.userData.userPage is defined and user.checkPermission('SITE', 'CHANGE_USERPAGE')) or user.checkPermission('SITE', 'CREATE_USERPAGE')) %}
<div>Aesthetics</div>
{% if user.checkPermission('SITE', 'CHANGE_AVATAR') %}
<a href="/settings/avatar">Avatar</a>
{% for catname,category in pages %}
<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>
{% endif %}
{% if (user.data.userData.profileBackground is defined and user.checkPermission('SITE', 'CHANGE_BACKGROUND')) or user.checkPermission('SITE', 'CREATE_BACKGROUND') %}
<a href="/settings/background">Background</a>
{% endif %}
{% if (user.data.userData.userPage is defined and user.checkPermission('SITE', 'CHANGE_USERPAGE')) or user.checkPermission('SITE', 'CREATE_USERPAGE') %}
<a href="/settings/userpage">Userpage</a>
{% endif %}
{% endif %}
<div>Account</div>
<a href="/settings/email">E-mail Address</a>
<a href="/settings/username">Username</a>
<a href="/settings/usertitle">User Title</a>
<a href="/settings/password">Password</a>
<a href="/settings/ranks">Ranks</a>
<div>Danger zone</div>
<a href="/settings/sessions">Sessions</a>
<a href="/settings/regkeys">Registration Keys</a>
<a href="/settings/deactivate">Deactivate Account</a>
{% endfor %}
{% endfor %}
</div>

View file

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
<meta name="msapplication-TileColor" content="#fbeeff" />
<meta name="msapplication-TileImage" content="/content/images/icons/ms-icon-144x144.png" />
<meta name="theme-color" content="#fbeeff" />
<meta name="theme-color" content="#9475B2" />
{% if page.redirect %}
<meta http-equiv="refresh" content="3; URL={{ page.redirect }}" />
{% endif %}
@ -147,7 +147,7 @@
}
{% endif %}
{% if php.self == '/profile.php' ? profile.data.userData.profileBackground : (user.checkPermission('SITE', 'CREATE_BACKGROUND') and user.data.userData.userOptions.profileBackgroundSiteWide == 'true' and user.data.userData.profileBackground) %}
{% 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) %}
initialiseParallax('userBackground');
{% endif %}
@ -165,7 +165,9 @@
<a class="menu-item" href="/" title="Return to the front page of Flashii">Home</a>
<a class="menu-item" href="/news" title="Here you can read updates on Flashii">News</a>
<a class="menu-item" href="//chat.{{ sakura.urlMain }}/" title="Chat with other Flashii members">Chat</a>
{% if user.checkPermission('FORUM', 'USE_FORUM') %}
<a class="menu-item" href="/forum" title="Discuss things with other members but static">Forums</a>
{% endif %}
<a class="menu-item" href="/search" title="Search on Flashii">Search</a>
{% if session.checkLogin %}
<a class="menu-item" href="/members" title="View a list with all the activated user accounts">Members</a>
@ -179,7 +181,7 @@
<a class="menu-item" href="/messages" title="Read your private message">Messages</a>
<a class="menu-item" href="/manage" title="Manage the site">Manage</a>
<a class="menu-item" href="/settings" title="Change your settings">Settings</a>
<a class="menu-item" href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentpage }}" title="End your login session" id="headerLogoutLink">Logout</a>
<a class="menu-item" href="/logout?mode=logout&amp;time={{ php.time }}&amp;session={{ php.sessionid }}&amp;redirect={{ sakura.currentPage }}" title="End your login session" id="headerLogoutLink">Logout</a>
{% else %}
{% if sakura.lockAuth %}
<div class="menu-item" style="padding-left: 10px; padding-right: 10px;">Authentication is locked</div>
@ -196,7 +198,7 @@
</div>
<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 == 'true' and user.data.userData.profileBackground) %}
{% 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>
{% endif %}
{% if not session.checkLogin and php.self != '/authenticate.php' %}
@ -225,11 +227,11 @@
{% 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. You will <i>temporarily</i> not be able to use 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="/contact" style="color: inherit;">get in touch with one of our staff members</a>.</div>
</div>
{% endif %}
<noscript>
<div class="headerNotify" style="padding-top: 10px; padding-bottom: 10px;">
<div class="headerNotify" style="padding-top: 10px; padding-bottom: 10px; background: repeating-linear-gradient(-45deg, #C2AFFE, #C2AFFE 10px, #D3BFFF 10px, #D3BFFF 20px);">
<h1>You have JavaScript disabled!</h1>
<p style="padding: 0 10px;">A lot of things on this site require JavaScript to be enabled (e.g. the chat), we try to keep both sides happy but it is highly recommended that you enable it (you'll also have to deal with this message being here if you don't enable it).</p>
</div>

View file

@ -1,37 +0,0 @@
{% include 'global/header.tpl' %}
<div class="content settings messages">
<div class="content-right content-column">
{% include 'elements/settingsNav.tpl' %}
</div>
<div class="content-left content-column">
{#<div class="head">
Messages / Inbox
</div>
{% if messages|length %}
<table class="msgTable">
<thead>
<tr>
<th>From</th>
<th>Subject</th>
<th>Sent on</th>
</tr>
</thead>
<tbody>
{% for message in messages %}
<tr>
<td><a href="/u/{{ message.data.from.user.id }}" class="default" style="font-weight: 700; color: {% if message.data.from.user.name_colour == null %}{{ message.data.from.rank.colour }}{% else %}{{ message.data.from.user.name_colour }}{% endif %};">{{ message.data.from.user.username }}</a></td>
<td><a href="/messages/read/{{ message.id }}" class="default">{{ message.subject }}</a></td>
<td>{{ message.time|date(sakura.dateFormat) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h1 class="stylised"style="line-height: 1.8em; text-align: center;">Nothing to view!</h1>
{% endif %}
<h3 style="text-align: center;">Click Compose in the menu on the right side to write a new message!</h3>#}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">The PM system is currently unavailable.</h1>
</div>
<div class="clear"></div>
</div>
{% include 'global/footer.tpl' %}

View file

@ -1,5 +1,5 @@
{% include 'global/header.tpl' %}
{% if profile.data.id < 1 or profile.data.password_algo == 'nologin' %}
{% if profile.checkPermission('SITE', 'DEACTIVATED') or profile.data.password_algo == 'nologin' or (profile.checkPermission('SITE', 'RESTRICTED') and (user.data.id != profile.data.id and not user.checkPermission('MANAGE', 'USE_MANAGE'))) %}
<div class="content standalone" style="padding: 20px;">
<h1>The requested user does not exist!</h1>
There are a few possible reasons for this:
@ -74,16 +74,18 @@
{% endif %}
<hr class="default" />
<b>Account Standing</b>
{% if profile.data.rank_main < 2 %}
{% if profile.checkPermission('SITE', 'DEACTIVATED') %}
<h2 style="color: #888; text-shadow: 0 0 7px #888; margin-top: 0;">Deactivated</h2>
{% elseif profile.checkBan %}
<h2 style="color: #222; text-shadow: 0 0 7px #222; margin-top: 0;">Banned</h2>
{% elseif profile.checkPermission('SITE', 'RESTRICTED') %}
<h2 style="color: #800; text-shadow: 0 0 7px #800; margin-top: 0;">Restricted</h2>
{% else %}
{% if profile.getWarnings %}
<h2 style="color: red; text-shadow: 0 0 7px #888; margin-top: 0;">Bad</h2>
<h2 style="color: #A00; text-shadow: 0 0 7px #A00; margin-top: 0;">Bad</h2>
<span style="font-size: 10px; line-height: 10px;">This user has <b>{{ profile.getWarnings|length }} warning{% if profile.getWarnings|length != 1 %}s{% endif %}</b>.<br />After 5 to 10 warnings (depending on what they are for) this user may be permanently banned.</span>
{% else %}
<h2 style="color: green; text-shadow: 0 0 7px #888; margin-top: 0;">Good</h2>
<h2 style="color: #0A0; text-shadow: 0 0 7px #0A0; margin-top: 0;">Good</h2>
{% endif %}
{% endif %}
</div>

View file

@ -7,7 +7,7 @@
<div class="friends-list-name" style="color: {% if friend.user.name_colour %}{{ friend.user.name_colour }}{% else %}{{ friend.rank.colour }}{% endif %};">{{ friend.user.username }}</div>
</a>
<div class="friends-list-actions">
<a class="remove fill fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/settings/friends&amp;direct=true"></a>
<a class="remove fill fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/settings/listing/friends&amp;direct=true"></a>
<div class="clear"></div>
</div>
</div>
@ -18,13 +18,13 @@
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/friends/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
<a href="/settings/friends/listing/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in friends %}
<a href="/settings/friends/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
<a href="/settings/friends/listing/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < friends|length %}
<a href="/settings/friends/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
<a href="/settings/friends/listing/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>

View file

@ -8,7 +8,7 @@
</a>
<div class="friends-list-actions">
<a class="add fa fa-check" title="Add friend" href="/friends?add={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/settings/friendrequests&amp;direct=true"></a>
<a class="remove fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/settings/friendrequests&amp;direct=true"></a>
<a class="remove fa fa-remove" title="Remove friend" href="/friends?remove={{ friend.user.id }}&amp;session={{ php.sessionid }}&amp;time={{ php.time }}&amp;redirect=/settings/friends/requests&amp;direct=true"></a>
<div class="clear"></div>
</div>
</div>
@ -19,13 +19,13 @@
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/friends/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
<a href="/settings/friends/requests/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in friends %}
<a href="/settings/friends/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
<a href="/settings/friends/requests/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < friends|length %}
<a href="/settings/friends/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
<a href="/settings/friends/requests/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>

View file

@ -2,20 +2,20 @@
<h1 class="stylised">Common Tasks</h1>
<h2>Profile</h2>
<ul>
<li><a href="/settings/avatar" class="default">Change Avatar</a></li>
<li><a href="/settings/userpage" class="default">Change Userpage</a></li>
<li><a href="/settings/signature" class="default">Change Signature</a></li>
<li><a href="/settings/profile" class="default">Change Profile Details</a></li>
<li><a href="/settings/appearance/avatar" class="default">Change Avatar</a></li>
<li><a href="/settings/appearance/userpage" class="default">Change Userpage</a></li>
<li><a href="/settings/appearance/signature" class="default">Change Signature</a></li>
<li><a href="/settings/general/profile" class="default">Change Profile Details</a></li>
</ul>
<h2>Messaging</h2>
<ul>
<li><a href="/messages/index" class="default">View Inbox</a></li>
<li><a href="/messages/inbox" class="default">View Inbox</a></li>
<li><a href="/messages/compose" class="default">Send PM</a></li>
</ul>
<h2>Account</h2>
<ul>
<li><a href="/settings/sessions" class="default">Manage Active Sessions</a></li>
<li><a href="/settings/password" class="default">Change Password</a></li>
<li><a href="/settings/advanced/sessions" class="default">Manage Active Sessions</a></li>
<li><a href="/settings/account/password" class="default">Change Password</a></li>
</ul>
<br />
<h1 class="stylised">Personal Statistics</h1>
@ -26,7 +26,7 @@
<li>You have <b>{{ settings.friends|length - (settings.friends.online ? 1 : 0) - (settings.friends.offline ? 1 : 0) }} friend{% if settings.friends|length - (settings.friends.online ? 1 : 0) - (settings.friends.offline ? 1 : 0) != 1 %}s{% endif %}</b>.</li>
</ul>
<br />
<h1 class="stylised"><a class="clean" href="/settings/friendlisting">Friends</a></h1>
<h1 class="stylised"><a class="clean" href="/settings/friends/listing">Friends</a></h1>
<h2 style="color: #080;">Online</h2>
{% if settings.friends.online %}
{% for key,friend in settings.friends.online %}

View file

@ -12,7 +12,7 @@
</div>
</div>
<div style="padding: 8px 0;">
<input type="{{ field.formtype }}" name="option_{{ field.id }}" class="inputStyling"{% if options.user[field.id] %}{% if field.formtype == 'checkbox' and options.user[field.id] == 'true' %} checked="checked"{% else %} value="{{ options.user[field.id] }}"{% endif %}{% endif %} />
<input type="{{ field.formtype }}" name="option_{{ field.id }}" class="inputStyling"{% if options.user[field.id] %}{% if field.formtype == 'checkbox' and options.user[field.id] %} checked="checked" value="option_{{ field.id }}"{% else %} value="{{ options.user[field.id] }}"{% endif %}{% endif %} />
</div>
</div>
{% endfor %}

View file

@ -0,0 +1,46 @@
{% if profile.fields %}
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="editProfileForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="profile" />
{% for field in profile.fields %}
<div class="profile-field">
<div>
<h2>{{ field.name }}</h2>
</div>
<div>
<input type="{{ field.formtype }}" name="profile_{{ field.ident }}" class="inputStyling" placeholder="{{ field.description }}"{% if profile.user[field.ident].value %}{% if field.formtype == 'checkbox' and profile.user[field.ident].value == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident].value }}"{% endif %}{% endif %} />
</div>
{% if field.addit %}
{% for id,addit in field.addit %}
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if profile.user[field.ident][id] %}{% if addit[0] == 'checkbox' and profile.user[field.ident][id] == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident][id] }}"{% endif %}{% endif %} />
<label for="{{ id }}" style="font-size: 10px;">{{ addit[1]|raw }}</label>
</div>
{% endfor %}
{% endif %}
</div>
{% endfor %}
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
</div>
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
var editProfileForm = document.getElementById('editProfileForm');
var createInput = document.createElement('input');
var submit = editProfileForm.querySelector('[type="submit"]');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
editProfileForm.appendChild(createInput);
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\''+ editProfileForm.action +'\', formToObject(\'editProfileForm\'), true, \'Updating Profile...\');');
});
</script>
{% else %}
<h1 class="stylised" style="margin: 2em auto; text-align: center;">There are no changeable profile fields.</h1>
{% endif %}

View file

@ -0,0 +1,23 @@
{% if messages|length %}
<table class="msgTable">
<thead>
<tr>
<th>From</th>
<th>Subject</th>
<th>Sent on</th>
</tr>
</thead>
<tbody>
{% for message in messages %}
<tr>
<td><a href="/u/{{ message.data.from.user.id }}" class="default" style="font-weight: 700; color: {% if message.data.from.user.name_colour == null %}{{ message.data.from.rank.colour }}{% else %}{{ message.data.from.user.name_colour }}{% endif %};">{{ message.data.from.user.username }}</a></td>
<td><a href="/messages/read/{{ message.id }}" class="default">{{ message.subject }}</a></td>
<td>{{ message.time|date(sakura.dateFormat) }}</td>
</tr>
{% endfor %}
</tbody>
</table>
{% else %}
<h1 class="stylised"style="line-height: 1.8em; text-align: center;">Nothing to view!</h1>
{% endif %}
<h3 style="text-align: center;">Click Compose in the menu on the right side to write a new message!</h3>

View file

@ -1 +0,0 @@
<h1 class="stylised" style="margin: 2em auto; text-align: center;">Could not find what you were looking for.</h1>

View file

@ -30,13 +30,13 @@
<div>
<div class="pagination" style="float: right;">
{% if page.currentPage > 0 %}
<a href="/settings/notifications/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
<a href="/settings/notifications/history/p{{ page.currentPage }}"><span class="fa fa-step-backward"></span></a>
{% endif %}
{% for id,npage in notifs %}
<a href="/settings/notifications/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
<a href="/settings/notifications/history/p{{ id + 1 }}"{% if id == page.currentPage %} class="current"{% endif %}>{{ id + 1 }}</a>
{% endfor %}
{% if page.currentPage + 1 < notifs|length %}
<a href="/settings/notifications/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
<a href="/settings/notifications/history/p{{ page.currentPage + 2 }}"><span class="fa fa-step-forward"></span></a>
{% endif %}
</div>
<div class="clear"></div>

View file

@ -1,42 +0,0 @@
<form enctype="multipart/form-data" method="post" action="{{ sakura.currentPage }}" id="editProfileForm">
<input type="hidden" name="sessid" value="{{ php.sessionid }}" />
<input type="hidden" name="timestamp" value="{{ php.time }}" />
<input type="hidden" name="mode" value="profile" />
{% for field in profile.fields %}
<div class="profile-field">
<div>
<h2>{{ field.name }}</h2>
</div>
<div>
<input type="{{ field.formtype }}" name="profile_{{ field.ident }}" class="inputStyling" placeholder="{{ field.description }}"{% if profile.user[field.ident].value %}{% if field.formtype == 'checkbox' and profile.user[field.ident].value == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident].value }}"{% endif %}{% endif %} />
</div>
{% if field.addit %}
{% for id,addit in field.addit %}
<div>
<input type="{{ addit[0] }}" id="{{ id }}" name="profile_additional_{{ id }}"{% if profile.user[field.ident][id] %}{% if addit[0] == 'checkbox' and profile.user[field.ident][id] == 'true' %} checked="checked"{% else %} value="{{ profile.user[field.ident][id] }}"{% endif %}{% endif %} />
<label for="{{ id }}" style="font-size: 10px;">{{ addit[1]|raw }}</label>
</div>
{% endfor %}
{% endif %}
</div>
{% endfor %}
<div class="profile-save">
<input type="submit" value="Save" name="submit" class="inputStyling" />
<input type="reset" value="Reset" name="reset" class="inputStyling" />
</div>
</form>
<script type="text/javascript">
window.addEventListener("load", function() {
var editProfileForm = document.getElementById('editProfileForm');
var createInput = document.createElement('input');
var submit = editProfileForm.querySelector('[type="submit"]');
createInput.setAttribute('name', 'ajax');
createInput.setAttribute('value', 'true');
createInput.setAttribute('type', 'hidden');
editProfileForm.appendChild(createInput);
submit.setAttribute('type', 'button');
submit.setAttribute('onclick', 'submitPost(\''+ editProfileForm.action +'\', formToObject(\'editProfileForm\'), true, \'Updating Profile...\');');
});
</script>

View file

@ -35,13 +35,14 @@ RewriteRule ^news.xml$ news.php?xml [L,QSA]
# Settings
RewriteRule ^settings/?$ settings.php [L,QSA]
RewriteRule ^settings/([a-z]+)/?$ settings.php?mode=$1 [L,QSA]
RewriteRule ^settings/([a-z]+)/p([0-9]+)/?$ settings.php?mode=$1&page=$2 [L,QSA]
RewriteRule ^settings/([a-z]+)/?$ settings.php?cat=$1 [L,QSA]
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/?$ messages.php [L,QSA]
RewriteRule ^messages/([a-z]+)/?$ messages.php?mode=$1 [L,QSA]
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]

View file

@ -9,5 +9,8 @@ namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Set 404 header
header('HTTP/1.0 404 Not Found');
// Print page contents
print Templates::render('errors/http404.tpl', $renderData);

View file

@ -367,6 +367,18 @@ a:active {
/*
* Profiles
*/
.userNotFound {
margin: 10px 14px;
font-family: "Exo2-0-LightItalic", sans-serif;
font-size: 1.5em;
line-height: 1.3em;
}
.userNotFound > ul {
padding-left: 18px;
list-style: square;
}
.profile {
text-shadow: 1px 1px 2px rgba(0, 0, 0, .75);
font-family: "Exo2-0-LightItalic", sans-serif;
@ -578,6 +590,19 @@ a:active {
line-height: 1em;
}
/*
* User Background
*/
#userBackground {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
z-index: -1;
background: no-repeat center center / cover transparent;
}
/*
* Homepage
*/

View file

@ -488,7 +488,7 @@ function formToObject(formId) {
if(typeof children[i] == 'object') {
requestParts[children[i].name] = ((typeof children[i].type !== "undefined" && children[i].type.toLowerCase() == "checkbox") ? children[i].checked : children[i].value);
requestParts[children[i].name] = ((typeof children[i].type !== "undefined" && children[i].type.toLowerCase() == "checkbox") ? (children[i].checked ? 1 : 0) : children[i].value);
}

View file

@ -1,22 +0,0 @@
<?php
/*
* Sakura Private Messages
*/
// Declare Namespace
namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Add page specific things
$renderData['page'] = [
'title' => 'Inbox'
];
$renderData['messages'] = Users::getPrivateMessages();
// Print page contents
print Templates::render('main/messages.tpl', $renderData);

View file

@ -19,7 +19,7 @@ $renderData['profile'] = $profile;
// Set proper page title
$renderData['page']['title'] = (
$profile->data['id'] < 1 || $profile->data['password_algo'] == 'nologin'
$profile->checkPermission('SITE', 'DEACTIVATED') || $profile->data['password_algo'] == 'nologin' || ($profile->checkPermission('SITE', 'RESTRICTED') && ($profile->data['id'] != $currentUser->data['id'] && !$currentUser->checkPermission('MANAGE', 'USE_MANAGE')))
? 'User not found!'
: 'Profile of '. $profile->data['username']

View file

@ -322,9 +322,6 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
}
if(empty($_FILES[$mode]))
die('yes');
// Check if the upload went properly
if($_FILES[$mode]['error'] !== UPLOAD_ERR_OK && $_FILES[$mode]['error'] !== UPLOAD_ERR_NO_FILE) {
@ -537,9 +534,12 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
foreach($field['additional'] as $addKey => $addVal) {
// Skip if the value is empty
if(!isset($_POST['profile_additional_'. $addKey]) || empty($_POST['profile_additional_'. $addKey]))
if(!isset($_POST['profile_additional_'. $addKey]) || empty($_POST['profile_additional_'. $addKey])) {
continue;
}
// Add to the array
$store[$addKey] = $_POST['profile_additional_'. $addKey];
@ -574,19 +574,15 @@ if(isset($_REQUEST['request-notifications']) && $_REQUEST['request-notifications
// Go over each field
foreach($fields as $field) {
// Add to the store array
if(isset($_POST['option_'. $field['id']]) && !empty($_POST['option_'. $field['id']])) {
// Make sure the user has sufficient permissions to complete this action
if(!$currentUser->checkPermission('SITE', $field['require_perm'])) {
$store[$field['id']] = false;
continue;
}
$store[$field['id']] = $_POST['option_'. $field['id']];
}
$store[$field['id']] = isset($_POST['option_'. $field['id']]) && !empty($_POST['option_'. $field['id']]) ? $_POST['option_'. $field['id']] : null;
}
@ -666,73 +662,358 @@ if(Users::checkLogin()) {
// Settings page list
$pages = [
'home' => ['General', 'Home', ['Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences.']],
'profile' => ['General', 'Edit Profile', ['These are the external account links etc. on your profile, shouldn\'t need any additional explanation for this one.']],
'options' => ['General', 'Site Options', ['These are a few personalisation options for the site while you\'re logged in.']],
'groups' => ['General', 'Groups', ['{{ user.colour }}']],
'friendlisting' => ['Friends', 'List', ['Manage your friends.']],
'friendrequests' => ['Friends', 'Requests', ['Handle friend requests.']],
'notifications' => ['Notifications', 'History', ['This is the history of notifications that have been sent to you.']],
'avatar' => ['Aesthetics', 'Avatar', ['Your avatar which is displayed all over the site and on your profile.', 'Maximum image size is {{ avatar.max_width }}x{{ avatar.max_height }}, minimum image size is {{ avatar.min_width }}x{{ avatar.min_height }}, maximum file size is {{ avatar.max_size_view }}.']],
'background' => ['Aesthetics', 'Background', ['The background that is displayed on your profile.', 'Maximum image size is {{ background.max_width }}x{{ background.max_height }}, minimum image size is {{ background.min_width }}x{{ background.min_height }}, maximum file size is {{ background.max_size_view }}.']],
'userpage' => ['Aesthetics', 'Userpage', ['The custom text that is displayed on your profile.', '<a href="/p/markdown" class="default">Click here if you don\'t know how to markdown!</a>']],
'email' => ['Account', 'E-mail Address', ['You e-mail address is used for password recovery and stuff like that, we won\'t spam you ;).']],
'username' => ['Account', 'Username', ['Probably the biggest part of your identity on a site.', '<b>You can only change this once every 30 days so choose wisely.</b>']],
'usertitle' => ['Account', 'User Title', ['That little piece of text displayed under your username on your profile.']],
'password' => ['Account', 'Password', ['Used to authenticate with the site and certain related services.']],
'ranks' => ['Account', 'Ranks', ['Manage what ranks you\'re in and what is set as your main rank. Your main rank is highlighted. You get the permissions of all of the ranks you\'re in combined.']],
'sessions' => ['Danger zone', 'Sessions', ['Session keys are a way of identifying yourself with the system without keeping your password in memory.', 'If someone finds one of your session keys they could possibly compromise your account, if you see any sessions here that shouldn\'t be here hit the Kill button to kill the selected session.', 'If you get logged out after clicking one you\'ve most likely killed your current session, to make it easier to avoid this from happening your current session is highlighted.']],
'regkeys' => ['Danger zone', 'Registration Keys', ['Sometimes we activate the registration key system which means that users can only register using your "referer" keys, this means we can keep unwanted people from registering.', 'Each user can generate 5 of these keys, bans and deactivates render these keys useless.']],
'deactivate' => ['Danger zone', 'Deactivate Account', ['You can deactivate your account here if you want to leave :(.']],
'notfound' => ['Settings', '404', ['This is an error.']]
'general' => [
'title' => 'General',
'modes' => [
'home' => [
'title' => 'Home',
'description' => [
'Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences.'
],
'access' => !$currentUser->checkPermission('SITE', 'DEACTIVATED')
],
'profile' => [
'title' => 'Edit Profile',
'description' => [
'These are the external account links etc. on your profile, shouldn\'t need any additional explanation for this one.'
],
'access' => $currentUser->checkPermission('SITE', 'ALTER_PROFILE')
],
'options' => [
'title' => 'Site Options',
'description' => [
'These are a few personalisation options for the site while you\'re logged in.'
],
'access' => !$currentUser->checkPermission('SITE', 'DEACTIVATED')
],
'groups' => [
'title' => 'Groups',
'description' => [
'{{ user.colour }}'
],
'access' => $currentUser->checkPermission('SITE', 'JOIN_GROUPS')
]
]
],
'friends' => [
'title' => 'Friends',
'modes' => [
'listing' => [
'title' => 'Listing',
'description' => [
'Manage your friends.'
],
'access' => $currentUser->checkPermission('SITE', 'MANAGE_FRIENDS')
],
'requests' => [
'title' => 'Requests',
'description' => [
'Handle friend requests.'
],
'access' => $currentUser->checkPermission('SITE', 'MANAGE_FRIENDS')
]
]
],
'messages' => [
'title' => 'Messages',
'modes' => [
'inbox' => [
'title' => 'Inbox',
'description' => [
'The list of messages you\'ve received.'
],
'access' => $currentUser->checkPermission('SITE', 'USE_MESSAGES')
],
'sent' => [
'title' => 'Sent',
'description' => [
'The list of messages you\'ve sent to other users.'
],
'access' => $currentUser->checkPermission('SITE', 'USE_MESSAGES')
],
'compose' => [
'title' => 'Compose',
'description' => [
'Write a new message.'
],
'access' => $currentUser->checkPermission('SITE', 'SEND_MESSAGES')
]
]
],
'notifications' => [
'title' => 'Notifications',
'modes' => [
'history' => [
'title' => 'History',
'description' => [
'The history of notifications that have been sent to you.'
],
'access' => !$currentUser->checkPermission('SITE', 'DEACTIVATED')
]
]
],
'appearance' => [
'title' => 'Appearance',
'modes' => [
'avatar' => [
'title' => 'Avatar',
'description' => [
'Your avatar which is displayed all over the site and on your profile.',
'Maximum image size is {{ avatar.max_width }}x{{ avatar.max_height }}, minimum image size is {{ avatar.min_width }}x{{ avatar.min_height }}, maximum file size is {{ avatar.max_size_view }}.'
],
'access' => $currentUser->checkPermission('SITE', 'CHANGE_AVATAR')
],
'background' => [
'title' => 'Background',
'description' => [
'The background that is displayed on your profile.',
'Maximum image size is {{ background.max_width }}x{{ background.max_height }}, minimum image size is {{ background.min_width }}x{{ background.min_height }}, maximum file size is {{ background.max_size_view }}.'
],
'access' => (isset($currentUser->data['userData']['profileBackground']) && $currentUser->checkPermission('SITE', 'CHANGE_BACKGROUND')) || $currentUser->checkPermission('SITE', 'CREATE_BACKGROUND')
],
'userpage' => [
'title' => 'Userpage',
'description' => [
'The custom text that is displayed on your profile.'
],
'access' => (isset($currentUser->data['userData']['userPage']) && $currentUser->checkPermission('SITE', 'CHANGE_USERPAGE')) || $currentUser->checkPermission('SITE', 'CREATE_USERPAGE')
]
]
],
'account' => [
'title' => 'Account',
'modes' => [
'email' => [
'title' => 'E-mail Address',
'description' => [
'You e-mail address is used for password recovery and stuff like that, we won\'t spam you ;).'
],
'access' => $currentUser->checkPermission('SITE', 'CHANGE_EMAIL')
],
'username' => [
'title' => 'Username',
'description' => [
'Probably the biggest part of your identity on a site.',
'<b>You can only change this once every 30 days so choose wisely.</b>'
],
'access' => $currentUser->checkPermission('SITE', 'CHANGE_USERNAME')
],
'usertitle' => [
'title' => 'Username',
'description' => [
'That little piece of text displayed under your username on your profile.'
],
'access' => $currentUser->checkPermission('SITE', 'CHANGE_USERTITLE')
],
'password' => [
'title' => 'Password',
'description' => [
'Used to authenticate with the site and certain related services.'
],
'access' => $currentUser->checkPermission('SITE', 'CHANGE_PASSWORD')
],
'ranks' => [
'title' => 'Ranks',
'description' => [
'Manage what ranks you\'re in and what is set as your main rank. Your main rank is highlighted. You get the permissions of all of the ranks you\'re in combined.'
],
'access' => $currentUser->checkPermission('SITE', 'ALTER_RANKS')
]
]
],
'advanced' => [
'title' => 'Advanced',
'modes' => [
'sessions' => [
'title' => 'Sessions',
'description' => [
'Session keys are a way of identifying yourself with the system without keeping your password in memory.',
'If someone finds one of your session keys they could possibly compromise your account, if you see any sessions here that shouldn\'t be here hit the Kill button to kill the selected session.',
'If you get logged out after clicking one you\'ve most likely killed your current session, to make it easier to avoid this from happening your current session is highlighted.'
],
'access' => $currentUser->checkPermission('SITE', 'MANAGE_SESSIONS')
],
'registrationkeys' => [
'title' => 'Registration Keys',
'description' => [
'Sometimes we activate the registration key system which means that users can only register using your "referer" keys, this means we can keep unwanted people from registering.',
'Each user can generate 5 of these keys, bans and deactivates render these keys useless.'
],
'access' => $currentUser->checkPermission('SITE', 'CREATE_REGKEYS')
],
'deactivate' => [
'title' => 'Deactivate Account',
'description' => [
'You can deactivate your account here if you want to leave :(.'
],
'access' => $currentUser->checkPermission('SITE', 'DEACTIVATE_ACCOUNT')
]
]
]
];
// Current settings page
$currentPage = isset($_GET['mode']) ? (array_key_exists($_GET['mode'], $pages) ? $_GET['mode'] : 'notfound') : 'home';
$category = isset($_GET['cat']) ? (array_key_exists($_GET['cat'], $pages) ? $_GET['cat'] : false) : array_keys($pages)[0];
$mode = isset($_GET['mode']) && $category ? (array_key_exists($_GET['mode'], $pages[$category]['modes']) ? $_GET['mode'] : false) : array_keys($pages[array_keys($pages)[0]]['modes'])[0];
// Not found
if(!$category || empty($category) || !$mode || empty($mode) || !$pages[$category]['modes'][$mode]['access']) {
header('HTTP/1.0 404 Not Found');
print Templates::render('errors/http404.tpl', $renderData);
exit;
}
// Render data
$renderData['current'] = $currentPage;
$renderData['current'] = $category .'.'. $mode;
// Settings pages
$renderData['pages'] = $pages;
// Page data
$renderData['page'] = [
'title' => $pages[$currentPage][0] .' / '. $pages[$currentPage][1],
'title' => $pages[$category]['title'] .' / '. $pages[$category]['modes'][$mode]['title'],
'currentPage' => isset($_GET['page']) && ($_GET['page'] - 1) >= 0 ? $_GET['page'] - 1 : 0,
'description' => $pages[$currentPage][2]
'description' => $pages[$category]['modes'][$mode]['description']
];
// Section specific
switch($currentPage) {
switch($category .'.'. $mode) {
// Homepage
case 'home':
case 'general.home':
$renderData['settings'] = [
'friends' => Users::getFriends(null, true, true, true)
];
break;
// Avatar and background sizes
case 'avatar':
case 'background':
$renderData[$currentPage] = [
'max_width' => Configuration::getConfig($currentPage .'_max_width'),
'max_height' => Configuration::getConfig($currentPage .'_max_height'),
'min_width' => Configuration::getConfig($currentPage .'_min_width'),
'min_height' => Configuration::getConfig($currentPage .'_min_height'),
'max_size' => Configuration::getConfig($currentPage .'_max_fsize'),
'max_size_view' => Main::getByteSymbol(Configuration::getConfig($currentPage .'_max_fsize'))
];
break;
// Profile
case 'userpage':
break;
// Profile
case 'profile':
case 'general.profile':
$renderData['profile'] = [
'user' => $currentUser->profileFields(),
@ -742,7 +1023,7 @@ if(Users::checkLogin()) {
break;
// Options
case 'options':
case 'general.options':
$renderData['options'] = [
'user' => $currentUser->optionFields(),
@ -752,20 +1033,45 @@ if(Users::checkLogin()) {
break;
// Friends
case 'friendlisting':
case 'friends.listing':
$renderData['friends'] = array_chunk(array_reverse(Users::getFriends(null, true, true)), 12, true);
break;
// Pending Friend Requests
case 'friendrequests':
case 'friends.requests':
$renderData['friends'] = array_chunk(array_reverse(Users::getPendingFriends(null, true)), 12, true);
break;
// PM inbox
case 'messages.inbox':
$renderData['messages'] = Users::getPrivateMessages();
break;
// Notification history
case 'notifications':
case 'notifications.history':
$renderData['notifs'] = array_chunk(array_reverse(Users::getNotifications(null, 0, false, true)), 10, true);
break;
// Avatar and background sizes
case 'appearance.avatar':
case 'appearance.background':
$renderData[$mode] = [
'max_width' => Configuration::getConfig($mode .'_max_width'),
'max_height' => Configuration::getConfig($mode .'_max_height'),
'min_width' => Configuration::getConfig($mode .'_min_width'),
'min_height' => Configuration::getConfig($mode .'_min_height'),
'max_size' => Configuration::getConfig($mode .'_max_fsize'),
'max_size_view' => Main::getByteSymbol(Configuration::getConfig($mode .'_max_fsize'))
];
break;
// Profile
case 'appearance.userpage':
break;
}
// Print page contents