aboutsummaryrefslogtreecommitdiffstats
path: root/index.php
blob: 136bbce5f241a673545d2050f7256c634c1c372e (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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
<?php include("include/header.php"); ?>
<?php include_once("include/autoloader.php"); ?>

<div class="container" role="main">
	<div class="alert alert-success" role="alert">
		Latest images: <strong>Replicant 6.0 0003</strong>.
		Replicant supports up to <strong>13</strong> different devices!
	</div>
	<div class="row">
		<div class="col-md-8">
			<div class="panel panel-default">
				<div class="panel-heading">
					<h3 class="panel-title">
						<span class="glyphicon glyphicon-pencil">
						</span>
						<a href="//blog.replicant.us/">
							Replicant blog
						</a>
					</h3>
				</div>
				<div class="panel-body">
<?php
$feed = new SimplePie();

$feed->set_feed_url("http://blog.replicant.us/feed/");
$feed->set_cache_location("cache/");

$feed_init = $feed->init();

if ($feed->error() || !$feed_init) {
	print("\t\t\t\t\t<div class=\"alert alert-danger\" role=\"alert\">");
	print("Loading RSS feed failed");
	print("</div>\n");
} else {
	$count = 1;

	foreach ($feed->get_items() as $item) {
		print("\t\t\t\t\t<div class=\"page-header\">");
		print("<h3>");
		print("<a href=\"".$item->get_permalink()."\">"
		      .$item->get_title()
		      ."</a>");
		print("</h3>");
		print("<small>");
		print("Posted on ");
		print("<strong>".$item->get_date("j F Y")."</strong>");
		if($item->get_author()) {
			print(" by ");
			print("<strong>".$item->get_author()->get_name()."</strong>");
		}
		print("</small>");
		print("</div>\n");
		print("\t\t\t\t\t<p>".$item->get_description()."</p>\n");

		if ($count++ >= 10)
			break;
	}
}
?>
				</div>
			</div>
		</div>
		<div class="col-md-4">
			<div class="panel panel-default">
				<div class="panel-heading">
					<span class="glyphicon glyphicon-user">
					</span>
					<a href="//redmine.replicant.us/projects/replicant/boards">
					Replicant forums
					</a>
				</div>
				<ul class="list-group">
<?php
$feed = new SimplePie();

$feed->set_feed_url("http://redmine.replicant.us/projects/replicant/activity.atom?show_messages=1");
$feed->set_cache_location("cache/");

$feed_init = $feed->init();

if ($feed->error() || !$feed_init) {
	print("\t\t\t\t\t<li class=\"list-group-item list-group-item-danger\">");
	print("Loading RSS feed failed");
	print("</li>\n");
} else {
	$count = 1;

	foreach ($feed->get_items() as $item) {
		print("\t\t\t\t\t<li class=\"list-group-item\">");
		print("<a href=\"".$item->get_permalink()."\">"
		      .$item->get_title()
		      ."</a>");
		print("<br />");
		print("<small>");
		print("Posted on ");
		print("<strong>".$item->get_date("j F Y")."</strong>");
		if($item->get_author()) {
			print(" by ");
			print("<strong>".$item->get_author()->get_name()."</strong>");
		}
		print("</small>");
		print("</li>\n");

		if ($count++ >= 8)
			break;
	}
}
?>
				</ul>
			</div>
		</div>
	</div>
</div>

<?php include("include/footer.php"); ?>