diff --git a/plugins/function.topartists.php b/plugins/function.topartists.php new file mode 100644 index 0000000..08bec3a --- /dev/null +++ b/plugins/function.topartists.php @@ -0,0 +1,36 @@ + '.strtotime("-3 month").' GROUP BY artist ORDER BY COUNT(artist) DESC LIMIT 15'; + + $data = $adodb->CacheGetAll(600, $query); + /*foreach($data as &$item) { + $item['trackurl'] = Server::getTrackURL($artist, null, $item['track']); + if (!$item['image']) { + $item['image'] = $default_album_image; + } else { + $item['image'] = resolve_external_url($item['image']); + } + }*/ + + $template->assign(topartists, $data); +} +?> diff --git a/plugins/function.toptracks.php b/plugins/function.toptracks.php new file mode 100644 index 0000000..28032c6 --- /dev/null +++ b/plugins/function.toptracks.php @@ -0,0 +1,36 @@ + '.strtotime("-3 month").' GROUP BY track ORDER BY COUNT(track) DESC LIMIT 15'; + + $data = $adodb->CacheGetAll(600, $query); + /*foreach($data as &$item) { + $item['trackurl'] = Server::getTrackURL($artist, null, $item['track']); + if (!$item['image']) { + $item['image'] = $default_album_image; + } else { + $item['image'] = resolve_external_url($item['image']); + } + }*/ + + $template->assign(toptracks, $data); +} +?> diff --git a/templates/user-profile.tpl b/templates/user-profile.tpl index 2788ba7..d1320be 100644 --- a/templates/user-profile.tpl +++ b/templates/user-profile.tpl @@ -19,6 +19,22 @@

Recent plays

{include file="tracklist.tpl" class=#table# items=$userscrobbles fimage=true fstream=true fartist=true flove=true ftime=true} +{topartists userid=$me->uniqueid limit=10} +

Top Artists

+ + +{toptracks userid=$me->uniqueid limit=10} +

Top Tracks

+ + {if !empty($lovedArtists)}

{t name=$me->name}Free artists that %1 loves{/t}