diff --git a/chat.php b/chat.php
index 588bd96..1f2ef8f 100644
--- a/chat.php
+++ b/chat.php
@@ -32,7 +32,6 @@
* 9 - Private messages
*/
-send_headers();
// initialize and load variables/configuration
$I=[];// Translations
$L=[];// Languages
@@ -40,6 +39,7 @@ $U=[];// This user data
$db;// Database connection
$memcached;// Memcached connection
$language;// user selected language
+$styles = []; //css styles
load_config();
// set session variable to cookie if cookies are enabled
if(!isset($_REQUEST['session']) && isset($_COOKIE[COOKIENAME])){
@@ -249,35 +249,33 @@ function route_setup(){
}
// html output subs
-function print_stylesheet($init=false){
- global $U;
- //default css
- echo '';
- if($init){
+ $styles['default'] .= 's forwards;z-index:2;background-color:#500000;border:2px solid #ff0000} ';
+ $styles['default'] .= '@keyframes timeout_messages{0%{top:-200%} 99%{top:-200%} 100%{top:0%}} ';
+ $styles['default'] .= '.notes textarea{height:80vh;width:80%}';
+ if($init || ! $db instanceof PDO){
return;
}
$css=get_setting('css');
@@ -287,8 +285,18 @@ function print_stylesheet($init=false){
}else{
$colbg=get_setting('colbg');
}
+ $styles['custom'] = preg_replace("/(\r?\n|\r\n?)/u", '', "body{background-color:#$colbg;color:#$coltxt} $css");
+}
+
+function print_stylesheet($init = false){
+ global $styles;
+ //default css
+ echo "";
+ if($init){
+ return;
+ }
//overwrite with custom css
- echo "";
+ echo "";
}
function print_end(){
@@ -301,7 +309,7 @@ function credit(){
}
function meta_html(){
- return '';
+ return '';
}
function form($action, $do=''){
@@ -342,6 +350,8 @@ function thr(){
function print_start($class='', $ref=0, $url=''){
global $I;
+ prepare_stylesheets($class === 'init');
+ send_headers();
if(!empty($url)){
$url=str_replace('&', '&', $url);// Don't escape "&" in URLs here, it breaks some (older) browsers and js refresh!
header("Refresh: $ref; URL=$url");
@@ -349,9 +359,6 @@ function print_start($class='', $ref=0, $url=''){
echo '
'.meta_html();
if(!empty($url)){
echo "$I[ignore] | ";
echo " |
---|
|