Subversion Repositories taios

Rev

Rev 264 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
262 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Manage All Forum Posts', '../');
6
$page->drawHeader();
7
$page->drawMiddle();
8
 
9
$page->checkLoggedIn();
10
 
11
if ($page->isUserAdmin($page->getLoggedInUser()))
12
{
13
    write('<p class="bold">Use this to manage all the forum categories on the Tim32 Website.</p><br />');
14
 
15
    write('<table>');
16
    write('<tr>');
17
    write('<td class="bold">ID</td>');
18
    write('<td class="bold">Author</td>');
19
    write('<td class="bold">Category</td>');
20
    write('<td class="bold">Parent</td>');
21
    write('<td class="bold">Title</td>');
22
    write('<td class="bold">Content</td>');
23
    write('<td class="bold">Date Posted</td>');
24
    write('<td class="bold">Spam</td>');
25
    write('</tr>');
26
 
27
    $ids = $page->findIDs('ForumPosts');
28
    for ($i = 0; $i < count($ids); $i++)
29
    {
30
        $post = $page->getForumPost($ids[$i]);
31
        write('<tr>');
32
        write('<td><a href="../forums/post.php?id=' . $post->ID . '">' . $post->ID . '</a></td>');
522 muzer 33
        write('<td><a href="account.php?id=' . $post->author->ID . '">' . htmlentities($post->author->name, ENT_QUOTES) . '</a></td>');
262 tom 34
        if (!$post->category)
35
        {
36
            write('<td style="color: #444444;">No Category</td>');
37
        }
38
        else
39
        {
522 muzer 40
            write('<td>' . htmlentities($post->category->title, ENT_QUOTES) . '</td>');
262 tom 41
        }
42
        if (!$post->parent)
43
        {
44
            write('<td style="color: #444444;">No Parent</td>');
45
        }
46
        else
47
        {
522 muzer 48
            write('<td>' . htmlentities($post->parent->title, ENT_QUOTES) . '</td>');
262 tom 49
        }
522 muzer 50
        write('<td>' . htmlentities($post->title, ENT_QUOTES) . '</td>');
51
        write('<td>' . str_replace("\n", ' ', htmlentities($post->content, ENT_QUOTES)) . '</td>');
262 tom 52
        write('<td>' . date('j/m/Y H:i', $post->datePosted) . '</td>');
53
        write('<td>' . $post->spam . '</td>');
54
        write('</tr>');
55
    }
56
 
57
    write('</table>');
58
}
59
else
60
{
61
    $page->drawError('You do not have permission to access this page.');
62
}
63
 
64
$page->drawFooter();
65
 
66
?>
67