diff --git a/webapp/2014/index.php b/webapp/2014/index.php index 6a270d481c..c32468589e 100644 --- a/webapp/2014/index.php +++ b/webapp/2014/index.php @@ -28,5 +28,5 @@ chdir('..'); require_once 'init.php'; -$controller = new InsightEOYStreamController(); +$controller = new InsightEOYStreamController(false, '2014-11-01'); echo $controller->go(); diff --git a/webapp/2015/index.php b/webapp/2015/index.php new file mode 100644 index 0000000000..25b2fc4b93 --- /dev/null +++ b/webapp/2015/index.php @@ -0,0 +1,32 @@ +. + * + * + * @author Gina Trapani + * @license http://www.gnu.org/licenses/gpl.html + * @copyright 2014-2015 Gina Trapani + */ +chdir('..'); +require_once 'init.php'; + +$controller = new InsightEOYStreamController(false, '2015-11-01'); +echo $controller->go(); diff --git a/webapp/_lib/class.Utils.php b/webapp/_lib/class.Utils.php index ceb5afefe5..e33441ce54 100644 --- a/webapp/_lib/class.Utils.php +++ b/webapp/_lib/class.Utils.php @@ -264,7 +264,7 @@ public static function validateURL($url) { * @return str */ public static function getSiteRootPathFromFileSystem() { - $dirs_under_root = array('account', 'post', 'session', 'user', 'install', 'tests', 'crawler', '2014'); + $dirs_under_root = array('account', 'post', 'session', 'user', 'install', 'tests', 'crawler', '2014', '2015'); if (isset($_SERVER['PHP_SELF'])) { $current_script_path = explode('/', $_SERVER['PHP_SELF']); } else { diff --git a/webapp/_lib/controller/class.InsightEOYStreamController.php b/webapp/_lib/controller/class.InsightEOYStreamController.php index ad43599212..bcc85521ca 100644 --- a/webapp/_lib/controller/class.InsightEOYStreamController.php +++ b/webapp/_lib/controller/class.InsightEOYStreamController.php @@ -36,6 +36,16 @@ class InsightEOYStreamController extends InsightStreamController { * @var string */ var $tpl_name = 'insights-eoy.tpl'; + /** + * Show insights since. + * @var str + */ + var $since; + + public function __construct($session_started=false, $since=null) { + parent::__construct($session_started); + $this->since = $since; + } /** * Load view with data to display page of insights. */ @@ -48,6 +58,7 @@ protected function displayPageOfInsights() { $this->addToView('tomorrows_teaser', $tomorrows_teaser); $this->addToView('is_year_end', true); + $this->addToView('year_end_year', substr($this->since, 0, 4)); $insight_dao = DAOFactory::getDAO('InsightDAO'); $page = (isset($_GET['page']) && is_numeric($_GET['page']))?$_GET['page']:1; @@ -55,18 +66,19 @@ protected function displayPageOfInsights() { if ($this->isAdmin()) { ///show all insights for all service users $insights = $insight_dao->getAllInstanceEOYInsights($page_count=(self::PAGE_INSIGHTS_COUNT+1), - $page); + $page, $this->since); } else { //show only service users owner owns $owner_dao = DAOFactory::getDAO('OwnerDAO'); $owner = $owner_dao->getByEmail($this->getLoggedInUser()); $insights = $insight_dao->getAllOwnerInstanceEOYInsights($owner->id, - $page_count=(self::PAGE_INSIGHTS_COUNT+1), $page); + $page_count=(self::PAGE_INSIGHTS_COUNT+1), $page, $this->since); } } else { //show just public service users in stream - $insights = $insight_dao->getPublicEOYInsights($page_count=(self::PAGE_INSIGHTS_COUNT+1), $page); + $insights = $insight_dao->getPublicEOYInsights($page_count=(self::PAGE_INSIGHTS_COUNT+1), $page, + $this->since); } if (isset($insights) && sizeof($insights) > 0) { if (sizeof($insights) == (self::PAGE_INSIGHTS_COUNT+1)) { diff --git a/webapp/_lib/dao/class.InsightMySQLDAO.php b/webapp/_lib/dao/class.InsightMySQLDAO.php index fa6446176a..09c2c364cf 100644 --- a/webapp/_lib/dao/class.InsightMySQLDAO.php +++ b/webapp/_lib/dao/class.InsightMySQLDAO.php @@ -279,16 +279,16 @@ public function getPublicInsights($page_count=10, $page_number=1) { return self::getInsightsForInstances($page_count, $page_number, $public_only = true); } - public function getPublicEOYInsights($page_count=10, $page_number=1) { - return self::getEOYInsightsForInstances($page_count, $page_number, $public_only = true); + public function getPublicEOYInsights($page_count=10, $page_number=1, $since='12-01-2014') { + return self::getEOYInsightsForInstances($page_count, $page_number, $public_only = true, 1, $since); } public function getAllInstanceInsights($page_count=10, $page_number=1) { return self::getInsightsForInstances($page_count, $page_number, $public_only = false); } - public function getAllInstanceEOYInsights($page_count=10, $page_number=1) { - return self::getEOYInsightsForInstances($page_count, $page_number, $public_only = false); + public function getAllInstanceEOYInsights($page_count=10, $page_number=1, $since='12-01-2014') { + return self::getEOYInsightsForInstances($page_count, $page_number, $public_only = false, 1, $since); } public function getAllInstanceInsightsSince($since) { diff --git a/webapp/_lib/view/insights.tpl b/webapp/_lib/view/insights.tpl index d342fe2e64..9d2486a630 100644 --- a/webapp/_lib/view/insights.tpl +++ b/webapp/_lib/view/insights.tpl @@ -27,10 +27,10 @@ {/capture}

- {if isset($thinkup_username)}{$thinkup_username}'s {else}My {/if}Best of 2014 + {if isset($thinkup_username)}{$thinkup_username}'s {else}My {/if}Best of {$year_end_year}

@@ -125,8 +125,8 @@ (isset($i->related_data.hero_image) and $i->emphasis > '1') | $i->slug eq 'weekly_graph'}insight-wide{/if}{if $i->slug|strpos:'eoy_'===0}insight-yearend insight-wide{/if}" id="insight-{$i->id}"> {if $i->slug|strpos:'eoy_'===0}
- Best of 2014 - See more + Best of {$i->date|date_format:"%Y"} + See more
{/if}
@@ -184,12 +184,12 @@