Add this to viewlisting.tpl.php:
HTML Code:
<script type="text/javascript" language="javascript">
{literal}
function showPic (whichpic) {
if (document.getElementById) {
document.getElementById('placeholder').src = whichpic.href;
if (whichpic.title) {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.title;
} else {
document.getElementById('desc').childNodes[0].nodeValue = whichpic.childNodes[0].nodeValue;
}
return false;
} else {
return true;
}
}
{/literal}
</script>
Replace your view image part with this one:
HTML Code:
{* This the image display portion *}
{if $viewphotos=="Y"}
{if $data<>""}
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="80%">
{if $data}
{section name=image loop=$data max=1}
<p align="center"><img id="placeholder" src="photos/{$data[image].image}" alt="" class="imageborder" /></p>
<strong><p align="center" id="desc">{$data[image].title}</p></strong>
{/section}</td>
</tr>
<tr>
<td>
<DIV STYLE="height:100px; width:400px;overflow:auto">
<div align="center">
{foreach from=$data item="entry"}<a onclick="return showPic(this)" href="photos/{$entry.image}" title="{$entry.title}"><img src="thumbs/small_{$entry.image}" hspace="5" vspace="5" border="0" class="imageborder" /></a>
{/foreach} </div>
</div>
{/if} </td>
</tr>
</table>
{/if}
{/if}
{* This ends the image display portion *}
it's strickly on the template level.
This is code from one of Eric's classifieds site.