From aaab8433e5ca39702ae93e22f94f5a87229eaa94 Mon Sep 17 00:00:00 2001 From: flashwave Date: Sat, 12 Sep 2015 21:57:44 +0200 Subject: [PATCH] ignore this commit, it never happened Signed-off-by: Flashwave --- _sakura/changelog.json | 23 +++- _sakura/components/Sessions.php | 5 +- _sakura/cron.php | 17 +++ _sakura/sakura.php | 37 ++++++ _sakura/templates/yuuno/global/master.tpl | 35 +++++- _sakura/templates/yuuno/main/support.tpl | 2 +- public/content/data/yuuno/css/yuuno.css | 146 +++++++++++++++------- public/content/data/yuuno/js/yuuno.js | 11 +- 8 files changed, 218 insertions(+), 58 deletions(-) create mode 100644 _sakura/cron.php diff --git a/_sakura/changelog.json b/_sakura/changelog.json index 65c797e..8cd2630 100644 --- a/_sakura/changelog.json +++ b/_sakura/changelog.json @@ -2674,7 +2674,7 @@ "type": "UPD", "change": "Moved pagination to self-contained template file.", "user": "Flashwave" - },, + }, { "type": "UPD", "change": "Moved news section over to new API.", @@ -2696,6 +2696,27 @@ "user": "Flashwave" } + ], + + "20150913": [ + + "eminence", + { + "type": "UPD", + "change": "Rewrote code for scroll to top button.", + "user": "Flashwave" + }, + { + "type": "ADD", + "change": "Added (commented out) beginnings of on-site chat interface.", + "user": "Flashwave" + }, + { + "type": "ADD", + "change": "Added Windows no cron task method.", + "user": "Flashwave" + } + ] } diff --git a/_sakura/components/Sessions.php b/_sakura/components/Sessions.php index 5a4c919..b799a70 100644 --- a/_sakura/components/Sessions.php +++ b/_sakura/components/Sessions.php @@ -15,9 +15,12 @@ class Session { public static function init() { // Start PHP session - if(session_status() != PHP_SESSION_ACTIVE) + if(session_status() != PHP_SESSION_ACTIVE) { + session_start(); + } + // Assign user and session IDs self::$userId = isset($_COOKIE[Configuration::getConfig('cookie_prefix') .'id']) ? $_COOKIE[Configuration::getConfig('cookie_prefix') .'id'] : 0; self::$sessionId = isset($_COOKIE[Configuration::getConfig('cookie_prefix') .'session']) ? $_COOKIE[Configuration::getConfig('cookie_prefix') .'session'] : ''; diff --git a/_sakura/cron.php b/_sakura/cron.php new file mode 100644 index 0000000..012aaa7 --- /dev/null +++ b/_sakura/cron.php @@ -0,0 +1,17 @@ + /dev/null 2>/dev/null &'); + + } + + // Update last execution time + Database::update('config', [ + + [ + + 'config_value' => time() + + ], + [ + + 'config_name' => ['no_cron_last', '='] + + ] + + ]); + + } + +} + // Start output buffering ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null); diff --git a/_sakura/templates/yuuno/global/master.tpl b/_sakura/templates/yuuno/global/master.tpl index 35f67c3..896face 100644 --- a/_sakura/templates/yuuno/global/master.tpl +++ b/_sakura/templates/yuuno/global/master.tpl @@ -63,7 +63,7 @@ window.addEventListener("load", function() { // Alter the go to top button - var gotop = document.getElementById('gotop'); + var gotop = document.getElementById('scrollToTop'); gotop.setAttribute('href', 'javascript:void(0);'); gotop.setAttribute('onclick', 'scrollToTop();'); @@ -248,8 +248,37 @@ {% block content %}

{{ php.self }} is now printing!

{% endblock %} - - +{#} +
+
+
+ Online Users +
+
+
+
+
+
Hanyuu
+
Display actions
+
+
+
+
+
+
Flashwave
+
Display actions
+
+
+
+
+
+#} +
+{# + + #} + +
diff --git a/public/content/data/yuuno/css/yuuno.css b/public/content/data/yuuno/css/yuuno.css index 1635c3d..e4cc7d2 100644 --- a/public/content/data/yuuno/css/yuuno.css +++ b/public/content/data/yuuno/css/yuuno.css @@ -41,7 +41,6 @@ 100% { opacity: 0; - display: none; } } @@ -55,7 +54,6 @@ 100% { opacity: 1; - display: block; } } @@ -243,51 +241,6 @@ a.default:active { text-decoration: underline; } -a#gotop, -a#changePageWidth { - 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, -a#changePageWidth:hover { - opacity: .8; - box-shadow: 0 0 7px #FFF inset; - text-shadow: 0 0 7px #FFF; -} - -a#gotop:active, -a#changePageWidth: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; @@ -469,6 +422,48 @@ a#gotop.exit { } +#actionBtns { + position: fixed; + bottom: 0; + right: 0; + z-index: 4; +} + +#actionBtns > a { + display: flex; + flex-direction: column; + margin: 5px 0; + background: rgba(0, 0, 0, .5); + color: #FFF; + font-size: 2em; + width: 40px; + height: 40px; + line-height: 40px; + border-radius: 5px 0 0 5px; + text-decoration: none; + text-align: center; + text-shadow: 0 0 2px #FFF; + position: relative; + transition: .5s; + box-shadow: 0 0 2px #222; +} + +#actionBtns > a:hover { + text-shadow: 0 0 5px #FFF; +} + +#actionBtns > a:active { + text-shadow: 0 0 7px #FFF; +} + +#actionBtns > a.enter { + animation: slideInFromRight 1 .6s, fadeIn 1 .6s; +} + +#actionBtns > a.exit { + animation: slideOutToBottom 1 .6s, fadeOut 1 .6s; +} + #headerLoginForm { background: rgba(211, 191, 255, .8); border: 1px solid #9475B2; @@ -553,6 +548,63 @@ a#gotop.exit { text-shadow: 0 0 8px #8364A1; } +/* + * Site chat styling + */ +#chat > #chatOnlineUsers { + position: fixed; + right: 0; + top: 0; + bottom: 0; + width: 300px; + background: rgba(0, 0, 0, .7); + color: #FFF; + z-index: 3; + box-shadow: 0 0 2px #222; + overflow: auto; +} + +#chat > #chatOnlineUsers > div { + margin: 5px; +} + +#chat > #chatOnlineUsers > .chatOnlineListTitle { + background: none; + font-size: 2em; + line-height: 1.2em; + font-family: "SegoeUI-Light", sans-serif; + padding: 5px; +} + +#chatUserList > div { + display: flex; + align-items: center; + background: rgba(0, 0, 0, .7); + padding: 5px; + border-radius: 5px; +} + +#chatUserList > div:not(:last-child) { + margin-bottom: 5px; +} + +#chatUserList > div > .avatar { + width: 50px; + height: 50px; + background: transparent url("/pixel.png") no-repeat scroll left center / contain; + border-radius: 5px; +} + +#chatUserList > div > .options { + margin-left: 10px; +} + +#chatUserList > div > .options > .actions { + list-style: none; + font-size: .8em; + line-height: 1.2em; +} + /* * Site header styling */ diff --git a/public/content/data/yuuno/js/yuuno.js b/public/content/data/yuuno/js/yuuno.js index 6d4c3ad..7412ad8 100644 --- a/public/content/data/yuuno/js/yuuno.js +++ b/public/content/data/yuuno/js/yuuno.js @@ -818,10 +818,10 @@ var n = this, window.onscroll = function() { // Assign the gotop button to a variable - var gotop = document.getElementById('gotop'); + var gotop = document.getElementById('scrollToTop'); // If the vertical offset of the page is below 112px (just below the header) keep the button hidden - if(this.pageYOffset < 112) { + if(this.pageYOffset < 1) { // Check if the "exit" is in the classes and if it isn't continue if(gotop.className.indexOf('exit') < 0) { @@ -835,15 +835,16 @@ window.onscroll = function() { // Set a timeout to add the hidden class after 600ms setTimeout(function() { - gotop.className = gotop.className + ' hidden'; + if(this.pageYOffset < 1) { + gotop.className = gotop.className + ' hidden'; + } }, 600); - } } // Else show the button - } else if(this.pageYOffset > 112) { + } else if(this.pageYOffset > 0) { // Check if enter is set if(gotop.className.indexOf('enter') < 0) {