-
Notifications
You must be signed in to change notification settings - Fork 0
/
viewer.php
52 lines (49 loc) · 1.51 KB
/
viewer.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
<?php
$user = $_POST["username"];
$stream = $_POST["stream"];
$counter = (int)$_POST["counter"];
$limit = $_POST["limit"];
$sorting = $_POST["sorted"];
if (isset($_POST["name"]))
{
$button = $_POST["name"];
if ($button == "Next Post")
{
if ($counter + 1 <= (int)$limit)
$counter++;
}
else if ($button == "choose" || $button == "Check for new posts")
{
exec('./a2/count_posts.py ' . $user . ' ' . $stream, $limit_ret);
$limit = $limit_ret[0];
}
else if ($button == "Sorting")
{
if ($sorting == "0")
$sorting = "1";
else
$sorting = "0";
}
else {
if ($counter - 1 >= 0)
$counter--;
}
}
if(isset($_POST["username"]) && isset($_POST["stream"]))
{
exec('./parser header.wpml ' . $user . ' ' . $stream . ' ' . $counter . ' ' . $limit . ' ' . $sorting . ' 2>&1', $arr);
foreach($arr as $a)
echo $a;
exec('./a2/viewer.py ' . $user . ' ' . $stream . ' ' . $counter . ' ' . $limit . ' ' . $sorting .' 2>&1', $return);
foreach($return as $b)
echo $b;
}
else
{
exec('./parser header.wpml', $arr);
foreach($arr as $a)
echo $a;
echo "Please <a href=\"index.php\">login</a> and <a href=\"choose.php\">choose</a> a stream to view posts!<br>";
echo "</body></html>";
}
?>