Skip to content

Commit

Permalink
add in trends page
Browse files Browse the repository at this point in the history
remove feed from map page
pull in 2 tagged feeds on /trends page
  • Loading branch information
rmarianski committed May 27, 2011
1 parent 19b6b4d commit 9a3e429
Show file tree
Hide file tree
Showing 5 changed files with 78 additions and 30 deletions.
27 changes: 27 additions & 0 deletions application/controllers/trends.php
@@ -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);
}
}
5 changes: 5 additions & 0 deletions application/helpers/nav.php
Expand Up @@ -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
Expand Down
17 changes: 11 additions & 6 deletions themes/pps/css/style.css
Expand Up @@ -2422,7 +2422,7 @@ border-radius: 16px;

.filter-list li {
list-style: none;
margin: 2px;
margin: 2px;
float: left;
width: 125px;
}
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down
24 changes: 0 additions & 24 deletions themes/pps/views/main.php
Expand Up @@ -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>
35 changes: 35 additions & 0 deletions themes/pps/views/trends.php
@@ -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.