need help with code

4 posts by 2 authors in: Forums > CMS Builder
Last Post: August 22, 2011   (RSS)

I am working on a "Members only page for a book club and am having some trouble making the download link for the PDF's display properly. As of right now I have them displayed but they are displaying the PDF downloads for every record. I just need a way to make it display the PDF for that record only but I am stumped.

I am attaching a copy of the page code for your reference.

The URL to the page is: http://www.clowninroundreaders.com/pages/membership/Members.php

It will ask you to a log in. You can use the username: bob and password: smarter to log in.

Any help is appreciated.

Thanks,

Jeff
Attachments:

members.php 14K

Re: [jeffrenner] need help with code

By robin - August 19, 2011

Hey Jeff,

Looks like you have an extra loop that is causing every book to show up on every record.

Instead of:
<?php foreach ($booksRecords as $record): ?>
<?php foreach ($record['books'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

You could probably use:
<?php foreach ($title['books'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

And remove the matching endforeach below also.

Hope that helps,
Robin
Robin
Programmer
interactivetools.com

Re: [jeffrenner] need help with code

By robin - August 22, 2011

Hey Jeff,

You can leave the image code the same if you move the file around. You don't need anything like $upload['../urlPath']. What happends if you just use the original image code?

Thanks,
Robin
Robin
Programmer
interactivetools.com