diff options
author | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-09 06:17:37 +0000 |
---|---|---|
committer | Karl 'vollmerk' Vollmer <vollmer@ampache.org> | 2007-08-09 06:17:37 +0000 |
commit | 796c2692d0cfa4641e0c47700371c24a01412ed1 (patch) | |
tree | 33d8921798b9603c177a0dd2a025e09f3f32691f /modules | |
parent | 905d434c669b634c6e070c60811a4a5ecfc1c67a (diff) | |
download | ampache-796c2692d0cfa4641e0c47700371c24a01412ed1.tar.gz ampache-796c2692d0cfa4641e0c47700371c24a01412ed1.tar.bz2 ampache-796c2692d0cfa4641e0c47700371c24a01412ed1.zip |
fixed lower paging horn, tweaked css for page-a-nation, added paging to playlists, genres and radio strations, added detection of purchase urls to find missing tracks on albums
Diffstat (limited to 'modules')
-rw-r--r-- | modules/infotools/openstrands.class.php | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/modules/infotools/openstrands.class.php b/modules/infotools/openstrands.class.php index b477b966..1994c084 100644 --- a/modules/infotools/openstrands.class.php +++ b/modules/infotools/openstrands.class.php @@ -163,8 +163,10 @@ class openStrands { * lookup_albums
* This returns the data for a given mystrands album (based on ID)
* If it's an array of ids pass as [] = ID, [] = ID
+ * You can optionally pass an alias to this, if you do you can get
+ * the 'buy' links as UserPurchaseURI
*/
- public function lookup_albums($ids) {
+ public function lookup_albums($ids,$alias='') {
// This allows multiple albums in a single query,
// so build it accordingly
@@ -179,6 +181,11 @@ class openStrands { $string = '?id=' . intval($ids);
}
+ // If they have passed an alias
+ if ($alias) {
+ $string .= '&alias=' . urlencode($alias);
+ }
+
$xml_doc = self::run_query("/lookup/albums$string");
// Set the right parent
@@ -194,8 +201,10 @@ class openStrands { * lookup_tracks
* This returns the data for a given mystrands track (based on ID)
* If it's an array of ids pass as [] = ID, [] = ID
+ * This can take an optional alias, if passed UserPurchaseURI will
+ * be returned
*/
- public function lookup_tracks($ids) {
+ public function lookup_tracks($ids,$alias='') {
// This allows for multiple entires, so build accordingly
if (is_array($ids)) {
@@ -209,6 +218,11 @@ class openStrands { $string = '?id=' . intval($ids);
}
+ // If they have passed an alias
+ if ($alias) {
+ $string .= '&alias=' . urlencode($alias);
+ }
+
$xml_doc = self::run_query("/lookup/tracks$string");
// Set the parent
@@ -224,11 +238,15 @@ class openStrands { * lookup_album_tracks
* This takes a album ID and then returns the track list for it
*/
- public function lookup_album_tracks($mystrands_album_id) {
+ public function lookup_album_tracks($mystrands_album_id,$alias='') {
$mystrands_album_id = intval($mystrands_album_id);
- $xml_doc = self::run_query("/lookup/album/tracks?id=$mystrands_album_id");
+ if ($alias) {
+ $alias_txt = '&alias=' . urlencode($alias);
+ }
+
+ $xml_doc = self::run_query("/lookup/album/tracks?id=$mystrands_album_id$alias_txt");
// Set the right parent
$this->_containerTag = 'AlbumTrack';
@@ -608,6 +626,7 @@ class openStrands { // Build the URL
$url = self::$base_url . $action . '&subscriberId=' . self::$auth_token;
+
$contents = file_get_contents($url);
return $contents;
|