Hey guys,
The code im about to post displays images in one long single line. Basically if I have 20 items, then it spans the page down 20 items. Could anyone help me get this in a better format? like maybe 4 columns across per row?
<?
$sql = "SELECT * FROM images WHERE user='$myuid'";
$qr1 = mysql_query($sql);
$rowcount = mysql_num_rows($qr1);
$pagecount = ceil($rowcount / $limit);
print "<table width=100%><td>Page No: " . ($pageno+1) ."</td><td align=right>
<select onChange=\"gotocluster(this)\">\n
<option>Select A Page</option>";
for($x=0; $x<$pagecount; $x++){
$p = $x + 1;
$l = $x * $limit + 1;
$u = $l + $limit - 1;
if($u>$rowcount) $u=$rowcount;
print "<option value='editimg.php?pageno=".$x."'>Page $p ($l - $u)</option>\n";
}
print "</select></td></table>";
$l = $pageno * $limit;
$u = $l + $limit-1;
$count = -1;
$i = 1;
$domCount = 0;
while( $a = mysql_fetch_object($qr1) ){
$count++;
$row = ($count % 2)+1;
if ($limit && $count < $l ) continue;
if($limit && $count > $u) continue;
$filen = $siteurl."/".str_replace('./', '', $att_path)."/".$a->filename;
$filen = str_replace('http://','%%',$filen);
$filen = str_replace('//','/',$filen);
$filen = str_replace('%%','http://',$filen);
if( file_exists($att_path."/".$a->filename) ){
echo "<a href='$filen' target='_new'><img src='$filen' width=100 height=100 border=0></a><br>";
}else{
echo "no image found<br>";
}
echo "<a href='getcode.php?img=".$a->id."'>get code</a> | ";
echo "<a href='editimg.php?pageno=".$pageno."&del=".$a->id."'>delete</a><br>";
}
print "<table width=100%><td>Page No: " . ($pageno+1) ."</td><td align=right>
<select onChange=\"gotocluster(this)\">\n
<option>Select A Page</option>";
for($x=0; $x<$pagecount; $x++){
$p = $x + 1;
$l = $x * $limit + 1;
$u = $l + $limit - 1;
if($u>$rowcount) $u=$rowcount;
print "<option value='editimg.php?pageno=".$x."'>Page $p ($l - $u)</option>\n";
}
print "</select></td></table>";
?>