Esempio n. 1
0
 public static function withPlaylists()
 {
     $query = "\n\t\t\t\tSELECT\n\t\t\t\t\tChannels.*\n\t\t\t\tFROM\n\t\t\t\t\tz_youtube_channels Channels\n\t\t\t\tWHERE\n\t\t\t\t\tChannels.status = " . static::STATUS_ACTIVE;
     $channels = array();
     $result = static::execute($query)->group();
     if ($result) {
         foreach ($result as $channelId => $channel) {
             $channels[$channelId] = array_merge($channel[0], array('id' => $channelId));
         }
     }
     $playlists = PlaylistsModel::all(array('conditions' => array('channel_id' => array_keys($channels), 'status' => PlaylistsModel::STATUS_ACTIVE), 'order' => array('title' => 'ASC')))->toArray();
     if ($playlists) {
         foreach ($playlists as $playlist) {
             if (isset($channels[$playlist['channel_id']])) {
                 $channels[$playlist['channel_id']]['playlists'][] = $playlist;
             }
         }
     }
     return $channels;
 }
Esempio n. 2
0
<html>
	<head>
		<title>Mandolin <?php 
echo $v;
?>
</title>
	</head>
	<body>
		<center>
			<p>Mandolin <?php 
echo $v;
?>
</p>
			<p><img src="./client/images/logo.jpg" alt="Mandolin" /></p>
			<div id="plList">
				<?php 
$userName = $_SESSION["username"];
include_once './models/playlists.php';
$mPlaylist = new PlaylistsModel($userName);
$resultArr = $mPlaylist->get(null);
//print_r($resultArr);
for ($i = 0; $i < count($resultArr); $i++) {
    echo "<a href='./server/music.php?a=play&pl_id=" . $resultArr[$i]['id'] . "&SID=" . $_SESSION["id"] . "'>" . $resultArr[$i]['name'] . "</a><br />\n";
}
unset($mPlaylist);
?>
			</div>
		</center>
	</body>
</html>