Ideas for layout real estate

Locked
Shizzle
User
Posts: 65
Joined: Sat May 28, 2005 9:00 am
Location: Gresham, OR USA
Contact:

Ideas for layout real estate

Post by Shizzle »

just a quick question....

when you perfom a fast update (only add new albums), is there a way to find out what the last 5, 10 or whatever amount of albums were added and display on the browse page? So that there would be a seperate block on the right side of the page that will tell you the recent additions to the site...

"Last 10 Artists (Album) added"

and then maybe another block below the above one that lists the 10 mostly popularly played tracks

"Last 10 Popularly Played Tracks"

and then another block below that one that displays recent searches

"Last 10 Searches Performed"

I been working on a script that may do the top two not sure how to do the searches one.

Here is the code that I put together:

Last 10 Artists (Album) added:

Code: Select all

echo '<th colspan="2" align="right">("Latest 10 albums added");
$qry="SELECT album, FROM album, artist WHERE ((artist,album)) ORDER BY album DESC";
$result=execute_sql($qry,0,10,$num_rows);
echo '<tr><td><b>'.$d_album.'</td><td><b>'.$d_artist.'</td></tr>';
while ($row=mysql_fetch_array($result)) {
	fancy_tr($tmpcount,$tdnorm,$tdalt,$tdhighlight);
	add_album_link($row['artist'],$row['artist_alphetic']);
	add_performer_link($row['artist'],$row['artist_alphetic']);
	print "</tr> \n";
}
echo '</td></tr></table>';
As for the other blocks I was thinking that this information would come from the session ids database but I am probably wrong. Is it possible to incorporate this information?

Thanks
User avatar
wbartels
netjukebox developer
Posts: 881
Joined: Thu Nov 04, 2004 3:12 pm
Location: Netherlands
Contact:

Post by wbartels »

The new albums can already be listed with: favorites > new
If you like you can add a LIMIT 10 to the query.
The query in favorites.php will than look like this:

Code: Select all

$query = mysql_query('SELECT artist, artist_alphabetic, album, album_add_time, album_id FROM album WHERE album_add_time ORDER BY album_add_time DESC LIMIT 10');
Locked