From 3064aa1ab36bf14d73e55eecb2665e49b17bb6af Mon Sep 17 00:00:00 2001 From: Andy Baio Date: Tue, 30 Aug 2011 04:10:34 -0700 Subject: [PATCH] Added Facebook likes/replies chart to dashboard Closes #936 --- .../controller/class.DashboardController.php | 2 +- webapp/_lib/view/dashboard.tpl | 26 +++++++++++++------ 2 files changed, 19 insertions(+), 9 deletions(-) diff --git a/webapp/_lib/controller/class.DashboardController.php b/webapp/_lib/controller/class.DashboardController.php index 463c90e784..2b15589b88 100644 --- a/webapp/_lib/controller/class.DashboardController.php +++ b/webapp/_lib/controller/class.DashboardController.php @@ -175,7 +175,7 @@ private function loadDefaultDashboard() { $post_dao = DAOFactory::getDAO('PostDAO'); //posts - $recent_posts = $post_dao->getAllPosts($this->instance->network_user_id, $this->instance->network, 3, true); + $recent_posts = $post_dao->getAllPosts($this->instance->network_user_id, $this->instance->network, 20, true); $this->addToView('recent_posts', $recent_posts); $most_replied_to_1wk = $post_dao->getMostRepliedToPostsInLastWeek($this->instance->network_username, $this->instance->network, 5); diff --git a/webapp/_lib/view/dashboard.tpl b/webapp/_lib/view/dashboard.tpl index 0d1955418b..04d1fda925 100644 --- a/webapp/_lib/view/dashboard.tpl +++ b/webapp/_lib/view/dashboard.tpl @@ -78,12 +78,22 @@ {if $recent_posts} {foreach from=$recent_posts key=tid item=t name=foo} - {if $instance->network eq "twitter"} - {include file="_post.counts_no_author.tpl" post=$t headings="NONE"} - {else} - {include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true} + {if $smarty.foreach.foo.index < 3} + {if $instance->network eq "twitter"} + {include file="_post.counts_no_author.tpl" post=$t headings="NONE"} + {else} + {include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true} + {/if} {/if} {/foreach} + + {if $instance->network neq "twitter" && $recent_posts|@count > 3} +

Recent Activity

+
+ +
+ {/if} + {/if} {if $follower_count_history_by_day.history && $follower_count_history_by_week.history} @@ -109,7 +119,7 @@ {if $least_likely_followers}
-

Most Discerning Followers

+

Most Discerning Followers

{foreach from=$least_likely_followers key=uid item=u name=foo}
@@ -121,10 +131,10 @@
{/if} - + {if $most_replied_to_1wk}
-

This Week's Most Replied-To Posts

+

This Week's Most Replied-To Posts

{foreach from=$most_replied_to_1wk key=tid item=t name=foo} {if $instance->network eq "twitter"} {include file="_post.counts_no_author.tpl" post=$t headings="NONE"} @@ -137,7 +147,7 @@ {if $most_faved_1wk}
-

This Week's Most Liked Posts

+

This Week's Most Liked Posts

{foreach from=$most_faved_1wk key=tid item=t name=foo} {include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true} {/foreach}