How can I change this code (if possible) to show 50 images as random preview but not all the images in one line... maybe show them 4 per line?
global $scripturl,$db_prefix,$modSettings,$boardurl;
echo'<table cellspacing="0" cellpadding="5" border="0" align="center" width="90%"><tr>';
if(empty($modSettings['gallery_url']))
{
$modSettings['gallery_url'] = $boardurl . '/gallery/';
}
$request = db_query("SELECT thumbfilename,ID_PICTURE FROM {$db_prefix}gallery_pic GROUP BY thumbfilename ORDER BY rand() DESC LIMIT 50", __FILE__,__LINE__);
while ($row = mysql_fetch_assoc($request))
echo' <td align="center" colspan="3"><a href="', $scripturl, '?action=gallery;sa=view;id=',
$row['ID_PICTURE'], '"><img src="', $modSettings['gallery_url'] .
$row['thumbfilename'] ,'" /></a>';
echo'</td></tr>';
echo'</table></br>';
mysql_free_result($request);
echo '<table width="100%" border="0" cellspacing="0" cellpadding="6">
<tr>
<td><div align="center"><a href="http://xxxxxxxxxxxxx.net/index.php?action=gallery">Upload Images</a></div></td>
</tr>
</table>';