Thumbnail gallery

14 posts by 3 authors in: Forums > CMS Builder
Last Post: August 19, 2010   (RSS)

By Kittybiccy - August 18, 2010

Thanks! When I change the php on line 17 the page will not display at all so not sure if it is working! Will attach the page again, any ideas?
Attachments:

test_012.php 7K

Re: [Kittybiccy] Thumbnail gallery

By Jason - August 18, 2010

Hi,

Have you tried making the changes Chris suggested? If you can email your CMS Builder and FTP details to jason@interactivetools.com I can take a quick look at this.

Please only email this information, don't post it to the forum.

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/

Re: [Jason] Thumbnail gallery

By Chris - August 18, 2010

Hi Hannah,

Here's a section of your code, with line 17 highlighted in red:

// load records
list($testRecords, $testMetaData) = getRecords(array(
'tableName' => 'test',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$testRecord = @$testRecords[0]; // get first record
// show error message if no matching record is found
if (!$testRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}


The code I gave you expects the record variable to be called $record, but your code provides a record variable called $testRecord. I'm assuming that you followed Jason's earlier advice again and renamed $testRecord to $record on line 17. Did you also rename $testRecord to $record on line 19? That might be the problem. Your code should look like this:

// load records
list($testRecords, $testMetaData) = getRecords(array(
'tableName' => 'test',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$record = @$testRecords[0]; // get first record
// show error message if no matching record is found
if (!$record) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}


Alternately, you could change every instance of $record in my code to $testRecord. It doesn't matter what the record variable is called, but it does matter that it's called the same thing every time.

Does this help? Please let me know if you have any questions.
All the best,
Chris