Skip to Content
It is currently December 3rd, 2021, 5:39 pm

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: July 10th, 2021, 1:44 pm 
Offline
Senior User
Senior User

Joined: January 1st, 2009, 8:50 pm
Posts: 145
Hi! I'm finally getting around to updating my stations to the full "/samPHPweb/" files (being forced to, actually, since my web provider is dropping php 5.6.40). My sites use a mixture of the old "/php/" and the newer "/samPHPweb/" files because I could never get the "/samPHPweb/web/playing.php" page to ever show up, although the "/samPHPweb/web/playlist.php" page worked just fine for me. Since the "/php/" versions of that worked (in php 5.6.40), I just kept using that. Well, now I'm being forced to change so I started digging around some more. Luckily I finally found the reason the playing.php wasn't working, and am working on updating all of my code snippets to use the newer code.

My issue...
I can get the dedication name and message to show up for the current song, and for the previous songs, but I can't get it to show up for the upcoming songs. I want more than just "~requested~" in the upcoming songs list. It acts like there is a different keyword (or the keywords are missing) for "dedicationName" and "dedicationMessage" for $comingSong. They work just fine for $currentSong and $recentSong.

I looked through the class.song.php file and I see that getComingSongs does not have dedication information in it like the getRecentSongs function does. I am absolutely horrible about dbase expressions, but I tried to add the lines from getRecent into getComing and that totally bombs the page.

Any thoughts on how I can get this functionality? It works in the old "/php/" version, and I really want to continue seeing the name/message in the new version.

Thanks much!
Terry


Top
 Profile  
Reply with quote  
PostPosted: July 10th, 2021, 2:04 pm 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 8298
Location: Cologne (Germany)
Go to code/classes/class.song.php, copy lines 88-91 and insert them after line 48.

Then change h.requestID to q.requestID in what's now line 50.

In the end it should look somewhat like this:
Code:
                    $select = $db->select()
                                             ->from(array('s' => 'songlist'),
                                                            array('*'))
                                             ->join(array('q' => 'queuelist'),
                                                            'q.songID = s.ID',
                                                            array('requestID'))
                                             ->joinLeft(array('r' => 'requestlist'),
                                                               'r.id = q.requestID',
                                                   array('dedicationName' => 'name',
                                                      'dedicationMessage' => 'msg'))
                                             ->where('s.songtype = ?', 'S') //Only return song of type S
                                             ->order('q.sortID ASC')
                                             ->limit(COMING_UP_COUNT);


The templates don't connect the request table to the upcoming tracks by default.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

Shop for readymade PAL scripts by countrywesterndj - Or get a custom script made by me (or others)

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


Top
 Profile  
Reply with quote  
PostPosted: October 14th, 2021, 10:45 am 
Offline
Senior User
Senior User

Joined: January 1st, 2009, 8:50 pm
Posts: 145
Mastacheata wrote:
Go to code/classes/class.song.php, copy lines 88-91 and insert them after line 48.

Then change h.requestID to q.requestID in what's now line 50.

In the end it should look somewhat like this:
Code:
                    $select = $db->select()
                                             ->from(array('s' => 'songlist'),
                                                            array('*'))
                                             ->join(array('q' => 'queuelist'),
                                                            'q.songID = s.ID',
                                                            array('requestID'))
                                             ->joinLeft(array('r' => 'requestlist'),
                                                               'r.id = q.requestID',
                                                   array('dedicationName' => 'name',
                                                      'dedicationMessage' => 'msg'))
                                             ->where('s.songtype = ?', 'S') //Only return song of type S
                                             ->order('q.sortID ASC')
                                             ->limit(COMING_UP_COUNT);


The templates don't connect the request table to the upcoming tracks by default.



Thanks!!
Although my line numbers, and the code to copy didn't match, I found that mine was missing the joinLeft section. I added that and now it works.
Thanks a bunch!
Tjoe


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

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 21 guests


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