Changeset 701681
- Timestamp:
- 04/22/2013 05:43:15 PM (13 years ago)
- Location:
- runkeeper-activity-feed/trunk
- Files:
-
- 1 deleted
- 3 edited
-
assets-wp-repo (deleted)
-
readme.txt (modified) (3 diffs)
-
runkeeper-wordpress-activity-feed.php (modified) (7 diffs)
-
runkeeper-wordpress-records-widget.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
runkeeper-activity-feed/trunk/readme.txt
r687190 r701681 5 5 Requires at least: 3.5 6 6 Tested up to: 3.5.1 7 Stable tag: 1. 3.17 Stable tag: 1.4.0 8 8 License: GPLv2 or later 9 9 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 42 42 == Frequently Asked Questions == 43 43 44 None yet! 44 = I get this error: "Fatal error: Call to undefined function date_create_from_format()" = 45 46 This function was introduced in PHP 5.3, so you'll need to check with your hosting provider to make sure you're using at least PHP 5.3. 45 47 46 48 == Screenshots == … … 53 55 == Changelog == 54 56 55 = 1.3.1= 57 = 1.4.0 = 58 * NEW FEATURE: Single Activity Import based on Activity ID 59 60 = 1.3.1 = 56 61 * BUG FIX: Update RunKeeper API Library with Records Method 57 62 -
runkeeper-activity-feed/trunk/runkeeper-wordpress-activity-feed.php
r687190 r701681 6 6 Description: A plugin to automatically draft posts of all your Runkeeper Activities. 7 7 Author: A. Kai Armstrong 8 Version: 1. 3.18 Version: 1.4.0 9 9 Author URI: http://www.kaiarmstrong.com 10 10 */ … … 39 39 define('YAMLPATH', TOZRKPATH.'includes/yaml/'); 40 40 define('RUNKEEPERAPIPATH', TOZRKPATH.'includes/runkeeperAPI/'); 41 define(' CONFIGPATH', TOZRKPATH.'includes/');41 define('TOZRKCONFIGPATH', TOZRKPATH.'includes/'); 42 42 43 43 require(YAMLPATH.'lib/sfYamlParser.php'); … … 51 51 /* API initialization */ 52 52 $toz_rkAPI = new runkeeperAPI( 53 CONFIGPATH.'rk-api.yml' /* api_conf_file */53 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 54 54 ); 55 55 if ($toz_rkAPI->api_created == false) { … … 197 197 <input type="submit" class="button-primary" value="<?php _e('Reset Options') ?>" /></p> 198 198 </form></p> 199 <hr /> 200 <p><form method="post" action=""> 201 <p>Import a Single Post based on ID: 202 <input type="hidden" name="action" value="toz_rk_import_single" /> 203 <input type="text" name="rkActivity_id" value="Activity ID" class="regular-text code" /> 204 <input type="submit" class="button-primary" value="<?php _e('Import Single') ?>" /></p> 205 </form></p> 206 <hr /> 199 207 <p><form method="post" action=""> 200 208 <p>Import all (1000) of your previous activities: … … 205 213 <?php if ( isset($_POST['action']) && ( $_POST['action'] == 'toz_rk_import_old' )) { ?> 206 214 <h3>Historical Import</h3> 207 <?php toz_rk_import_old(); ?> 208 <?php } else { 209 //Do Nothing 215 <?php toz_rk_import_old(); 216 } else if ( isset($_POST['action']) && ( $_POST['action'] == 'toz_rk_import_single' )) { ?> 217 <h3>Single Activity Import</h3> 218 <?php toz_rk_import_single($_POST['rkActivity_id']); 219 } else { 220 //DO NOTHING 210 221 } 211 222 } ?> … … 228 239 function toz_rk_schedule_event() { 229 240 $toz_schedule_rkAPI = new runkeeperAPI( 230 CONFIGPATH.'rk-api.yml' /* api_conf_file */241 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 231 242 ); 232 243 if ($toz_schedule_rkAPI->api_created == false) { … … 272 283 } 273 284 285 //Import a Single Event based on ID 286 function toz_rk_import_single($rkActivity_id) { 287 $toz_import_single_rkAPI = new runkeeperAPI( 288 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 289 ); 290 if ($toz_import_single_rkAPI->api_created == false) { 291 echo 'error '.$toz_import_single_rkAPI->api_last_error; /* api creation problem */ 292 exit(); 293 } 294 295 $toz_rk_auth_code = get_option( 'toz_rk_auth_code' ); 296 if ( !empty($toz_rk_auth_code) ) { 297 $toz_import_single_rkAPI->setRunkeeperToken( get_option( 'toz_rk_access_token' ) ); 298 } 299 300 if ( !empty($rkActivity_id) ) { 301 302 $rkActivity_uri = '/fitnessActivities/' . $rkActivity_id; 303 304 $rkActivity_detailed = $toz_import_single_rkAPI->doRunkeeperRequest('FitnessActivity','Read', '', $rkActivity_uri); 305 $rkActivity_detailed_array = (array) $rkActivity_detailed; 306 307 toz_rk_post($rkActivity_detailed_array); 308 309 } else { 310 echo $toz_import_single_rkAPI->api_last_error; 311 print_r($toz_import_single_rkAPI->request_log); 312 } 313 } 274 314 275 315 //This is how we import all the old posts. 276 316 function toz_rk_import_old() { 277 317 $toz_import_rkAPI = new runkeeperAPI( 278 CONFIGPATH.'rk-api.yml' /* api_conf_file */318 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 279 319 ); 280 320 if ($toz_import_rkAPI->api_created == false) { -
runkeeper-activity-feed/trunk/runkeeper-wordpress-records-widget.php
r687180 r701681 38 38 39 39 $toz_widget_rkAPI = new runkeeperAPI( 40 CONFIGPATH.'rk-api.yml' /* api_conf_file */40 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 41 41 ); 42 42 if ($toz_widget_rkAPI->api_created == false) { … … 104 104 105 105 $toz_widget_form_rkAPI = new runkeeperAPI( 106 CONFIGPATH.'rk-api.yml' /* api_conf_file */106 TOZRKCONFIGPATH.'rk-api.yml' /* api_conf_file */ 107 107 ); 108 108 if ($toz_widget_form_rkAPI->api_created == false) {
Note: See TracChangeset
for help on using the changeset viewer.