ignore this commit, it never happened

Signed-off-by: Flashwave <me@flash.moe>
This commit is contained in:
flash 2015-09-12 21:57:44 +02:00
parent b3554ea11a
commit aaab8433e5
8 changed files with 218 additions and 58 deletions

View file

@ -2674,7 +2674,7 @@
"type": "UPD", "type": "UPD",
"change": "Moved pagination to self-contained template file.", "change": "Moved pagination to self-contained template file.",
"user": "Flashwave" "user": "Flashwave"
},, },
{ {
"type": "UPD", "type": "UPD",
"change": "Moved news section over to new API.", "change": "Moved news section over to new API.",
@ -2696,6 +2696,27 @@
"user": "Flashwave" "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"
}
] ]
} }

View file

@ -15,9 +15,12 @@ class Session {
public static function init() { public static function init() {
// Start PHP session // Start PHP session
if(session_status() != PHP_SESSION_ACTIVE) if(session_status() != PHP_SESSION_ACTIVE) {
session_start(); session_start();
}
// Assign user and session IDs // Assign user and session IDs
self::$userId = isset($_COOKIE[Configuration::getConfig('cookie_prefix') .'id']) ? $_COOKIE[Configuration::getConfig('cookie_prefix') .'id'] : 0; 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'] : ''; self::$sessionId = isset($_COOKIE[Configuration::getConfig('cookie_prefix') .'session']) ? $_COOKIE[Configuration::getConfig('cookie_prefix') .'session'] : '';

17
_sakura/cron.php Normal file
View file

@ -0,0 +1,17 @@
<?php
/*
* Sakura Cron Agent
*/
// Declare Namespace
namespace Sakura;
// Define that this page won't require templating
define('SAKURA_NO_TPL', true);
// Include components
require_once str_replace(basename(__DIR__), '', dirname(__FILE__)) .'_sakura/sakura.php';
// Override expiration variables
ignore_user_abort(true);
set_time_limit(0);

View file

@ -65,6 +65,43 @@ Main::init(ROOT .'_sakura/config/config.ini');
// Assign servers file to whois class // Assign servers file to whois class
Whois::setServers(ROOT .'_sakura/'. Configuration::getLocalConfig('data', 'whoisservers')); Whois::setServers(ROOT .'_sakura/'. Configuration::getLocalConfig('data', 'whoisservers'));
// Check if we the system has a cron service
if(Configuration::getConfig('no_cron_service')) {
// If not do an "asynchronous" call to the cron.php script
if(Configuration::getConfig('no_cron_last') < (time() - Configuration::getConfig('no_cron_interval'))) {
// Check OS
if(substr(strtolower(PHP_OS), 0, 3) == 'win') {
pclose(popen('start /B '. PHP_BINDIR .'\php.exe '. addslashes(ROOT .'_sakura\cron.php'), 'r'));
} else {
shell_exec(PHP_BINDIR .'/php '. ROOT .'_sakura/cron.php > /dev/null 2>/dev/null &');
}
// Update last execution time
Database::update('config', [
[
'config_value' => time()
],
[
'config_name' => ['no_cron_last', '=']
]
]);
}
}
// Start output buffering // Start output buffering
ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null); ob_start(Configuration::getConfig('use_gzip') ? 'ob_gzhandler' : null);

View file

@ -63,7 +63,7 @@
window.addEventListener("load", function() { window.addEventListener("load", function() {
// Alter the go to top button // Alter the go to top button
var gotop = document.getElementById('gotop'); var gotop = document.getElementById('scrollToTop');
gotop.setAttribute('href', 'javascript:void(0);'); gotop.setAttribute('href', 'javascript:void(0);');
gotop.setAttribute('onclick', 'scrollToTop();'); gotop.setAttribute('onclick', 'scrollToTop();');
@ -248,8 +248,37 @@
{% block content %} {% block content %}
<h1 class="stylised" style="text-align: center; margin: 2em auto;">{{ php.self }} is now printing!</h1> <h1 class="stylised" style="text-align: center; margin: 2em auto;">{{ php.self }} is now printing!</h1>
{% endblock %} {% endblock %}
{#}
<a id="gotop" class="fa fa-angle-double-up hidden" href="#top"></a> <div id="chat">
<div id="chatOnlineUsers">
<div class="chatOnlineListTitle">
Online Users
</div>
<div id="chatUserList">
<div>
<div class="avatar" style="background-image: url('/a/1');"></div>
<div class="options">
<div class="username" style="color: #2B3F84;">Hanyuu</div>
<div class="actions">Display actions</div>
</div>
</div>
<div>
<div class="avatar" style="background-image: url('/a/2');"></div>
<div class="options">
<div class="username" style="color: #C00;">Flashwave</div>
<div class="actions">Display actions</div>
</div>
</div>
</div>
</div>
</div>
#}
<div id="actionBtns">
{# <a id="showChatTicker" class="fa fa-list" href="#"></a>
<a id="showOnlineUsers" class="fa fa-users" href="#"></a>
<a id="openSiteChat" class="fa fa-comments-o" href="#"></a>#}
<a id="scrollToTop" class="fa fa-angle-double-up larger hidden" onclick="scrollToTop();" href="#top"></a>
</div>
</div> </div>
<div class="footer"> <div class="footer">
<div class="ftsections"> <div class="ftsections">

View file

@ -98,7 +98,7 @@
<h1 class="stylised">Total: &#8364;<span id="totalAmount"></span></h1> <h1 class="stylised">Total: &#8364;<span id="totalAmount"></span></h1>
</div> </div>
<div style="float: right;"> <div style="float: right;">
<button class="inputStyling" onclick="document.getElementById('purchaseForm').submit();">Get <span id="monthNoBtn">1</span> month<span id="monthsTrailingS"></span> of Tenshi</button> <button class="inputStyling" onclick="ajaxBusyView(true, 'Please wait...');document.getElementById('purchaseForm').submit();">Get <span id="monthNoBtn">1</span> month<span id="monthsTrailingS"></span> of Tenshi</button>
</div> </div>
<div class="clear"></div> <div class="clear"></div>
</div> </div>

View file

@ -41,7 +41,6 @@
100% { 100% {
opacity: 0; opacity: 0;
display: none;
} }
} }
@ -55,7 +54,6 @@
100% { 100% {
opacity: 1; opacity: 1;
display: block;
} }
} }
@ -243,51 +241,6 @@ a.default:active {
text-decoration: underline; 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 { .content {
margin: 10px auto; margin: 10px auto;
padding: 2px 3px; 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 { #headerLoginForm {
background: rgba(211, 191, 255, .8); background: rgba(211, 191, 255, .8);
border: 1px solid #9475B2; border: 1px solid #9475B2;
@ -553,6 +548,63 @@ a#gotop.exit {
text-shadow: 0 0 8px #8364A1; 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 * Site header styling
*/ */

View file

@ -818,10 +818,10 @@ var n = this,
window.onscroll = function() { window.onscroll = function() {
// Assign the gotop button to a variable // 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 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 // Check if the "exit" is in the classes and if it isn't continue
if(gotop.className.indexOf('exit') < 0) { if(gotop.className.indexOf('exit') < 0) {
@ -835,15 +835,16 @@ window.onscroll = function() {
// Set a timeout to add the hidden class after 600ms // Set a timeout to add the hidden class after 600ms
setTimeout(function() { setTimeout(function() {
gotop.className = gotop.className + ' hidden'; if(this.pageYOffset < 1) {
gotop.className = gotop.className + ' hidden';
}
}, 600); }, 600);
} }
} }
// Else show the button // Else show the button
} else if(this.pageYOffset > 112) { } else if(this.pageYOffset > 0) {
// Check if enter is set // Check if enter is set
if(gotop.className.indexOf('enter') < 0) { if(gotop.className.indexOf('enter') < 0) {