-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgenerate_configuration.php
44 lines (37 loc) · 1.62 KB
/
generate_configuration.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
<?php
require_once("configuration.php");
if (!isset($_SESSION["LOGIN_USER"]))
{
header("Location: http://" . $_SERVER['SERVER_NAME'] . "/subscription_block");
}
$alku = true;
$numero = @$_GET["papid"];
$brand = @$_GET["papbrand"];
if (!isset($_GET["papbrand"]))
{
die("ERROR: Paper brand not defined");
}
if (!isset($_GET["papid"]))
{
die("ERROR: Paper id not defined.");
}
$numero = intval($numero);
header('Content-Type: text/xml');
$konfis = file_get_contents('http://www.e-pages.dk/' . $brand . '/' . $numero . '/demo/configuration/flash/v1/application/configuration.xml');
$konfis = str_replace("demoMode=\"true\"","demoMode=\"false\"",$konfis);
$konfis = str_replace("searchable=\"false\"","searchable=\"true\"",$konfis);
$konfis = str_replace("demo pageLimit=\"2\"","demo pageLimit=\"2000\"",$konfis);
$konfis = str_replace("demo pageLimit=\"3\"","demo pageLimit=\"3000\"",$konfis);
$konfis = str_replace("demo pageLimit=\"4\"","demo pageLimit=\"4000\"",$konfis);
$konfis = str_replace("demo pageLimit=\"5\"","demo pageLimit=\"5000\"",$konfis);
if ($brand != "pohjalainen" && $brand != "ilkka" && $brand != "savonsanomat" && $brand != "viiskunta" && $brand != "ylakainuu" && $brand != "komiatlehti")
{
$konfis = str_replace("<map source=\"stat\" cluster=\"stat\"/>","<map source=\"stat\" cluster=\"stat\"/><map source=\"vector\" cluster=\"vector\"/>",$konfis);
$konfis = str_replace("</clusters>","<cluster name=\"vector\">
<server priority=\"10\" key=\"key4\">
http://front.device.e-pages.dk/[key4]/" . $brand . "/" . $numero . "
</server>
</cluster></clusters>",$konfis);
}
echo $konfis;
?>