Skip to content
Permalink
Browse files

fixed getLastPlays

  • Loading branch information...
RocketMan committed Dec 18, 2018
1 parent 2c97a73 commit bfbb1626cc4a9dca685d1365151a60de7a00c063
Showing with 3 additions and 6 deletions.
  1. +1 −1 engine/impl/Playlist.php
  2. +2 −5 ui/Playlists.php
@@ -280,7 +280,7 @@ public function getLastPlays($tag, $count=0) {
if($count)
$stmt->bindValue(2, (int)$count, \PDO::PARAM_INT);
return $this->execute($stmt);
return $this->executeAndFetchAll($stmt);
}
public function getRecentPlays(&$result, $airname, $count) {
@@ -1597,17 +1597,14 @@ public function emitViewDate() {
}
public function viewLastPlays($tag, $count=0) {
$results = Engine::api(IPlaylist::class)->getLastPlays($tag, $count);
if($results) {
$plays = Engine::api(IPlaylist::class)->getLastPlays($tag, $count);
if($plays) {
echo "<TABLE WIDTH=\"100%\">\n";
echo " <TR><TH ALIGN=LEFT CLASS=\"secdiv\">Recent Airplay</TH>";
echo "</TR>\n</TABLE>\n";
echo "<TABLE CELLPADDING=4 CELLSPACING=0 BORDER=0>\n";
while($row = $results->fetch())
$plays[] = $row;
// Setup date format differently if plays extend into another year
$now = getdate(time());
list($y,$m,$d) = explode("-", $plays[sizeof($plays)-1]["showdate"]);

0 comments on commit bfbb162

Please sign in to comment.
You can’t perform that action at this time.