Subversion Repositories taios

Rev

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

Rev Author Line No. Line
96 tom 1
<?php
2
 
3
require '../_taios.php';
4
 
5
$page = new Taios_Page('Manage All Blog 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 blog posts on the Tim32 Website.</p><br />');
14
 
15
    write('<table>');
16
    write('<tr>');
17
    write('<td class="bold">ID</td>');
107 tom 18
    write('<td class="bold">Parent</td>');
19
    write('<td class="bold">Author</td>');
96 tom 20
    write('<td class="bold">Title</td>');
21
    write('<td class="bold">Content</td>');
110 tom 22
    write('<td class="bold">Date Posted</td>');
96 tom 23
    write('<td class="bold">Category</td>');
24
    write('<td class="bold">Spam</td>');
25
    write('</tr>');
26
 
27
    $ids = $page->findIDs('BlogPosts');
28
    for ($i = 0; $i < count($ids); $i++)
29
    {
98 tom 30
        $post = $page->getBlogPost($ids[$i]);
96 tom 31
        write('<tr>');
102 tom 32
        write('<td><a href="../blog/edit-post.php?id=' . $post->ID . '">' . $post->ID . '</a></td>');
96 tom 33
        if ($post->parent == -1)
34
        {
107 tom 35
            write('<td>No Parent</td>');
96 tom 36
        }
37
        else
38
        {
107 tom 39
            write('<td>' . $post->parent->title . '</td>');
96 tom 40
        }
107 tom 41
        write('<td><a href="account.php?id=' . $post->author->ID . '">' . $post->author->name . '</a></td>');
96 tom 42
        write('<td>' . $post->title . '</td>');
43
        write('<td>' . $post->content . '</td>');
109 tom 44
        write('<td>' . date('j/m/Y H:i', $post->datePosted) . '</td>');
96 tom 45
        write('<td>' . $post->category . '</td>');
46
        write('<td>' . $post->spam . '</td>');
47
        write('</tr>');
48
    }
49
 
50
    write('</table>');
51
}
52
else
53
{
54
    drawError('You do not have permission to access this page.');
55
}
56
 
57
$page->drawFooter();
58
 
59
?>
60