<?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: featurepal.tmpl -->
<table class="{$Style['tablesurround']}" cellpadding="1" cellspacing="1" border="0" width="100%" align="center">
<tr>
<td>
    <table cellpadding="2" cellspacing="1" width="100%" class="{$Style['tableborders']}">
<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
    </table>
    </td>
    </tr>
</table>
<br />
<!-- END TEMPLATE: featurepal.tmpl -->
PPPRINT;

?>
