Re: [jdancisin] Strange issue
From the list page. As you will notice I have another viewer that shows in the same page (Deadline) I have search shut down as I thought that may be a conflict but no luck.
(From List page)
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/stdavid/public_html/cms/lib/viewer_functions.php";
list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
));
?>
<?php
require_once "/home/stdavid/public_html/cms/lib/viewer_functions.php";
list($deadlineRecords, $deadlineMetaData) = getRecords(array(
'tableName' => 'deadline',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => 'false',
));
$deadlineRecord = @$deadlineRecords[0]; // get first record
// show error message if no matching record is found
if (!$deadlineRecord) {
print "Record not found!";
exit;
}
?>
<?php foreach ($newsRecords as $record): ?>
<strong><u><?php echo $record['title'] ?></u></strong><br/>
<?php echo $record['content'] ?>
<a href="<?php echo $record['_link'] ?>">Link</a><br/>
<hr/>
<?php endforeach; ?>
<?php if (!$newsRecords): ?>
No records were found!<br/><br/>
<?php endif ?>
(From Detail Page)
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/stdavid/public_html/cms/lib/viewer_functions.php";
list($newsRecords, $newsMetaData) = getRecords(array(
'tableName' => 'news',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
'allowSearch' => 'false',
));
$newsRecord = @$newsRecords[0]; // get first record
// show error message if no matching record is found
if (!$newsRecord) {
print "Record not found!";
exit;
}
?>
<?php
require_once "/home/stdavid/public_html/cms/lib/viewer_functions.php";
list($deadlineRecords, $deadlineMetaData) = getRecords(array(
'tableName' => 'deadline',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$deadlineRecord = @$deadlineRecords[0]; // get first record
// show error message if no matching record is found
if (!$deadlineRecord) {
print "Record not found!";
exit;
}
?>
Record Number: <?php echo $newsRecord['num'] ?><br/>
Title: <?php echo $newsRecord['title'] ?><br/>
Content: <?php echo $newsRecord['content'] ?><br/>
_link : <a href="<?php echo $newsRecord['_link'] ?>"><?php echo $newsRecord['_link'] ?></a><br/>
<hr/>
<?php if (!$newsRecord): ?>
No record found!<br/><br/>
<?php endif ?>
<a href="<?php echo $newsMetaData['_listPage']; ?>"><< Back to list page</a>
<div align="center"><u><strong> <?php echo $deadlineRecord['title'] ?></strong></u></div><br />
<?php echo $deadlineRecord['content'] ?>