1
0
Fork 0
mirror of https://github.com/Yetangitu/ampache synced 2025-10-05 19:41:55 +02:00

some work on the rss feed stuff

This commit is contained in:
Karl 'vollmerk' Vollmer 2008-12-06 18:47:09 +00:00
parent 286840fbcc
commit 287a46f11e
5 changed files with 72 additions and 16 deletions

View file

@ -27,24 +27,38 @@
*/
class RSS {
private static $types = array('nowplaying',
'latestartist',
'latestalbum',
'popularalbum',
'popularartist',
'popularsong',
'recentlyplayed');
public $type;
public $data;
/**
* Constructor
* This takes a flagged.id and then pulls in the information for said flag entry
*/
public function __construct() {
public function __construct($type) {
// Nothing here for now
if (!RSS::valid_type($type)) {
$type = 'now_playing';
}
} // constructor
/**
* validate_type
* this returns a valid type for an rss feed, if the specified type is invalid it returns a default value
*/
public static function validate_type($type) {
$valid_types = array('now_playing','recently_played','latest_album','latest_artist','latest_song',
'popular_song','popular_album','popular_artist');
if (!in_array($type,$valid_types)) {
return 'now_playing';
}
return $type;
} // validate_type
/**
* get_display
* This dumps out some html and an icon for the type of rss that we specify