Help

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

Re: [kcmedia] Help

By Jason - August 25, 2010

Hi Craig,

So in the events section, they want to be able to select sponsors the sponsors they want to associate with a particular event. Is that right?

If so, you can set up a multi value list field in the events section that pulls its information from the sponsors table.

If I don't have it right, please provide some more clarification on exactly what needs to happen and what fields exist in each section.

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 25, 2010

Hi Jason

I sent you a message did you get it.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Help

By KCMedia - August 26, 2010

Hi Jason

here is the file you wanted.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

the-event.php 8K

Re: [kcmedia] Help

By Jason - August 27, 2010

Hi,

Try adding this code to where you're selecting your records (I've highlighted the changes in red):

// load records
list($the_eventRecords, $the_eventMetaData) = getRecords(array(
'tableName' => 'the_event',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$the_eventRecord = @$the_eventRecords[0]; // get first record

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

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


This code will put all of the sponsors associated with the event into $sponsorRecords. You can then output this information anywhere you want.

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 27, 2010

Hi Jason

I tried that but still no images for the sponsors showing up.
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

the-event_001.php 8K

Re: [kcmedia] Help

By KCMedia - August 30, 2010

Hi Jason

any update?
Thanks



Craig

KC Media Solutions

www.kcmedia.biz

Re: [kcmedia] Help

By Chris - August 30, 2010

Hi kcmedia,

Jason isn't in the office today, but maybe I can help.

This may be unrelated, but I noticed what seems like a typo in the code above. Should this read "sponsors"?

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

I took a look at your the-event.php code and noticed that you aren't using $sponsorRecords anywhere. You'll need to add some code where you want your images in your page to loop over the sponsors you've selected and display their uploads:

<?php foreach ($sponsorRecords as $sponsor): ?>
<!-- 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['uploads'] 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 -->
<?php endforeach ?>


I hope this helps. Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Help

By KCMedia - August 30, 2010

Hi Chris

I have tried that also and no good check out the error code on the page

http://champagneforcharity.org/the-event.php

craig
Thanks



Craig

KC Media Solutions

www.kcmedia.biz
Attachments:

the-event_002.php 9K

Re: [kcmedia] Help

By Jason - August 31, 2010

Hi Craig,

I think we'll have to take a look on your server to see exactly what's happening. Please fill out a 2nd Level Support Request here:
https://www.interactivetools.com/support/email_support_form.php

and I'll take a closer look at this.

Thanks.
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

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