Problem with images 3 across

9 posts by 3 authors in: Forums > CMS Builder
Last Post: November 3, 2009   (RSS)

By kitka - October 27, 2009

I have done this before with success...
I am trying to get the contents to display in rows of 3...
It does until i try and put the photo in there and it revers to showing only 1 items instead of all.
The current page is here at

http://www.cadainfo.com/contentList4.php
The i am using is as follows
<table width="800" cellpadding="40"> <?php foreach ($contentRecords as $record): ?> <td><h5> For Sale By<br> <?php echo $record['dealer'] ?></h5><br/>Location: <?php echo $record['location'] ?><br/>
Category: <?php echo $record['category'] ?><br/>Price: <?php echo $record['price'] ?><br/>
<a href="<?php echo $record['_link'] ?>">More Details</a><br/> </td> <?php $maxCols=3; if (@++$count % $maxCols == 0): ?> </tr> <tr> <?php endif ?> <?php endforeach ?> </table>

</td>
</tr>
</table>

When i try to add the image to this mix it only shows 1 item
Here is th coding for the images[/#ff0000]

<!-- STEP 2a: Display Uploads for field 'photo' (Paste this anywhere inside STEP2 to display uploads) -->
<!-- Upload Fields: num, createdTime, tableName, fieldName, recordNum, preSaveTempId, filePath, filename, extension, thumbFilePath, isImage, hasThumbnail, urlPath, width, height, thumbUrlPath, thumbWidth, thumbHeight, info1, info2, info3, info4, info5 -->
<?php foreach ($record['photo'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
<!-- STEP2a: /Display Uploads -->

Any suggestions
jim albert

Re: [kitka] Problem with images 3 across

By ross - October 28, 2009

Hi there.

Thanks for posting!

Here's how I would do this. First, get everything going again without the images. You mentioned that had been working just fine so you'll already know the code for that.

Once you get it back to everything working with out images, try just hardcoding an image in there so that all your listings display the same image, but still go three across.

Does that make sense? You'll basically be making the same image appear over and over again but because it's just a single hardcoded image, it will be much easier to work with for the time being.

The final step (after it all works with the hardcoded image) is to just replace the hardcoded image with the entire block of code to make the image display from CMS Builder.

Does that make sense?

What we are doing here is breaking the problem down into smaller pieces so it's easier to trouble shoot.

Give it a shot and let me know how you make out :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [kitka] Problem with images 3 across

By ross - October 30, 2009

Hi there.

Glad to hear you got the images going :).

The link you are looking for will be something like this:

<a href="membersDetail.php?<?php echo <?php echo $record['dealer'] ?>-<?php echo $record['createdByUserNum'] ?>">
<?php echo $record['dealer'] ?>
</a>


Does that make sense? Give it a shot and let me know how you make out.
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] Problem with images 3 across

By kitka - October 30, 2009

The code didn't work but i changed it so now it does.

http://www.cadainfo.com/contentList_test.php

The problme is now the link goes to the cada member number but it is showing the data from the assigned dealrNumber...
Which are differemt

For example....

Greg Connor has a user ID of 4 but a CADA member number of 1.....
CADA member #4 is RHV Tee which is where the results are showing from...
So how would you get it to the go to the homepage of unique uer 1 which is Greg Connor instead then.
here is he code right now

<table width="900" cellspacing="0" cellpadding="0" border="0">
<td><tr>







<table border="0" cellspacing="0" cellpadding="3">
<tr>
<?php foreach ($contentRecords as $record): ?>
<?php foreach ($record['photo'] as $upload): ?>
<td><h5><font face="Arial,Helvetica,sans-serif" size="-1"><?php echo $record['title'] ?></font><br><a href="membersDetail.php?<?php echo $record['dealer'] ?>-<?php echo $record['createdByUserNum'] ?>"> <?php echo $record['dealer'] ?> </a>
[/#ff0000]</h5>
<a href="<?php echo $upload['urlPath'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" border="0" /></a><br><font face="Arial,Helvetica,sans-serif" size="-2">Location: <?php echo $record['location'] ?><br/>Price: <?php echo $record['price'] ?><br>
<a href="<?php echo $record['_link'] ?>">MORE INFORMATION</a><br/>
</font><br/></td>
<?php $maxCols=3; if (@++$count % $maxCols == 0): ?></tr><tr><?php endif; ?>


<?php endforeach ?>
<?php endforeach ?>


</tr>
</table>






</td>

</tr>
</table>
jim albert

Re: [kitka] Problem with images 3 across

By Donna - October 30, 2009

Hi Kitka!

Make sure the member page is owned by the user you're writing about. So, when you edit the detail page, look at the top where it says "Created" and make sure it matches up with the user the page is about. :)
Donna

--
support@interactivetools.com

Re: [Donna] Problem with images 3 across

By kitka - October 30, 2009

Yes did that with the Greg Connor example...Test item 4.... It weas created by his account but when you clikc on the link it goes to RHV Tee and Sons which is member number 4 in the CADA members List
thats why i thought it was weird...
jim albert

Re: [kitka] Problem with images 3 across

By Donna - November 2, 2009

Hi Kitka,

hmm, I think it'll be easier if I can take a look at that directly -- can you fill out a support request here?

https://www.interactivetools.com/support/email_support.cgi
Donna

--
support@interactivetools.com

Re: [Donna] Problem with images 3 across

By kitka - November 3, 2009

Ok...

I just sent the login info...

You will see the waht i mean when you click on the delaer name it reads the contact info from the contact list rather than user the user member.
jim albert