forked from MattsShack/Plex-Movie-Poster-Display
-
Notifications
You must be signed in to change notification settings - Fork 1
/
adminConfig.php
171 lines (170 loc) · 7.52 KB
/
adminConfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!DOCTYPE html>
<?php
session_start();
include('./control.php');
include('./config.php');
$tvlocations = glob($pseudochannelTrim . "*", GLOB_ONLYDIR);
foreach ($tvlocations as $tvbox) {
if ($tvbox . "/" == $pseudochannelMaster) {
$boxname = $configClientName;
$boxes .= "<li><a href='schedule.php?tv=$boxname' class='gn-icon gn-icon-videos'>TV: $boxname</a></li>";
} else {
$boxname = trim($tvbox, $pseudochannelTrim . "_");
$boxes .= "<li><a href='schedule.php?tv=$boxname' class='gn-icon gn-icon-videos'>TV: $boxname</a></li>";
}
}
$clientcount = 1;
foreach ($clientsxml->Server as $key => $xmlarray) {
$clientinfodump .= "<a class='dripdrop-title'>Plex Client #$clientcount</a></br><a class='dripdrop-header'>Name:</a></br><a href='schedule.php?tv=$xmlarray[name]' style='color:white'> $xmlarray[name] </a></br></br>";
$clientinfodump .= "<a class='dripdrop-header'>Local IP Address:</a></br><a> $xmlarray[address] </a></br></br>";
$clientinfodump .= "<a class='dripdrop-header'>Unique Identifier</a></br><a> $xmlarray[machineIdentifier] </a></br></br>";
$clientcount = $clientcount + 1;
}
?>
<html lang="en" class="no-js" style="height:100%">
<head>
<style type="text/css">a {text-decoration: none}</style>
<meta charset="UTF-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0;">
<title>FakeTV Guide and Control</title>
<meta name="description" content="A page that works with Pseudo Channel and Plex to display now playing data and allow viewing and navigation of Pseudo Channel schedules" />
<link rel="shortcut icon" href="../favicon.ico">
<link rel="stylesheet" type="text/css" href="css/normalize.css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<link rel="stylesheet" type="text/css" href="css/component.css" />
<link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png">
<link rel="manifest" href="assets/site.webmanifest">
<link rel="mask-icon" href="assets/safari-pinned-tab.svg" color="#5bbad5">
<link rel="shortcut icon" href="assets/favicon.ico">
<meta name="msapplication-TileColor" content="#2b5797">
<meta name="msapplication-config" content="assets/browserconfig.xml">
<meta name="theme-color" content="#ffffff">
<script src="js/modernizr.custom.js"></script>
<script
src="https://code.jquery.com/jquery-2.2.4.min.js"
integrity="sha256-BbhdlvQf/xTY9gja0Dq3HiwQF8LaCRTXxZKRutelT44="
crossorigin="anonymous">
</script>
<script type="text/javascript" src="assets/js/bootstrap.min.js"></script>
<script>
$(document).ready(
function() {
setInterval(function() {
$.getJSON('getData.php',function(data) {
$.each(data, function(key, val) {
$('#'+key).html(val);
});
});
}, 1000);
});
</script>
<script language="JavaScript">
function channel() {
<?php $id="$ch_file"; ?>
}
setInterval(autorefresh_div, 3000);
function httpGet(theUrl)
{
var xmlHttp = new XMLHttpRequest();
xmlHttp.open( "GET", theUrl, false );
xmlHttp.send( null );
return xmlHttp.responseText;
}
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<script>
$(document).ready( function() {
$("#topbar").load("topbar.php");
});
</script>
<?php if (!empty($_POST)) {
$myfile = fopen("psConfig.php", "w") or die("<p color=white>Unable to open file!</p>");
$txt = "<?php //Pseudo Channel
\$pseudochannel = '$_POST[pseudochannel]';
\n//Display Type
\$DisplayType = '$_POST[DisplayType]';
\n//Schedule Type
\$ScheduleType = '$_POST[ScheduleType]';
\n//Debug Mode
\$DebugMode = '$_POST[DebugMode]';
?>
";
echo $txt;
fwrite($myfile, $txt);
fclose($myfile);
$update = "1";
} ?>
<?php include_once('config.php');
if ($DisplayType == "half" || $_POST['DisplayType'] == "half") {
$halfstatus = "checked";
$fullstatus = "";
} elseif ($DisplayType =="full" || $_POST['DisplayType'] == "full") {
$halfstatus = "";
$fullstatus = "checked";
} else {
$halfstatus = "";
$fullstatus = "";
}
$ScheduleType == "landscape";
if ($DebugMode == "off" || $_POST['DebugMode'] == "off") {
$debugoff = "checked";
$debugon = "";
} elseif ($DebugMode == "on" || $_POST['DebugMode'] == "on") {
$debugoff = "";
$debugon = "checked";
} else {
$debugoff = "checked";
$debugon = "checked";
}
?>
</head>
<body>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<div id="container">
<div class="container" style="position:absolute;top:60px" scrolling="no">
<h3 style="color:white" class="gn-icon gn-icon-cog">Settings</h3>
<div class="container" name="schedulearea" type="text/html";>
<form method="post">
<div class="container" name="schedulearea" type="text/html";>
<label style="padding-left:10px;padding-right:5px;color:white">Pseudo Channel Directory: </label></br>
<input type="text" style="padding-right:50px" name="pseudochannel" value="<?php echo "$pseudochannelMaster"; ?>"></br></br>
<label style="padding-left:10px;color:white">Status Screen Display Type:</label></br>
<a style="padding-left:50px;color:white"><input type="radio" name="DisplayType" value="full" style="padding-left:20px" <?php echo "$fullstatus"; ?> >Full</input></a>
<a style="padding-left:20px;color:white"><input type="radio" name="DisplayType" value="half" style="padding-left:20px" <?php echo "$halfstatus"; ?> >Half</input></a></br></br>
<label style="padding-left:10px;color:white">Debug Mode:</label></br>
<a style="padding-left:50px;color:white"><input type="radio" name="DebugMode" value="off" style="padding-left:20px" <?php echo "$debugoff"; ?> >Off</input></a>
<a style="padding-left:20px;color:white"><input type="radio" name="DebugMode" value="on" style="padding-left:20px" <?php echo "$debugon"; ?> >On</input></a>
</div>
<div style="padding-left:50px">
<input class="btn btn-primary"type="submit" value="Save Changes" name='submit' />
</div>
<?php if($update == "1") {
echo "<div class='alert alert-info' style='color:white;padding-left:50px'>Settings File Updated.</div>";
} ?>
</form>
</div>
<div class="dripdrop" style="color:white;padding-left:10px"></br>
<a class="dripdrop-title">Plex Server Data</a></br></br>
<a class="dripdrop-header">IP Address:</a></br>
<a><?php echo $plexServer; ?></a></br></br>
<a class="dripdrop-header">Web Port:</a></br>
<a><?php echo $plexport; ?></a></br></br>
<a class="dripdrop-header">Web Token:</a></br>
<a><?php echo $plexToken; ?></a></br></br>
<?php echo $clientinfodump; ?>
<div style="">
<a class="btn btn-primary" style="color:white!important;" href="schedule.php?action=purgefaviconcache&<?php echo $urlstring; ?>">→ Purge Logo Image Cache</a>
</div>
</div>
<div id="topbar" name="topbar"></div>
</div><!-- /container -->
<script src="js/classie.js"></script>
<script src="js/gnmenu.js"></script>
<script>
new gnMenu( document.getElementById( 'gn-menu' ) );
</script>
</body>
</html>