Superfluous code?

3 posts by 2 authors in: Forums > CMS Builder
Last Post: May 7, 2010   (RSS)

By roddruce - May 7, 2010

Hello all,

Is all the code below required? I am only using the content code line for this page.

<?php echo $aboutRecord['content'] ?>

Are lines beginning with forward slashes required?

Also is this line of code needed? header("HTTP/1.0 404 Not Found");

Rod

______________________________________________________________

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

<?php

// load viewer library

$libraryPath = 'cmsAdmin/lib/viewer_functions.php';

$dirsToCheck = array('/home/vintager/public_html/','','../','../../','../../../');

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($aboutRecords, $aboutMetaData) = getRecords(array(

'tableName' => 'about',

'where' => whereRecordNumberInUrl(1),

'limit' => '1',

));

$aboutRecord = @$aboutRecords[0]; // get first record

// show error message if no matching record is found

if (!$aboutRecord) {

header("HTTP/1.0 404 Not Found");

print "Record not found!";

exit;

}

?>


Re: [Jason] Superfluous code?

By roddruce - May 7, 2010

Thank you Jason, this does help me build a picture and understanding of CMS Builder so I can do more in the future for my clients.

Rod