From 4404c6ea428a48a10c8d42851c59488a630b3bc0 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sun, 9 Aug 2015 20:26:01 +0200 Subject: [PATCH] relatively large commit --- _sakura/changelog.json | 32 ++- _sakura/components/Main.php | 21 ++ _sakura/components/Users.php | 18 +- _sakura/sakura.php | 2 +- _sakura/templates/errorPage.tpl | 2 +- .../templates/yuuno/elements/indexPanel.tpl | 2 +- .../templates/yuuno/elements/settingsNav.tpl | 4 +- _sakura/templates/yuuno/global/footer.tpl | 2 +- _sakura/templates/yuuno/main/profile.tpl | 16 +- _sakura/templates/yuuno/settings/avatar.tpl | 6 +- .../{friends.tpl => friendlisting.tpl} | 0 _sakura/templates/yuuno/settings/home.tpl | 48 +++- .../yuuno/settings/{page.tpl => userpage.tpl} | 0 content/data/yuuno/css/yuuno.css | 82 ++++++- content/data/yuuno/js/yuuno.js | 6 - content/images/emoticons/smug.png | Bin 0 -> 506 bytes main/imageserve.php | 6 +- main/profile.php | 3 +- main/settings.php | 222 +++++++++++++++++- 19 files changed, 431 insertions(+), 41 deletions(-) rename _sakura/templates/yuuno/settings/{friends.tpl => friendlisting.tpl} (100%) rename _sakura/templates/yuuno/settings/{page.tpl => userpage.tpl} (100%) create mode 100644 content/images/emoticons/smug.png diff --git a/_sakura/changelog.json b/_sakura/changelog.json index 6204d1b..dc8c57f 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -38,7 +38,8 @@ "20150728", "20150730", "20150731", - "20150807" + "20150807", + "20150809" ] @@ -1633,6 +1634,35 @@ "change": "Added profile changing backend." } + ], + + "20150809": [ + + { + "type": "FIX", + "change": "Fixed homepage friends link going to the wrong location." + }, + { + "type": "UPD", + "change": "Redid settings frontpage." + }, + { + "type": "ADD", + "change": "Added :smug: emote (thanks malloc)." + }, + { + "type": "FIX", + "change": "Fixed links to GitHub links to link to their Bitbucket alternative." + }, + { + "type": "ADD", + "change": "Added responsive view for notification for smaller screens." + }, + { + "type": "ADD", + "change": "Added avatar uploading (background uploads soon)." + } + ] } diff --git a/_sakura/components/Main.php b/_sakura/components/Main.php index 4388dd5..525bcdc 100644 --- a/_sakura/components/Main.php +++ b/_sakura/components/Main.php @@ -774,4 +774,25 @@ class Main { } + // Get the byte symbol from a value + public static function getByteSymbol($bytes) { + + // Return nothing if the input was 0 + if(!$bytes) + return; + + // Array with byte symbols + $symbols = ['B', 'KiB', 'MiB', 'GiB', 'TiB', 'PiB', 'EiB', 'ZiB', 'YiB']; + + // Calculate byte entity + $exp = floor(log($bytes) / log(1024)); + + // Format the things + $bytes = sprintf("%.2f ". $symbols[$exp], ($bytes / pow(1024, floor($exp)))); + + // Return the formatted string + return $bytes; + + } + } diff --git a/_sakura/components/Users.php b/_sakura/components/Users.php index dc23192..0e0c4d2 100644 --- a/_sakura/components/Users.php +++ b/_sakura/components/Users.php @@ -894,13 +894,13 @@ class Users { } // Updating the profile data of a user - public static function updateUserProfileFields($id, $data) { + public static function updateUserDataField($id, $data) { // We retrieve the current content from the database $current = self::getUser($id)['userData']; // Merge the arrays - $data = array_merge($current, ['profileFields' => $data]); + $data = array_merge($current, $data); // Encode the json $data = json_encode($data); @@ -1322,7 +1322,7 @@ class Users { } // Get friends - public static function getFriends($uid = null, $timestamps = false, $getData = false) { + public static function getFriends($uid = null, $timestamps = false, $getData = false, $checkOnline = false) { // Assign $uid if(!$uid) @@ -1349,6 +1349,18 @@ class Users { } + // Check who is online and who isn't + if($checkOnline) { + + // Check each user + foreach($friends as $key => $friend) { + + $friends[self::checkUserOnline($getData ? $friend['user']['id'] : $friend) ? 'online' : 'offline'][] = $friend; + + } + + } + // Return formatted array return $friends; diff --git a/_sakura/sakura.php b/_sakura/sakura.php index e275e79..8f6deb4 100644 --- a/_sakura/sakura.php +++ b/_sakura/sakura.php @@ -8,7 +8,7 @@ namespace Sakura; // Define Sakura version -define('SAKURA_VERSION', '20150731'); +define('SAKURA_VERSION', '20150809'); define('SAKURA_VLABEL', 'Eminence'); define('SAKURA_COLOUR', '#6C3082'); define('SAKURA_STABLE', false); diff --git a/_sakura/templates/errorPage.tpl b/_sakura/templates/errorPage.tpl index 268a657..bf41c07 100644 --- a/_sakura/templates/errorPage.tpl +++ b/_sakura/templates/errorPage.tpl @@ -68,7 +68,7 @@
{{ error }}
-

If you have an account on GitHub please go to the issues section and report the error listed above (do a check to see if it hasn't been reported yet as well).

+

If you have an account on BitBucket please go to the issues section and report the error listed above (do a check to see if it hasn't been reported yet as well).

Contact the System Operator at me@flash.moe or check our Status Page and Twitter Account to see if anything is going on. diff --git a/_sakura/templates/yuuno/elements/indexPanel.tpl b/_sakura/templates/yuuno/elements/indexPanel.tpl index b80a40d..50fcd51 100644 --- a/_sakura/templates/yuuno/elements/indexPanel.tpl +++ b/_sakura/templates/yuuno/elements/indexPanel.tpl @@ -2,7 +2,7 @@
Hi, {{ user.data.username }}!
diff --git a/_sakura/templates/yuuno/elements/settingsNav.tpl b/_sakura/templates/yuuno/elements/settingsNav.tpl index e81847f..e011d0f 100644 --- a/_sakura/templates/yuuno/elements/settingsNav.tpl +++ b/_sakura/templates/yuuno/elements/settingsNav.tpl @@ -7,7 +7,7 @@ Edit Profile Groups
Friends
- List + List Requests
Messages
Inbox @@ -18,7 +18,7 @@
Aesthetics
Avatar Background - Profile Page + Profile Page
Account
E-mail Address Username diff --git a/_sakura/templates/yuuno/global/footer.tpl b/_sakura/templates/yuuno/global/footer.tpl index 5c444f4..fcf4f8a 100644 --- a/_sakura/templates/yuuno/global/footer.tpl +++ b/_sakura/templates/yuuno/global/footer.tpl @@ -18,7 +18,7 @@
  • Twitter
  • YouTube
  • Steam
  • -
  • Github
  • +
  • BitBucket