diff --git a/chat.php b/chat.php
index d72b196..a20c93c 100644
--- a/chat.php
+++ b/chat.php
@@ -54,7 +54,8 @@ cron();
route();
// main program: decide what to do based on queries
-function route(){
+function route(): void
+{
global $U;
if(!isset($_REQUEST['action'])){
send_login();
@@ -232,7 +233,8 @@ function route_admin() : string {
return '';
}
-function route_setup(){
+function route_setup(): void
+{
global $U;
if(!valid_admin()){
send_alogin();
@@ -263,7 +265,8 @@ function route_setup(){
}
// html output subs
-function prepare_stylesheets(string $class){
+function prepare_stylesheets(string $class): void
+{
global $U, $db, $scripts, $styles;
if($class === 'fatal_error') {
$styles[ 'fatal_error' ] = 'body{background-color:#000000;color:#FF0033}';
@@ -295,6 +298,41 @@ function prepare_stylesheets(string $class){
if($class === 'init' || ! $db instanceof PDO){
return;
}
+ if($class === 'frameset'){
+ if(($U['status']>=5 || ($U['status']>2 && get_count_mods()==0)) && get_setting('enfileupload')>0 && get_setting('enfileupload')<=$U['status']){
+ $postheight='120px';
+ }else{
+ $postheight='100px';
+ }
+ if((!isset($_REQUEST['sort']) && !$U['sortupdown']) || (isset($_REQUEST['sort']) && $_REQUEST['sort']==0)) {
+ $styles[ 'frameset' ] = "#frameset-mid{position:fixed;top:$postheight;bottom:45px;left:0;right:0;margin:0;padding:0;overflow:hidden}";
+ $styles[ 'frameset' ] .= "#frameset-top{position:fixed;top:0;left:0;right:0;height:$postheight;margin:0;padding:0;overflow:hidden;border-bottom: 1px solid}";
+ $styles[ 'frameset' ] .= "#frameset-bot{position:fixed;bottom:0;left:0;right:0;height:45px;margin:0;padding:0;overflow:hidden;border-top:1px solid}";
+ } else{
+ $styles[ 'frameset' ] =" #frameset-mid{position:fixed;top:45px;bottom:$postheight;left:0;right:0;margin:0;padding:0;overflow:hidden}";
+ $styles[ 'frameset' ] .= "#frameset-top{position:fixed;top:0;left:0;right:0;height:45px;margin:0;padding:0;overflow:hidden;border-bottom:1px solid}";
+ $styles[ 'frameset' ] .= "#frameset-bot{position:fixed;bottom:0;left:0;right:0;height:$postheight;margin:0;padding:0;overflow:hidden;border-top:1px solid}";
+ }
+ }
+ if($class === 'filter'){
+ $styles['filter'] = 'table table{width:100%} ';
+ $styles['filter'] .= 'table table td:nth-child(1){width:8em;font-weight:bold} ';
+ $styles['filter'] .= 'table table td:nth-child(2),table table td:nth-child(3){width:12em} ';
+ $styles['filter'] .= 'table table td:nth-child(4){width:9em} ';
+ $styles['filter'] .= 'table table td:nth-child(5),table table td:nth-child(6),table table td:nth-child(7),table table td:nth-child(8){width:5em} ';
+ }
+ if($class === 'linkfilter'){
+ $styles['linkfilter'] = 'table table{width:100%} ';
+ $styles['linkfilter'] .= 'table table td:nth-child(1){width:8em;font-weight:bold} ';
+ $styles['linkfilter'] .= 'table table td:nth-child(2),table table td:nth-child(3){width:12em} ';
+ $styles['linkfilter'] .= 'table table td:nth-child(4),table table td:nth-child(5){width:5em} ';
+ }
+ if($class === 'post'){
+ $styles['post'] = '.spacer{width:10px}';
+ }
+ if($class === 'messages'){
+ $styles['post'] = '.nicklink{text-decoration:none}.channellink{text-decoration:underline}';
+ }
$css=get_setting('css');
$coltxt=get_setting('coltxt');
if(!empty($U['bgcolour'])){
@@ -323,7 +361,7 @@ function prepare_stylesheets(string $class){
}
}
-function print_stylesheet(string $class)
+function print_stylesheet(string $class): void
{
global $scripts, $styles;
//default css
@@ -331,20 +369,21 @@ function print_stylesheet(string $class)
if ( $class === 'init' ) {
return;
}
+ if(isset($styles[$class])) {
+ echo "";
+ }
//overwrite with custom css
echo "";
$allow_js = (bool) get_setting( 'allow_js' );
if ( $allow_js ) {
- if($class === 'frameset') {
- echo "";
- }
- if($class === 'post') {
- echo "";
+ if(isset($scripts[$class])) {
+ echo "";
}
}
}
-function print_end(){
+function print_end(): void
+{
echo '