blob: 8b4fb995f8b6832f08a466ef5ef653e877f435dd (
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
|
<?php
$current_page = 'news';
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="description" content="" />
<meta name="keywords" content="" />
<title>Cobbler</title>
<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
</head>
<body>
<div id="wrap">
<?php
include("top.html");
?>
<div id="main">
<div id="sidebar">
<?php
include("nav.php");
?>
</div>
<div id="content">
<h2>News</h2>
<?php
require_once('magpierss/rss_fetch.inc');
$url = 'http://cobbler.wordpress.com/feed/';
$rss = fetch_rss($url);
foreach ($rss->items as $item) {
$href = $item['link'];
$title = $item['title'];
$body = $item['content']['encoded'];
$author = $item['dc']['creator'];
$category = $item['category'];
$comment_url = $item['comments'];
$raw_timestamp = $item['pubdate'];
$unixtime = strtotime($raw_timestamp);
$timestamp = date('g:i A T j F Y', $unixtime);
echo "<h3>$title</h3>";
echo "<p>$body</p>";
echo "<p class=\"metadata\">Posted $timestamp by $author in $category | <a href=$href>Comment on this!</a></p>";
}
?>
</div>
</div>
<div id="footer">
<?php
include("footer.html");
?>
</div>
</div>
</body>
</html>
|