Permalink
Browse files

add in trends page

remove feed from map page
pull in 2 tagged feeds on /trends page
  • Loading branch information...
1 parent 19b6b4d commit 9a3e4295c5b01e6686a4b200f07450dc0024bceb @rmarianski committed May 27, 2011
@@ -0,0 +1,27 @@
+<?php defined('SYSPATH') or die('No direct script access.');
+
+class Trends_Controller extends Main_Controller {
+
+ public function query_feed($feed_name) {
+ $db = new Database();
+
+ $feed_item_data = $db->query(
+ "SELECT fi.item_title, fi.item_description, fi.item_date " .
+ "FROM feed_item fi " .
+ "INNER JOIN feed f on f.id=fi.feed_id " .
+ "WHERE f.feed_name='$feed_name'");
+ return $feed_item_data;
+ }
+
+ public function index() {
+ $this->template->header->this_page = 'trends';
+ $this->template->header->header_block = $this->themes->header_block();
+ $this->template->content = new View('trends');
+
+ $feed_name_list = 'urban design week list';
+ $feed_name_post = 'urban design week post';
+
+ $this->template->content->feed_list = $this->query_feed($feed_name_list);
+ $this->template->content->feed_post = $this->query_feed($feed_name_post);
+ }
+}
@@ -66,6 +66,11 @@ public static function main_tabs($this_page = FALSE)
}
*/
+ // add in trends page
+ $menu .= '<li><a href="' . url::site('trends') . '"' .
+ (($this_page === 'trends') ? ' class="active"' : '') .
+ '>Trends</a></li>';
+
echo $menu;
// Action::nav_admin_reports - Add items to the admin reports navigation tabs
View
@@ -2422,7 +2422,7 @@ border-radius: 16px;
.filter-list li {
list-style: none;
- margin: 2px;
+ margin: 2px;
float: left;
width: 125px;
}
@@ -2431,8 +2431,7 @@ border-radius: 16px;
}
.feeds-container {
- margin-top: 2em;
- margin-left: 10px;
+ margin: 2em 0 0 10px;
}
.feeds-container .heading {
text-transform: uppercase;
@@ -2447,13 +2446,11 @@ border-radius: 16px;
padding: 20px;
margin: 0 0 3em 0;
background-color: white;
- width:660px;
-
}
.feeds-container .feed-item p {
padding: 0px;
margin: 0 0 1em 0;
- font-size:13px;
+ font-size:13px;
}
.feeds-container .feed-item .feed-title {
font-size: 1.75em;
@@ -2469,6 +2466,14 @@ border-radius: 16px;
.feeds-container .feed-item a {
color: #FF6600;
}
+#feed-list {
+ float: left;
+ width: 450px;
+}
+#feed-post {
+ float: right;
+ width: 450px;
+}
.map-meta {
width: 700px;
View
@@ -200,27 +200,3 @@
</div>
</div>
<!-- / main body -->
-
-<?php if (count($feeds) > 0): ?>
-<div class="feeds-container">
- <h2 class="heading"><a href="http://urbandesignweek.tumblr.com/">Tumblr Feed</a></h2>
- <?php foreach ($feeds as $feed): ?>
- <?php $feed_date = date('c', strtotime($feed->item_date)); ?>
- <div class="feed-item">
- <h3 class="feed-title"><?php echo $feed->item_title; ?></h3>
- <p><?php echo $feed->item_description; ?></p>
- <p class="date"><abbr class="timeago" title="<?php echo $feed_date; ?>"><?php echo $feed_date; ?></abbr></p>
- </div>
- <?php endforeach; ?>
- </div>
-</div>
-<?php endif; ?>
-
-<script type="text/javascript" src="<?php echo url::site('media/js/jquery.timeago.js'); ?>"></script>
-<script type="text/javascript">
-(function($) {
- $(document).ready(function() {
- jQuery("abbr.timeago").timeago();
- });
-})(jQuery);
-</script>
@@ -0,0 +1,35 @@
+<?php
+function display_feed_items($feed_data) {
+ foreach ($feed_data as $feed) {
+ $feed_date = date('c', strtotime($feed->item_date));
+ ?>
+ <div class="feed-item">
+ <h3 class="feed-title"><?php echo $feed->item_title; ?></h3>
+ <p><?php echo $feed->item_description; ?></p>
+ <p class="date"><abbr class="timeago" title="<?php echo $feed_date; ?>"><?php echo $feed_date; ?></abbr></p>
+ </div>
+ <?php
+ }
+}
+?>
+
+<div class="feeds-container">
+
+ <div id="feed-list">
+ <?php display_feed_items($feed_list); ?>
+ </div>
+
+ <div id="feed-post">
+ <?php display_feed_items($feed_post); ?>
+ </div>
+
+</div>
+
+<script type="text/javascript" src="<?php echo url::site('media/js/jquery.timeago.js'); ?>"></script>
+<script type="text/javascript">
+(function($) {
+ $(document).ready(function() {
+ jQuery("abbr.timeago").timeago();
+ });
+})(jQuery);
+</script>

0 comments on commit 9a3e429

Please sign in to comment.