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); }
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 setVariables($config) { parent::setVariables($config); $this->size = $config['size']; }