Skip to content

Commit

Permalink
Foursquare plugin improvements
Browse files Browse the repository at this point in the history
* Complete documentation
* Add help links
* Rearrange dashboard module order (this week first, then all-time on bar and pie charts)
* Use proper post checkin template on This Week's Most Replied-To module
  • Loading branch information
ginatrapani committed Sep 7, 2012
1 parent 9c24ced commit d15044d
Show file tree
Hide file tree
Showing 11 changed files with 146 additions and 35 deletions.
6 changes: 6 additions & 0 deletions docs/source/userguide/listings/facebook/dashboard.rst
Expand Up @@ -35,3 +35,9 @@ Friend Count by Day and Week
----------------------------

If there's data, these line charts display your friend count history the past 5 days and 5 weeks.

Flashback: On This Day In Years Past
------------------------------------

Status updates you posted on this day in past years. For example, your posts from 1 year ago, 2 years ago, and 3 years
ago.
50 changes: 50 additions & 0 deletions docs/source/userguide/listings/foursquare/dashboard.rst
@@ -0,0 +1,50 @@
Dashboard
=========

The dashboard for a Foursquare user contains brief sections of information you can find in more depth in
individual data listings.

Foursquare User name
--------------------

Name, service name (Foursquare), Foursquare avatar, and last updated time.

Where You Went This Week
------------------------

A Google Map of your last 7 days of checkins.

Checkins Per Hour This Week
---------------------------

A bar chart of checkins per hour of the day in the past 7 days.

Checkins Per Hour All Time
--------------------------

A bar chart of all-time checkins per hour of the day.

The Types Of Places You've Visited This Week
--------------------------------------------

A pie chart of the types of places you have checked in at in the past 7 days.

The Types Of Places You Visit
-----------------------------

A pie chart of the types of places you have ever checked in at.

Response Rates
--------------

A bar chart of comment activity on recent checkins.

This Week's Most Replied-To Posts
---------------------------------

The checkins with the most comments posted in the last 7 days, ordered by number of comments descending.

Flashback: On This Day In Years Past
------------------------------------

Checkins on this day in past years. For example, your checkins from 1 year ago, 2 years ago, and 3 years ago.
17 changes: 17 additions & 0 deletions docs/source/userguide/listings/foursquare/dashboard_listings.rst
@@ -0,0 +1,17 @@
Foursquare
==========

ThinkUp offers several listings for an authorized Foursquare user account.

.. toctree::
:maxdepth: 1

dashboard.rst

Checkins
--------

.. toctree::
:maxdepth: 1

dashboard_posts.rst
9 changes: 9 additions & 0 deletions docs/source/userguide/listings/foursquare/dashboard_posts.rst
@@ -0,0 +1,9 @@
Checkins
========

All the checkins ThinkUp has captured for this Foursquare user.

Export (Logged-in only)
-----------------------

To export a set of results to a CSV file for download, click on the "Export" link.
5 changes: 5 additions & 0 deletions docs/source/userguide/listings/googleplus/dashboard.rst
Expand Up @@ -36,3 +36,8 @@ This Week's Most Reshared Posts
--------------------------------

The posts with the most reshares posted in the last 7 days, ordered by number of reshares descending.

Flashback: On This Day In Years Past
------------------------------------

Posts you published on this day in past years. For example, your posts from 1 year ago, 2 years ago, and 3 years ago.
1 change: 1 addition & 0 deletions docs/source/userguide/listings/index.rst
Expand Up @@ -14,6 +14,7 @@ Dashboard data listings apply to sets of posts or users.

twitter/dashboard_listings.rst
facebook/dashboard_listings.rst
foursquare/dashboard_listings.rst
googleplus/dashboard_listings.rst

Post Data Listings
Expand Down
4 changes: 4 additions & 0 deletions docs/source/userguide/listings/twitter/dashboard.rst
Expand Up @@ -62,3 +62,7 @@ Client Usage

Pie chart of which Twitter clients this user uses over all time.

Flashback: On This Day In Years Past
------------------------------------

Tweets you published on this day in past years. For example, your posts from 1 year ago, 2 years ago, and 3 years ago.
32 changes: 20 additions & 12 deletions webapp/_lib/view/_post.checkin.tpl
@@ -1,3 +1,12 @@
{*
Render a checkin, ie, a post with place information.
Included in multiple plugin templates which render lists of posts.
Parameters:
$post (required) Post object
*}

{if $smarty.foreach.foo.first}
<div class="header clearfix">
<div class="grid_14 alpha">&#160;</div>
Expand All @@ -17,22 +26,21 @@
{/if}
</div>
</div>

<div class="grid_10">
<div class="post">
{if $post->post_text != " "}{$post->post_text}<br><br>{/if}
{foreach from=$post->links item=current_link}
<a href="{$current_link->url}"><img src="{$current_link->url}" width=100px height=100px}></a><br>
{/foreach}
<div class="post">
{if $post->post_text != " "}{$post->post_text}<br><br>{/if}
{foreach from=$post->links item=current_link}
<a href="{$current_link->url}"><img src="{$current_link->url}" width=100px height=100px}></a><br>
{/foreach}

{$post->place} <br> {$post->location} <br>
<div class="small gray">
<span class="metaroll">
<a href="{$site_root_path}post/?t={$post->post_id}&n={$post->network|urlencode}">{$post->pub_date|relative_datetime} ago</a> via {$post->source}
</span>
{$post->place} <br> {$post->location} <br>
<div class="small gray">
<span class="metaroll">
<a href="{$site_root_path}post/?t={$post->post_id}&n={$post->network|urlencode}">{$post->pub_date|relative_datetime} ago</a> via {$post->source}
</span>
</div>
</div>
</div>
</div>

<div class="grid_2 omega">
{if $post->reply_count_cache > 0}
Expand Down
48 changes: 27 additions & 21 deletions webapp/_lib/view/dashboard.tpl
Expand Up @@ -80,13 +80,13 @@
{include file="_dashboard.checkinsperhouralltime.tpl"}
{/if}

{if $checkins_by_type|count_characters neq 0}
{include file="_dashboard.checkinplacetypesalltime.tpl"}
{/if}

{if $checkins_by_type_last_week|count_characters neq 0}
{include file="_dashboard.checkinplacetypeslastweek.tpl"}
{/if}

{if $checkins_by_type|count_characters neq 0}
{include file="_dashboard.checkinplacetypesalltime.tpl"}
{/if}
{/if}

{if $hot_posts_data}
Expand Down Expand Up @@ -120,12 +120,24 @@
</div>
{/if}

{if $instance->network eq "foursquare"}
<style type="text/css">
{literal}
.map-image-container { width: 130px; height: 130px; padding-bottom : 30px; }
img.map-image2 {float:left;margin:6px 0 0 0;width:150px;height:150px;}
img.place-icon2 {position: relative;width: 32px;height: 32px;top: -146px;left: 5px;}
{/literal}
</style>
{/if}
{if $most_replied_to_1wk}
<div class="section">
<h2>This Week's Most {if $instance->network eq 'google+'}Discussed{else}Replied-To{/if} Posts</h2>
{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"}
{elseif $instance->network eq 'foursquare'}
{include file="_post.checkin.tpl" post=$t}
{else}
{include file="_post.counts_no_author.tpl" post=$t headings="NONE" show_favorites_instead_of_retweets=true}
{/if}
Expand Down Expand Up @@ -159,20 +171,22 @@
{/foreach}
</div>
{/if}
{if $instance->network eq 'twitter' }
<div class="section" style="float : left; clear : none; width : 345px;">
{include file="_dashboard.posttypes.tpl"}
</div>
<div class="section" style="float : left; clear : none;margin-left : 10px; width : 345px;">
{include file="_dashboard.clientusage.tpl"}
</div>
{/if}
{if $posts_flashback|@count > 0 }
<div class="section">
<h2>Flashback: On This Day In Years Past</h2>
{if $instance->network eq 'foursquare'}
<style type="text/css">
{literal}
.map-image-container { width: 130px; height: 130px; padding-bottom : 30px; }
img.map-image2 {float:left;margin:6px 0 0 0;width:150px;height:150px;}
img.place-icon2 {position: relative;width: 32px;height: 32px;top: -146px;left: 5px;}
{/literal}
</style>
{foreach from=$posts_flashback item=post name=foo}
{include file="_post.checkin.tpl"}
{include file="_post.checkin.tpl" }
{/foreach}
{else}
{foreach from=$posts_flashback key=tid item=post name=foo}
Expand All @@ -182,14 +196,6 @@
</div>
{/if}
{if $instance->network eq 'twitter' }
<div class="section" style="float : left; clear : none; width : 345px;">
{include file="_dashboard.posttypes.tpl"}
</div>
<div class="section" style="float : left; clear : none;margin-left : 10px; width : 345px;">
{include file="_dashboard.clientusage.tpl"}
</div>
{/if}
{/if} {* end if $data_template *}
{/if}
{/if}
Expand Down
3 changes: 2 additions & 1 deletion webapp/plugins/foursquare/model/class.FoursquarePlugin.php
Expand Up @@ -128,11 +128,12 @@ public function getDashboardMenuItems($instance) {
// Set the view template to checkins.tpl
$checkins_data_tpl = Utils::getPluginViewDirectory('foursquare').'checkins.tpl';
// Add a checkins link to the list of pages on the left
$checkins_menu_item = new MenuItem("Checkins", "All checkins", $checkins_data_tpl);
$checkins_menu_item = new MenuItem("Checkins", "Your checkins", $checkins_data_tpl);

// Get the data for our checkins link
$checkins_menu_ds_1 = new Dataset("all_checkins", 'PostDAO', "getAllCheckins",
array($instance->network_user_id, $instance->network, 15, "#page_number#"));
$checkins_menu_ds_1->addHelp('userguide/listings/foursquare/dashboard_posts');
$checkins_menu_item->addDataset($checkins_menu_ds_1);

// Add the checkins to our array of items
Expand Down
6 changes: 5 additions & 1 deletion webapp/plugins/foursquare/view/checkins.tpl
Expand Up @@ -8,7 +8,11 @@ img.place-icon2 {position: relative;width: 32px;height: 32px;top: -146px;left: 5
{if $all_checkins|@count >0}
<div class="section">
<h2>Your Checkins</h2>
<div class="clearfix">
{insert name="help_link" id=$display}
<h2>{if $parent_name}<a href="?v={$parent}&u={$instance->network_username}&n=twitter">{$parent_name}</a> &rarr; {/if}{$header}</h2>
{if $description}<h3>{$description}</h3>{/if}
</div>
<div class="header">
{if $logged_in_user and $display eq 'posts'}<a href="{$site_root_path}post/export.php?u={$instance->network_username|urlencode}&n={$instance->network}">Export</a>{/if}
</div>
Expand Down

0 comments on commit d15044d

Please sign in to comment.