-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
47 lines (43 loc) · 1.12 KB
/
index.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
<?php
require_once('functions.php');
connect();
?>
<!doctype html>
<html>
<head>
<title><?php echo $GLOBALS['blog_name'] ?></title>
<?php
head();
echo " <h2>Recent Blog Posts</h2>\n";
$recent_blogs_func = recent_blog(3);
if($recent_blogs_func != 0){
echo " <ul class=\"posts\">\n";
foreach ($recent_blogs_func as $row){
$date = getdate($row["date"]);
$title = word_wrap($row['title']);
$content = word_wrap($row['content']);
$author = word_wrap($row['author']);
$day = $date['weekday'];
$mday = $date['mday'];
$month = $date['month'];
$year = $date['year'];
$comment_no = $row[0];
echo <<<END
<li>
<h3><a href="view.php?blog=$title">$title</a></h3>
<h5>$day $mday $month $year</h5>
<p>$content...</p>
<h5><a href="author.php?name=$author">$author</a></h5>
<h5>$comment_no comments</h5>
</li>
END;
echo " </ul>\n";
}
}else{
echo '<p class="error">Failed :(</p>';
}
echo " <a id=\"all_posts\" href=\"view.php\">All posts...</a>";
footer();
?>
</body>
</html>