 | |  |
 |

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
<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=""> </td> <td width="91"> </td> </tr> <tr> <td> </td> <td> </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().
... $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']?>"> </td> <td width="91"> </td> </tr> <tr> <td> </td> <td> </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
|
|
|  |
|