Posted by markuslowe on April 14, 2008 at 7:08pm
Wondering if anyone uses the Station module Playlists to do music charting/reporting? If so, how do you accomplish this?
Thanks!
Wondering if anyone uses the Station module Playlists to do music charting/reporting? If so, how do you accomplish this?
Thanks!
Comments
Not currently
Hello. No, the 5.x versions do not provide this feature. I'm not sure if they're plans to to add this feature. It's something I've considered building but my customer has since gone off the air.
darn!
I would love to have a functionality like that. It would make my life easier and cut down on the amount of time I spend with my homebrew charting app.
rick
Operations Manager and general tech guy
WONY, 90.9FM Oneonta
Operations Manager and general tech guy
WONY, 90.9FM Oneonta
Count me in
That would be a huge time-saver for our station as well.
Here's the PHP Code
Here's the start of some charting code. It would be good to do a JOIN with {station_playlist} so that we can make use of the timestamp to only look at newer playlists.
<?php
$result = db_query('SELECT COUNT(t.artist), t.artist, t.album FROM {station_playlist_track} t GROUP BY t.album ORDER BY COUNT(t.artist) DESC');
while ($row = db_fetch_array($result)) {
echo $row['COUNT(t.artist)'] ." ". $row['artist']. " - ".$row['album'] . "<br />";
}
?>
Hmmm
Maybe something like this? In probably not-the-most-efficient code ever.
<?php
$result = db_query('SELECT station_playlist_track.artist, station_playlist_track.album, node.nid, node.created FROM node, station_playlist_track
WHERE TIMEDIFF(UNIX_TIMESTAMP(), node.created)<604800
GROUP BY station_playlist_track.album ORDER BY COUNT(station_playlist_track.album) DESC;');
while ($row = db_fetch_array($result)) {
echo $row['COUNT(station_playlist_track.artist)'] ." ". $row['artist']. " - ".$row['album'] . "<br />";
}
?>
Where you're looking for the TIMEDIFF to give you only the last 7 days (604800 seconds) worth of playlist data.
Rick
Operations Manager and general tech guy
WONY, 90.9FM Oneonta
Operations Manager and general tech guy
WONY, 90.9FM Oneonta
I started looking at doing
I started looking at doing this via Views but it'll take some work since making this a base table views would require a new primary key field which in turn would require updating the node edit form.