11-13-2009, 06:40 PM
[eluser]GamingFusion[/eluser]
In my site i am using a simple templating system, where i load one view file and pass a variable to the view that contains what view file to load.
When a user is logged in the sidebar changes to accomidate the logged in user with a profiel and logout link.
But if you go to any other page the side bar seems to think the user isnt logged in even though they are.
The template file loads header.php and footer.php files. the header file contains the sidebar and the the code that check when the user is logged in.
here is all of header.php
and here is the template file you you dont quite understand
In my site i am using a simple templating system, where i load one view file and pass a variable to the view that contains what view file to load.
When a user is logged in the sidebar changes to accomidate the logged in user with a profiel and logout link.
But if you go to any other page the side bar seems to think the user isnt logged in even though they are.
The template file loads header.php and footer.php files. the header file contains the sidebar and the the code that check when the user is logged in.
here is all of header.php
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title><?php if(!isset($title)){ echo 'Untitled Document';}else{echo $title;} ?></title>
<link rel="stylesheet" href="http://localhost:8888/ci/css/<?php if(!isset($css)){ echo 'styles.css';}else{echo $css . '.css';;} ?>" type="text/css" media="screen" />
</head>
<body>
<div class="wrapper">
<div class="header">
<img src="http://localhost:8888/ci/img/logo.png" alt="Theatre311" />
<span><img src="http://localhost:8888/ci/img/ad.png" /></span>
</div>
<div class="sidebar">
<center><h3>Menu</h3></center>
<hr />
<ul>
<li><?=anchor('http://localhost:8888/ci', 'Home')?></li>
<li><?=anchor('theater/prices', 'Prices')?></li>
<li><?=anchor('theater/show', 'View Shows')?></li>
<li><?=anchor('theater/about', 'About Us')?></li>
<li><?=anchor('theater/contact', 'Contact Us')?></li>
<?php
if (isset($isLoggedIn))
{
echo '<li>' . anchor('members/profile', 'Profile') . '</li>';
echo '<li>' . anchor('members/logout', 'Logout') . '</li>';
}
else
{
echo anchor('members', 'Staff Login');
}
?>
<li><a href="mailto:[email protected]">Report a Bug</a></li>
</ul>
</div>
<div class="content">
and here is the template file you you dont quite understand
Code:
<?php $this->load->view('includes/header.php'); ?>
<?php $this->load->view($content); ?>
<?php $this->load->view('includes/footer.php'); ?>