Rev 457 | Rev 477 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
169 | tom | 1 | <?php |
2 | |||
3 | require '_taios.php'; |
||
4 | |||
5 | $page = new Taios_Page('Home'); |
||
6 | $page->drawHeader(); |
||
7 | write('<h3>Pages</h3>'); |
||
8 | $page->drawMenuItem('Biggles', '/~biggles/'); |
||
457 | tom | 9 | $page->drawMenuItem('FredFace', '/~freddie/'); |
169 | tom | 10 | $page->drawMenuItem('Muzer', '/~muzer/'); |
457 | tom | 11 | $page->drawMenuItem('TomMan', '/~tom/'); |
169 | tom | 12 | $page->drawMiddle(); |
13 | |||
14 | ?> |
||
15 | |||
16 | <p class="bold">Welcome to Tim32!</p> |
||
17 | <p>Tim32 is a 10 year-old laptop running Ubuntu Server Edition 10.04.</p> |
||
18 | <br /> |
||
19 | |||
393 | tom | 20 | <h3 title="Take the Tim32 challenge: http://tim32.org/challenge/">Latest Blog Posts</h3> |
427 | tom | 21 | <p><a href="blog/rss.php">Rss Feed</a></p> |
169 | tom | 22 | |
23 | <?php |
||
24 | |||
25 | $ids = $page->findIDs('BlogPosts', 'WHERE ParentID = -1 ORDER BY DatePosted DESC'); |
||
417 | tom | 26 | for ($i = 0; $i < 4 && $i < count($ids); $i++) |
169 | tom | 27 | { |
28 | $id = $ids[$i]; |
||
29 | $post = $page->getBlogPost($id); |
||
476 | tom | 30 | |
31 | $comment_count = 0; |
||
32 | $ids2 = $page->findIDs('BlogPosts', 'WHERE ParentID=' . $id); |
||
33 | for ($i = 0; $i < count($ids2); $i++) |
||
34 | { |
||
35 | $comment_count++; |
||
36 | } |
||
37 | |||
38 | write('<a href="blog/post.php?id=' . $id . '"><h3>' . $post->title. '</h3></a>'); |
||
169 | tom | 39 | write('<h5 style="color: #666666;">Posted On ' . date('l j F Y', $post->datePosted) . ' by ' . $post->user->name . ' (' . $post->user->username . ')</h5>'); |
175 | tom | 40 | write('<p>' . $page->replaceBBCode($post->content) . '</p>'); |
476 | tom | 41 | write('<h5 style="color: #666666;">' . $comment_count . ' Comments</h5>'); |
169 | tom | 42 | write('<br />'); |
43 | } |
||
44 | |||
45 | $page->drawFooter(); |
||
46 | |||
47 | ?> |