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/

Re: [Jason] Help

By KCMedia - August 31, 2010

Hi Jason

spot on mate perfect, just one more small thing in the sponsors area for each sponsor we put their website address i want to link the images on the event page tot he sponsors website that is set in the sponsors area.

how do i go about that have a look at the event file now how i did it but it dosnt work.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

the-event_003.php 9K

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/

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