Quote
<table class='ipb_table' cellspacing="1">
<tbody>
<tr>
<td class='row2'>
<?php
/* Init */
$return = "";
$to_show = 9;
$per_row = 3;
$count = 0;
/* Query */
$this->DB->build( array( 'select' => 'i.id AS picid, i.masked_file_name, i.directory, i.caption',
'from' => array( 'gallery_images' => 'i' ),
'add_join' => array( 0 => array( 'select' => 'm.name as uname',
'from' => array( 'members' => 'm' ),
'where' => 'i.member_id=m.member_id',
'type' => 'left' ) ),
'order' => 'i.id DESC',
'limit' => array( 0, $to_show ),
) );
$this->DB->execute();
/* Got some rows */
if ( $this->DB->getTotalRows() )
{
$return .= "<div><table class='ipb_table'><tr>";
while ( $row = $this->DB->fetch() )
{
$count++;
$return .= <<<EOF
<td class='short'>
<a href="index.php?app=gallery&module=images§ion=viewimage&img={$row['picid']}">
<img src="uploads/{$row['directory']}/tn_{$row['masked_file_name']}" alt="{$row['caption']}" />
</a>
Photo submitted by:
<strong>{$row['uname']}</strong>
</td>
EOF;
/* New row */
if ( $count && $count % $per_row == 0 )
{
$return .= "</tr><tr>";
}
}
$return .= "</tr></table></div>";
}
/* Return */
print $return;
?>
</td>
</tr>
</tbody>
</table>
<tbody>
<tr>
<td class='row2'>
<?php
/* Init */
$return = "";
$to_show = 9;
$per_row = 3;
$count = 0;
/* Query */
$this->DB->build( array( 'select' => 'i.id AS picid, i.masked_file_name, i.directory, i.caption',
'from' => array( 'gallery_images' => 'i' ),
'add_join' => array( 0 => array( 'select' => 'm.name as uname',
'from' => array( 'members' => 'm' ),
'where' => 'i.member_id=m.member_id',
'type' => 'left' ) ),
'order' => 'i.id DESC',
'limit' => array( 0, $to_show ),
) );
$this->DB->execute();
/* Got some rows */
if ( $this->DB->getTotalRows() )
{
$return .= "<div><table class='ipb_table'><tr>";
while ( $row = $this->DB->fetch() )
{
$count++;
$return .= <<<EOF
<td class='short'>
<a href="index.php?app=gallery&module=images§ion=viewimage&img={$row['picid']}">
<img src="uploads/{$row['directory']}/tn_{$row['masked_file_name']}" alt="{$row['caption']}" />
</a>
Photo submitted by:
<strong>{$row['uname']}</strong>
</td>
EOF;
/* New row */
if ( $count && $count % $per_row == 0 )
{
$return .= "</tr><tr>";
}
}
$return .= "</tr></table></div>";
}
/* Return */
print $return;
?>
</td>
</tr>
</tbody>
</table>
But it doesnt work mate, any ideas












