<?php

$numfeatures = 0;
$cellblocks = null;

for ( $x=1; $x < ($count+1); $x++ )
{
    if ( $numfeatures == $rcols )
    {
$cellblocks .= <<<PPPRINT
        </tr><tr>
PPPRINT;
        $numfeatures = 0;
    }
    $numfeatures++;

$cellblocks .= <<<PPPRINT
        <td class="{$Style['tddetails']}" width="$twidth%" valign="middle" align="center">
        	{$pthumb[$x]}
            <span class="{$Style['small']}">{$ptitle[$x]}<br />{$puser[$x]}</span>
        </td>
PPPRINT;
}

if ( $numfeatures < $rcols )
{
    while ($numfeatures != $rcols)
    {
$cellblocks .= <<<PPPRINT
        <td class="{$Style['tddetails']}" width="$twidth%" valign="middle" align="center">
            &nbsp;
        </td>
PPPRINT;
        $numfeatures++;
    }
}

$featurestrip = <<<PPPRINT
<!-- BEGIN TEMPLATE: feature.tmpl -->
$ppopen
<tr>
<td class="{$Style['menubar']}" colspan="$rcols">
	$group_title
</td>
</tr>
<tr>
$cellblocks
</tr>
PPPRINT;

if ( $morephotos )
{
$featurestrip .= <<<PPPRINT
<tr>
<td class="{$Style['tddetails']}" colspan="$rcols" align="center">
    $morephotos
</td>
</tr>
PPPRINT;
}

$featurestrip .= <<<PPPRINT
$ppclose
<br />

<!-- END TEMPLATE: feature.tmpl -->
PPPRINT;

?>
