Getting Upload to Background Image

2 posts by 2 authors in: Forums > CMS Builder
Last Post: March 11, 2008   (RSS)

Re: [justritedesign] Getting Upload to Background Image

By Dave - March 11, 2008

Try this after the first code block with options and getRecord().

...
$record = getRecord($options);
$uploads = getUploads($options['tableName'], 'images', $record['num']);
?>

<br/>
<table width="171" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="80" background="<?php echo $uploads[0]['thumbUrlPath']?>">&nbsp;</td>
<td width="91">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>


Or if you want the full size image us 'urlPath' instead of 'thumbUrlPath'.

Basically we're just assigning the list of uploads to "$uploads", then the [0] says get the first one (in PHP they start counting at zero instead of one sometimes), and then the fieldname on the end is what you want to display.

Hope that helps! Let me know if it works for you!
Dave Edis - Senior Developer
interactivetools.com