Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. <?
  2. $stamp = mktime(0,0,0,date('m')-$requestdays,date('d'),date('Y'));
  3. $now = date('Y-m-d H:i:s',$stamp);
  4.  
  5. //Handle different types of databases' special needs
  6. switch($db->login["Type"])
  7. {
  8. case "ibase" : $orderby = "ORDER BY count(songlist.ID) DESC"; break;
  9. case "mysql" :
  10. default : $orderby = "ORDER BY cnt DESC"; break;
  11. }
  12.  
  13. $now = $db->FormatTimestamp($now);
  14. $db->open("SELECT songlist.ID, songlist.title, songlist.artist, count(songlist.ID) as cnt
  15. FROM requestlist, songlist
  16. WHERE (requestlist.songID = songlist.ID) AND
  17. (requestlist.code=200) AND
  18. (requestlist.t_stamp>=$now)
  19. GROUP BY songlist.ID, songlist.artist, songlist.title
  20. $orderby",20);
  21.  
  22. if($db->num_rows()>0)
  23. {
  24.  
  25. function PutRow($song)
  26. {
  27. global $i;
  28. Preparesong($song);
  29.  
  30. ?>
  31.  
  32. <font size="2" color="#003366"><small><? echo $i; ?>.
  33. <a href="javascript:songinfo(<? echo $song["songid"]; ?>)"><? echo $song["artist"]; ?></a></small></font> <font size="2" color="#9F9F9F"><small>(<? echo $song["cnt"]; ?>)</small></font><br>
  34. <font size="2" color="#003366"><small>&nbsp;&nbsp;&nbsp;&nbsp;<? echo $song["title"]; ?></small></font><br>
  35.  
  36. <?}?>
  37.  
  38. <table width="100%" bgcolor="<? echo $lightrow; ?>" border="0" cellspacing="0" cellpadding="5">
  39. <tr bgcolor="<? echo $darkrow; ?>"><td nowrap><b><font size="1" face="Verdana, Arial, Helvetica, sans-serif" color="#555555">Top 20 Requests</font></b></td></tr>
  40. <tr><td nowrap>
  41. <?
  42. $i=0;
  43. while($song = $db->row())
  44. {
  45. $i++;
  46. PutRow($song);
  47. }
  48. ?>
  49. </td></tr>
  50. </table>
  51. <br>
  52. <?}?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement