From 8f5b7066c357c840ba0b7d9fcccb713b3c614ae5 Mon Sep 17 00:00:00 2001 From: flashwave Date: Fri, 19 Jun 2015 16:12:44 +0000 Subject: [PATCH] desu --- _sakura/changelog.json | 12 ++- _sakura/components/Parser.php | 0 _sakura/sakura.php | 2 +- _sakura/templates/yuuno/elements/newsPost.tpl | 2 +- .../templates/yuuno/elements/settingsNav.tpl | 2 +- _sakura/templates/yuuno/global/header.tpl | 26 ++---- _sakura/templates/yuuno/settings/avatar.tpl | 18 +++++ .../templates/yuuno/settings/background.tpl | 18 +++++ .../templates/yuuno/settings/deactivate.tpl | 17 ++++ _sakura/templates/yuuno/settings/email.tpl | 17 ++++ _sakura/templates/yuuno/settings/home.tpl | 2 +- _sakura/templates/yuuno/settings/notfound.tpl | 17 ++++ .../yuuno/settings/notifications.tpl | 46 +++++++++++ _sakura/templates/yuuno/settings/page.tpl | 18 +++++ _sakura/templates/yuuno/settings/password.tpl | 17 ++++ _sakura/templates/yuuno/settings/profile.tpl | 17 ++++ _sakura/templates/yuuno/settings/ranks.tpl | 17 ++++ _sakura/templates/yuuno/settings/regkeys.tpl | 17 ++++ _sakura/templates/yuuno/settings/sessions.tpl | 19 +++++ _sakura/templates/yuuno/settings/username.tpl | 18 +++++ .../templates/yuuno/settings/usertitle.tpl | 17 ++++ content/data/yuuno/css/yuuno.css | 79 ++++++++++++++++--- main/.htaccess | 4 +- main/imageserve.php | 2 +- main/settings.php | 24 +++++- 25 files changed, 388 insertions(+), 40 deletions(-) create mode 100644 _sakura/components/Parser.php create mode 100644 _sakura/templates/yuuno/settings/avatar.tpl create mode 100644 _sakura/templates/yuuno/settings/background.tpl create mode 100644 _sakura/templates/yuuno/settings/deactivate.tpl create mode 100644 _sakura/templates/yuuno/settings/email.tpl create mode 100644 _sakura/templates/yuuno/settings/notfound.tpl create mode 100644 _sakura/templates/yuuno/settings/notifications.tpl create mode 100644 _sakura/templates/yuuno/settings/page.tpl create mode 100644 _sakura/templates/yuuno/settings/password.tpl create mode 100644 _sakura/templates/yuuno/settings/profile.tpl create mode 100644 _sakura/templates/yuuno/settings/ranks.tpl create mode 100644 _sakura/templates/yuuno/settings/regkeys.tpl create mode 100644 _sakura/templates/yuuno/settings/sessions.tpl create mode 100644 _sakura/templates/yuuno/settings/username.tpl create mode 100644 _sakura/templates/yuuno/settings/usertitle.tpl diff --git a/_sakura/changelog.json b/_sakura/changelog.json index 8889914..7df8a2e 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -19,7 +19,8 @@ "20150529", "20150530", "20150602", - "20150604" + "20150604", + "20150619" ] @@ -1251,6 +1252,15 @@ "change": "Add /header to profile for spooky things." } + ], + + "20150619": [ + + { + "type": "ADD", + "change": "Added notification history section contents to settings panel." + } + ] } diff --git a/_sakura/components/Parser.php b/_sakura/components/Parser.php new file mode 100644 index 0000000..e69de29 diff --git a/_sakura/sakura.php b/_sakura/sakura.php index e308d84..5fc6940 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20150604'); +define('SAKURA_VERSION', '20150619'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_VTYPE', 'Development'); define('SAKURA_COLOUR', '#6C3082'); diff --git a/_sakura/templates/yuuno/elements/newsPost.tpl b/_sakura/templates/yuuno/elements/newsPost.tpl index ba63179..06899f1 100644 --- a/_sakura/templates/yuuno/elements/newsPost.tpl +++ b/_sakura/templates/yuuno/elements/newsPost.tpl @@ -1,4 +1,4 @@ -{% if newsPosts|length > 1 %}{{ newsPost.title }}{% endif %} +{% if newsPosts|length > 1 %}{{ newsPost.title }}{% endif %}
diff --git a/_sakura/templates/yuuno/elements/settingsNav.tpl b/_sakura/templates/yuuno/elements/settingsNav.tpl index 1c41c26..7e2f690 100644 --- a/_sakura/templates/yuuno/elements/settingsNav.tpl +++ b/_sakura/templates/yuuno/elements/settingsNav.tpl @@ -16,7 +16,7 @@ Background Profile Page
Account
- E-Mail Address + E-mail Address Username User Title Password diff --git a/_sakura/templates/yuuno/global/header.tpl b/_sakura/templates/yuuno/global/header.tpl index 6800f0d..012de26 100644 --- a/_sakura/templates/yuuno/global/header.tpl +++ b/_sakura/templates/yuuno/global/header.tpl @@ -61,25 +61,16 @@ function initHeaderLoginForm() { var headerLoginForm = document.getElementById('headerLoginForm'); - var headerLoginLink = document.getElementById('headerLoginLink'); var createInput = document.createElement('input'); + var submit = headerLoginForm.querySelector('[type="submit"]'); createInput.setAttribute('name', 'ajax'); createInput.setAttribute('value', 'true'); createInput.setAttribute('type', 'hidden'); headerLoginForm.appendChild(createInput); - - headerLoginLink.setAttribute('href', 'javascript:void(0);'); - headerLoginLink.setAttribute('onclick', 'toggleLoginForm();'); - - } - - // Toggling the dynamic login form - function toggleLoginForm() { - - var headerLoginForm = document.getElementById('headerLoginForm'); - - headerLoginForm.className = (headerLoginForm.className == 'hidden' ? '' : 'hidden'); + + submit.setAttribute('type', 'button'); + submit.setAttribute('onclick', 'submitPost(\'headerLoginForm\', true, \'Logging in...\');'); } @@ -200,8 +191,7 @@ {% if sakura.lockauth %} {% else %} - Login - Register + Login or Register {% endif %} {% endif %}
@@ -213,8 +203,8 @@
- {% if not user.checklogin %} -
- +
{% endif %} diff --git a/_sakura/templates/yuuno/settings/avatar.tpl b/_sakura/templates/yuuno/settings/avatar.tpl new file mode 100644 index 0000000..f3feaee --- /dev/null +++ b/_sakura/templates/yuuno/settings/avatar.tpl @@ -0,0 +1,18 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+
Your avatar which is displayed all over the site and on your profile.
+
Maximum image size is 500x500, minimum image size is 20x20, maximum file size is 10 MB.
+
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/background.tpl b/_sakura/templates/yuuno/settings/background.tpl new file mode 100644 index 0000000..5793039 --- /dev/null +++ b/_sakura/templates/yuuno/settings/background.tpl @@ -0,0 +1,18 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+
The background that is displayed on your profile.
+
Maximum image size is 2560x1440, minimum image size is 20x20, maximum file size is 10 MB.
+
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/deactivate.tpl b/_sakura/templates/yuuno/settings/deactivate.tpl new file mode 100644 index 0000000..0f05061 --- /dev/null +++ b/_sakura/templates/yuuno/settings/deactivate.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ You can deactivate your account here if you want to leave :(. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/email.tpl b/_sakura/templates/yuuno/settings/email.tpl new file mode 100644 index 0000000..b5af069 --- /dev/null +++ b/_sakura/templates/yuuno/settings/email.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ You e-mail address is used for password recovery and stuff like that, we won't spam you ;). +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/home.tpl b/_sakura/templates/yuuno/settings/home.tpl index f5c372a..08e715c 100644 --- a/_sakura/templates/yuuno/settings/home.tpl +++ b/_sakura/templates/yuuno/settings/home.tpl @@ -5,7 +5,7 @@
- General / Home + {{ page.title }}
Welcome to the Settings Panel. From here you can monitor, view and update your profile and preferences. diff --git a/_sakura/templates/yuuno/settings/notfound.tpl b/_sakura/templates/yuuno/settings/notfound.tpl new file mode 100644 index 0000000..bcb5af8 --- /dev/null +++ b/_sakura/templates/yuuno/settings/notfound.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ This is an error. +
+

Could not find what you were looking for.

+
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/notifications.tpl b/_sakura/templates/yuuno/settings/notifications.tpl new file mode 100644 index 0000000..7d61d07 --- /dev/null +++ b/_sakura/templates/yuuno/settings/notifications.tpl @@ -0,0 +1,46 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ This is the history of notifications that have been sent to you. +
+
+ {% for notif in notifs %} +
+
+ {% if 'FONT:' in notif.notif_img %} +
+ {% else %} + Notification + {% endif %} +
+
+
+ {{ notif.timestamp|date("r") }} +
+
+
+ {{ notif.notif_title }} +
+
+ {{ notif.notif_text }} + {% if notif.notif_link %} + | Go + {% endif %} +
+
+
+
+
+ {% endfor %} +
+
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/page.tpl b/_sakura/templates/yuuno/settings/page.tpl new file mode 100644 index 0000000..6e75b4d --- /dev/null +++ b/_sakura/templates/yuuno/settings/page.tpl @@ -0,0 +1,18 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+
The custom text that is displayed on your profile.
+ +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/password.tpl b/_sakura/templates/yuuno/settings/password.tpl new file mode 100644 index 0000000..70b57e7 --- /dev/null +++ b/_sakura/templates/yuuno/settings/password.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ Used to authenticate with the site and certain related services. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/profile.tpl b/_sakura/templates/yuuno/settings/profile.tpl new file mode 100644 index 0000000..9fc5c6f --- /dev/null +++ b/_sakura/templates/yuuno/settings/profile.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ These are the external account links etc. on your profile, shouldn't need any additional explanation for this one. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/ranks.tpl b/_sakura/templates/yuuno/settings/ranks.tpl new file mode 100644 index 0000000..636742a --- /dev/null +++ b/_sakura/templates/yuuno/settings/ranks.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ 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. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/regkeys.tpl b/_sakura/templates/yuuno/settings/regkeys.tpl new file mode 100644 index 0000000..8cb7959 --- /dev/null +++ b/_sakura/templates/yuuno/settings/regkeys.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ 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. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/sessions.tpl b/_sakura/templates/yuuno/settings/sessions.tpl new file mode 100644 index 0000000..278f163 --- /dev/null +++ b/_sakura/templates/yuuno/settings/sessions.tpl @@ -0,0 +1,19 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ 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. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/username.tpl b/_sakura/templates/yuuno/settings/username.tpl new file mode 100644 index 0000000..6d90489 --- /dev/null +++ b/_sakura/templates/yuuno/settings/username.tpl @@ -0,0 +1,18 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+
Probably the biggest part of your identity on a site.
+
You can only change this once every 30 days so choose wisely.
+
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/_sakura/templates/yuuno/settings/usertitle.tpl b/_sakura/templates/yuuno/settings/usertitle.tpl new file mode 100644 index 0000000..e0715e0 --- /dev/null +++ b/_sakura/templates/yuuno/settings/usertitle.tpl @@ -0,0 +1,17 @@ +{% include 'global/header.tpl' %} +
+
+ {% include 'elements/settingsNav.tpl' %} +
+
+
+ {{ page.title }} +
+
+ That little piece of text displayed under your username on your profile. +
+ +
+
+
+{% include 'global/footer.tpl' %} diff --git a/content/data/yuuno/css/yuuno.css b/content/data/yuuno/css/yuuno.css index 19f127a..a470737 100644 --- a/content/data/yuuno/css/yuuno.css +++ b/content/data/yuuno/css/yuuno.css @@ -10,6 +10,7 @@ @import url('//maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css'); /* Import Segoe UI */ +@import url('/fonts/segoeui/font.css'); @import url('/fonts/segoeui-light/font.css'); /* Import markdown specific style */ @@ -182,7 +183,7 @@ h3, h4, h5, h6 { - font-family: "SegoeUI-Light", "Segoe UI", sans-serif; + font-family: "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif; font-weight: 100; margin: 5px 0; } @@ -407,7 +408,7 @@ a.gotop.exit { min-width: 200px; border: 2px solid #9475B2; float: left; - font-family: "Segoe UI", sans-serif; + font-family: "SegoeUI", "Segoe UI", sans-serif; text-align: left; margin: 0 2px; transition: background .5s; @@ -452,28 +453,42 @@ a.gotop.exit { } #headerLoginForm { - background: #9475B2; - border-bottom: 2px solid #9475B2; - box-shadow: 0 0 5px #8364A1; + background: rgba(211, 191, 255, .8); + border: 1px solid #9475B2; + box-shadow: 0 0 3px #8364A1; text-align: center; + max-width: 1024px; + margin: 10px auto 0; + padding: 6px 3px; + border-radius: 3px; } #headerLoginForm > div { display: inline-block; } +#headerLoginForm input[type="submit"], +#headerLoginForm input[type="button"] { + display: inline-block; + border-radius: 3px; +} + @media (max-width: 640px) { #headerLoginForm > div { display: block; + } + + #headerLoginForm label { text-align: right; - padding-right: 2px; + min-width: 80px; + display: inline-block; } } #headerLoginForm label { - font-family: "Segoe UI", sans-serif; + font-family: "SegoeUI", "Segoe UI", sans-serif; font-weight: 100; font-size: 15px; } @@ -515,7 +530,7 @@ a.gotop.exit { width: auto; display: inline-block; text-decoration: none; - font: 100 70px/80px "SegoeUI-Light", "Segoe UI", sans-serif; + font: 100 70px/80px "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif; color: #B06AC4; transition: color .2s, text-shadow .2s; } @@ -532,7 +547,7 @@ a.gotop.exit { @media (max-width: 768px) { .header .logo { - font: 100 50px/60px "SegoeUI-Light", "Segoe UI", sans-serif; + font: 100 50px/60px "SegoeUI-Light", "SegoeUI", "Segoe UI", sans-serif; } } @@ -673,7 +688,7 @@ a.gotop.exit { .headerNotify { margin: 10px auto; - padding: 10px; + padding: 2px 3px; width: auto; max-width: 1024px; border: 1px solid #9475B2; @@ -922,7 +937,7 @@ a.gotop.exit { bottom: 5px; right: 5px; z-index: 3; - font-family: "Segoe UI", sans-serif; + font-family: "SegoeUI", "Segoe UI", sans-serif; overflow-y: auto; overflow-x: hidden; max-height: 510px; @@ -1267,6 +1282,48 @@ a.gotop.exit { overflow: auto; } +.settings .notification-history > div { + border: 1px solid #507; + margin: 5px; + background: rgba(113, 74, 150, .3); +} + +.settings .notification-history > div > .notif-hist-icon { + float: left; + width: 80px; + height: 80px; + line-height: 80px; + text-align: center; + background: rgba(0, 0, 0, .5); + display: block; + color: #FFF; +} + +.settings .notification-history > div > .notif-hist-icon > .font-icon { + margin: .34em 0; +} + +.settings .notification-history > div > .notif-hist-content > .notif-hist-time { + font-style: italic; + text-align: right; + float: right; + margin-right: 6px; + font-size: .8em; +} + +.settings .notification-history > div > .notif-hist-content > .notif-hist-inside { + float: left; + margin-left: 2px; + padding-left: 8px; +} + +.settings .notification-history > div > .notif-hist-content > .notif-hist-inside > .notif-hist-title { + font-family: "SegoeUI", "Segoe UI", sans-serif; + font-weight: 300; + font-size: 1.7em; + margin-top: 1em; +} + /* * Donation page Styling */ diff --git a/main/.htaccess b/main/.htaccess index 4aa4dd7..db95e87 100644 --- a/main/.htaccess +++ b/main/.htaccess @@ -17,8 +17,8 @@ Options +FollowSymLinks -Indexes RewriteRule ^feedback/?$ https://github.com/circlestorm/Sakura/issues RewriteRule ^credits/?$ credits.php RewriteRule ^index/?$ index.php -RewriteRule ^login/?$|logout?/?$|activate?/?$|register?/?$|forgotpassword?/?|authenticate?/?$ authenticate.php -RewriteRule ^donate/?$|support?/?$ donate.php +RewriteRule ^login/?$|^logout/?$|^activate/?$|^register/?$|^forgotpassword/?|^authenticate/?$ authenticate.php +RewriteRule ^donate/?$|^support/?$ donate.php RewriteRule ^contact/?$ infopage.php?r=contact RewriteRule ^changelog/?$ changelog.php RewriteRule ^faq/?$ faq.php diff --git a/main/imageserve.php b/main/imageserve.php index 47bc28a..1f3b573 100644 --- a/main/imageserve.php +++ b/main/imageserve.php @@ -27,7 +27,7 @@ if(isset($_GET['m'])) { $bannedAvatar = ROOT .'content/images/banned-av.png'; // If ?u= isn't set or if it isn't numeric - if(!isset($_GET['u']) || !is_numeric($_GET['u'])) { + if(!isset($_GET['u']) || !is_numeric($_GET['u']) || $_GET['u'] == 0) { $serveImage = $noAvatar; break; } diff --git a/main/settings.php b/main/settings.php index a799bc0..0af34e3 100644 --- a/main/settings.php +++ b/main/settings.php @@ -56,16 +56,34 @@ $pages = [ 'avatar' => ['Aesthetics', 'Avatar'], 'background' => ['Aesthetics', 'Background'], 'page' => ['Aesthetics', 'Profile Page'], - 'email' => ['Account', 'E-Mail Address'], + 'email' => ['Account', 'E-mail Address'], 'username' => ['Account', 'Username'], 'usertitle' => ['Account', 'User Title'], 'password' => ['Account', 'Password'], 'ranks' => ['Account', 'Ranks'], 'sessions' => ['Danger zone', 'Sessions'], 'regkeys' => ['Danger zone', 'Registration Keys'], - 'deactivate' => ['Danger zone', 'Deactivate Account'] + 'deactivate' => ['Danger zone', 'Deactivate Account'], + 'notfound' => ['Settings', '404'] ]; -$currentPage = isset($_GET['mode']) && array_key_exists($_GET['mode'], $pages) ? $_GET['mode'] : key($pages); + +// Current settings page +$currentPage = isset($_GET['mode']) ? (array_key_exists($_GET['mode'], $pages) ? $_GET['mode'] : 'notfound') : 'home'; + +// Render data +$renderData['page'] = [ + 'title' => $pages[$currentPage][0] .' / '. $pages[$currentPage][1] +]; + +// Section specific +switch($currentPage) { + + // Notification history + case 'notifications': + $renderData['notifs'] = array_reverse(Users::getNotifications(null, 0, false, true)); + break; + +} // Print page contents print Templates::render('settings/'. $currentPage .'.tpl', $renderData);