big commit

This commit is contained in:
flash 2015-06-04 12:41:55 +00:00
parent ef45c2668d
commit 6bb9643df1
36 changed files with 1882 additions and 1612 deletions

6
.gitignore vendored
View file

@ -42,10 +42,8 @@ local.properties
errors.log
_sakura/config/config.ini
content/images/avatars/*
!content/images/avatars/.htaccess
content/images/backgrounds/*
!content/images/backgrounds/.htaccess
content/images/user/*
!content/images/user/.htaccess
BingSiteAuth.xml
google*.html
main/logs/*

View file

@ -0,0 +1,12 @@
# Disallow external connections
# Apache <= 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
deny from all
</IfModule>
# Apache 2.4 =>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>

13
_sakura/cache/.htaccess vendored Normal file → Executable file
View file

@ -1,12 +1 @@
# Disallow external connections
# Apache <= 2.2
<IfModule !mod_authz_core.c>
Order deny,allow
deny from all
</IfModule>
# Apache 2.4 =>
<IfModule mod_authz_core.c>
Require all denied
</IfModule>
#

View file

@ -16,7 +16,10 @@
"20150524",
"20150525",
"20150526",
"20150529"
"20150529",
"20150530",
"20150602",
"20150604"
]
@ -1205,6 +1208,49 @@
"change": "Added permission checking functions."
}
],
"20150530": [
{
"type": "ADD",
"change": "Compress Yuuno back to one CSS file again."
},
{
"type": "UPD",
"change": "Added configuration option to enable template caching."
},
{
"type": "FIX",
"change": "Fixed logged out users inherit permission strings from random user groups."
},
{
"type": "FIX",
"change": "Removed old deactivation checking method."
}
],
"20150602": [
{
"type": "ADD",
"change": "Added JSON indentation/pretty printing function."
}
],
"20150604": [
{
"type": "UPD",
"change": "Redid some of the users table structure."
},
{
"type": "ADD",
"change": "Add /header to profile for spooky things."
}
]
}

View file

@ -5,6 +5,9 @@
namespace Sakura;
use Parsedown;
use PHPMailer;
class Main {
public static $_MD; // Markdown class container
@ -46,7 +49,7 @@ class Main {
// Initialise Parsedown
private static function initMD() {
self::$_MD = new \Parsedown();
self::$_MD = new Parsedown();
}
@ -65,7 +68,7 @@ class Main {
// In the highly unlikely case that it failed to get anything forge a false
if(!$resp)
return array('success' => false, 'error-codes' => array('Could not connect to the ReCAPTCHA server.'));
return false;
// Decode the response JSON from the servers
$resp = json_decode($resp, true);
@ -124,7 +127,7 @@ class Main {
public static function sendMail($to, $subject, $body) {
// Initialise PHPMailer
$mail = new \PHPMailer();
$mail = new PHPMailer();
// Set to SMTP
$mail->IsSMTP();
@ -556,17 +559,94 @@ class Main {
}
// Convert a number to a hexadecimal value
public static function toHex($num) {
// Indent JSON
public static function jsonIndent($json) {
// Convert $num to an int if not yet
$num = intval($num);
// Defines
$tab = ' ';
$out = '';
$lvl = 0;
$str = false;
$obj = json_decode($json);
// Check if it's within the proper range
if($num < 0 || $num > 255)
return 00;
// Validate the object
if($obj === false)
return false;
// Re-encode the json and get the length
$json = json_encode($obj);
$len = strlen($json);
// Go over the entries
for($c = 0; $c < $len; $c++) {
// Get the current character
$char = $json[$c];
switch($char) {
case '[':
case '{':
if($str) {
$out .= $char;
} else {
$out .= $char ."\r\n". str_repeat($tab, $lvl + 1);
$lvl++;
}
break;
case ']':
case '}':
if($str) {
$out .= $char;
} else {
$lvl--;
$out .= "\r\n". str_repeat($tab, $lvl) . $char;
}
break;
case ',':
if($str) {
$out .= $char;
} else {
$out .= ",\r\n". str_repeat($tab, $lvl);
}
break;
case ':':
if($str) {
$out .= $char;
} else {
$out .= ": ";
}
break;
default:
$out .= $char;
break;
}
}
// Return the indented JSON
return $out;
}

View file

@ -7,6 +7,18 @@ namespace Sakura;
class Permissions {
// Fallback permission data
private static $fallback = [
'rid' => 0,
'uid' => 0,
'siteperms' => '000000000000000000000000001',
'manageperms' => '0',
'forumperms' => '0',
'rankinherit' => '111'
];
// Global permissions table
protected static $permissions = [
@ -60,14 +72,20 @@ class Permissions {
];
// Checking if a user has the permissions to do a thing
public static function check($layer, $action, $perm) {
public static function check($layer, $action, $operator, $mode = 0) {
// Check if the permission layer and the permission itself exists
if(!array_key_exists($layer, self::$permissions) || !array_key_exists($action, self::$permission[$layer]))
if(!array_key_exists($layer, self::$permissions) || !array_key_exists($action, self::$permissions[$layer]))
return false;
// Convert to the appropiate mode
if($mode === 2)
$operator = self::getRankPermissions($operator)[$layer];
elseif($mode === 1)
$operator = self::getUserPermissions($operator)[$layer];
// Perform the bitwise AND
if((bindec($perm) & self::$permission[$layer][$action]) != 0)
if(bindec($operator) & self::$permissions[$layer][$action])
return true;
// Else just return false
@ -86,6 +104,10 @@ class Permissions {
foreach($ranks as $rank)
$getRanks[] = Database::fetch('permissions', false, ['rid' => [$rank, '='], 'uid' => [0 ,'=']]);
// Check if getRanks is empty or if the rank id is 0 return the fallback
if(empty($getRanks) || in_array(0, $ranks))
$getRanks = [self::$fallback];
// Go over the permission data
foreach($getRanks as $rank) {

View file

@ -5,6 +5,10 @@
namespace Sakura;
use Twig_Loader_Filesystem;
use Twig_Environment;
use Twig_Extension_StringLoader;
class Templates {
// Engine container, template folder name and options
@ -41,17 +45,20 @@ class Templates {
private static function twigLoader() {
// Initialise Twig Filesystem Loader
$twigLoader = new \Twig_Loader_Filesystem(ROOT .'_sakura/templates/'. self::$_TPL);
$twigLoader = new Twig_Loader_Filesystem(ROOT .'_sakura/templates/'. self::$_TPL);
// Environment variable
$twigEnv = [];
// Enable caching
if(Configuration::getConfig('enable_tpl_cache'))
$twigEnv['cache'] = ROOT .'_sakura/cache';
// And now actually initialise the templating engine
self::$_ENG = new \Twig_Environment($twigLoader, array(
// 'cache' => SATOKO_ROOT_DIRECTORY. self::getConfig('path', 'cache') // Set cache directory
));
self::$_ENG = new Twig_Environment($twigLoader, $twigEnv);
// Load String template loader
self::$_ENG->addExtension(new \Twig_Extension_StringLoader());
self::$_ENG->addExtension(new Twig_Extension_StringLoader());
}

View file

@ -25,16 +25,13 @@ class Users {
'register_ip' => '127.0.0.1',
'last_ip' => '127.0.0.1',
'usertitle' => 'Internal fallback account',
'profile_md' => '',
'avatar_url' => '',
'background_url' => '',
'regdate' => 0,
'lastdate' => 0,
'lastunamechange' => 0,
'birthday' => '',
'posts' => 0,
'country' => 'EU',
'profile_data' => '[]'
'userData' => '[]'
];
// Empty rank template
@ -71,6 +68,10 @@ class Users {
if(!$session = Session::checkSession($uid, $sid))
return false;
// Check if the user is activated
if(Permissions::check('SITE', 'DEACTIVATED', $uid, 1))
return false;
// Extend the cookie times if the remember flag is set
if($session == 2 && !$bypassCookies) {
@ -135,7 +136,7 @@ class Users {
}
// Check if the user has the required privs to log in
if(self::checkIfUserHasRanks([0, 1], $user, true))
if(Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'NOT_ALLOWED'];
// Create a new session
@ -259,7 +260,7 @@ class Users {
'lastdate' => 0,
'lastunamechange' => time(),
'country' => Main::getCountryCode(),
'profile_data' => '[]'
'userData' => '[]'
]);
// Get userid of the new user
@ -307,9 +308,9 @@ class Users {
if(count($user) < 2)
return [0, 'USER_NOT_EXIST'];
// Check if the user is deactivated
if(self::checkIfUserHasRanks([0, 1], $user, true))
return [0, 'DEACTIVATED'];
// Check if the user has the required privs to log in
if(Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'NOT_ALLOWED'];
// Generate the verification key
$verk = Main::newActionCode('LOST_PASS', $user['id'], [
@ -349,9 +350,9 @@ class Users {
// Get user data
$user = Users::getUser(Session::$userId);
// Check if the user is deactivated
if(self::checkIfUserHasRanks([0, 1], $user, true))
return [0, 'DEACTIVATED'];
// Check if the user has the required privs to log in
if(Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'NOT_ALLOWED'];
// Check if the account is disabled
if('nologin' == $user['password_algo'])
@ -459,7 +460,7 @@ class Users {
return [0, 'USER_NOT_EXIST'];
// Check if a user is activated
if(!self::checkIfUserHasRanks([0, 1], $user, true))
if(!Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'USER_ALREADY_ACTIVE'];
// Send activation e-mail
@ -477,7 +478,7 @@ class Users {
$user = Database::fetch('users', false, ['id' => [$uid, '=']]);
// User is already activated or doesn't even exist
if(count($user) < 2 || !self::checkIfUserHasRanks([0, 1], $user, true))
if(count($user) < 2 || !Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return false;
// Generate activation key
@ -521,7 +522,7 @@ class Users {
return [0, 'USER_NOT_EXIST'];
// Check if user is already activated
if(!self::checkIfUserHasRanks([0, 1], $user, true))
if(!Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'USER_ALREADY_ACTIVE'];
// Set default values for activation
@ -572,7 +573,7 @@ class Users {
return [0, 'USER_NOT_EXIST'];
// Check if user is already deactivated
if(self::checkIfUserHasRanks([0, 1], $user, true))
if(Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
return [0, 'USER_ALREADY_DEACTIVE'];
// Deactivate the account
@ -693,8 +694,22 @@ class Users {
}
// Getting the profile data array of a user
public static function getUserProfileData($id, $inputIsUser = false) {
// Get user data
$user = ($inputIsUser ? $id : self::getUser($id));
// Decode the userData json
$data = json_decode($user['userData'], true);
// Return the profile data
return $data;
}
// Get user's profile fields
public static function getUserProfileData($id) {
public static function getUserProfileFields($id, $inputIsData = false) {
// Get profile fields
$profileFields = Database::fetch('profilefields');
@ -703,15 +718,15 @@ class Users {
if(!count($profileFields))
return null;
// Get the profile data JSON from the specified user's profile
$profileData = Database::fetch('users', false, ['id' => [$id, '=']]);
// Assign the profileData variable
$profileData = ($inputIsData ? $id : self::getUserProfileData($id));
// Once again if nothing was returned just return null
if(count($profileData) < 2 || $profileData['profile_data'] == null || !count(json_decode($profileData['profile_data'], true)))
if(count($profileData) < 1 || $profileData == null || empty($profileData['profileFields']))
return null;
// Decode the profile_data json
$profileData = json_decode($profileData['profile_data'], true);
// Redeclare profileData
$profileData = $profileData['profileFields'];
// Create output array
$profile = [];
@ -763,6 +778,39 @@ class Users {
}
// Getting the profile page of a user
public static function getProfilePage($id, $inputIsData = false) {
// Check if the input is the data
if($inputIsData) {
// Reassign data
$data = $id;
} else {
// Get user data
$user = self::getUser($id);
// Decode the userData json
$data = json_decode($user['userData'], true);
}
// Check if the profilePage key exists
if(!array_key_exists('profilePage', $data))
return false;
// TODO: implement BBcodes
// Parse the markdown
$profilePage = Main::mdParse(base64_decode($data['profilePage'][0]));
// Return the parsed profile page
return $profilePage;
}
// Check if a user is online
public static function checkUserOnline($id) {
@ -860,7 +908,7 @@ class Users {
}
// Get users in rank
public static function getUsersInRank($rankId, $users = null) {
public static function getUsersInRank($rankId, $users = null, $excludeAbyss = true) {
// Get all users (or use the supplied user list to keep server load down)
if(!$users)
@ -873,7 +921,7 @@ class Users {
foreach($users as $user) {
// If so store the user's row in the array
if(self::checkIfUserHasRanks([$rankId], $user, true) && $user['password_algo'] != 'nologin')
if(self::checkIfUserHasRanks([$rankId], $user, true) && ($excludeAbyss ? $user['password_algo'] != 'nologin' : true))
$rank[] = $user;
}
@ -900,7 +948,7 @@ class Users {
continue;
// Skip if inactive and not include deactivated users
if(!$includeInactive && self::checkIfUserHasRanks([0, 1], $user, true))
if(!$includeInactive && Permissions::check('SITE', 'DEACTIVATED', $user['id'], 1))
continue;
$users[$user['id']] = $user;

View file

@ -8,7 +8,7 @@
namespace Sakura;
// Define Sakura version
define('SAKURA_VERSION', '20150529');
define('SAKURA_VERSION', '20150604');
define('SAKURA_VLABEL', 'Eminence');
define('SAKURA_VTYPE', 'Development');
define('SAKURA_COLOUR', '#6C3082');
@ -51,6 +51,7 @@ ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null);
$renderData = [
'sakura' => [
'version' => SAKURA_VERSION,
'vlabel' => SAKURA_VLABEL,
'vtype' => SAKURA_VTYPE,
@ -76,15 +77,26 @@ $renderData = [
'minpwdentropy' => Configuration::getConfig('min_entropy'),
'minusernamelength' => Configuration::getConfig('username_min_length'),
'maxusernamelength' => Configuration::getConfig('username_max_length')
],
'perms' => [
'canUseChat' => Permissions::check('SITE', 'USE_CHAT', Session::$userId, 1),
'canUseForums' => Permissions::check('FORUM', 'USE_FORUM', Session::$userId, 1)
],
'php' => [
'sessionid' => \session_id(),
'time' => \time(),
'self' => $_SERVER['PHP_SELF']
],
'user' => [
'checklogin' => Users::checkLogin(),
'session' => Session::$sessionId,
'data' => ($_init_udata = Users::getUser(Session::$userId)),

View file

@ -178,7 +178,9 @@
<!-- Navigation menu, displayed on left side of the bar. -->
<a class="menu-item" href="//{{ sakura.urls.main }}/" title="Return to the front page of Flashii">Home</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/news" title="Here you can read updates on Flashii">News</a>
{% if perms.canUseChat %}
<a class="menu-item" href="//{{ sakura.urls.chat }}/" title="Chat with other Flashii members">Chat</a>
{% endif %}
<a class="menu-item" href="//{{ sakura.urls.main }}/forum" title="Discuss things with other members but static">Forums</a>
<a class="menu-item" href="//{{ sakura.urls.main }}/search" title="Search on Flashii">Search</a>
{% if user.checklogin %}
@ -240,3 +242,4 @@
<p>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>
</noscript>

View file

@ -13,7 +13,7 @@
{% else %}
<div id="userBackground"></div>
<div class="content profile">
<div class="{% if profile.profpage|length > 1 %}content-right {% endif %}content-column">
<div class="{% if profile.profilePage|length > 1 %}content-right {% endif %}content-column">
<div style="text-align: center;">
<img src="/a/{{ profile.user.id }}" alt="{{ profile.user.username }}'s Avatar" class="default-avatar-setting" style="box-shadow: 0 3px 7px #{% if profile.online %}484{% else %}844{% endif %};" />
<br /><span style="font-size: .8em;">{{ profile.ranktitle }}</span>
@ -38,11 +38,11 @@
<b>Last Seen on</b> {{ profile.user.lastdate|date("l Y-m-d H:i T") }}
{% endif %}<br />
<b>User has {% if not profile.user.posts %}no{% else %}{{ profile.user.posts }}{% endif %} forum post{% if profile.user.posts != 1 %}s{% endif %}.</b>
{% if profile.data is not null %}
{% if profile.fields is not null %}
<hr class="default" />
{% if user.checklogin %}
<table style="width: 100%;">
{% for name,field in profile.data %}
{% for name,field in profile.fields %}
<tr>
<td style="text-align: left; font-weight: bold;">
{{ field.name }}
@ -82,12 +82,12 @@
{% endif %}
</div>
</div>
<div class="content-left content-column markdown{% if profile.profpage|length < 1 %} hidden{% endif %}">
{{ profile.profpage|raw }}
<div class="content-left content-column markdown{% if profile.profilePage|length < 1 %} hidden{% endif %}">
{{ profile.profilePage|raw }}
</div>
<div class="clear"></div>
</div>
{% if profile.user.background_url %}
{% if profile.data.profileBackground %}
<script type="text/javascript">
initialiseParallax('userBackground');
</script>

View file

@ -1,77 +0,0 @@
/*
* Authentication page Styling
*/
@charset "utf-8";
.loginPage {
margin: 0 auto;
max-width: 825px;
}
.loginPage > .registerCont > *,
.loginPage > .loginCont > * {
text-align: center;
border: 1px solid #9475B2;
margin: 10px auto;
padding: 2px 3px;
width: 400px;
border: 1px solid #9475B2;
box-shadow: 0 0 3px #9475B2;
border-radius: 3px;
background: #D3BFFF;
}
@media (max-width: 430px) {
.loginPage > .registerCont > *,
.loginPage > .loginCont > * {
width: 300px;
}
}
.loginPage > .loginCont {
float: left;
}
.loginPage > .registerCont {
float: right;
}
@media (max-width: 820px) {
.loginPage > .loginCont {
float: none;
}
.loginPage > .registerCont {
float: none;
}
}
.loginPage .head {
text-align: left;
}
.loginPage > div > form > div > input {
font-size: 16px;
}
.loginPage input[type="text"],
.loginPage input[type="password"] {
width: calc(100% - 16px);
}
.loginPage form > div > label {
font-size: 20px;
font-weight: 100;
padding: 0 5px;
line-height: 32px;
color: #222;
text-shadow: #888 0 0 3px;
}
.loginPage .subLinks {
font-size: 10px;
}

View file

@ -1,416 +0,0 @@
/*
* Standard Elements
*/
@charset "utf-8";
* {
/* Reset margin and padding */
margin: 0;
padding: 0;
}
html {
width: 100%;
height: 100%;
}
body {
font: 12px/20px Verdana, sans-serif;
background: linear-gradient(180deg, #C2AFFE, #FBEEFF) no-repeat scroll left top #FBEEFF;
background-size: cover;
color: #000;
height: 100%;
position: relative;
width: 100%;
}
#container {
min-height: 100%;
position: relative;
width: 100%;
}
#contentwrapper {
padding-bottom: 220px;
}
@media (max-width: 642px) {
#contentwrapper {
padding-bottom: 335px;
}
}
@media (max-width: 426px) {
#contentwrapper {
padding-bottom: 450px;
}
}
@media (max-width: 400px) {
#contentwrapper {
padding-bottom: 450px;
}
}
@media (max-width: 300px) {
.footer {
display: none;
}
#contentwrapper {
padding-bottom: 0;
}
}
.clear {
clear: both !important;
float: none !important;
}
.hidden {
display: none !important;
visibility: hidden !important;
}
.centreAlign {
text-align: center;
}
.leftAlign {
text-align: left;
}
.rightAlign {
text-align: right;
}
h1,
h2,
h3,
h4,
h5,
h6 {
font-family: "SegoeUI-Light", "Segoe UI", sans-serif;
font-weight: 100;
margin: 5px 0;
}
h1.stylised {
text-shadow: 0 0 5px #8364A1;
color: #614390;
}
hr.default {
border: 0;
height: 1px;
color: #9475B2;
background: #9475B2;
}
img {
max-width: 100%;
max-height: 100%;
}
img.default-avatar-setting {
max-width: 200px;
max-height: 200px;
border: 3px solid #EEE;
background: #EEE;
box-shadow: 0 3px 7px #888;
border-radius: 3px;
margin: 5px;
}
img.homepage-menu-avatar {
float: right;
max-width: 100px;
max-width: 100px;
margin-top: -25px;
margin-right: 0;
}
@media (max-width: 400px) {
img.homepage-menu-avatar {
display: none;
}
}
.standalone img:not(:hover) {
max-width: 100%;
}
a.clean,
a.underline,
a.no-underline {
color: inherit !important;
text-decoration: none !important;
}
a.underline:hover {
text-decoration: underline !important;
}
a.default {
color: #22E;
text-decoration: none;
}
a.default:hover {
color: #22E;
text-decoration: underline;
}
a.default:active {
color: #E22;
text-decoration: underline;
}
a.gotop {
display: inline-block;
background: #111;
color: #FFF;
width: 60px;
height: 60px;
border-radius: 5px;
text-decoration: none;
opacity: .3;
transition: opacity .5s, box-shadow .5s;
margin: 10px 5px;
float: right;
position: fixed;
bottom: 0;
right: 5px;
z-index: 2;
line-height: 60px;
text-align: center;
font-size: 5em;
text-shadow: 0 0 5px #FFF;
}
a.gotop:hover {
opacity: .8;
box-shadow: 0 0 7px #FFF inset;
text-shadow: 0 0 7px #FFF;
}
a.gotop:active {
box-shadow: 0 0 15px #FFF inset;
text-shadow: 0 0 10px #FFF;
opacity: .9;
}
a.gotop.enter {
animation: slideInFromRight 1 .6s;
}
a.gotop.exit {
animation: slideOutToBottom 1 .6s;
}
.content {
margin: 10px auto;
padding: 2px 3px;
width: 1024px;
border: 1px solid #9475B2;
box-shadow: 0 0 3px #9475B2;
border-radius: 3px;
background: #D3BFFF;
}
.content-column {
position: relative;
min-height: 600px;
}
.content-left {
float: left;
width: 688px;
}
.content-right {
float: right;
width: 334px;
}
.content-left .head,
.news .head,
.donate .head,
.loginPage > .loginCont .head,
.messages .head {
margin: -1px -2px;
padding: 4px 5px 5px;
font-weight: 700;
font-size: 20px;
color: #306;
background: linear-gradient(90deg, rgba(148,117,178,.7), rgba(148,117,178,0)) #C2AFFE;
border-radius: 2px;
}
.content-right .head,
.loginPage > .registerCont .head {
margin: -1px -2px -1px;
padding: 4px 5px 5px;
font-weight: 700;
font-size: 20px;
color: #306;
background: linear-gradient(270deg, rgba(148,117,178,.7), rgba(148,117,178,0)) #C2AFFE;
border-radius: 2px;
}
.standalone {
background: #C2AEEE;
padding: 10px;
width: auto;
max-width: 1024px;
}
.private-message {
border-top: 1px solid #C2AEEE;
}
.ajax-busy {
background: rgba(0, 0, 0, .4);
position: fixed;
top: 0;
left: 0;
bottom: 0;
right: 0;
z-index: 5;
text-align: center;
opacity: 1;
}
.ajax-busy .ajax-inner {
line-height: 2em;
color: #FFF;
background: #222;
background: linear-gradient(0deg, rgba(0, 0, 0, .4) 20%, transparent) rgba(0, 0, 0, .8);
display: inline-block;
margin: 10% auto 0;
padding: 10px 20px 15px;
border-radius: 10px;
box-shadow: 0 5px 1em #111;
}
.ajax-busy .ajax-inner h2 {
padding-bottom: 5px;
}
.homepage .content-right ul {
margin: 10px 0;
margin-left: 30px;
}
.dropDown {
display: inline-block;
position: relative;
}
.dropDown .dropDownInner {
display: inline-block;
background: rgba(12, 12, 12, .7);
min-width: 200px;
border: 2px solid #9475B2;
float: left;
font-family: "Segoe UI", sans-serif;
text-align: left;
margin: 0 2px;
transition: background .5s;
}
.dropDown .dropDownInner:hover {
background: rgba(21, 21, 21, .8);
}
.dropDown .dropDownInner a {
padding: 0 1px 0 4px;
display: none;
color: #FFF;
text-decoration: none;
clear: both;
transition: background .2s;
}
.dropDown .dropDownInner a:hover {
background: rgba(21, 21, 21, .5);
}
.dropDown .dropDownInner a:active {
background: rgba(21, 21, 21, .7);
}
.dropDown .dropDownInner a.dropDownSelected {
display: inline-block;
}
.dropDown .dropDownInner:hover a {
display: block;
float: none;
}
.dropDown .dropDownInner a.dropDownDesc {
display: inline-block;
}
.dropDown .dropDownInner:hover a.dropDownDesc {
display: none;
}
#headerLoginForm {
background: #9475B2;
border-bottom: 2px solid #9475B2;
box-shadow: 0 0 5px #8364A1;
text-align: center;
}
#headerLoginForm > div {
display: inline-block;
}
@media (max-width: 640px) {
#headerLoginForm > div {
display: block;
text-align: right;
padding-right: 2px;
}
}
#headerLoginForm label {
font-family: "Segoe UI", sans-serif;
font-weight: 100;
font-size: 15px;
}
.indexSidePanelLinks {
font-size: 4em;
text-align: center;
line-height: 1.3em;
}
.indexSidePanelLinks > a {
color: #8364A1;
text-decoration: none;
text-shadow: 0 0 2px #9475B2;
transition: all .2s;
}
.indexSidePanelLinks > a:hover {
text-shadow: 0 0 6px #9475B2;
}
.indexSidePanelLinks > a:active {
color: #725390;
text-shadow: 0 0 8px #8364A1;
}

View file

@ -1,65 +0,0 @@
/*
* Donation page Styling
*/
@charset "utf-8";
.donate .sectionHeader {
margin: -1px -2px;
background: linear-gradient(270deg, rgba(148, 117, 178, .7), rgba(148, 117, 178, 0), rgba(148, 117, 178, .7)) #C2AFFE;
padding: 2px;
font-weight: 700;
font-size: 15px;
color: #306;
}
.donate .featureParent {
width: 100%;
padding: 10px 0;
overflow: hidden;
text-align: center;
}
.donate .featureBox {
background: linear-gradient(180deg, #C2AFFE, #B19EED) no-repeat scroll left top / cover #C2AFFE;
margin: 7px;
border-radius: 5px;
text-align: center;
box-shadow: 0 0 .5em #000;
display: inline-block;
vertical-align: top;
transition: box-shadow .2s;
width: 320px;
padding: 5px 0;
}
.donate .featureBox:hover {
box-shadow: 0 0 1em #000;
cursor: pointer;
}
.donate .featureBox:active {
box-shadow: 0 0 1.5em #609;
}
.donate .featureBoxHeader {
font-weight: 700;
font-size: 15px;
}
.donate .featureBoxDesc {
padding: 1px 2px;
}
.donate .featureBoxDesc.donateClosed {
display: none;
}
.donate .featureBoxDesc.donateOpened {
display: block;
}
.donate .paypal-donate-form {
margin: 10px auto;
display: block;
text-align: center;
}

View file

@ -1,63 +1,83 @@
html {
background: url('/images/satori-error.png') top right no-repeat #FFF;
font-family: 'verdana', sans-serif;
font-size: 0.8em;
}
html,
body {
margin: 0px 2em;
}
html, body {
min-height: 100%;
width: 90;
}
html {
background: url('/images/satori-error.png') top right no-repeat #FFF;
font-family: 'verdana', sans-serif;
font-size: .8em;
}
body {
margin: 0 2em;
}
#wrap {
max-width: 34em;
}
h1, h2, h3, p {
h1,
h2,
h3,
p {
margin: 0;
padding: 0;
font-size: 1em;
font-weight: normal;
}
h1 {
font-size: 1.5em;
margin: 1.33em 0;
}
h1 img {
margin: 0px 0.5em -0.75em 0px;
margin: 0 .5em -.75em 0;
}
p {
padding: 0px;
margin: 2em 0px;
padding: 0;
margin: 2em 0;
line-height: 1.33em;
}
hr {
margin: 1.9em 0px;
margin: 1.9em 0;
background: #BBB;
border: none;
}
ul {
padding: 0.75em 0px 0px 0px;
padding: .75em 0 0 0;
}
li {
margin: 0px 0px 0.8em 3.46em;
line-height: 1.32em;
}
a {
color: red;
}
img+a:before {
content: ' ';
content: " ";
}
h3 {
margin: 2.5em 0px;
margin: 2.5em 0;
}
li:nth-child(3) img {
margin: -0.2em 0px
margin: -0.2em 0;
}
li:nth-child(4) img {
margin: -0.5em 0px
margin: -0.5em 0;
}
table {
position: absolute;
top: 0;
@ -67,12 +87,16 @@ table {
opacity: 0;
display: none;
}
table, tr, td {
background: rgba(0,0,0,0.2);
table,
tr,
td {
background: rgba(0, 0, 0, .2);
height: 100%;
width: 100%;
text-align: center;
}
table img {
border-radius: 32px;
box-shadow: 0 4px 32px #888;

View file

@ -1,53 +0,0 @@
/*
* Site footer styling
*/
@charset "utf-8";
.footer {
box-shadow: 0 0 1em #9475B2;
font-size: small;
width: 100%;
padding-top: 10px;
padding-bottom: 30px;
background: linear-gradient(180deg, #9475B2 0%, #FBEEFF 20%, #C2AFFE 100%) #C2AFFE;
position: absolute;
bottom: 0;
}
.footer .ftsections a {
color: inherit;
text-decoration: none;
}
.footer .ftsections a:hover {
text-decoration: underline;
}
.footer .ftsections {
margin: auto;
text-align: center;
width: 95%;
min-height: 150px;
}
.footer .ftsections .ftsection {
vertical-align: top;
text-align: left;
display: inline-block;
width: 200px;
list-style-type: none;
}
.footer .ftsections .ftsection li {
margin: 2px;
}
.footer .ftsections .ftsection li.fthead {
margin-bottom: 5px;
font-weight: 700;
}
.footer .sections .copycentre {
text-align: center;
width: 100%;
}

View file

@ -1,78 +0,0 @@
/*
* Forum Styling
*/
@charset "utf-8";
.forum .forumList {
width: 100%;
border-spacing: 0;
margin-top: 2px;
}
.forum .forumList .forumCategory {
background: #C2AFFE;
font-weight: 700;
font-size: 17px;
color: inherit;
text-decoration: none;
}
.forum .forumList .forumCategory .forumCategoryTitleColumn {
padding: 4px;
}
.forum .forumList .forumForum {
height: 50px;
}
.forum .forumList .forumForum .forumIconColumn {
text-align: center;
width: 50px;
}
.forum .forumList .forumForum .forumIconColumn .forumIcon.read {
color: #444;
text-shadow: 0 0 5px #444;
}
.forum .forumList .forumForum .forumIconColumn .forumIcon.unread {
color: #6C5D7B;
text-shadow: 0 0 5px #9475B2;
}
.forum .forumList .forumForum .forumTitleColumn .name {
font-size: 1.2em;
line-height: 1.7em;
}
.forum .forumList .forumForum .forumTitleColumn .desc {
font-size: .8em;
line-height: 1em;
}
.forum .forumList .forumForum .forumCountColumn {
width: 70px;
text-align: center;
}
.forum .forumList .forumForum .forumCountColumn .topics {
font-size: 1.5em;
color: #111;
}
.forum .forumList .forumForum .forumCountColumn .posts {
font-size: .8em;
line-height: 1.2em;
color: #555;
}
.forum .forumList .forumForum .forumLastColumn {
width: 250px;
font-size: .9em;
line-height: 1.4em;
}
.forum .forumList .forumForum .forumLastColumn div,
.forum .forumList .forumForum .forumTitleColumn div {
padding-left: 5px;
}

View file

@ -1,185 +0,0 @@
/*
* Site header styling
*/
@charset "utf-8";
.header {
text-align: center;
background: linear-gradient(180deg, #C2AFFE, #CCBAFE);
box-shadow: 0 0 5px #8364A1;
}
.header .logo {
background: none;
height: auto;
width: auto;
display: inline-block;
text-decoration: none;
font: 100 70px/80px "SegoeUI-Light", "Segoe UI", sans-serif;
color: #B06AC4;
transition: color .2s, text-shadow .2s;
}
.header .logo:hover {
color: #C17BD5;
text-shadow: 0 0 .1em #C17BD5;
}
.header .logo:active {
color: #A059B3;
text-shadow: 0 0 .1em #A059B3;
}
@media (max-width: 768px) {
.header .logo {
font: 100 50px/60px "SegoeUI-Light", "Segoe UI", sans-serif;
}
}
.header .menu {
border-bottom: 2px solid #9475B2;
}
.header .menu .menu-nav {
text-align: left;
float: left;
}
.header .menu .menu-ucp {
text-align: right;
float: right;
}
.header .menu .menu-mob {
display: none;
}
.header .menu .menu-item {
margin: 0 8px -2px;
display: inline-block;
min-width: 75px;
padding: 5px;
border-bottom: 2px solid #8364A1;
color: inherit;
text-decoration: none;
text-align: center;
transition: border-color .5s, background .3s;
}
.header .menu .menu-item.avatar {
width: auto;
padding-left: 36px;
background: url('/pixel.png') no-repeat scroll left center / contain transparent;
}
.header .menu .menu-item:hover {
border-color: #503180 !important;
}
.header .menu .menu-item:active {
border-color: #503180 !important;
background-color: #503180 !important;
}
.header .menu .menu-donate:hover {
border-color: #EE9400 !important;
}
.header .menu .menu-donate:active {
border-color: #EE9400 !important;
background-color: #EE9400 !important;
}
@media (max-width: 1283px) and (min-width: 930px) {
.header .menu {
border: 0;
padding-bottom: 5px;
}
.header .menu .menu-nav {
margin-left: 32px;
}
.header .menu .menu-nav,
.header .menu .menu-ucp {
display: block;
float: none;
text-align: center;
}
.header .menu .menu-item {
min-width: 120px;
border: 0;
margin: 0 8px;
}
.header .menu .menu-nav .menu-item {
min-width: 120px;
border-bottom: 1px solid #8364A1;
}
.header .menu .menu-ucp .menu-item {
min-width: 120px;
border-top: 1px solid #8364A1;
}
}
@media (max-width: 930px) {
.header .menu .menu-nav, .header .menu .menu-ucp {
float: none;
text-align: center;
display: none;
}
.header .menu .menu-hid {
display: block;
}
.header .menu .menu-mob {
display: block;
}
.header .menu .menu-item.avatar {
padding-left: 0;
}
.header .menu .menu-mob .menu-item {
width: 100px;
}
.header .menu .menu-nav .menu-item, .header .menu .menu-ucp .menu-item {
display: block;
border-top: 0;
border-bottom: 1px solid #8364A1;
margin: 0 8px;
}
.header .menu .menu-nav:before {
content: "Navigation";
font-size: 20px;
line-height: 40px;
}
.header .menu .menu-ucp:before {
content: "User Settings";
font-size: 20px;
line-height: 40px;
}
}
.headerNotify {
margin: 10px auto;
padding: 10px;
width: auto;
max-width: 1024px;
border: 1px solid #9475B2;
box-shadow: 0 0 3px #9475B2;
border-radius: 3px;
background: #D3BFFF;
display: block;
text-align: center;
}

View file

@ -1,74 +0,0 @@
/*
* Input box Styling
*/
@charset "utf-8";
input[type="submit"].inputStyling,
input[type="button"].inputStyling,
input[type="reset"].inputStyling {
padding: 3px 10px;
cursor: pointer;
border: 0;
border-radius: 3px;
background: linear-gradient(180deg, #9475B2 0%, #9475B2 50%, #86A 50%) #9475B2;
margin: 4px 1px;
color: #FFF;
box-shadow: inset #222 0 0 1px;
text-shadow: #888 0 0 2px;
transition: text-shadow .5s, box-shadow .5s;
font-size: 22px;
min-width: 120px;
}
input[type="submit"].inputStyling.small,
input[type="button"].inputStyling.small,
input[type="reset"].inputStyling.small {
padding: 0 4px 1px;
margin: -2px 0 0;
font-size: 16px;
border-radius: 0;
min-width: 80px !important;
}
input[type="submit"].inputStyling:hover,
input[type="button"].inputStyling:hover,
input[type="reset"].inputStyling:hover {
box-shadow: inset #222 0 0 3px;
text-shadow: #F1F1F1 0 0 5px;
}
input[type="submit"].inputStyling:active,
input[type="button"].inputStyling:active,
input[type="reset"].inputStyling:active {
box-shadow: inset #222 0 0 5px;
text-shadow: #F1F1F1 0 0 3px;
transition: text-shadow .2s, box-shadow .2s;
}
input[type="text"].inputStyling,
input[type="password"].inputStyling ,
input[type="date"].inputStyling {
padding: 3px 4px;
border: 1px solid #CCC;
box-shadow: inset #DDD 0 0 5px;
background: linear-gradient(180deg, #FFF 0%, #EEE 50%, #E5E5E5 50%) #FFF;
}
input[type="text"].inputStyling.red,
input[type="password"].inputStyling.red,
input[type="date"].inputStyling.red {
box-shadow: inset 0px 0px 7px #EB5959;
}
input[type="text"].inputStyling.green,
input[type="password"].inputStyling.green,
input[type="date"].inputStyling.green {
box-shadow: inset 0px 0px 7px #A9EC8B;
}
textarea.inputStyling {
padding: 3px 4px;
border: 1px solid #CCC;
box-shadow: inset #DDD 0 0 5px;
background: linear-gradient(180deg, #FFF 0%, #EEE 50%, #E5E5E5 50%) #FFF;
}

View file

@ -1,71 +0,0 @@
/*
* Animation Keyframes
*/
@charset "utf-8";
/* Spin */
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
/* Fade out */
@keyframes fadeOut {
0% {
opacity: 1;
}
100% {
opacity: 0;
display: none;
}
}
/* Fade in */
@keyframes fadeIn {
0% {
opacity: 0;
}
100% {
opacity: 1;
display: block;
}
}
/* Slide in from right */
@keyframes slideInFromRight { /* Requires position: relative to be set on the element */
0% {
right: -100%;
}
100% {
right: 0%;
}
}
/* Slide out to bottom */
@keyframes slideOutToBottom { /* Read comment above */
0% {
bottom: 0%;
}
100% {
bottom: -100%;
}
}

View file

@ -1,103 +0,0 @@
/*
* Members page Styling
*/
@charset "utf-8";
.membersPage {
width: 100%;
padding: 10px 0;
overflow: hidden;
text-align: center;
}
.membersPage a {
color: inherit;
}
.membersPage .userBox {
background: linear-gradient(180deg, #C2AFFE, #B19EED) no-repeat scroll left top / cover #C2AFFE;
margin: 7px;
border-radius: 5px;
text-align: center;
box-shadow: 0 0 .5em #000;
display: inline-block;
vertical-align: top;
transition: box-shadow .2s;
}
.membersPage .userBox {
padding: 10px;
line-height: 330%;
}
.membersPage .userBox:hover {
box-shadow: 0 0 1em #000;
cursor: pointer;
}
.membersPage .userBox:active {
box-shadow: 0 0 1.5em #609;
}
.membersPage .userBox img {
margin: 0 auto;
}
.membersPage .userBox .userBoxUserName {
font-weight: 700;
}
.membersPage .boxes .userBox {
width: 200px;
height: 230px;
}
.membersPage .boxes .userBox img {
width: 200px;
height: 200px;
display: block;
}
.membersPage .rectangles .userBox {
width: 300px;
height: 100px;
text-align: left;
}
.membersPage .rectangles .userBox img {
width: 100px;
height: 100px;
display: inline-block;
}
.membersPage .rectangles .userBox .userBoxUserName {
display: inline-block;
vertical-align: top;
padding: 30px 10px;
}
.membersPage .list table {
margin: 10px auto;
background: #C2AFFE;
box-shadow: 0 0 3px #9475B2;
border: 1px solid #9475B2;
max-width: 1024px;
width: auto;
border-radius: 3px;
border-spacing: 0;
}
.membersPage .list table td,
.membersPage .list table th {
padding: 4px 8px;
}
.membersPage .list thead th {
border-bottom: 1px solid #9475B2;
background: #A586C4;
}
.membersPage .list tfoot th {
border-top: 1px solid #9475B2;
background: #A586C4;
}

View file

@ -1,41 +0,0 @@
/*
* Private Messages Styling
*/
@charset "utf-8";
.messages table {
width: 100%;
border-spacing: 0;
}
.messages table > tbody > tr.unread {
background: #C2AFFE;
font-weight: 700;
}
.messages table > tbody > tr > td {
border-bottom: 1px solid #B19EED;
border-top: 1px solid #B19EED;
}
.messages table > * > tr > td {
padding: 0 4px;
}
.messages table > * > tr > td:first-child {
width: 150px;
text-align: center;
}
.messages table > tbody > tr > td:first-child {
border-left: 1px solid #B19EED;
}
.messages table > * > tr > td:last-child {
width: 220px;
text-align: center;
}
.messages table > tbody > tr > td:last-child {
border-right: 1px solid #B19EED;
}

View file

@ -1,74 +0,0 @@
/*
* News page styling
*/
@charset "utf-8";
.news {
min-height: 0;
}
.news-head {
margin: -1px -2px;
padding: 4px;
background: #C2AFFE;
font-weight: 700;
display: block;
font-size: 17px;
color: inherit;
text-decoration: none;
}
.news-rss {
float: right;
}
.news-body {
font-size: 10pt;
padding: 2px 0 0 3px;
}
.news-post-time {
font-size: 8pt;
padding: 6px 15px;
text-align: right;
font-weight: 700;
}
.news-poster {
margin-top: -20px;
float: right;
text-align: center;
width: 140px;
}
.news-poster img {
max-width: 120px;
max-height: 120px;
}
.news-poster h1 {
line-height: 100%;
margin: 0;
margin-top: -5px;
}
@media (max-width: 768px) {
.news-poster {
margin: 0;
}
}
@media (max-width: 400px) {
.news-poster {
margin-top: 10px;
width: auto;
padding: 0 10px 0 0;
}
.news-poster img {
display: none;
}
}

View file

@ -1,99 +0,0 @@
/*
* Notification styling
*/
@charset "utf-8";
#notifications {
position: fixed;
bottom: 5px;
right: 5px;
z-index: 3;
font-family: "Segoe UI", sans-serif;
overflow-y: auto;
overflow-x: hidden;
max-height: 510px;
max-width: 600px;
text-align: right;
}
#notifications > div {
cursor: pointer;
text-align: left;
display: inline-block;
height: 80px;
background: rgba(113, 74, 150, .9);
border: 1px solid #507;
border-right-width: 5px;
color: #FFF;
padding: 2px 0 2px 2px;
margin: 5px;
position: relative;
box-shadow: 0 0 4px rgba(0, 0, 0, .9);
}
#notifications > .notification-enter {
animation: slideInFromRight 1 .4s, fadeIn 1 .4s;
}
#notifications > .notification-exit {
animation: slideOutToBottom 1 .4s, fadeOut 1 .4s;
}
#notifications > div > .notification-icon {
float: left;
width: 80px;
height: 80px;
text-align: center;
background: rgba(0, 0, 0, .5);
display: block;
}
#notifications > div > .notification-icon > img {
max-height: 80px;
max-width: 80px;
}
#notifications > div > .notification-icon > .font-icon {
margin: .34em 0;
}
#notifications > div > .notification-content {
float: left;
min-width: 350px;
max-width: 450px;
padding-right: 6px;
border-left: 1px solid rgb(85, 0, 119);
height: 80px;
margin-left: 2px;
padding-left: 8px;
}
#notifications > div > .notification-content > .notification-title {
font-weight: 300;
font-size: 1.7em;
margin-top: 1em;
}
#notifications > div > .notification-close:before {
font-family: FontAwesome;
content: "\f00d";
}
#notifications > div > .notification-close {
font-size: 2em;
float: right;
height: 80px;
width: 20px;
background: #507;
margin-top: -3px;
padding-bottom: 6px;
padding-left: 2px;
border-left: 3px solid #507;
line-height: 3.4em;
text-align: center;
display: none;
}
#notifications > div:hover > .notification-close {
display: block;
}

View file

@ -1,49 +0,0 @@
/*
* Profile page Styling
*/
@charset "utf-8";
.profile .content-left {
max-height: 800px;
overflow: auto;
}
.profile .user-actions {
font-size: 3em;
line-height: 1.4em;
}
.profile .user-actions a {
color: #8364A1;
text-decoration: none;
text-shadow: 0 0 2px #9475B2;
transition: all .2s;
}
.profile .user-actions a:hover {
text-shadow: 0 0 6px #9475B2;
}
.profile .user-actions a:active {
color: #725390;
text-shadow: 0 0 8px #8364A1;
}
@media (max-width: 1024px) {
.content {
width: auto;
}
.content .content-right {
width: 100%;
min-height: 0;
}
.content .content-left {
width: 100%;
min-height: 0;
border-top: 1px solid #9475B2;
}
}

View file

@ -1,91 +0,0 @@
/*
* Settings page styling
*/
@charset "utf-8";
.settings .right-menu-nav > div {
background: #C2AFFE;
padding: 4px;
margin: -1px -2px;
font-weight: 700;
display: block;
font-size: 17px;
}
.settings .right-menu-nav > a {
display: block;
font-size: 14px;
line-height: 25px;
color: #22E;
text-decoration: none;
padding-left: 10px;
}
.settings .right-menu-nav > a:hover {
color: #22E;
text-decoration: underline;
}
.settings .right-menu-nav > a:active {
color: #E22;
text-decoration: underline;
}
.settings .settings-explanation {
font-size: 11px;
line-height: 18px;
padding: 7px;
border-bottom: 1px solid #C2AFFE;
margin-bottom: 7px;
}
.settings .settings-table {
width: 100%;
}
.settings .settings-table tr > th {
font-size: 17px;
background: #C2AFFE;
padding: 4px;
margin: -1px -2px;
font-weight: 700;
}
.settings .settings-table tr > td {
text-align: center;
}
.settings .settings-table > tbody > tr:not(:last-child) > td {
border-bottom: 1px solid #C2AFFE;
}
.settings .settings-table tr.current-session > td {
background: #B39EED;
}
.settings .profile-field {
width: 100%;
}
.settings .profile-field > div:nth-child(2) > input {
width: calc(100% - 16px);
}
.settings .profile-save {
text-align: center;
padding: 10px;
}
.settings .background-frame {
max-width: 600px;
max-height: 400px;
border: 3px solid #EEE;
background: #EEE;
box-shadow: 0 3px 7px #888;
border-radius: 3px;
margin: 5px;
}
.settings form {
overflow: auto;
}

File diff suppressed because it is too large Load diff

View file

@ -1 +0,0 @@
# Profile background directory

Binary file not shown.

After

Width:  |  Height:  |  Size: 252 KiB

View file

@ -54,6 +54,11 @@ RewriteRule ^members/([a-z]+)/([0-9]+)/p([0-9]+)/?$ members.php?sort=$1&rank=$2&
RewriteRule ^u/?$ profile.php
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/?$ profile.php?u=$1
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/api/?$ profile.php?data
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/header/?$ imageserve.php?m=header&u=$1
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/groups/?$ profile.php?u=$1&view=groups
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/friends/?$ profile.php?u=$1$view=friends
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/threads/?$ profile.php?u=$1$view=threads
RewriteRule ^u/([A-Za-z0-9_-\s\.]+)/posts/?$ profile.php?u=$1$view=posts
# Serving Images
RewriteRule ^a/([0-9]+)$|a/([0-9]+).png$ imageserve.php?m=avatar&u=$1

View file

@ -95,7 +95,7 @@ if(isset($_REQUEST['mode'])) {
$messages = [
'USER_NOT_LOGIN' => 'What are you doing, you\'re not even logged in. GO AWAY!',
'INCORRECT_PASSWORD' => 'The password you entered was invalid.',
'NOT_ALLOWED' => 'Your account does not have the required permissions to log in.',
'NOT_ALLOWED' => 'Your account does not have the required permissions to change your password.',
'NO_LOGIN' => 'Logging into this account is disabled.',
'PASS_TOO_SHIT' => 'Your password is too weak, try adding some special characters.',
'PASS_NOT_MATCH' => 'Passwords do not match.',
@ -198,7 +198,7 @@ if(isset($_REQUEST['mode'])) {
'AUTH_LOCKED' => 'Authentication is currently not allowed, try again later.',
'USER_NOT_EXIST' => 'The user you tried to log into does not exist.',
'INCORRECT_PASSWORD' => 'The password you entered was invalid.',
'DEACTIVATED' => 'Your account is deactivated.',
'NOT_ALLOWED' => 'Your account does not have the required permissions to log in.',
'NO_LOGIN' => 'Logging into this account is disabled.',
'LEGACY_SUCCESS' => 'Login successful! Taking you to the password changing page...',
'LOGIN_SUCESS' => 'Login successful!'
@ -274,7 +274,7 @@ if(isset($_REQUEST['mode'])) {
$messages = [
'AUTH_LOCKED' => 'Authentication is currently not allowed, try again later.',
'USER_NOT_EXIST' => 'The requested user does not exist (confirm the username/email combination).',
'DEACTIVATED' => 'Your account is deactivated.',
'NOT_ALLOWED' => 'Your account does not have the required permissions to change your password.',
'SUCCESS' => 'The password reset e-mail has been sent to the address associated with your account.'
];

View file

@ -12,6 +12,9 @@ require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sak
// Set Content type
header('Content-Type: application/octet-stream');
// Path to user uploads
$userDirPath = ROOT .'content/images/user/';
// Check if the m(ode) GET request is set
if(isset($_GET['m'])) {
@ -22,7 +25,6 @@ if(isset($_GET['m'])) {
$noAvatar = ROOT .'content/images/no-av.png';
$deactiveAvatar = ROOT .'content/images/deactivated-av.png';
$bannedAvatar = ROOT .'content/images/banned-av.png';
$avatarDirPath = ROOT .'content/images/avatars/';
// If ?u= isn't set or if it isn't numeric
if(!isset($_GET['u']) || !is_numeric($_GET['u'])) {
@ -32,6 +34,7 @@ if(isset($_GET['m'])) {
// Get user data
$user = Users::getUser($_GET['u']);
$data = Users::getUserProfileData($user, true);
// If user is deactivated use deactive avatar
if(Users::checkIfUserHasRanks([0, 1], $user, true)) {
@ -46,19 +49,18 @@ if(isset($_GET['m'])) {
}
// Check if user has an avatar set
if(empty($user['avatar_url']) || !file_exists($avatarDirPath . $user['avatar_url'])) {
if(empty($data['userAvatar']) || !file_exists($userDirPath . $data['userAvatar'])) {
$serveImage = $noAvatar;
break;
}
// Check if the avatar exist and assign it to a value
$serveImage = $avatarDirPath . $user['avatar_url'];
$serveImage = $userDirPath . $data['userAvatar'];
break;
case 'background':
// Set paths
$noBackground = ROOT .'content/pixel.png';
$bgDirPath = ROOT .'content/images/backgrounds/';
$noBackground = ROOT .'content/pixel.png';
// If ?u= isn't set or if it isn't numeric
if(!isset($_GET['u']) || !is_numeric($_GET['u'])) {
@ -68,15 +70,64 @@ if(isset($_GET['m'])) {
// Get user data
$user = Users::getUser($_GET['u']);
$data = Users::getUserProfileData($user, true);
// Check if user has an avatar set
if(empty($user['background_url']) || !file_exists($bgDirPath . $user['background_url'])) {
$serveImage = $noAvatar;
// If user is deactivated use deactive avatar
if(Users::checkIfUserHasRanks([0, 1], $user, true)) {
$serveImage = $noBackground;
break;
}
// Check if user is banned
if(false) { // [Flashwave 2015-04-27] Banning isn't implemented yet
$serveImage = $noBackground;
break;
}
// Check if user has a background set
if(empty($data['profileBackground']) || !file_exists($userDirPath . $data['profileBackground'])) {
$serveImage = $noBackground;
break;
}
// Check if the avatar exist and assign it to a value
$serveImage = $bgDirPath . $user['background_url'];
$serveImage = $userDirPath . $data['profileBackground'];
break;
case 'header':
// Set paths
$noHeader = ROOT .'content/images/triangles.png';
// If ?u= isn't set or if it isn't numeric
if(!isset($_GET['u']) || !is_numeric($_GET['u'])) {
$serveImage = $noHeader;
break;
}
// Get user data
$user = Users::getUser($_GET['u']);
$data = Users::getUserProfileData($user, true);
// If user is deactivated use deactive avatar
if(Users::checkIfUserHasRanks([0, 1], $user, true)) {
$serveImage = $noHeader;
break;
}
// Check if user is banned
if(false) { // [Flashwave 2015-04-27] Banning isn't implemented yet
$serveImage = $noHeader;
break;
}
// Check if user has a background set
if(empty($data['profileHeader']) || !file_exists($userDirPath . $data['profileHeader'])) {
$serveImage = $noHeader;
break;
}
// Check if the avatar exist and assign it to a value
$serveImage = $userDirPath . $data['profileHeader'];
break;
default:

View file

@ -8,7 +8,7 @@ namespace Sakura;
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
//print Permissions::check('SITE', 'USE_CHAT', Session::$userId, 1);
// Add page specific things
$renderData['newsPosts'] = Main::getNewsPosts(3);
$renderData['page'] = [

View file

@ -19,7 +19,7 @@ $renderData['page'] = [
'sort' => isset($_GET['sort']) && $_GET['sort'] && in_array($_GET['sort'], $_MEMBERLIST_SORTS) ? $_GET['sort'] : $_MEMBERLIST_SORTS[0],
'title' => isset($_GET['rank']) && $_GET['rank'] && !$_MEMBERLIST_NFOUND ? 'Viewing '. $_MEMBERLIST_RANKS[$_GET['rank']]['name'] . ($_MEMBERLIST_RANKS[$_GET['rank']]['multi'] ? 's' : '') : 'Member List',
'page' => isset($_GET['page']) && ($_GET['page'] - 1) >= 0 ? $_GET['page'] - 1 : 0,
'users' => array_chunk($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE) : Users::getAllUsers(), 30, true)
'users' => array_chunk($_MEMBERLIST_ACTIVE && !$_MEMBERLIST_NFOUND ? Users::getUsersInRank($_MEMBERLIST_ACTIVE, null, true, true) : Users::getAllUsers(), 30, true)
];

View file

@ -25,22 +25,23 @@ if(isset($_REQUEST['data'])) {
if(isset($_GET['u'])) {
$renderData['profile'] = [
'notset' => false,
'user' => ($_PROFILE_USER_DATA = Users::getUser(($_USER_USERNAME_ID = Users::userExists($_GET['u'], false)) ? $_USER_USERNAME_ID : $_GET['u'])),
'rank' => ($_PROFILE_RANK_DATA = Users::getRank($_PROFILE_USER_DATA['rank_main'])),
'colour' => ($_PROFILE_USER_DATA['name_colour'] == null ? $_PROFILE_RANK_DATA['colour'] : $_PROFILE_USER_DATA['name_colour']),
'ranktitle' => ($_PROFILE_USER_DATA['usertitle'] == null ? $_PROFILE_RANK_DATA['title'] : $_PROFILE_USER_DATA['usertitle']),
'country' => Main::getCountryName($_PROFILE_USER_DATA['country']),
'istenshi' => Users::checkUserTenshi($_PROFILE_USER_DATA['id']),
'online' => Users::checkUserOnline($_PROFILE_USER_DATA['id']),
'profpage' => Main::mdParse(base64_decode($_PROFILE_USER_DATA['profile_md'])),
'data' => Users::getUserProfileData($_PROFILE_USER_DATA['id']),
'warnings' => Users::getWarnings($_PROFILE_USER_DATA['id'])
'notset' => false,
'user' => ($_PROFILE_USER_DATA = Users::getUser(($_USER_USERNAME_ID = Users::userExists($_GET['u'], false)) ? $_USER_USERNAME_ID : $_GET['u'])),
'rank' => ($_PROFILE_RANK_DATA = Users::getRank($_PROFILE_USER_DATA['rank_main'])),
'colour' => ($_PROFILE_USER_DATA['name_colour'] == null ? $_PROFILE_RANK_DATA['colour'] : $_PROFILE_USER_DATA['name_colour']),
'ranktitle' => ($_PROFILE_USER_DATA['usertitle'] == null ? $_PROFILE_RANK_DATA['title'] : $_PROFILE_USER_DATA['usertitle']),
'data' => ($_PROFILE_PROFILE_DATA = Users::getUserProfileData($_PROFILE_USER_DATA, true)),
'country' => Main::getCountryName($_PROFILE_USER_DATA['country']),
'istenshi' => Users::checkUserTenshi($_PROFILE_USER_DATA['id']),
'online' => Users::checkUserOnline($_PROFILE_USER_DATA['id']),
'profilePage' => Users::getProfilePage($_PROFILE_PROFILE_DATA, true),
'fields' => Users::getUserProfileFields($_PROFILE_PROFILE_DATA, true),
'warnings' => Users::getWarnings($_PROFILE_USER_DATA['id'])
];
$renderData['page'] = [
'title' => ($_PROFILE_USER_DATA['id'] < 1 || $_PROFILE_USER_DATA['password_algo'] == 'nologin' ? 'User not found!' : 'Profile of '. $_PROFILE_USER_DATA['username']),
'style' => ($_PROFILE_USER_DATA['background_url'] ? [
'style' => (!empty($_PROFILE_PROFILE_DATA['profileBackground']) ? [
'#userBackground' => [
'background' => 'url("/bg/'. $_PROFILE_USER_DATA['id'] .'") no-repeat center center / cover transparent !important',
'position' => 'fixed',
@ -49,9 +50,6 @@ if(isset($_GET['u'])) {
'right' => '0',
'left' => '0',
'z-index' => '-1'
],
'.profile' => [
'background' => 'rgba(211, 191, 255, .8) !important'
]
] : null)
];