mirror of
https://github.com/10h30/wp-strava.git
synced 2026-07-16 21:23:48 +09:00
Changes for better language support
Cleaned up more formatting
This commit is contained in:
+15
-16
@@ -4,20 +4,20 @@
|
||||
*/
|
||||
class WPStrava_Rides {
|
||||
|
||||
const RIDES_URL = "http://app.strava.com/rides/";
|
||||
const ATHLETES_URL = "http://app.strava.com/athletes/";
|
||||
|
||||
const RIDES_URL = 'http://app.strava.com/rides/';
|
||||
const ATHLETES_URL = 'http://app.strava.com/athletes/';
|
||||
|
||||
public function getRide( $rideId ) {
|
||||
return WPStrava::get_instance()->api->get( "activities/{$rideId}" );
|
||||
} // getRideDetails
|
||||
|
||||
public function getRides( $club_id = NULL, $quantity = NULL ) {
|
||||
|
||||
public function getRides( $club_id = null, $quantity = null ) {
|
||||
$api = WPStrava::get_instance()->api;
|
||||
|
||||
$data = NULL;
|
||||
$data = null;
|
||||
|
||||
$args = $quantity ? array( 'per_page' => $quantity ) : null;
|
||||
|
||||
$args = $quantity ? array( 'per_page' => $quantity ) : NULL;
|
||||
|
||||
//Get the json results using the constructor specified values.
|
||||
if ( is_numeric( $club_id ) ) {
|
||||
$data = $api->get( "clubs/{$club_id}/activities", $args );
|
||||
@@ -27,16 +27,16 @@ class WPStrava_Rides {
|
||||
|
||||
if ( is_wp_error( $data ) )
|
||||
return $data;
|
||||
|
||||
|
||||
if ( is_array( $data ) )
|
||||
return $data;
|
||||
|
||||
return array();
|
||||
|
||||
|
||||
return array();
|
||||
|
||||
} // getRides
|
||||
|
||||
public function getRidesLongerThan( $rides, $dist ) {
|
||||
$som = WPStrava_SOM::get_som();
|
||||
$som = WPStrava_SOM::get_som();
|
||||
$meters = $som->distance_inverse( $dist );
|
||||
|
||||
$long_rides = array();
|
||||
@@ -45,9 +45,8 @@ class WPStrava_Rides {
|
||||
$long_rides[] = $ride_info;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
return $long_rides;
|
||||
}
|
||||
|
||||
|
||||
} // class Rides
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user