Thanks Pikachu
Thanks for the info. I have now installed a Wamp Server with PHP / phpmyadmin / et al. And I can create aliases which point to local code repositories. ;-)
I still am missing graphics and I'm assuming it's this short open tags stuff. But the code is confusing me.
I also saw something about eval earlier which confuses me even more.
Here is a code snippet. What is wrong as if I change lots of the <? & <?= lines to the relevant <?php or <php echo I get the same problem before I change the short flag to on from off.
for e.g
<?php require(dirname(__FILE__).'/pre-processor.php'); // Start the CMS ?>
<?php require(dirname(__FILE__).'/html-header.php'); // Load the HTML Header data ?>
<?php
$pageID = strtolower(substr(str_replace('.php', '', str_replace('/', '-', $_SERVER["REQUEST_URI"])), 1));
?>
<body id="top" class="<?=$pageID;?>">
<div id="content">
<div id="header">
<h1 id="logo"><a href="<?=SITE_URL;?>"><img class="logo" alt="RH Layout" title="RH Layout" src="<?=IMAGE_RESOURCE_URL;?>/logo.png" /><span id="text-replacement">RH Layout</span></a></h1>
<div id="accessibility">
<?php
$generic_params = '';
if($vars_str != null) {
$generic_params = UrlHelper::addParameter($generic_params, 'vars', $vars_str); }
if($from_str != null) {
$generic_params = UrlHelper::addParameter($generic_params, 'from', $from_str); }
$signin_url = 'sign-in.php'.$generic_params;
$signout_url = 'sign-out.php'.$generic_params;
$register_url = 'register.php'.$generic_params;
$forgot_url = 'forgot-password.php'.$generic_params;
?>
<?php if($LOGGED_IN) :
// Work out the user's name
$user = $SECURE->getUser();
$fullname = $user->get($user->username());
$forename = $user->get($user->forename());
$surname = $user->get($user->surname());
if(!empty($forename) && empty($surname)) {
$fullname = $forename; }
else if(!empty($forename) && !empty($surname)) {
$fullname = $forename.' '.$surname; }
?>
Hello <strong><a href="<?=SITE_URL;?>/customer/my-account.php" title="View your account"><?=$fullname;?></a></strong>
<?php if($SUBSCRIBER) : ?>
<span class="subscriber">*</span>
<?php endif; ?>
/ <a href="<?=SITE_URL;?>/customer/<?=$signout_url;?>">Sign-out</a>
<?php else : // not logged in ?>
<a href="<?=SITE_URL;?>/customer/<?=$register_url;?>">Register</a></li> /
<a href="<?=SITE_URL;?>/customer/<?=$signin_url;?>">Sign-in</a>
<?php endif; ?>
</div>
<div id="basket">
my basket
<ul>
<li class="item"><a href="<?=SITE_URL;?>/store/basket.php"><?=($SHOPPING_CART->getItemCount() == 1) ? $SHOPPING_CART->getItemCount().' item' : $SHOPPING_CART->getItemCount().' items';?></a></li>
<?php if($LOGGED_IN && $SUBSCRIBER) : ?>
<li class="price">£n/a</li>
<?php else : ?>
<li class="price">£<?=StringHelper::formatCurrency($SHOPPING_CART->getGrandTotal());?></li>
<?php endif; ?>
</ul>
</div>
<?php
// Highlight the current page
function isSelected($current, $page, $getVar=null, $notGetVar=null, $noClass=false) {
$selected_noclass = 'selected';
$selected = ' class="'.$selected_noclass.'"'; // Highlight the current page
if($current==$page) {
if((!is_null($getVar) && !isset($_GET[$getVar]))) {
return null; }
if((!is_null($notGetVar) && isset($_GET[$notGetVar]))) {
return null; }
if($noClass) {
return $selected_noclass; }
else {
return $selected; }
}}
?>
<div id="nav-bar">
<ul id="nav">
<li<?=isSelected($FILENAME, 'index.php');?>><a href="<?=SITE_URL;?>">Home</a></li>
<?php if($LOGGED_IN) : /***** CUSTOMER MENU WHEN LOGGED-IN *****/ ?>
<?php require(dirname(__FILE__).'/menus/memberOptions.php'); ?>
<?php endif; // end /***** CUSTOMER MENU WHEN LOGGED-IN *****/ ?>
<?php if(!$LOGGED_IN) : /***** FREE TRIAL MENU WHEN NOT LOGGED-IN *****/ ?>
<li<?=isSelected($FILENAME, 'browse.php', 'free');?>><a href="<?=SITE_URL;?>/store/browse.php?free=yes&tid=all">Free Trial<span> </span></a>
<ul>
<?php
try { $CATALOGUE_ELEMENTS->menuTypes(SITE_URL.'/store/browse.php?free=yes',
(($FILENAME == 'browse.php' && isset($_GET['tid'])) ? $_GET['tid'] : null), false, false); }
catch(Exception $e) {echo '<ul><li>'.$e->__toString().'</li></ul>';}
?>
<li><a href="<?=SITE_URL;?>/store/browse.php?free=yes&tid=all">All Free Templates</a></li>
</ul></li>
<?php endif; // end /***** CUSTOMER MENU WHEN LOGGED-IN *****/ ?>
<li<?=isSelected($FILENAME, 'subscriptions.php');?>><a href="<?=SITE_URL;?>/store/subscriptions.php">Product Range<span> </span></a>
<ul>
<?php
try { $CATALOGUE_ELEMENTS->menuSubscriptions(SITE_URL.'/store/subscriptions.php?',
(($FILENAME == 'subscriptions.php' && isset($_GET['pid'])) ? $_GET['pid'] : null), false, false); }
catch(Exception $e) {echo '<ul><li>'.$e->__toString().'</li></ul>';}
?>
</ul></li>
<li<?=isSelected($FILENAME, 'browse.php', null, 'free');?><?=isSelected($FILENAME, 'template.php');?>><a href="<?=SITE_URL;?>/store/browse.php">Templates<span> </span></a>
<ul>
<?php
try { $CATALOGUE_ELEMENTS->menuTypes(SITE_URL.'/store/browse.php',
(($FILENAME == 'browse.php' && isset($_GET['tid'])) ? $_GET['tid'] : null), false, false); }
catch(Exception $e) {echo '<ul><li>'.$e->__toString().'</li></ul>';}
?></ul></li>
<li class="last
<?=isSelected($FILENAME, 'frequently-asked-questions.php', null, null, true);?>
<?=isSelected($FILENAME, 'help-guide.php', null, null, true);?>
<?=isSelected($FILENAME, 'contact-us.php', null, null, true);?>"><a href="#">Support<span> </span></a>
<ul>
<li><a href="<?=SITE_URL;?>/customer/my-account.php">My Account</a></li>
<li><a href="<?=SITE_URL;?>/frequently-asked-questions.php">FAQ</a></li>
<li><a href="<?=SITE_URL;?>/help-guide.php">Help Guide</a></li>
<li><a href="<?=SITE_URL;?>/contact-us.php">Contact Us</a></li>
</ul></li>
</ul>
<form id="search-form" action="<?=SITE_URL;?>/search.php" method="get">
<div style="float:left;">
<label for="query">Search</label>
<input type="text" id="query" name="query" />
<input type="hidden" name="search" value="1" />
</div>
<input class="submit" type="image" src="<?=IMAGE_RESOURCE_URL;?>/go-button.png" alt="Go" />
</form>
</div>
</div>
<div id="main">
<?php if($FILENAME == 'index.php') : ?>
<div id="flashbox">
<!-- exchange the header code below for flash code if wanted -->
<h1 class="main"><strong>Welcome to</strong>RH Layout</h1>
</div>
<?php endif; ?>
<div id="section">
Sorry it may not look to pretty as I just cut & pasted.
Thanks in advance.