forked from titelies/Plex-Movie-Poster-Display-V1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathadminConfig.php
111 lines (91 loc) · 4.29 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
<?php if (!empty($_POST)) {
$myfile = fopen("config.php", "w") or die("Unable to open file!");
//Hack to fix '... Need to fix this later.
$_POST[comingSoonTopText] = str_replace("'", "\'", $_POST[comingSoonTopText]);
$_POST[comingSoonBottomText] = str_replace("'", "\'", $_POST[comingSoonBottomText]);
$_POST[nowShowingTopText] = str_replace("'", "\'", $_POST[nowShowingTopText]);
$txt = "
<?php
//Server Configuration
\$plexServer = '$_POST[plexServer]';
\$plexToken = '$_POST[plexToken]';
\$plexServerMovieSection = '$_POST[plexServerMovieSection]';
\n//Cleint Configuration
\$plexClient = '$_POST[plexClient]';
\n//Custom Image
\$customImageEnabled = '$_POST[customImageEnabled]';
\$customImage = '$_POST[customImage]';
\n//Misc
\$comingSoonTopText = '$_POST[comingSoonTopText]';
\$comingSoonBottomText = '$_POST[comingSoonBottomText]';
\$nowShowingTopText = '$_POST[nowShowingTopText]';
?>
";
echo $txt;
fwrite($myfile, $txt);
fclose($myfile);
$update = "1";
} ?>
<?php include_once('config.php'); ?>
<?php include_once('assets/header.php'); ?>
<h4><span class="glyphicon glyphicon-cog" aria-hidden="true"></span> Configuration</h4>
<?php if($update == "1") {
echo "<div class='alert alert-info'>Configuration File Updated.</div>";
} ?>
<form class="form-horizontal" method="post">
<div class="form-group">
<label class="control-label col-sm-2">Server IP: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="plexServer" value="<?php echo "$plexServer"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"><a href="https://support.plex.tv/hc/en-us/articles/204059436-Finding-your-account-token-X-Plex-Token" target=_blank>
<span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></a> X-Plex-Token: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="plexToken" value="<?php echo "$plexToken"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span> Movie Section: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="plexServerMovieSection" value="<?php echo "$plexServerMovieSection"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Client IP: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="plexClient" value="<?php echo "$plexClient"; ?>">
</div>
</div>
<div class="form-group">
<div class="col-sm-10">
<input type="hidden" class="form-control" name="customImageEnabled" value="<?php echo "$customImageEnabled"; ?>">
<input type="hidden" class="form-control" name="customImage" value="<?php echo "$customImage"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Coming Soon Top: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="comingSoonTopText" value="<?php echo "$comingSoonTopText"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Coming Soon Bottom: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="comingSoonBottomText" value="<?php echo "$comingSoonBottomText"; ?>">
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-2">Now Showing Text: </label>
<div class="col-sm-10">
<input type="text" class="form-control" name="nowShowingTopText" value="<?php echo "$nowShowingTopText"; ?>">
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<input class="btn btn-primary" type="submit" value="Save" name='submit' />
</div>
</div>
</form>
<?php include_once('assets/footer.php'); ?>