close ad
WARNING PC USERS: Do Not Install the DREAMWEAVER CC 2017 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

multiple photos

Thread began 1/11/2011 8:48 pm by davidp420108 | Last modified 1/12/2011 1:47 pm by Dave Buchholz | 1517 views | 11 replies |

davidp420108

multiple photos

I need a little push in the right direction please.

I would like to have the option for a client to upload up to 9 photos, and that works fine. the problem is if they want to only upload 4 photos, my detail page shows 4 photos and 5 blanks.

I would like to have the "null" photos spots be invisible or hidden. I don't know where to start, so any help would be appreciated.

Here is an example of the "problem"

auto_Detail.php?Inventory_ID=41

Sign in to reply to this post

Dave BuchholzBeta Tester

David,

can you post the code for the page and then I can advise the best way to go about it.

Sign in to reply to this post

davidp420108

This is the file that i am including that has that code. le t me know if you need the whole page.

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_1_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_1_Resize']; ?>" alt="" border="0" /></span></a>
<!-- ------image 2 ------ -->
<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_2_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_2_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_3_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_3_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_4_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_4_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_5_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_5_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_6_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_6_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_7_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_7_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_8_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_8_Resize']; ?>" alt="" border="0" /></span></a>

<a class="thumbnail" href="#thumb"><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_9_Thumb']; ?>" border="0" /><span><img src="<?php $_SERVER['DOCUMENT_ROOT']?>/Auto_Dealers/<?php echo $row_WADAinventory_tbl["Dealer_Name"]?>/images/<?php echo $row_WADAinventory_tbl["Inventory_ID"]?>/<?php echo $row_WADAinventory_tbl['Photo_9_Resize']; ?>" alt="" border="0" /></span></a>

Sign in to reply to this post

Dave BuchholzBeta Tester

David,

use the following code to replace each of the instances of your thumbnail replacing $row_WADAinventory_tbl['Photo_1_Thumb'] with $row_WADAinventory_tbl['Photo_2_Thumb'] etc.

php:
<?php echo $row_WADAinventory_tbl['Photo_1_Thumb']?'<a class="thumbnail" href="#thumb"><img  src="' $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' $row_WADAinventory_tbl["Dealer_Name"] . '/images/' $row_WADAinventory_tbl["Inventory_ID"] . '/' $row_WADAinventory_tbl['Photo_1_Thumb'];  . '" border="0" /><span><img  src="<?php $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_1_Resize'];  . '" alt="" border="0" /></span></a>':"";  ?>
Sign in to reply to this post

davidp420108

thanks,

but could you tell me why this works. I don't see anything that indicates a "display if" or something like it.

If you have a minute could you educate me on what is making this work?

Sign in to reply to this post

davidp420108

its broken

auto_Detail.php?Inventory_ID=38

this is what displays now.

In Dreamweaver, the code is not coloring properly, like a " is missing or something. thumb_1 looks good, thumb_2 is color coded wrong, thumb_3 is good, thumb_4 is wrong etc.

I am new to php so your code is confusing me a little, making it hard to track down.

thanks for your help

Sign in to reply to this post

Dave BuchholzBeta Tester

David,

attach the whole page for me please, I have probably missed a quote somewhere

I have used what is called a ternary operator rather than an if statement

Sign in to reply to this post

Dave BuchholzBeta Tester

in fact I have found the issue, my bad trying to do to many things at once

replace the faulty code with this, again making changes as necessary

php:
<?php echo $row_WADAinventory_tbl['Photo_1_Thumb']?'<a class="thumbnail" href="#thumb"><img  src="' $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' $row_WADAinventory_tbl["Dealer_Name"] . '/images/' $row_WADAinventory_tbl["Inventory_ID"] . '/' $row_WADAinventory_tbl['Photo_1_Thumb']  . '" border="0" /><span><img  src="' $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' $row_WADAinventory_tbl["Dealer_Name"] . '/images/' $row_WADAinventory_tbl["Inventory_ID"] . '/' $row_WADAinventory_tbl['Photo_1_Resize']  . '" alt="" border="0" /></span></a>':"";  ?>
Sign in to reply to this post

davidp420108

still not quite working.

Its close. It only showed empty boxes for the proper number of photos. But the actual image is not showing up. in dreamweaver the <a href> is usually green and it is red in the example you gave me. don't know if that helps.

auto_Detail.php?Inventory_ID=37

how do you put the code in the code box in your replies?


<?php echo $row_WADAinventory_tbl['Photo_1_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_1_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_1_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_2_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_2_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_2_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_3_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_3_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_3_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_4_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_4_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_4_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_5_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_5_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_5_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_6_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_6_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_6_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_7_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_7_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_7_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_8_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_8_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_8_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

<?php echo $row_WADAinventory_tbl['Photo_9_Thumb']?'<a class="thumbnail" href="#thumb"><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_9_Thumb'] . '" border="0" /><span><img src="' . $_SERVER['DOCUMENT_ROOT'] . '/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_9_Resize'] . '" alt="" border="0" /></span></a>':""; ?>

Sign in to reply to this post

Dave BuchholzBeta Tester

try changing the dynamic code to:

php:
<?php echo $row_WADAinventory_tbl['Photo_1_Thumb']?'<a class="thumbnail" href="#thumb"><img  src="' /Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_1_Thumb']  . '" border="0" /><span><img  src="/Auto_Dealers/' . $row_WADAinventory_tbl["Dealer_Name"] . '/images/' . $row_WADAinventory_tbl["Inventory_ID"] . '/' . $row_WADAinventory_tbl['Photo_1_Resize']  . '" alt="" border="0" /></span></a>':"";  ?>



it's the document root that is causing the issue

to put code in blocks see misc.php?do=bbcode

Sign in to reply to this post
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...