summaryrefslogtreecommitdiff
path: root/htdocs/moderate/index.php
blob: 454a514c3bae1fa0f8eee40dd2666a2183d1da21 (plain)
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
<?php

/* Foursquare Community Site
 * 
 * Copyright (C) 2011 Foursquare Church.
 * 
 * Developers: Jesse Morgan <jmorgan@foursquarestaff.com>
 *
 */

require_once('../src/base.inc.php');

if (!isset($_SESSION['currentUser'])) {
    header('Location: ' . $CONFIG['urlroot'].'/moderate/login.php');
    exit();
}

require_once('header.inc.php');

?>

<h2>Welcome</h2>

<?php

// List posts to be approved
echo "<h3>Moderate Posts</h3>";

$posts = new PostIterator();
$posts->filterStage('moderation');
$posts->query();

// TODO: Also filter by source?

if ($posts->valid()) {
    foreach ($posts as $id => $post) {
        printf("<div class=\"post\"><p><a href=\"preview/%s\">%s</a></p>"
                . "<div class=\"options\"><a href=\"approve/%s\">Approve</a>"
                . " <a href=\"reject/%s\">Reject</a></div></div>",
                
                $id, $post->getName(), $id, $id);
    }

} else {
    echo "<p>No posts awaiting approval</p>";
}

require_once('footer.inc.php');

?>