Skip to Content
It is currently February 26th, 2020, 6:28 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
PostPosted: October 17th, 2008, 1:25 am 
Offline
Senior User
Senior User

Joined: April 24th, 2008, 2:26 pm
Posts: 152
Location: Huntington, WV
Hi.

I have been working on two scripts that would do display the Top Artists (most played by play count) it's the top ten requests html document modified. I'm posting the code here because I'd like to know if I have left anything out and where should I put the Songtype = "S" as I don't want to display PSAs and Sweepers.

Code:
<!--count_played.LIMIT=10-->
<!--count_played.SQL="SELECT songlist.ID, songlist.count_played, songlist.artist
                         count(*) as cnt
                        FROM history, songlist 
         GROUP BY songlist.ID, songlist.artist
         ORDER BY songlist.count_played DESC"-->


<!--LOOP_HEADER-->
<table width="100%" bgcolor="$lightrow$" border="0" cellspacing="0" cellpadding="5">
<tr bgcolor="$darkrow$"><td nowrap><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#555555">Top Artists</font></b></td></tr>
<tr><td nowrap>
<!--LOOP_ROW-->
<!--LOOP_FOOTER-->
</td></tr>
</table>
<!--LOOP_END-->


I've had this script running for a few hours now and I've seen it being uploaded via the SAM FTP function but it has yet to output anything @ http://bfaradio.net/playlist/topartists.html
I have a feeling that I'm leaving something important out but I'm not sure what.

This next script is the playing html document that comes with SAM. It was modified to show the time and date that the song was played.

This is the code.

Code:
<!--include("_config.html")-->

<SCRIPT LANGUAGE="JavaScript">
<!---
 var refreshID = "";
 refreshID = setTimeout("DoRefresh()", $timeout$);
 
function DoRefresh()
{
  var buster = Math.random();
  document.location.href = 'playing.html?buster='+buster;
}
//--->
</SCRIPT>

<table border="0" width="98%" cellspacing="0" cellpadding="4">
  <tr bgcolor="#002E5B">
    <td colspan="1" nowrap align="left">
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b>Currently Playing</b></font>
    </td>
   <td colspan="3" nowrap align="center">
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b>Links</b></font>
    </td>
    <td nowrap align="left">
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b>Album</b></font>
    </td>
   <td nowrap align="Right">
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b>Time</b></font>
    </td>
        <td nowrap align="Right">
      <p><font face="Verdana, Arial, Helvetica, sans-serif" size="1" color="#FFFFFF"><b>Date Played</b></font>
    </td>
  </tr>

  <tr bgcolor="$darkrow$">
 

    <td><font size="2" color="#003366"><small>$song.combine$</small></font></td>
    <td nowrap width="1%">
      <p align="center"><font size="2" color="#003366"><a href="$song.buycd$" target="_blank"><img
    src="images/buy.gif" alt="Buy this CD now!" border="0"></a></font>
    </td>
    <td nowrap width="1%">
      <p align="center"><font size="2" color="#003366"><a href="$song.website$" target="_blank"><img
    src="images/home.gif" alt="Artist homepage" border="0"></a></font>
    </td>
   
   <td nowrap align="center" nowrap width="1%">
      <font size="2" color="#003366"><a href="javascript:songinfo($song.songID$)"><img
    src="images/info.gif" alt="Song information" border="0"></a></font>
    </td>
   
    <td nowrap><font color="#003366" size="2"><small>$song.album$</small></font></td>
    <td nowrap>
      <p align="right"><font color="#003366" size="2"><small><strong>$song.mmss$</strong></small></font>
    </td>
  </tr>
 

<!--LOOP(queue,2)-->
<!--LOOP_HEADER-->
<tr bgcolor="$lightrow$"><td colspan="6">
<b><font size="2" color="#777777">Coming up:</font></b>
<font size="2" color="003366"><b>
<!--LOOP_ROW-->
$queue.artist$&nbsp;
<!--LOOP_FOOTER-->
</b></font></td></tr>
<!--LOOP_END-->
 
  <tr bgcolor="#002E5B">
    <td colspan="6" nowrap>
      <p align="left"><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#FFFFFF">Recently
        played songs</font></b>
    </td>
  </tr>
 
<!--LOOP(history,1,10)-->
<!--LOOP_ROW-->
<tr bgcolor="$darkrow$">
    <td><font size="2" color="#003366"><small>$history.combine$</small></font></td>
    <td nowrap width="1%">
      <p align="center"><font size="2" color="#003366"><a href="$history.buycd$" target="_blank"><img
    src="images/buy.gif" alt="Buy this CD now!" border="0"></a></font>
    </td>
    <td nowrap width="1%">
      <p align="center"><font size="2" color="#003366"><a href="$history.website$" target="_blank"><img
    src="images/home.gif" alt="Artist homepage" border="0"></a></font>
    </td>
   
   <td nowrap align="center" nowrap width="1%"></td>
   
    <td nowrap><font color="#003366" size="2"><small>$history.album$</small></font></td>
    <td nowrap>
      <p align="right"><font color="#003366" size="2"><small><strong>$history.mmss$</strong></small></font>
    </td>
     <p align="right"><font color="#003366" size="2"><small><strong>$history.date_played$</strong></small></font>
    </td>
  </tr>
<!--LOOP_END--> 
 
</table>

</td><td valign='top' align='center'>
</td>


I think I put the date_played in the wrong place because time and date of tracks played aren't lined up with the rest of the information - http://bfaradio.net/playlist/playing2.html

What did I do wrong?

Any help that can be provided to steer me in the right direction would be greatly appreciated as I'm new to code and script. Thanks in advance.

Michael Trueheart


Last edited by Elevatorboy on October 17th, 2008, 7:18 am, edited 1 time in total.
Changed tags to improve readability of code


Top
 Profile  
Reply with quote  
PostPosted: October 18th, 2008, 8:20 am 
Offline
SVS Member
SVS Member

Joined: May 5th, 2008, 4:53 pm
Posts: 300
Before Group BY try to insert
where songtype = 'S'

_________________
Ivan Radolović - Spacial Volunteer Support (SVS)


Top
 Profile  
Reply with quote  
PostPosted: October 18th, 2008, 9:17 am 
Offline
Senior User
Senior User

Joined: April 24th, 2008, 2:26 pm
Posts: 152
Location: Huntington, WV
Thanks, I'll try that. Though the script still isn't outputing anything.


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 6 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:  
Powered by phpBB® Forum Software © phpBB Group