Skip to Content
It is currently October 23rd, 2019, 11:17 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
PostPosted: October 3rd, 2019, 1:48 am 
Offline
New User
New User

Joined: October 3rd, 2019, 1:36 am
Posts: 9
I am using Sam Broadcaster's PHP website and it all works fine.
I notice that the website only shows the Album Art for audios files that are Type "S" (actual songs)...
however, what PHP page should I edit or where is it programmed to only read/display the audio details for Type "S" files?

I need the PHP website to also show the album art for Type "A" (advertisement category) and Type "V" (interview category).
Problem is that while an interview is playing, the playing.php page shows the last song details which is not related at all to the current interview or advertisement.

Ideal would be for the PHP website to show the album art for Type "S", Type "A" and Type "V" audio files when available.
Is it possible to edit the PHP code somewhere so the "playing.php" page also shows the album art for these categories?

Or is there a way that you know of to show the album art for our advertisements & interviews to not confuse listeners when they see a song's album art and the interview is totally unrelated? I just need a solution for this. Either by editing an existing PHP file, creating a new custom PHP page or by doing something in SAM Broadcaster to make this work.

I thought about simply making my Interviews as Type S, but then they get included in the royalty reports that we need to submit. Not ideal. Since I am new to SAM, has anyone found a workaround for this? Having them as category V for example is great for reports, etc. But the problem is they dont show in the now playing page. :(

Thank you in advance.


Top
 Profile  
Reply with quote  
PostPosted: October 4th, 2019, 6:04 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7878
Location: Aachen (Germany)
There should be a setting in the config file which songtypes will be shown.
The exact way to find that depends on the Version of the templates you're using.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
PostPosted: October 5th, 2019, 3:18 pm 
Offline
New User
New User

Joined: October 3rd, 2019, 1:36 am
Posts: 9
Mastacheata wrote:
There should be a setting in the config file which songtypes will be shown.
The exact way to find that depends on the Version of the templates you're using.


Thank you for the reply.
It seems that the only file that displays this is class.song.php.
It only asks for songtype on coming songs (line 33), recent songs (line 72) and playlist songs (line 172).
I edited these 3 sections but no changes happen. :(

Original code:
Code:
   public static function getComingSongs() {
      $db = Database::getInstance();

      // Return tracks in the queuelist table
      $select = $db->select()
                ->from(array('s' => 'songlist'),
                     array('*'))
                ->join(array('q' => 'queuelist'),
                     'q.songID = s.ID',
                     array('requestID'))
                ->where('s.songtype = ?', 'S') //Only return song of type S
                ->order('q.sortID ASC')
                ->limit(COMING_UP_COUNT);

      $songs = array();
      try {
         $songs = $db->fetchAll($select);
      } catch (Zend_Db_Adapter_Exception $ex) {
         echo "Please verify database settings.<br />";
         exit;
      }

      $comingSongs = array();
      foreach ($songs as $songKey => $song) {
         $comingSongs[$songKey] = new self();
         $comingSongs[$songKey]->setValues($song);
      }
      return $comingSongs;
   }


I changed that top original code to this:

Code:
   public static function getComingSongs() {
      $db = Database::getInstance();

      // Return tracks in the queuelist table
      $select = $db->select()
                ->from(array('s' => 'songlist'),
                     array('*'))
                ->join(array('q' => 'queuelist'),
                     'q.songID = s.ID',
                     array('requestID'))
                ->where('s.songtype = ?', 'S', 'A', 'N', 'V') //Should return song of type S, A, N, V
                ->order('q.sortID ASC')
                ->limit(COMING_UP_COUNT);

      $songs = array();
      try {
         $songs = $db->fetchAll($select);
      } catch (Zend_Db_Adapter_Exception $ex) {
         echo "Please verify database settings.<br />";
         exit;
      }

      $comingSongs = array();
      foreach ($songs as $songKey => $song) {
         $comingSongs[$songKey] = new self();
         $comingSongs[$songKey]->setValues($song);
      }
      return $comingSongs;
   }


And nothing happens on the coming, recent or playlist pages.
Would there be any other place that this is coming from that is not from this class.song.php file?

Also, the currentsong php code in this file has no section asking for songtype.
This is all it shows for current song... nothing mentioned on songtype...
Code:
   public static function getCurrentSong() {
      if (count(self::$songs) == 0) {
         self::getRecentSongs();
      }

      reset(self::$songs);
      return current(self::$songs);
   }



FYI, in my dbconfig.xml.php file, it shows me using version 3.4.2 of the template. I am guessing it should be the most recent since I reinstalled SAM to the latest and these files are what are in the install.


Top
 Profile  
Reply with quote  
PostPosted: October 5th, 2019, 4:29 pm 
Offline
New User
New User

Joined: October 3rd, 2019, 1:36 am
Posts: 9
Okay I have it displaying song types on Coming & Recent.
This is what I did on the coming:
Code:
   public static function getComingSongs() {
      $db = Database::getInstance();

      // Return tracks in the queuelist table
      $select = $db->select()
                ->from(array('s' => 'songlist'),
                     array('*'))
                ->join(array('q' => 'queuelist'),
                     'q.songID = s.ID',
                     array('requestID'))
                ->where('s.songtype IN (?)', array('S', 'A', 'N', 'V')) //Returns song of type S, A, N and V
                ->order('q.sortID ASC')
                ->limit(COMING_UP_COUNT);

      $songs = array();
      try {
         $songs = $db->fetchAll($select);
      } catch (Zend_Db_Adapter_Exception $ex) {
         echo "Please verify database settings.<br />";
         exit;
      }

      $comingSongs = array();
      foreach ($songs as $songKey => $song) {
         $comingSongs[$songKey] = new self();
         $comingSongs[$songKey]->setValues($song);
      }
      return $comingSongs;
   }


I had a dumb moment by not adding it as an array. haha.
Now any idea how to get these showing on the Currently playing?

Thanx.


Top
 Profile  
Reply with quote  
PostPosted: October 5th, 2019, 4:36 pm 
Offline
New User
New User

Joined: October 3rd, 2019, 1:36 am
Posts: 9
Columban wrote:
Now any idea how to get these showing on the Currently playing?


Okay nevermind...
By replacing with this code to the Recent section, it makes it work on the now playing.
Code:
->where('s.songtype IN (?)', array('S', 'A', 'N', 'V')) //Returns song of type S, A, N and V


So basically I added this code into the coming and recent songs.
This makes it display the artwork for Normal songs (S), Advertisements (A), Syndicated news (N) & Interviews (V) in the Coming Songs, Now playing & Recent songs list.

I did not add this code to the Playlist section because I do not want people to be able to see or search for Ads, News or Interviews.

Thank you anyway. I figured it out.

Hope this helps someone else.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group