Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
[DB MIGRATION REQ'D] Support for checkins
First of two commits that will add Foursquare support: This one is the data model modifications and core application changes required for posts with places, i.e., checkins. Adds Place model object. Adds and map_image and icon fields to the places table, and is_archive_loaded_posts to instances table. Also adds "Posts on this day from years past" to dashboard across networks.
- Loading branch information
1 parent
63b4aa8
commit 94cc96d
Showing
12 changed files
with
271 additions
and
45 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
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,96 @@ | ||
<?php | ||
/** | ||
* | ||
* ThinkUp/webapp/_lib/model/class.Place.php | ||
* | ||
* Copyright (c) 2012 Aaron Kalair | ||
* | ||
* LICENSE: | ||
* | ||
* This file is part of ThinkUp (http://thinkupapp.com). | ||
* | ||
* ThinkUp is free software: you can redistribute it and/or modify it under the terms of the GNU General Public | ||
* License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any | ||
* later version. | ||
* | ||
* ThinkUp is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied | ||
* warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more | ||
* details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with ThinkUp. If not, see | ||
* <http://www.gnu.org/licenses/>. | ||
* | ||
* | ||
* @license http://www.gnu.org/licenses/gpl.html | ||
* @copyright 2012 Aaron Kalair | ||
* @author Aaron Kalair <aaronkalair[at]gmail[dot]com> | ||
*/ | ||
|
||
class Place { | ||
/** | ||
* @var int Internal unique ID. | ||
*/ | ||
var $id; | ||
/** | ||
* @var str Place ID on a given network. | ||
*/ | ||
var $place_id; | ||
/** | ||
* @var str Type of place. | ||
*/ | ||
var $place_type; | ||
/** | ||
* @var str Short name of a place. | ||
*/ | ||
var $name; | ||
/** | ||
* @var str Full name of a place. | ||
*/ | ||
var $full_name; | ||
/** | ||
* @var str Country code where the place is located. | ||
*/ | ||
var $country_code; | ||
/** | ||
* @var str Country where the place is located. | ||
*/ | ||
var $country; | ||
/** | ||
* @var str The network this place appears on in lower-case, e.g. twitter or facebook. | ||
*/ | ||
var $network; | ||
/** | ||
* @var point Longitude/lattitude point. | ||
*/ | ||
var $longlat; | ||
/** | ||
* @var polygon Bounding box of place. | ||
*/ | ||
var $bounding_box; | ||
/** | ||
* @var icon Icon that represents the place | ||
*/ | ||
var $icon; | ||
/** | ||
* @var map_image URL to a image of the map representing the area this location is in | ||
*/ | ||
var $map_image; | ||
|
||
public function __construct($row = false) { | ||
if ($row) { | ||
$this->id = $row['id']; | ||
$this->place_id = $row['place_id']; | ||
$this->place_type = $row['place_type']; | ||
$this->name = $row['name']; | ||
$this->full_name = $row['full_name']; | ||
$this->country_code = $row['country_code']; | ||
$this->country = $row['country']; | ||
$this->network = $row['network']; | ||
$this->longlat = $row['longlat']; | ||
$this->bounding_box = $row['bounding_box']; | ||
$this->icon = $row['icon']; | ||
$this->map_image = $row['map_image']; | ||
} | ||
} | ||
} | ||
|
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
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
3 changes: 3 additions & 0 deletions
3
webapp/install/sql/mysql_migrations/2012-07-19_checkin_support.sql
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,3 @@ | ||
ALTER TABLE tu_places ADD icon VARCHAR ( 255 ) COMMENT 'URL to an icon which represents the place type.'; | ||
ALTER TABLE tu_places ADD map_image VARCHAR( 255 ) COMMENT 'URL to an image of a map representing the area this place is in.'; | ||
ALTER TABLE tu_instances ADD is_archive_loaded_posts INT( 1 ) NOT NULL DEFAULT 0 COMMENT 'Whether or not all the instance''s posts have been backfilled.' AFTER earliest_reply_in_system; |
Oops, something went wrong.