5 posts by 2 authors in: Forums > CMS Builder
Last Post: February 2, 2010   (RSS)

Re: [terryally] Display problem with VIEW URL

By Chris - January 29, 2010

Hi Terry,

Can you please post the complete PHP source code for that page?
All the best,
Chris

Re: [chris] Display problem with VIEW URL

Hi Terry,

Can you please post the complete PHP source code for that page?


The main page code follows immediate and below that are the codes for the two sidebar inserts starting at line 114.


MAIN PAGE:
<?php header('Content-type: text/html; charset=utf-8'); ?>
<?php
require_once "/home/lakeside/www/www/lcc_cmsadmin/lib/viewer_functions.php";
list($showsRecords, $showsMetaData) = getRecords(array(
'tableName' => 'shows',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$showsRecord = @$showsRecords[0]; // get first record

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

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title><?php echo $showsRecord['event_title'] ?></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
<link rel="stylesheet" type="text/css" href="/lcc_css/all.css"/>
<!--[if lt IE 7]><link rel="stylesheet" type="text/css" href="/lcc_css/lt7.css" media="screen"/><![endif]-->
<script type="text/javascript" src="lcc_js/swfobject.js"></script>

<script language="javascript" src="x_core.js"></script>
<script language="javascript" src="ylib.js"></script>
<script language="javascript" src="y_tabs.js"></script>
<script language="javascript">
var arrayHeaders = ["tab-header1","tab-header2","tab-header3"];
var arrayContents = ["tab-content1","tab-content2","tab-content3"];
window.onload = function(){
var tabRelationship =
new ylib.widget.Tabs(arrayHeaders, arrayContents, 0);
}
</script>
<link rel="stylesheet" type="text/css" href="lcc_css/contentslider.css" />

<script type="text/javascript" src="contentslider.js">



</script>
</head>
<body>


<div id="pattern">
<div id="header-area">
<div id="header">
<div id="header-flash">
<object type="application/x-shockwave-flash" data="header.swf" width="1040" height="240">
<param name="movie" value="header.swf" />
<param value="transparent" name="wmode" />
</object>
</div>
</div>
</div>


<div id="wrapper">
<div id="main-t">&nbsp;</div>
<div id="main">
<div id="content">
<h2 class="lakeside"><?php echo $showsRecord['event_title'] ?></h2>

<div id="content-c2">

<b>Date:</b> <?php echo date("l j M Y", strtotime($showsRecord['start_date'])) ?><br/><br/>

<b>Cost:</b> <?php echo $showsRecord['cost'] ?><br/><br/>
<b>Doors open: </b><?php echo $showsRecord['doors_open'] ?><br/><br/>

<?php if ($showsRecord['dinner_starts']): ?>
<b>Dinner starts: </b><?php echo $showsRecord['dinner_starts'] ?><br/><br/>
<?php endif ?>

<?php if ($showsRecord['show_time']): ?>
<b>Show time: </b><?php echo $showsRecord['show_time'] ?><br/><br/>
<?php endif ?>

<?php if ($showsRecord['show_ends']): ?>
<b>Show ends:</b> <?php echo $showsRecord['show_ends'] ?><br/><br/>
<?php endif ?>

<?php if ($showsRecord['venue']): ?>
<b>Venue:</b> <?php echo $showsRecord['venue'] ?><br/><br/>
<?php endif ?>

<?php if ($showsRecord['food']): ?>
<b>Food &amp; beverage</b>: <?php echo $showsRecord['food'] ?><br/><br/>
<?php endif ?>

<?php if ($showsRecord['notes']): ?>
<EM><?php echo $showsRecord['notes'] ?></EM><br/><br/>
<?php endif ?>

<br/><br/>
<a href="mailto:?subject=<?php echo thisPageUrl() ?>">Email this Page</a>

</div><?php ?>

<div id="content-b">&nbsp;</div>
</div>
<div id="sidebar">

<!-- START SPECIAL FEATURED EVENTS MAX TWO 240PX WIDE AND VARIABLE LENGTH-->
<div class="banner">
<?php include "/home/lakeside/www/www/lcc_inc/featured_event1.inc.php" ;?>
</div>

<div class="banner02">
<?php include "/home/lakeside/www/www/lcc_inc/featured_event2.inc.php" ;?>
</div>
<!-- END SPECIAL FEATURED EVENTS MAX TWO 240PX WIDE AND VARIABLE LENGTH-->

</div><?php ?>

</div><?php ?>

<?php include "/home/lakeside/www/www/lcc_inc/footer.inc.php" ;?>

</div><?php ?>

</div><?php ?>

</div><?php ?>

</body>
</html>




FEATURED_EVENT1
<?php
list($featured_event_1Records, $featured_event_1MetaData) = getRecords(array(
'tableName' => 'featured_event_1',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$featured_event_1Record = @$featured_event_1Records[0]; // get first record
?>

<?php foreach ($featured_event_1Record['featured_image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<a href="<?php echo $featured_event_1Record['_link'] ?>" title="<?php echo $featured_event_1Record['title'] ?>" ><img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo $featured_event_1Record['title'] ?>" border="0" /></a><br/>

<?php elseif ($upload['isImage']): ?>
<a href="<?php echo $featured_event_1Record['_link'] ?>" title="<?php echo $featured_event_1Record['title'] ?>" ><img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="<?php echo $featured_event_1Record['title'] ?>" border="0" /></a><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
</a>

<?php if (!$featured_event_1Record): ?>
<a href="http://www.lakesidesurrey.co.uk/lcc_events.php" title="More shows">See more shows</a><br/><br/>
<?php endif ?>



FEATURED_EVENT2:
<?php
list($featured_event_2Records, $featured_event_2MetaData) = getRecords(array(
'tableName' => 'featured_event_2',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$featured_event_2Record = @$featured_event_2Records[0]; // get first record
?>
<?php foreach ($featured_event_2Record['featured_image'] as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>
<img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="" /><br/>

<?php elseif ($upload['isImage']): ?>
<img src="<?php echo $upload['urlPath'] ?>" width="<?php echo $upload['width'] ?>" height="<?php echo $upload['height'] ?>" alt="" /><br/>

<?php else: ?>
<a href="<?php echo $upload['urlPath'] ?>">Download <?php echo $upload['filename'] ?></a><br/>

<?php endif ?>
<?php endforeach ?>
</a>

<?php if (!$featured_event_2Record): ?>
<a href="http://www.lakesidesurrey.co.uk/lcc_events.php" title="More shows">See more shows</a><br/><br/>
<?php endif ?>

Re: [terryally] Display problem with VIEW URL

By Chris - February 1, 2010

Hi Terry,

Your featured event includes are using the record number of the request to select records. Can you try removing this line in both your featured event includes?

// FEATURED_EVENT1

<?php
list($featured_event_1Records, $featured_event_1MetaData) = getRecords(array(
'tableName' => 'featured_event_1',
'where' => whereRecordNumberInUrl(1),
'limit' => '1',
));
$featured_event_1Record = @$featured_event_1Records[0]; // get first record
?>


I hope this helps! Please let me know if you have any questions.
All the best,
Chris

Re: [chris] Display problem with VIEW URL

That did the trick Chris. Merci beacoup.