|
Posted by Steve on 03/24/07 21:41
| > if you have no idea how to do this, i'd be happy to post a couple of
pages
| > of code that integrates security.
|
| Yes, please!
site.cfg.php is required by every page. this next script is used most of the
time but not always. it sets up the basic look/feel of the site...if the
$securityEnable variable is set, then the page including this script will
only be accessible via a login. you will want to modify the header and
footer to suit your needs...just keep the logic entact.
======= header.inc.php
<?
require_once 'relative.path.php';
require_once $relativePath . 'site.cfg.php';
$showHeader = isset($showHeader) ? $showHeader : true;
$fullHeader = isset($fullHeader) ? $fullHeader : true;
$outputMenu = isset($outputMenu) ? $outputMenu : true;
$sessionHeader = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01
Transitional//EN\">
\r\n";
$sessionHeader .= "<html>
\r\n";
$sessionHeader .= " <head>
\r\n";
$sessionHeader .= " <title>$pageTitle</title>
\r\n";
$sessionHeader .= " <meta http-equiv=\"content-type\"
content=\"text/html; charset=iso-8859-1\">
\r\n";
$sessionHeader .= " <meta name=\"description\"
content=\"$listDescription\">
\r\n";
$sessionHeader .= " <meta name=\"keywords\" content=\"$listKeywords\">
\r\n";
$sessionHeader .= " <link rel=\"stylesheet\" type=\"text/css\" href=\"" .
$site->cssDirectory . "base.css.php" . "\"> \r\n";
$sessionHeader .= " <script type=\"text/javascript\" src=\"" .
$site->jscriptDirectory . "standard.js" . "\"></script>
\r\n";
$sessionHeader .= " </head>
\r\n";
if (!$enableContextMenu)
{
$sessionHeader .= " <script language=\"javascript\">
\r\n";
$sessionHeader .= " document.onmousedown=clickFilter;
\r\n";
$sessionHeader .= " document.onmouseup=clickFilter;
\r\n";
$sessionHeader .= " if (document.layers)
window.captureEvents(Event.MOUSEDOWN);
\r\n";
$sessionHeader .= " if (document.layers)
window.captureEvents(Event.MOUSEUP);
\r\n";
$sessionHeader .= " window.onmousedown=clickFilter;
\r\n";
$sessionHeader .= " window.onmouseup=clickFilter;
\r\n";
$sessionHeader .= " document.oncontextmenu=new Function('return
false;') \r\n";
$sessionHeader .= " </script>
\r\n";
}
$sessionHeader .= " <body>
\r\n";
$sessionHeader .= " <!----- start page header -----!>
\r\n";
if ($securityEnabled)
{
require_once $site->includeDirectory . 'security.inc.php';
$sessionHeader .= " <head>
\r\n";
$sessionHeader .= " <meta forua=\"true\"
http-equiv=\"cache-control\" content=\"no-cache, must-revalidate\">
\r\n";
$sessionHeader .= " <meta forua=\"true\" http-equiv=\"expires\"
content=\"-1\"> \r\n";
$sessionHeader .= " <meta forua=\"true\" http-equiv=\"pragma\"
content=\"no-cache\"> \r\n";
$sessionHeader .= " </head>
\r\n";
}
$sessionHeader .= " <div class=\"body\" style=\"background-image:url("
.. $site->imagesDirectory . 'background.jpg' . ");\"> \r\n";
if ($fullHeader)
{
$sessionHeader .= " <div style=\"background:white no-repeat url(" .
$site->imagesDirectory . 'header.jpg' . "); height:270px; margin-left:20px;
margin-right:20px; padding-top:270px; width:790px;\">\r\n";
} else {
$sessionHeader .= " <div style=\"background:white no-repeat url(" .
$site->imagesDirectory . 'header.jpg' . "); height:100px; margin-left:20px;
margin-right:20px; padding-top:100px; width:790px;\">\r\n";
}
$menuItems = array();
if ($userVerified && $outputMenu)
{
$menuItems = array(
'Dashboard' => $site->uri ,
'Create Report' => $site->uri . '?' ,
'Edit Profile' => $site->uri . '?' ,
'Help' => $site->uri . '?' ,
'Log Out' => $site->uri . '?logOut=yes'
);
$sessionHeader .= " <div style=\"padding-right:2px;
position:absolute; top:88px; width:800px;\">
\r\n";
foreach ($menuItems as $description => $uri)
{
$style = $description == 'Log Out' ? 'style="float:right;
margin-right:5px;"' : 'style="float:left; margin-left:8px"';
$sessionHeader .= " <span " . $style . ">
\r\n";
$sessionHeader .= " <a class=\"topMenu\" href=\"" . $uri .
"\"><span class=\"menuItem\" style=\"border:solid 1px white;
width:100px;\">" . $description . "</span></a>\r\n";
$sessionHeader .= " </span>
\r\n";
}
$sessionHeader .= " </div>
\r\n";
}
$sessionHeader .= " <!----- end page header -----!>
\r\n";
$sessionHeader .= " <div class=\"pageContent\">
\r\n";
$sessionHeader .= " <!----- start page content -----!>
\r\n";
$sessionHeader .= "
\r\n\r\n";
$sessionFooter = "
\r\n\r\n";
$sessionFooter .= " <!----- end page content -----!>
\r\n";
$sessionFooter .= " <!----- start page footer -----!>
\r\n";
$sessionFooter .= " <br clear=\"all\">
\r\n";
$sessionFooter .= " <div class=\"footer\"
style=\"background-image:url(" . $site->imagesDirectory . 'border.jpg' . ");
width:790px;\"> \r\n";
$sessionFooter .= " <span style=\"color:gray; float:left;
padding-top:15px;\">© " . date('Y') . " Summit Consulting Int'l,
Inc.</span> \r\n";
if ($userVerified && $outputMenu)
{
$menuItems = array_reverse($menuItems);
foreach ($menuItems as $description => $uri)
{
$sessionFooter .= " <span style=\"float:right; font-size:8pt;
padding-right:10px; padding-top:15px;\"> \r\n";
$sessionFooter .= " <a class=\"menuItem\" href=\"" . $uri .
"\" style=\"background-color:white; border-bottom:none; border-top:none;
color:gray; padding-left:5px; padding-right:5px;\">" . $description .
"</a>\r\n";
$sessionFooter .= " </span>
\r\n";
}
}
$sessionFooter .= " </div>
\r\n";
$sessionFooter .= " <!----- end page footer -----!>
\r\n";
$sessionFooter .= " </div>
\r\n";
$sessionFooter .= " </div>
\r\n";
$sessionFooter .= " </div>
\r\n";
$sessionFooter .= " </body>
\r\n";
$sessionFooter .= "</html>
\r\n";
if ($showHeader){ echo $sessionHeader; }
siteTracking($site->currentPage, $userName);
?>
Navigation:
[Reply to this message]
|