php include not working on multi-listing page

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

This question is going to best be exemplified by looking at addresses.

I have a multi-record module to list calendar events (http://174.143.92.42/waxahachiechamber.com/calendar/default.php). On the lower left of that page is also a single record module laid in as a php include (for Upcoming Events), which works extremely well, except for this one caveat.

On the first detail listing in the calendar, the Upcoming Events include shows up correctly. however, on every subsequent listing the Upcoming Event include will not show up (I WAS getting the dreaded 'No Record Found' error until I commented it out in the include file), now it just shows up as empty.

The code on my include file is:

<?php
require_once "C:/inetpub/wwwroot/waxahachiechamber.com/emediacms/lib/viewer_functions.php";

list($upcoming_eventsRecords, $upcoming_eventsMetaData) = getRecords(array(
'tableName' => 'upcoming_events',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$upcoming_eventsRecord = @$upcoming_eventsRecords[0]; // get first record

// show error message if no matching record is found
// if (!$upcoming_eventsRecord) {
// print "Record not found!";
// exit;
// }

?>

.....

<td class="events"><h3 align="center"><?php echo $upcoming_eventsRecord['title'] ?></h3>
<span align="justify"><?php echo $upcoming_eventsRecord['content'] ?></span></td>


So it's very simple. Is the error in the 'where' operator? Or is it the 'limit'?

This is the first I've used a module as an include file, but it's solving a lot of issues so I'd like to continue. Any suggestions?

Re: [Luke] php include not working on multi-listing page

Thanks Luke, That worked.

I did look at the source code for the Email link and it is showing:

<a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>

My Viewer URL's are set to http://174.143.92.42/waxahachiechamber.com/calendar/defaultDetail.php which is clunky, but this is mainly because the site is not in full production yet and this way is easier to set up the CMS database.