What is wrong in this detail page?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: March 14, 2011   (RSS)

By mbareara - March 13, 2011

It shows me always the same page, also if the article num is different.

This is php code at the top of the page:

<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php


// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/home/calciocatania/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($incontriRecords, $incontriMetaData) = getRecords(array(
'tableName' => 'incontri',
'leftJoin' => array(
// foreign table => local field (that matches num in foreign table)
'arbitri' => 'arbitro',
'articoli'=> 'editoriale',
'video'=> 'sintesi_video_2',
'foto'=> 'foto2',

),
));
$incontriRecord = @$incontriRecords[0]; // get first record

// show error message if no matching record is found
if (!$incontriRecord) {
header("HTTP/1.0 404 Not Found");
print "Record not found!";
exit;
}

?>

Re: [orazio] What is wrong in this detail page?

By mbareara - March 13, 2011

ok 've solved problem thanks to this forum :-)

This is the correct code:

list($incontriRecords, $incontriMetaData) = getRecords(array(
'tableName' => 'incontri',
'where' => 'incontri.num = ' . getNumberFromEndOfUrl(),
'leftJoin' => array(
// foreign table => local field (that matches num in foreign table)
'arbitri' => 'arbitro',
'articoli'=> 'editoriale',
'video'=> 'sintesi_video_2',
'foto'=> 'foto2',

),
));