Browse Source

Custom CSS clean up

causefx 8 years ago
parent
commit
421be6d5b7
6 changed files with 16 additions and 28 deletions
  1. 1 7
      chat.php
  2. 1 0
      error.php
  3. 11 0
      functions.php
  4. 1 7
      homepage.php
  5. 1 7
      index.php
  6. 1 7
      settings.php

+ 1 - 7
chat.php

@@ -117,13 +117,7 @@ endif;
                 -webkit-filter: grayscale; /*sepia, hue-rotate, invert....*/
                 -webkit-filter: brightness(25%);
             }
-            <?php if(CUSTOMCSS == "true") : 
-$template_file = "custom.css";
-$file_handle = fopen($template_file, "rb");
-echo fread($file_handle, filesize($template_file));
-fclose($file_handle);
-echo "\n";
-endif; ?>        
+            <?php customCSS(); ?>      
         </style>
     </head>
 

+ 1 - 0
error.php

@@ -67,6 +67,7 @@ $errorImage = $codes[$status][2];
         <link rel="stylesheet" href="<?php echo checkRootPath(dirname($_SERVER['SCRIPT_NAME'])); ?>bower_components/bootstrap/dist/css/bootstrap.min.css">
         <link rel="stylesheet" href="<?php echo checkRootPath(dirname($_SERVER['SCRIPT_NAME'])); ?>bower_components/Waves/dist/waves.min.css"> 
         <link rel="stylesheet" href="<?php echo checkRootPath(dirname($_SERVER['SCRIPT_NAME'])); ?>css/style.css">
+		<style><?php customCSS(); ?></style>
     </head>
     <body class="gray-bg" style="padding: 0;">
         <div class="main-wrapper" style="position: initial;">

+ 11 - 0
functions.php

@@ -3479,5 +3479,16 @@ function getCert(){
 	return $file;
 }
 
+function customCSS(){
+	if(CUSTOMCSS == "true") {
+		$template_file = "custom.css";
+		$file_handle = fopen($template_file, "rb");
+		echo "\n";
+		echo fread($file_handle, filesize($template_file));
+		fclose($file_handle);
+		echo "\n";
+	}
+}
+
 // Always run this
 dependCheck();

+ 1 - 7
homepage.php

@@ -241,13 +241,7 @@ $endDate = date('Y-m-d',strtotime("+".CALENDARENDDAY." days"));
 				white-space: normal !important;
 				width: 0% !important;
 				font-size: 12px; !important;
-			}<?php if(CUSTOMCSS == "true") : 
-$template_file = "custom.css";
-$file_handle = fopen($template_file, "rb");
-echo fread($file_handle, filesize($template_file));
-fclose($file_handle);
-echo "\n";
-endif; ?>        
+			}<?php customCSS(); ?>       
         </style>
     </head>
 

+ 1 - 7
index.php

@@ -501,13 +501,7 @@ if(file_exists("images/settings2.png")) : $iconRotate = "false"; $settingsIcon =
             padding: 5px 22px;
         }
         <?php endif; ?>
-        <?php if(CUSTOMCSS == "true") : 
-$template_file = "custom.css";
-$file_handle = fopen($template_file, "rb");
-echo fread($file_handle, filesize($template_file));
-fclose($file_handle);
-echo "\n";
-endif; ?>
+        <?php customCSS(); ?>
 
     </style>
 

+ 1 - 7
settings.php

@@ -289,13 +289,7 @@ if(SLIMBAR == "true") {
                 border-bottom: 0;
                 border-radius: 5px;
                 top: 3px;
-}<?php if(CUSTOMCSS == "true") : 
-$template_file = "custom.css";
-$file_handle = fopen($template_file, "rb");
-echo fread($file_handle, filesize($template_file));
-fclose($file_handle);
-echo "\n";
-endif; ?>
+}<?php customCSS(); ?>
         </style>
     </head>