Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
remove feed from map page pull in 2 tagged feeds on /trends page
- Loading branch information
1 parent
19b6b4d
commit 9a3e429
Showing
5 changed files
with
78 additions
and
30 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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> |