Location: PHPKode > scripts > Lightning Notes > ln_distro/ln_distro/category.php
<?php
$idx = $HTTP_SERVER_VARS['QUERY_STRING'];
if (isset($idx) && (!empty($idx))) {
    $idy = strip_tags($idx);
    $idz = escapeshellcmd($idy);
    $cat = $idz;
    
    if ($cat == 'features') {
        header('Location: feature.php'); // full URL here
    }
}
require_once ("admin/config.php");
require_once ("$DOCUMENT_ROOT/".$CFGglobal['root']."/admin/notesfnc.php");
$tree = GetXMLTree("$DOCUMENT_ROOT/".$CFGglobal['root']."/admin/entries.xml");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<?php
echo '<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="'.$CFGglobal['lang'].'" lang="'.$CFGglobal['lang'].'">'."\n";
echo '<head>'."\n";
    echo '<title>'.$CFGglobal['title'].' [Categories]</title>'."\n";
    echo '<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />'."\n";
    echo '<meta name="content-language" content="'.$CFGglobal['lang'].'" />'."\n";
    echo '<link rel="stylesheet" media="screen" href="/'.$CFGglobal['root'].'/c/screen.css" type="text/css" />'."\n";
    echo '<link rel="alternate stylesheet" media="screen" href="/'.$CFGglobal['root'].'/c/clean.css" type="text/css" title="clean" />'."\n";
    #echo '<link rel="alternate stylesheet" media="screen" href="/'.$CFGglobal['root'].'/c/large.css" type="text/css" title="large" />'."\n";
    echo '<link rel="stylesheet" media="print" href="/'.$CFGglobal['root'].'/c/print.css" type="text/css" />'."\n";
    echo '<script type="text/javascript" src="/'.$CFGglobal['root'].'/j/styleswitcher.js"></script>'."\n";
    echo '<link rel="start" title="Home page" href="'.$CFGglobal['domain'].'/'.$CFGglobal['root'].'/" />'."\n";
    echo '<link rel="contents" title="Categories" href="categories.php" />'."\n";
    echo '<link rel="search" title="Search this site" href="search.php" />'."\n";
    echo '<link rel="help" title="Access features of this site" href="'.$CFGglobal['domain'].'/'.$CFGglobal['root'].'/archive.php?entry=20030729accessibility_statement" />'."\n";
    echo '<link rel="author" title="Send feedback to the author" href="mailto:'.$CFGauthor['email'].'" />'."\n";
    echo '<link rel="up" title="Index" href="/'.$CFGglobal['root'].'/" />'."\n";
    include_once("$DOCUMENT_ROOT/".$CFGglobal['root']."/admin/analytics.php");
?>
</head>
<body id="cat">

<div id="masthead">
<?php
echo '<h1><a href="/'.$CFGglobal['root'].'/"><span>'.$CFGglobal['title'].'</span></a></h1>'."\n";
?>
</div>
<p class="skip"><a href="#nav">Navigation</a> &#187;</p>
<div id="recent">
<?php
echo '<p>'.$CFGglobal['abouthome'].'</p>'."\n";
echo '<p class="auth">&#8212;'.$CFGauthor['name'].'</p>'."\n";
echo '<h2>Recent Entries</h2>'."\n";
echo entrieslist ($tree, $id, $category = '', $entries = '5', $showdate = '0');
?>
</div>

<div id="content">
<?php
if (isset($cat) && (!empty($cat))) {
    $category = $cat;
    $catname = str_replace("_", " ", $category);
    echo '<h2>Category: '.strtoupper($catname).'</h2>'."\n";
    echo entriesbycat ($tree, $id, $category, $entries = '', $showdate = '0');
} else {
    echo '<h2>Categories</h2>'."\n";
    echo '<ul>'."\n";
    echo categories ($tree, $showsubcat = '1');
    echo '</ul>'."\n";
}
?>
</div>

<div id="nav">
<?php
include("$DOCUMENT_ROOT/".$CFGglobal['root']."/admin/nav.inc");
?>
</div>

</body>
</html>
Return current item: Lightning Notes