Browse Source

Create AJAX.PHP merge functions, other updates

Cerothen 9 năm trước cách đây
mục cha
commit
43b8fef122
11 tập tin đã thay đổi với 242 bổ sung189 xóa
  1. 76 1
      ajax.php
  2. 4 6
      ajax_remove_file.php
  3. 4 33
      ajax_upload_file.php
  4. 0 1
      error.php
  5. 147 54
      functions.php
  6. 8 9
      homepage.php
  7. 0 50
      image.php
  8. 2 1
      lang/en.ini
  9. 1 2
      settings.php
  10. 0 29
      submitCSS.php
  11. 0 3
      translate.php

+ 76 - 1
ajax.php

@@ -1,9 +1,84 @@
 <?php
+// Include functions if not already included
+require_once('functions.php');
+
+// Upgrade environment
+upgradeCheck();
+
+// Define Version
+ define('INSTALLEDVERSION', '1.31');
+
+// Lazyload settings
+$databaseConfig = configLazy('config/config.php');
+
 // Authorization
 	# Check if user is currently active and allowed to access resource
+	//require_once("user.php");
+	# ^^ I think adding this does that?
 	
-// Process Request
+// Get Action
+if (isset($_POST['submit'])) { $action = $_POST['submit']; }
+if (isset($_POST['action'])) { $action = $_POST['action']; }
+if (isset($_GET['action'])) { $action = $_GET['action']; }
+if (isset($_GET['a'])) { $action = $_GET['a']; }
+
+// No Action
+if (!isset($action)) {
+	debug_out('No Action Specified!',1);
+}
 
+// Process Request
+switch ($_SERVER['REQUEST_METHOD']) {
+	case 'GET':
+		switch ($action) {
+			case 'emby-image':
+				getEmbyImage();
+				break;
+			case 'plex-image':
+				getPlexImage();
+				break;
+			case 'emby-streams':
+				echo getEmbyStreams(12);
+				break;
+			case 'plex-streams':
+				echo getPlexStreams(12);
+				break;
+			case 'emby-streams':
+				echo getEmbyRecent($_GET['type'], 12);
+				break;
+			case 'plex-streams':
+				echo getPlexRecent($_GET['type'], 12);
+				break;
+			
+			default:
+				debug_out('Unsupported Action!',1);
+		}
+		break;
+	case 'POST':
+		switch ($action) {
+			case 'upload-images':
+				uploadFiles('images/', array('jpg', 'png', 'svg', 'jpeg', 'bmp'));
+				break;
+			case 'remove-images':
+				removeFiles('images/'.(isset($_POST['file'])?$_POST['file']:''));
+				break;
+			case 'editCSS':
+				write_ini_file($_POST["css-show"], "custom.css");
+				echo '<script>window.top.location = window.top.location.href.split(\'#\')[0];</script>';
+				break;
+			default:
+				debug_out('Unsupported Action!',1);
+		}
+		break;
+	case 'PUT':
+		
+		break;
+	case 'DELETE':
+		
+		break;
+	default:
+		debug_out('Unknown Request Type!',1);
+}
 
 
 

+ 4 - 6
ajax_remove_file.php

@@ -1,8 +1,6 @@
 <?php
-if(isset($_POST['file'])){
-    $file = 'images/' . $_POST['file'];
-    if(file_exists($file)){
-        unlink($file);
-    }
-}
+	// This file exists for legacy reasons
+	
+	$action = 'remove-images';
+	require_once('ajax.php');
 ?>

+ 4 - 33
ajax_upload_file.php

@@ -1,35 +1,6 @@
 <?php
-    include('class.uploader.php');
-
-    $uploader = new Uploader();
-    $data = $uploader->upload($_FILES['files'], array(
-        'limit' => 10, //Maximum Limit of files. {null, Number}
-        'maxSize' => 1, //Maximum Size of files {null, Number(in MB's)}
-        'extensions' => array('jpg', 'png', 'svg'), //Whitelist for file extension. {null, Array(ex: array('jpg', 'png'))}
-        'required' => false, //Minimum one file is required for upload {Boolean}
-        'uploadDir' => 'images/', //Upload directory {String}
-        'title' => array('name'), //New file name {null, String, Array} *please read documentation in README.md
-        'removeFiles' => true, //Enable file exclusion {Boolean(extra for jQuery.filer), String($_POST field name containing json data with file names)}
-        'replace' => true, //Replace the file if it already exists  {Boolean}
-        'perms' => null, //Uploaded file permisions {null, Number}
-        'onCheck' => null, //A callback function name to be called by checking a file for errors (must return an array) | ($file) | Callback
-        'onError' => null, //A callback function name to be called if an error occured (must return an array) | ($errors, $file) | Callback
-        'onSuccess' => null, //A callback function name to be called if all files were successfully uploaded | ($files, $metas) | Callback
-        'onUpload' => null, //A callback function name to be called if all files were successfully uploaded (must return an array) | ($file) | Callback
-        'onComplete' => null, //A callback function name to be called when upload is complete | ($file) | Callback
-        'onRemove' => null //A callback function name to be called by removing files (must return an array) | ($removed_files) | Callback
-    ));
-
-    if($data['isComplete']){
-        $files = $data['data'];
-
-        echo json_encode($files['metas'][0]['name']);
-    }
-
-    if($data['hasErrors']){
-        $errors = $data['errors'];
-        echo json_encode($errors);
-    }
-
-    exit;
+	// This file exists for legacy reasons
+	
+	$action = 'upload-images';
+	require_once('ajax.php');
 ?>

+ 0 - 1
error.php

@@ -52,7 +52,6 @@ function registration_callback($username, $email, $userdir)
 }
 
 require_once("user.php");
-require_once("translate.php");
 $USER = new User("registration_callback");
 
 $dbfile = DATABASE_LOCATION.'users.db';

+ 147 - 54
functions.php

@@ -427,7 +427,7 @@ function resolveEmbyItem($address, $token, $item) {
 	}
 	
 	// Assemble Item And Cache Into Array 
-	return '<div class="item"><a href="'.$address.'/web/itemdetails.html?id='.$item['Id'].'" target="_blank"><img alt="'.$item['Name'].'" class="'.$image.'" src="image.php?source=emby&img='.$imageId.'&height='.$height.'&width='.$width.'"></a><div class="carousel-caption" style="'.$style.'"><h4>'.$title.'</h4><small><em>'.$itemDetails['Overview'].'</em></small></div></div>';
+	return '<div class="item"><a href="'.$address.'/web/itemdetails.html?id='.$item['Id'].'" target="_blank"><img alt="'.$item['Name'].'" class="'.$image.'" src="ajax.php?a=emby-image&img='.$imageId.'&height='.$height.'&width='.$width.'"></a><div class="carousel-caption" style="'.$style.'"><h4>'.$title.'</h4><small><em>'.$itemDetails['Overview'].'</em></small></div></div>';
 }
 
 // Format item from Plex for Carousel
@@ -466,7 +466,7 @@ function resolvePlexItem($server, $token, $item) {
 	}
 	
 	// Assemble Item And Cache Into Array 
-	return '<div class="item"><a href="'.$address.'" target="_blank"><img alt="'.$item['Name'].'" class="'.$image.'" src="image.php?source=plex&img='.$item['thumb'].'&height='.$height.'&width='.$width.'"></a><div class="carousel-caption" style="'.$style.'"><h4>'.$title.'</h4><small><em>'.$summary.'</em></small></div></div>';
+	return '<div class="item"><a href="'.$address.'" target="_blank"><img alt="'.$item['Name'].'" class="'.$image.'" src="image.php?a=plex-image&img='.$item['thumb'].'&height='.$height.'&width='.$width.'"></a><div class="carousel-caption" style="'.$style.'"><h4>'.$title.'</h4><small><em>'.$summary.'</em></small></div></div>';
 }
 
 // Create Carousel
@@ -497,86 +497,66 @@ function outputCarousel($header, $size, $type, $items) {
 }
 
 // Get Now Playing Streams From Emby
-function getEmbyStreams($url, $port, $token, $size, $header) {
-    if (stripos($url, "http") === false) {
-        $url = "http://" . $url;
-    }
-    
-    if ($port !== "") { 
-		$url = $url . ":" . $port;
-	}
-    
-    $address = $url;
+function getEmbyStreams($size) {
+	$address = qualifyURL(EMBYURL);
 	
-	$api = json_decode(file_get_contents($address.'/Sessions?api_key='.$token),true);
+	$api = json_decode(file_get_contents($address.'/Sessions?api_key='.EMBYTOKEN),true);
 	
 	$playingItems = array();
 	foreach($api as $key => $value) {
 		if (isset($value['NowPlayingItem'])) {
-			$playingItems[] = resolveEmbyItem($address, $token, $value['NowPlayingItem']);
+			$playingItems[] = resolveEmbyItem($address, EMBYTOKEN, $value['NowPlayingItem']);
 		}
 	}
 	
-	return outputCarousel($header, $size, 'streams-emby', $playingItems);
+	return outputCarousel(translate('PLAYING_NOW_ON_EMBY'), $size, 'streams-emby', $playingItems);
 }
 
 // Get Now Playing Streams From Plex
-function getPlexStreams($url, $port, $token, $size, $header){
-    if (stripos($url, "http") === false) {
-        $url = "http://" . $url;
-    }
-    
-    if ($port !== "") { 
-		$url = $url . ":" . $port;
-	}
-    
-    $address = $url;
+function getPlexStreams($size){
+    $address = qualifyURL(PLEXURL);
     
 	// Perform API requests
-    $api = file_get_contents($address."/status/sessions?X-Plex-Token=".$token);
+    $api = file_get_contents($address."/status/sessions?X-Plex-Token=".PLEXTOKEN);
     $api = simplexml_load_string($api);
-    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".$token));
+    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
     
 	// Identify the local machine
     $gotServer = $getServer['machineIdentifier'];
 	
 	$items = array();
 	foreach($api AS $child) {
-		$items[] = resolvePlexItem($gotServer, $token, $child);
+		$items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child);
 	}
 	
-	return outputCarousel($header, $size, 'streams-plex', $items);
+	return outputCarousel(translate('PLAYING_NOW_ON_PLEX'), $size, 'streams-plex', $items);
 }
 
 // Get Recent Content From Emby
-function getEmbyRecent($url, $port, $type, $token, $size, $header) {
-    if (stripos($url, "http") === false) {
-        $url = "http://" . $url;
-    }
-    
-    if ($port !== "") { 
-		$url = $url . ":" . $port;
-	}
-    
-    $address = $url;
+function getEmbyRecent($type, $size) {
+    $address = qualifyURL(EMBYURL);
 	
 	// Resolve Types
 	switch ($type) {
 		case 'movie':
 			$embyTypeQuery = 'IncludeItemTypes=Movie&';
+			$header = translate('MOVIES');
 			break;
 		case 'season':
 			$embyTypeQuery = 'IncludeItemTypes=Episode&';
+			$header = translate('TV_SHOWS');
 			break;
 		case 'album':
 			$embyTypeQuery = 'IncludeItemTypes=MusicAlbum&';
+			$header = translate('MUSIC');
 			break;
 		default:
 			$embyTypeQuery = '';
+			$header = translate('RECENT_CONTENT');
 	}
 	
 	// Get A User
-	$userIds = json_decode(file_get_contents($address.'/Users?api_key='.$token),true);
+	$userIds = json_decode(file_get_contents($address.'/Users?api_key='.EMBYTOKEN),true);
 	foreach ($userIds as $value) { // Scan for admin user
 		$userId = $value['Id'];
 		if (isset($value['Policy']) && isset($value['Policy']['IsAdministrator']) && $value['Policy']['IsAdministrator']) {
@@ -585,33 +565,40 @@ function getEmbyRecent($url, $port, $type, $token, $size, $header) {
 	}
 	
 	// Get the latest Items
-	$latest = json_decode(file_get_contents($address.'/Users/'.$userId.'/Items/Latest?'.$embyTypeQuery.'EnableImages=false&api_key='.$token),true);
+	$latest = json_decode(file_get_contents($address.'/Users/'.$userId.'/Items/Latest?'.$embyTypeQuery.'EnableImages=false&api_key='.EMBYTOKEN),true);
 	
 	// For Each Item In Category
 	$items = array();
 	foreach ($latest as $k => $v) {
-		$items[] = resolveEmbyItem($address, $token, $v);
+		$items[] = resolveEmbyItem($address, EMBYTOKEN, $v);
 	}
 	
 	return outputCarousel($header, $size, $type.'-emby', $items);
 }
 
 // Get Recent Content From Plex
-function getPlexRecent($url, $port, $type, $token, $size, $header){
-    if (stripos($url, "http") === false) {
-        $url = "http://" . $url;
-    }
+function getPlexRecent($type, $size){
+    $address = qualifyURL(PLEXURL);
     
-    if ($port !== "") { 
-		$url = $url . ":" . $port;
+	// Resolve Types
+	switch ($type) {
+		case 'movie':
+			$header = translate('MOVIES');
+			break;
+		case 'season':
+			$header = translate('TV_SHOWS');
+			break;
+		case 'album':
+			$header = translate('MUSIC');
+			break;
+		default:
+			$header = translate('RECENT_CONTENT');
 	}
-    
-    $address = $url;
-    
+	
 	// Perform Requests
-    $api = file_get_contents($address."/library/recentlyAdded?X-Plex-Token=".$token);
+    $api = file_get_contents($address."/library/recentlyAdded?X-Plex-Token=".PLEXTOKEN);
     $api = simplexml_load_string($api);
-    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".$token));
+    $getServer = simplexml_load_string(file_get_contents($address."/?X-Plex-Token=".PLEXTOKEN));
 	
 	// Identify the local machine
     $gotServer = $getServer['machineIdentifier'];
@@ -619,13 +606,48 @@ function getPlexRecent($url, $port, $type, $token, $size, $header){
 	$items = array();
 	foreach($api AS $child) {
 		if($child['type'] == $type){
-			$items[] = resolvePlexItem($gotServer, $token, $child);
+			$items[] = resolvePlexItem($gotServer, PLEXTOKEN, $child);
 		}
 	}
 	
 	return outputCarousel($header, $size, $type.'-plex', $items);
 }
 
+// Get Image From Emby
+function getEmbyImage() {
+	$embyAddress = qualifyURL(EMBYURL);
+	
+	$itemId = $_GET['img'];
+	$imgParams = array();
+	if (isset($_GET['height'])) { $imgParams['height'] = 'maxHeight='.$_GET['height']; }
+	if (isset($_GET['width'])) { $imgParams['width'] = 'maxWidth='.$_GET['width']; }
+
+	if(isset($itemId)) {
+		$image_src = $embyAddress . '/Items/'.$itemId.'/Images/Primary?'.implode('&', $imgParams);
+		header('Content-type: image/jpeg');
+		readfile($image_src);
+	} else {
+		debug_out('Invalid Request',1);
+	}
+}
+
+// Get Image From Plex
+function getPlexImage() {
+	$plexAddress = qualifyURL(PLEXURL);
+	
+	$image_url = $_GET['img'];
+	$image_height = $_GET['height'];
+	$image_width = $_GET['width'];
+	
+	if(isset($image_url) && isset($image_height) && isset($image_width)) {
+		$image_src = $plexAddress . '/photo/:/transcode?height='.$image_height.'&width='.$image_width.'&upscale=1&url=' . $image_url . '&X-Plex-Token=' . PLEXTOKEN;
+		header('Content-type: image/jpeg');
+		readfile($image_src);
+	} else {
+		echo "Invalid Plex Request";	
+	}
+}
+
 // Simplier access to class
 function translate($string) {
 	if (isset($GLOBALS['language'])) {
@@ -712,6 +734,7 @@ function loadConfig($path = 'config/config.php') {
 	}
 }
 
+// Commit new values to the configuration
 function updateConfig($new, $current = false) {
 	// Get config if not supplied
 	if (!$current) {
@@ -770,6 +793,35 @@ function configLazy($path) {
 	return $config;
 }
 
+// Qualify URL
+function qualifyURL($url) {
+	// Get Digest
+	$digest = parse_url($url);
+	
+	// http/https
+	if (!isset($digest['scheme'])) {
+		if (isset($digest['port']) && in_array($digest['port'], array(80,8080,8096))) {
+			$scheme = 'http';
+		} else {
+			$scheme = 'https';
+		}
+	} else {
+		$scheme = $digest['scheme'];
+	}
+	
+	// Host
+	$host = (isset($digest['host'])?$digest['host']:'');
+	
+	// Port
+	$port = (isset($digest['port'])?':'.$digest['port']:'');
+	
+	// Path
+	$path = (isset($digest['path'])?$digest['path']:'');
+	
+	// Output
+	return $scheme.'://'.$host.$port.$path;
+}
+
 // Function to be called at top of each to allow upgrading environment as the spec changes
 function upgradeCheck() {
 	// Upgrade to 1.31
@@ -821,6 +873,47 @@ function dependCheck() {
 	return true;
 }
 
+// Process file uploads
+function uploadFiles($path, $ext_mask = null) {
+	if (isset($_FILES) && count($_FILES)) {
+		require_once('class.uploader.php');
+
+		$uploader = new Uploader();
+		$data = $uploader->upload($_FILES['files'], array(
+			'limit' => 10,
+			'maxSize' => 10,
+			'extensions' => $ext_mask,
+			'required' => false,
+			'uploadDir' => str_replace('//','/',$path.'/'),
+			'title' => array('name'),
+			'removeFiles' => true,
+			'replace' => true,
+		));
+
+		if($data['isComplete']){
+			$files = $data['data'];
+
+			echo json_encode($files['metas'][0]['name']);
+		}
+
+		if($data['hasErrors']){
+			$errors = $data['errors'];
+			echo json_encode($errors);
+		}
+	} else {
+		echo json_encode('No files submitted!');
+	}
+}
+
+// Remove file
+function removeFiles($path) {
+    if(is_file($path)) {
+        unlink($path);
+    } else {
+		echo json_encode('No file specified for removal!');
+	}
+}
+
 
 // ==============
 

+ 8 - 9
homepage.php

@@ -6,7 +6,6 @@ ini_set("display_errors", 1);
 ini_set("error_reporting", E_ALL | E_STRICT);
 
 require_once("user.php");
-require_once("translate.php");
 require_once("functions.php");
 use Kryptonit3\Sonarr\Sonarr;
 use Kryptonit3\SickRage\SickRage;
@@ -333,10 +332,10 @@ endif; ?>
                     if(PLEXPLAYINGNOW == "true"){ $plexSize++; }
                     if($plexSize >= 4){ $plexSize = 3; }elseif($plexSize == 3){ $plexSize = 4; }elseif($plexSize == 2){ $plexSize = 6; }elseif($plexSize == 1){ $plexSize = 12; }
                     
-                    if(PLEXRECENTMOVIE == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "movie", PLEXTOKEN, $plexSize, $language->translate("MOVIES")); }
-                    if(PLEXRECENTTV == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "season", PLEXTOKEN, $plexSize, $language->translate("TV_SHOWS")); }
-                    if(PLEXRECENTMUSIC == "true"){ echo getPlexRecent(PLEXURL, PLEXPORT, "album", PLEXTOKEN, $plexSize, $language->translate("MUSIC")); }
-                    if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams(PLEXURL, PLEXPORT, PLEXTOKEN, $plexSize, $language->translate("PLAYING_NOW_ON_PLEX")); }
+                    if(PLEXRECENTMOVIE == "true"){ echo getPlexRecent("movie", $plexSize); }
+                    if(PLEXRECENTTV == "true"){ echo getPlexRecent("season", $plexSize); }
+                    if(PLEXRECENTMUSIC == "true"){ echo getPlexRecent("album", $plexSize); }
+                    if(PLEXPLAYINGNOW == "true"){ echo getPlexStreams($plexSize); }
                     ?>
 
                 </div>
@@ -353,10 +352,10 @@ endif; ?>
                     if(EMBYPLAYINGNOW == "true"){ $embySize++; }
                     if($embySize >= 4){ $embySize = 3; }elseif($embySize == 3){ $embySize = 4; }elseif($embySize == 2){ $embySize = 6; }elseif($embySize == 1){ $embySize = 12; }
                     
-                    if(EMBYRECENTMOVIE == "true"){ echo getEmbyRecent(EMBYURL, EMBYPORT, "movie", EMBYTOKEN, $embySize, $language->translate("MOVIES")); }
-                    if(EMBYRECENTTV == "true"){ echo getEmbyRecent(EMBYURL, EMBYPORT, "season", EMBYTOKEN, $embySize, $language->translate("TV_SHOWS")); }
-                    if(EMBYRECENTMUSIC == "true"){ echo getEmbyRecent(EMBYURL, EMBYPORT, "album", EMBYTOKEN, $embySize, $language->translate("MUSIC")); }
-                    if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams(EMBYURL, EMBYPORT, EMBYTOKEN, $embySize, $language->translate("PLAYING_NOW_ON_EMBY")); }
+                    if(EMBYRECENTMOVIE == "true"){ echo getEmbyRecent("movie", $embySize); }
+                    if(EMBYRECENTTV == "true"){ echo getEmbyRecent("season", $embySize); }
+                    if(EMBYRECENTMUSIC == "true"){ echo getEmbyRecent("album", $embySize); }
+                    if(EMBYPLAYINGNOW == "true"){ echo getEmbyStreams($embySize); }
                     ?>
 
                 </div>

+ 0 - 50
image.php

@@ -1,50 +0,0 @@
-<?php
-
-require_once("user.php");
-
-$image_url = $_GET['img'];
-$image_height = $_GET['height'];
-$image_width = $_GET['width'];
-$image_source = (isset($_GET['source']) ? $_GET['source'] : 'plex');
-
-switch ($image_source) {
-	case 'emby':
-		$urlCheck = stripos(EMBYURL, "http");
-
-		if ($urlCheck === false) {
-			$embyAddress = "http://" . EMBYURL;
-		} else {
-			$embyAddress = EMBYURL;	
-		}
-		
-		if(EMBYPORT !== ""){ $embyAddress .= ":" . EMBYPORT; }
-		
-		if(isset($image_url) && isset($image_height) && isset($image_width)) {
-			$image_src = $embyAddress . '/Items/'.$image_url.'/Images/Primary?maxHeight='.$image_height.'&maxWidth='.$image_width;
-			header('Content-type: image/jpeg');
-			readfile($image_src);
-		} else {
-			echo "Invalid Emby Request";	
-		}
-		break;
-	case 'plex':
-	default:
-		$urlCheck = stripos(PLEXURL, "http");
-
-		if ($urlCheck === false) {
-			$plexAddress = "http://" . PLEXURL;
-		} else {
-			$plexAddress = PLEXURL;	
-		}
-		
-		if(PLEXPORT !== ""){ $plexAddress = $plexAddress . ":" . PLEXPORT; }
-		
-		if(isset($image_url) && isset($image_height) && isset($image_width)) {
-			$image_src = $plexAddress . '/photo/:/transcode?height='.$image_height.'&width='.$image_width.'&upscale=1&url=' . $image_url . '&X-Plex-Token=' . PLEXTOKEN;
-			header('Content-type: image/jpeg');
-			readfile($image_src);
-		} else {
-			echo "Invalid Plex Request";	
-		}
-		break;
-}

+ 2 - 1
lang/en.ini

@@ -236,4 +236,5 @@ PLEX_PASSWORD = "Plex Password"
 BOTH = "Both"
 ONLY = "Only"
 NO_CREATE = "Do Not Create Accounts"
-YES_CREATE = "Create Accounts As Needed"
+YES_CREATE = "Create Accounts As Needed"
+RECENT_CONTENT = "Recently Added Content"

+ 1 - 2
settings.php

@@ -8,7 +8,6 @@ ini_set("error_reporting", E_ALL | E_STRICT);
 require_once("user.php");
 require_once("functions.php");
 $USER = new User("registration_callback");
-require_once("translate.php");
 
 if(!$USER->authenticated) :
 
@@ -1188,7 +1187,7 @@ endif; ?>
                                         
                                     </form>
                                     
-                                     <form style="display: none" id="editCssForm" method="POST" action="submitCSS.php">
+                                     <form style="display: none" id="editCssForm" method="POST" action="ajax.php">
                                          
                                          <button class="btn waves btn-labeled btn-warning btn-sm pull-left text-uppercase waves-effect waves-float" type="button" id="backToThemeButton">
 

+ 0 - 29
submitCSS.php

@@ -1,29 +0,0 @@
-<?php
-
-function write_ini_file($content, $path) { 
-    
-    if (!$handle = fopen($path, 'w')) {
-        
-        return false; 
-    
-    }
-    
-    $success = fwrite($handle, $content);
-    
-    fclose($handle); 
-    
-    return $success; 
-
-}
-
-if ($_POST['submit'] == "editCSS" ) {
-
-    $text = $_POST["css-show"];
-    
-    write_ini_file($text, "custom.css");
-
-}
-
-?>
-
-<script>window.top.location = window.top.location.href.split('#')[0];</script>

+ 0 - 3
translate.php

@@ -1,3 +0,0 @@
-<?php
-// Legacy
-?>