Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Added news page

  • Loading branch information...
commit b67659c349c99bb1dd9541861c37c07a8b3dd557 1 parent 395e1c1
@katzgrau authored
View
1  application/config/routes.php
@@ -28,6 +28,7 @@
$route['ajax/packages/(:any)/rate'] = "ajax/packages/rate/$1";
$route['home'] = "home/index";
+$route['news'] = "home/news";
$route['download'] = "home/download";
$route['set-up'] = "home/set_up";
$route['set-up-mx'] = "home/set_up_mx";
View
7 application/controllers/home.php
@@ -124,6 +124,13 @@ function project()
$this->load->view('home/project');
}
+ function news()
+ {
+ $this->load->model('news');
+ $data['items'] = News::getRecent(100);
+ $this->load->view('home/news', $data);
+ }
+
/**
* The installation script
*/
View
2  application/controllers/packages.php
@@ -270,6 +270,8 @@ public function is_owner($spark_id)
function summary()
{
+ UtilityHelper::tryPageCache(1);
+
$this->load->model('spark');
$items_per = 5;
View
29 application/views/home/news.php
@@ -0,0 +1,29 @@
+<?php $this->load->view('global/_new_header.php', array('title' => 'Latest News')); ?>
+
+<h2>GetSparks.org Community News</h2>
+
+<p>
+ <strong>News about sparks from blogs and other places. Want to announce
+ something? Tweet <a href="http://twitter.com/getsparks">@getsparks</a>.</strong>
+</p>
+
+<table class="spark-table">
+ <thead>
+ <tr>
+ <th>Story</th>
+ <th>Source</th>
+ <th>Posted</th>
+ </tr>
+ </thead>
+ <tbody>
+ <?php foreach($items as $item): ?>
+ <tr>
+ <td><a href="<?php echo $item->url ?>"><?php echo $item->title ?></a></td>
+ <td><?php echo parse_url($item->url, PHP_URL_HOST) ?></td>
+ <td><?php echo date('F j, Y', strtotime($item->posted)); ?></td>
+ </tr>
+ <?php endforeach; ?>
+ </tbody>
+</table>
+
+<?php $this->load->view('global/_new_footer.php'); ?>
Please sign in to comment.
Something went wrong with that request. Please try again.