Home | Products | Consulting | Forums | Support | Order | 1-800-752-0455
  Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder:
Getting Upload to Background Image

 

 


justritedesign
User

Mar 11, 2008, 7:06 AM

Post #1 of 2 (263 views)
Shortcut
Getting Upload to Background Image Can't Post

I would like to have a client just upload a picture and have that image appear as the background in a table cell.

I have the page to look at here. http://www.efreewillmar.org/youth3.php

The image is above the table now.

The code looks like this

Code
<body> 
<?php
require_once "C:/Webspace/resadmin/mmoyers/efreewillmar.org/www/cmsAdmin/lib/viewer_functions.php";
$options = array(); // NOTE: see online documentation for more details on these options
$options['tableName'] = 'about_us_001'; // (REQUIRED) MySQL tablename to list record from. Example: "article";
$options['recordNum'] = ''; // (optional) Record number to display. Example: "1"; Defaults to number on end of url, then 1
$options['where'] = ''; // (ADVANCED) MySQL WHERE conditions to use INSTEAD of recordNum to look up record. Example: "fieldname = 'value'"
$record = getRecord($options);
?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'images', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" />
<?php endif ?>
<?php endforeach ?>
<?php endif ?>
<br/>
<table width="171" border="1" cellspacing="0" cellpadding="0">
<tr>
<td width="80" background="">&nbsp;</td>
<td width="91">&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>

</body>


When I have tried to pull in all or parts of the php into the "TD" tag it ends up not working.
Is this possible and how?

Thanks
Michael Moyers
Owner/Administrator
Just Rite Design & Just Rite Productions
A growing network of professionals in Web development, Programming, Graphic Design, Flash, and Audio and Video Productions


Dave
Staff / Moderator


Mar 11, 2008, 8:45 AM

Post #2 of 2 (261 views)
Shortcut
Re: [justritedesign] Getting Upload to Background Image [In reply to] Can't Post

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


Code
... 
$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

 
 
 


Search for (options)
Products
CMS Builder
Article Manager
Realty Manager
Listings Manager
Order Now
Services
Priority Consulting
Support
Online Documentation
Support Forums
Support Homepage
Company Info
12 reasons to choose us!
Meet the team
Monthly newsletter
Contact Us
Toll Free: 1-800-752-0455
Phone: (604) 689-3347
Sales | Support
Conditions of Use | Privacy Policy | Copyright © interactivetools.com 2008
#201 - 2730 Commercial Drive, Vancouver BC Canada V5N 5P4