-
Notifications
You must be signed in to change notification settings - Fork 3
/
changepluginsettings.php
43 lines (38 loc) · 1.27 KB
/
changepluginsettings.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
<?php
include 'admincheck.php';
if(isset($_POST['downloadExt'])) {
$d = $_POST['downloadExt'];
} else {
header("Location: index.php?error");
die("");
}
if(isset($_POST['footerExt'])) {
$f = $_POST['footerExt'];
} else {
header("Location: index.php?error");
die("");
}
$pluginFile = '<?php
// To enable a custom download form, change false to the name of your plugin file inside the plugin folder
// For example if we wanted to use an extension called aptLink, we would place aptLink.php inside the plugins/ folder
// ..and type "aptLink.php" in the place of false
define("DOWNLOAD", {{DLPL}});
// Footer plugin - Runs php file and places output below the content on the main page and above the footer
// This could be useful is using a visitor counter or featured download plugin
define("FOOTER", {{FTPL}});
?>';
$file = fopen("pluginconfig.php", "w");
if($d == "NONE") {
$pluginFile = str_replace("{{DLPL}}", "false", $pluginFile);
} else {
$pluginFile = str_replace("{{DLPL}}", '"' . $d . '"', $pluginFile);
}
if($f == "NONE") {
$pluginFile = str_replace("{{FTPL}}", "false", $pluginFile);
} else {
$pluginFile = str_replace("{{FTPL}}", '"' . $f . '"', $pluginFile);
}
fwrite($file, $pluginFile);
fclose($file);
header("Location: admin.php");
?>