Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Added support for showing past events.

  • Loading branch information...
commit 6b82eadfa640f47dcd8cc44d23360536275c375a 1 parent 139cf9e
Kasper Hartwich authored
View
1  songkick_concerts_and_festivals.php
@@ -132,6 +132,7 @@ function songkick_widget($args) {
}
add_action('admin_menu', 'songkick_admin_menu');
+
function songkick_admin_menu() {
add_options_page('Songkick Concerts and Festivals', 'Songkick', 'administrator', 'songkick-concerts-and-festivals', 'songkick_admin_settings');
}
View
21 songkick_past_events.php
@@ -0,0 +1,21 @@
+<?php
+require_once dirname(__FILE__) . '/songkick_events.php';
+
+class SongkickPastEvents extends SongkickEvents {
+ public $username;
+ public $apikey;
+
+ function SongkickPastEvents($apikey, $username) {
+ $this->SongkickEvents($apikey);
+ $this->username = trim($username);
+ }
+
+ function profile_url() {
+ return "http://www.songkick.com/users/$this->username";
+ }
+
+ protected function url($page, $per_page) {
+ return "$this->apiurl/users/$this->username/gigography.json?apikey=$this->apikey&per_page=$per_page&page=$page";
+ }
+}
+?>
View
4 songkick_presentable_events.php
@@ -5,6 +5,7 @@
require_once dirname(__FILE__) . '/songkick_artist_events.php';
require_once dirname(__FILE__) . '/songkick_metro_area_events.php';
require_once dirname(__FILE__) . '/songkick_venue_events.php';
+require_once dirname(__FILE__) . '/songkick_past_events.php';
class SongkickPresentableEvents {
@@ -29,6 +30,9 @@ function SongkickPresentableEvents($options) {
case 'user':
$this->songkick_events = new SongkickUserEvents($apikey, $songkick_id, $attendance);
break;
+ case 'past':
+ $this->songkick_events = new SongkickPastEvents($apikey, $songkick_id);
+ break;
case 'artist':
$this->songkick_events = new SongkickArtistEvents($apikey, $songkick_id);
break;
Please sign in to comment.
Something went wrong with that request. Please try again.