load to // fill them out private $feed_url; private $maxitems; /** * Constructor * This function does nothing... */ public function __construct() { return true; } /** * install * This is a required plugin function. It inserts our preferences * into Ampache */ public function install() { // Check and see if it's already installed if (Preference::exists('rssview_feed_url')) { return false; } Preference::insert('rssview_feed_url','RSS Feed url','','25','string','plugins'); Preference::insert('rssview_max_items','RSS Feed max items','5','25','integer','plugins'); return true; } /** * uninstall * This is a required plugin function. It removes our preferences from * the database returning it to its original form */ public function uninstall() { Preference::delete('rssview_feed_url'); Preference::delete('rssview_max_items'); return true; } /** * upgrade * This is a recommended plugin function */ public function upgrade() { return true; } /** * display_home * This display the module in home page */ public function display_home() { $xmlstr = file_get_contents($this->feed_url); $xml = simplexml_load_string($xmlstr); if ($xml->channel) { UI::show_box_top($xml->channel->title); $i = 0; echo '
';
echo ' ';
echo '';
echo ' ' . date("Y/m/d H:i:s", strtotime($item->pubDate)) . ' ';
echo ''; echo ' ';
if (isset($item->image)) {
echo ' ';
echo ''. $item->description .' ';
echo ' |