Help

15 posts by 4 authors in: Forums > CMS Builder
Last Post: August 31, 2010   (RSS)

By Jason - August 31, 2010

Hi Craig,

Chris and I were going over this problem, and think we may have found it. Trying changing your code to this:

$sponsorList = trim($the_eventRecord['sponosors'],"\t");
$sponsorList = "('".str_replace("\t","','",mysql_escape($sponsorList))."')";

list($sponsorRecords,$sponsorMetaData)=getRecords(array(
'tableName' => 'sponsors',
'allowSearch' => false,
'where' => "title IN $sponsorList",
));


This will place single quotes around each of the items in your list and should get rid of that MySQL error.

Hope this helps.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Jason - August 31, 2010

Hi,

It looks like you just need to change one name so that you're outputting the link from the sponsor record.

Try changing your code to this (the change is in red):

<!-- STEP 2a: Display Uploads for field 'uploads' (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 ($sponsor['logo'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $sponsor['website_url'] ?>" target="_blank"><img src="<?php echo $upload['thumbUrlPath'] ?>" alt="" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" vspace="3" border="0" /></a><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 -->


Hope this helps
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Re: [Jason] Help

By KCMedia - August 31, 2010

Hi Jason

oh yes now i understand how you have this working.

great thank you very much that just finished the site right now all good to go.

cheers

Craig
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

By gkornbluth - August 31, 2010 - edited: August 31, 2010

hi Jason, Chris and Craig,

Just curious, could you have used the Related Record Lookup Functions Plugin with a multi value pulldown list for this as well?

Nice to learn another way though.

Best,

Jerry
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php