windhamdavid 5 years ago
parent
commit
a20e2ce2b9
2 changed files with 110 additions and 105 deletions
  1. 48 44
      page-card.php
  2. 62 61
      page-music.php

File diff suppressed because it is too large
+ 48 - 44
page-card.php


+ 62 - 61
page-music.php

@@ -18,6 +18,67 @@ get_header(); ?>
 						</div>
 					</div>
 					<div class="row">
+						<div class="col-sm-12">							
+							<?php class NowPlaying{
+							    private $url;
+							    private $noTrackPlayingMessage;
+							    function __construct($user, $api_key){
+							        $this->url  = 'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1';
+							        $this->url .= '&user=' . $user . '&api_key=' . $api_key;
+							        $this->noTrackPlayingMessage = 'All Quiet - Silence is Golden';
+							    }
+							    public function getNowPlaying(){
+							        $xml = simplexml_load_file($this->url);
+							        $track = $xml->recenttracks->track;
+							        $nowplaying = $track->attributes()->nowplaying;
+							        if($nowplaying){
+							            $artist = $track->artist;
+							            $songname = $track->name;
+										$albumname = $track->album;
+										$albumart = $track->album->image[2];
+							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . $artist . ' - ' . $songname;
+							        }
+							        else{
+							            return $this->noTrackPlayingMessage;
+							        }
+							    }
+							    public function setNoTrackPlayingMessage($messageIn){
+							        $this->noTrackPlayingMessage = $messageIn;
+							    }
+							} 
+							$nowPlaying = new NowPlaying('windhamdavid', 'e12ea1d0253898ee9a93edfe42ffdeab');
+							?>
+							<h5 class="cm-type"><em>Now Playing</em></h5>
+							
+							<div class="panel panel-default">
+								<div class="panel-body">
+									<div id="player">
+										<div id="song-information">
+											<div class="row">
+												<div class="col-xs-6">
+													<span id="amplitude-now-playing-listeners">Listeners: <span id="listeners">00</span> - Peak: <span id="peak-listeners">00</span></span><br>
+													<span id="amplitude-now-playing-bitrate">Bitrate: <span id="bitrate">00</span> Kbps 44.100 Khz</span>
+												</div>
+												<div class="col-xs-6">
+													<span id="amplitude-now-playing-name">Current track: <span id="track">* Off Air *</span></span><br>
+												</div>
+											</div>
+										</div>
+										<input class="bar" type="range" id="amplitude-volume-slider" value="90"/>
+									<div id="controls">
+										<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
+											<span id="amplitude-current-time">0:00</span>
+										</div>
+										
+									</div>
+								</div>
+								<div class="panel-footer">
+									<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
+								</div>
+							</div>
+						</div>
+					</div>
+					<div class="row">
 						<div class="col-sm-2">
 							<h5 class="cm-type"><em>Averages:</em></h5>
 						</div>
@@ -102,67 +163,7 @@ get_header(); ?>
 						</div>
 					</div>
 					
-					<div class="row">
-						<div class="col-sm-12">							
-							<?php class NowPlaying{
-							    private $url;
-							    private $noTrackPlayingMessage;
-							    function __construct($user, $api_key){
-							        $this->url  = 'http://ws.audioscrobbler.com/2.0/?method=user.getrecenttracks&limit=1';
-							        $this->url .= '&user=' . $user . '&api_key=' . $api_key;
-							        $this->noTrackPlayingMessage = 'All Quiet - Silence is Golden';
-							    }
-							    public function getNowPlaying(){
-							        $xml = simplexml_load_file($this->url);
-							        $track = $xml->recenttracks->track;
-							        $nowplaying = $track->attributes()->nowplaying;
-							        if($nowplaying){
-							            $artist = $track->artist;
-							            $songname = $track->name;
-										$albumname = $track->album;
-										$albumart = $track->album->image[2];
-							            return '<img src="../../wp-content/themes/dw/img/eq.gif"> ' . $artist . ' - ' . $songname;
-							        }
-							        else{
-							            return $this->noTrackPlayingMessage;
-							        }
-							    }
-							    public function setNoTrackPlayingMessage($messageIn){
-							        $this->noTrackPlayingMessage = $messageIn;
-							    }
-							} 
-							$nowPlaying = new NowPlaying('windhamdavid', 'e12ea1d0253898ee9a93edfe42ffdeab');
-							?>
-							<h5 class="cm-type"><em>Now Playing</em></h5>
-							
-							<div class="panel panel-default">
-								<div class="panel-body">
-									<div id="player">
-										<div id="song-information">
-											<div class="row">
-												<div class="col-xs-6">
-													<span id="amplitude-now-playing-listeners">Listeners: <span id="listeners">00</span> - Peak: <span id="peak-listeners">00</span></span><br>
-													<span id="amplitude-now-playing-bitrate">Bitrate: <span id="bitrate">00</span> Kbps 44.100 Khz</span>
-												</div>
-												<div class="col-xs-6">
-													<span id="amplitude-now-playing-name">Current track: <span id="track">* Off Air *</span></span><br>
-												</div>
-											</div>
-										</div>
-										<input class="bar" type="range" id="amplitude-volume-slider" value="90"/>
-									<div id="controls">
-										<div id="amplitude-play-pause" class="amplitude-paused"></div><br>
-											<span id="amplitude-current-time">0:00</span>
-										</div>
-										
-									</div>
-								</div>
-								<div class="panel-footer">
-									<h5><?php echo $nowPlaying->getNowPlaying(); ?></h5>
-								</div>
-							</div>
-						</div>
-					</div>
+					
 					<div class="row">
 						<div class="col-sm-12">
 							<h5 class="cm-type"><em>Recently Played</em></h5>