From cfa7b083f946f0db8d278b0d7f2ef887e7a619e3 Mon Sep 17 00:00:00 2001 From: Justin Foell Date: Sun, 17 Feb 2013 21:19:08 -0600 Subject: [PATCH] Fixed broken references after moving things around a bit --- lib/LatestRidesWidget.class.php | 67 ++++++++++++++++++++++++++++++--- lib/Settings.class.php | 34 ++++++++--------- lib/Strava.class.php | 56 +-------------------------- readme.txt | 15 +++++--- wp-strava.php | 6 +-- 5 files changed, 92 insertions(+), 86 deletions(-) diff --git a/lib/LatestRidesWidget.class.php b/lib/LatestRidesWidget.class.php index a7a2033..e9eb695 100644 --- a/lib/LatestRidesWidget.class.php +++ b/lib/LatestRidesWidget.class.php @@ -4,14 +4,15 @@ * WP Strava Latest Rides Widget Class */ class WPStrava_LatestRidesWidget extends WP_Widget { - function __construct() { + + public function __construct() { $widget_ops = array('classname' => 'LatestRidesWidget', 'description' => __( 'Will publish your latest rides activity from strava.com.') ); parent::__construct('wp-strava', $name = 'Strava Latest Rides', $widget_ops); wp_enqueue_style('wp-strava'); } /** @see WP_Widget::widget */ - function widget($args, $instance) { + public function widget($args, $instance) { extract($args); //$widget_id = $args['widget_id']; @@ -24,13 +25,13 @@ class WPStrava_LatestRidesWidget extends WP_Widget { ?> - + strava_request_handler($strava_search_option, $strava_search_id, $strava_som_option, $quantity); ?> get_field_id('title'); ?>">

+

getLatestRides($strava_search_option, $strava_search_id, $quantity); - $rides_details = $strava_rides->getRidesDetails($strava_som_option); - - if ($strava_som_option == "metric") { - $units = array( - 'elapsedTime' => __('hours','wp-strava'), - 'movingTime' => __('hours','wp-strava'), - 'distance' => __('km','wp-strava'), - 'averageSpeed' => __('km/h','wp-strava'), - 'maximumSpeed' => __('km/h','wp-strava'), - 'elevationGain' => __('meters','wp-strava') - ); - } elseif ($strava_som_option == "english") { - $units = array( - 'elapsedTime' => __('hours','wp-strava'), - 'movingTime' => __('hours','wp-strava'), - 'distance' => __('miles','wp-strava'), - 'averageSpeed' => __('miles/h','wp-strava'), - 'maximumSpeed' => __('miles/h','wp-strava'), - 'elevationGain' => __('feet','wp-strava') - ); - } - - $response .= ""; - } - return $response; - } // Function strava_request_handler - } \ No newline at end of file diff --git a/readme.txt b/readme.txt index de84fa1..75afa85 100755 --- a/readme.txt +++ b/readme.txt @@ -1,18 +1,23 @@ === Plugin Name === -Contributors: cmanon (@cmanon) +Contributors: cmanon (@cmanon), jrfoell Donate link: http://cmanon.com/ -Tags: bycicle, strava +Tags: bicycle, cycling, strava Requires at least: 2.0 -Tested up to: 3.3.2 +Tested up to: 3.5.1 Stable tag: 0.62 +License: GPLv2 or later -This plugin is inteneded to show your strava.com information in your wordpress blog. +This plugin is intended to show your strava.com information in your WordPress site. == Description == -This plugin uses the REST strava.com API to pull the data out and show the information in your wordpress blog. +This plugin uses the REST strava.com API to pull the data out and show the information in your WordPress site. == Changelog == + += 0.70 = +Use WordPress Settings API for settings page + = 0.62 = Refactor some code. Fixed several bugs. diff --git a/wp-strava.php b/wp-strava.php index 45ca155..a0bf823 100755 --- a/wp-strava.php +++ b/wp-strava.php @@ -34,9 +34,9 @@ if( file_exists( WPSTRAVA_PLUGIN_DIR . 'lang/' . get_locale() . '.mo' ) ) { } require_once WPSTRAVA_PLUGIN_DIR . 'lib/Strava.class.php'; -$wpstrava = WPStrava::getInstance(); +$wpstrava = WPStrava::get_instance(); -/* +//@TODO only load these when needed function load_styles() { // Register a personalized stylesheet wp_register_style('wp-strava-style', WPSTRAVA_PLUGIN_URL . 'css/wp-strava.css' ); @@ -50,5 +50,3 @@ function load_scripts() { //wp_enqueue_script('google-maps', 'http://maps.google.com/maps/api/js?sensor=false'); } add_action('wp-enqueue_script', 'load_scripts'); - -*/ \ No newline at end of file