Strange issue

5 posts by 2 authors in: Forums > CMS Builder
Last Post: April 9, 2009   (RSS)

Re: [Ginslinger] Strange issue

By zip222 - April 9, 2009

I took a look but wasn't able to figure out the problem from the live view. Can you post your two viewer pages to this thread?

Re: [jdancisin] Strange issue

By Ginslinger - April 9, 2009

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']; ?>">&lt;&lt; Back to list page</a>



<div align="center"><u><strong> <?php echo $deadlineRecord['title'] ?></strong></u></div><br />
<?php echo $deadlineRecord['content'] ?>

Re: [Ginslinger] Strange issue

By zip222 - April 9, 2009

I think its likely that the error is coming from the second viewer (deadline), but you don't need to remove it, you just need to remove the bold line below...

<?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;
}

?>

Re: [jdancisin] Strange issue

By Ginslinger - April 9, 2009

That did the trick. Appreciate the help.

Thanks

Tim