my mistake, this will work well:
/////////////////////
// Set up the topic where the poll is.
$pollTopic = 3;
// Set poll topic subject
$polltext = "<center><b><h3>Subject = Abstract: Voting closes: 31 October 2010, 07:10:52</h3></b></center>" ;
/////////////////////
// Images per row.
$imagesPerRow = 3;
$pollResults = ssi_showPoll($pollTopic,'array');
// Just a counter..
$imageCount = 0;
global $scripturl, $context;
$patternImg = "/data-image=[\"']?([^\"']?.*(png|jpg|gif))[\"']?/i";
echo ' <center><b><h2>Poll for the weekly competition</h2></b></center> ';
echo $polltext ;
echo ' <hr> ';
echo '
<table style="width: 100%">
<tr>';
foreach ($pollResults['options'] as $pollItem)
{
preg_match($patternImg, $pollItem['option'], $image);
$imageCount++;
if ($imageCount > $imagesPerRow)
{
echo '
</tr>
<tr>';
$imageCount = 1;
}
echo '
<td style="width: 25%; text-align: center; padding: 1px 1px 10px 1px;">
<a href="' , $scripturl , '?topic=' , $pollTopic , '">
<div class="apimage" ' , $image[0] , ' data-width="100"></div>
</a>
<br />
Member : ' , strip_tags($pollItem['option']);
if (!$pollResults['allow_vote'] && !$context['user']['is_guest'])
{
echo '
<br />
Votes : ' , $pollItem['votes'] , ' (' , $pollItem['percent'] , '%)
<br />
' , $pollItem['bar'];
}
echo '
</td>';
}
while ($imageCount < $imagesPerRow)
{
echo '
<td style="width: 25%">
</td>';
$imageCount++;
}
echo '
</tr>
</table>';
echo ' <center><b>Please click on any image to take you to the poll</b></center> ';
EDIT:
Link problem is resloved!