public function __construct($config) { parent::setVariables($config); $this->setURL(sprintf('http://ws.audioscrobbler.com/2.0/?method=user.getweeklyalbumchart&api_key=%s&user=%s', $this->key, $this->username)); $this->classes = array('premier', 'deuxieme', 'troisieme', 'quatrieme'); $this->setItemTemplate('<li{%classe%}><a class="clearfix" href="{%link%}"><img src="{%image%}" width="{%size%}" height="{%size%}" alt="{%title%}"><strong><span>{%artist%}</span> {%album%}</strong></a></li>' . "\n"); parent::__construct($config); }
/** * Method: __construct() * The constructor. * * Access: * public * * Parameters: * key - _string_ (Optional) Your Last.fm API Key. If blank, it will look for the <AWS_KEY> constant. * secret_key - _string_ (Optional) Your Last.fm API Secret Key. If blank, it will look for the <AWS_SECRET_KEY> constant. * subclass - _string_ (Optional) Don't use this. This is an internal parameter. * * Returns: * boolean FALSE if no valid values are set, otherwise true. */ public function __construct($key = null, $secret_key = null, $subclass = null) { // Set default values $this->cache_mode = false; $this->cache_ttl = 3600; $this->cache_path = './cache/'; $this->header_mode = false; return parent::__construct($key, $secret_key, $subclass); }
public function __construct($config) { parent::setVariables($config); $period = $config['period'] ? $config['period'] : 'overall'; $this->classes = array('premier', 'deuxieme', 'troisieme', 'quatrieme'); $this->setURL(sprintf('http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&api_key=%s&user=%s&period=%s', $this->key, $this->username, $period)); $this->setItemTemplate('<li{{{classe}}}><a class="clearfix" href="{{{link}}}"><img src="{{{image_medium}}}" width="{{{size}}}" height="{{{size}}}" alt="{{{title}}}"><strong><span>{{{artist}}}</span> {{{album}}}</strong></a></li>' . "\n"); parent::__construct($config); }
public function __construct($config) { parent::setVariables($config); $period = isset($config['period']) ? $config['period'] : 'overall'; $this->setURL(sprintf('http://ws.audioscrobbler.com/2.0/?method=user.gettopalbums&api_key=%s&user=%s&period=%s', $this->key, $this->username, $period)); $this->setItemTemplate('<li><a href="{{{link}}}"><img class="item-media-thumbnail" src="{{{image_medium}}}" width="{{{size}}}" height="{{{size}}}" alt="{{{title}}}"><strong>{{{artist}}}</strong> {{{album}}}</a> ({{{playcount}}}x)</li>' . "\n"); parent::__construct($config); }