I am very new to this, please be kind...
How do I construct a crawler which checks the content of the local directory and returns files of a specific type for display in xhtml? ...say, for example in the subnav... so when new content files are uploaded, they are added to the nav for that directory on load...
Best case: the filenames do not dictate the displayed link name.
Demo URL
http://neilballer.com/dynasub/
//--Structure --//
index.php
<?php
require ('config.php');
$strPagename = 'index';
require ('header.php');
require ('content.php');
require ('subnav.php');
?>
config.php (all text content sans links - soon to be fed by MySQL...)
<?PHP $aryConfig = array(
/ header /
"index" => array (
"base" => "http://neilballer.com/" ,
"title" => "Neil Baller : WEB BANNERS" ,
"header" => "Neil Baller : WEB BANNERS" ,
"author" => "Neil Baller" ,
"contact" => "../contact.html" ,
/ subnav content/
"1" => "VERB CAMPAIGN" ,
"11" => "Phase One" ,
"11desc" => "The early stages of the relationship. Intrigue is key." ,
"12" => "Phase Two" ,
"12desc" => "With high traffic comes high expectations. Deliver on the promise!" ,
"13" => "Phase Three" ,
"13desc" => "Act on research results. Use the work." ,
"2" => "U.S. POST OFFICE" ,
"21" => "Item One" ,
"21desc" => "Description of content." ,
"22" => "Item Two" ,
"22desc" => "Description of content." ,
"23" => "" ,
"23desc" => "" ,
"3" => "SAM'S WINES" ,
"31" => "Pay-Per-Click Helps" ,
"31desc" => "One banner, hundreds of sales." ,
"32" => "" ,
"32desc" => "" ,
.......etc.......
);
?>
header.php (xhtml preamble and php)
<!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">
<html>
<?php
if (empty ($strTitle)) { $strTitle = $aryConfig[$strPagename]["title"]; }
if (empty ($strHeader)) { $strHeader = $aryConfig[$strPagename]["header"]; }
?>
<head>
<title><?php print $strTitle; ?></title>
<style type="text/css" media="all">@import "../css/robomenu.css";</style>
</head>
<body bgcolor="#ffffff">
<h1 div id="Header"><?php print $strHeader; ?></h1>
<p><div id="HeaderSubNav"><a href="../index.html" title="home">Home</a> | <a href="../contact.html" title="Email neil baller">Contact</a></div></p>
<!-- header end -->
subnav.php (nav for directory and wrapup)
<?php
if (empty ($str1)) { $str1 = $aryConfig[$strPagename]["1"]; }
if (empty ($str11)) { $str11 = $aryConfig[$strPagename]["11"]; }
if (empty ($str11desc)) { $str11desc = $aryConfig[$strPagename]["11desc"]; }
if (empty ($str12)) { $str12 = $aryConfig[$strPagename]["12"]; }
if (empty ($str12desc)) { $str12desc = $aryConfig[$strPagename]["12desc"]; }
if (empty ($str13)) { $str13 = $aryConfig[$strPagename]["13"]; }
if (empty ($str13desc)) { $str13desc = $aryConfig[$strPagename]["13desc"]; }
if (empty ($str2)) { $str2 = $aryConfig[$strPagename]["2"]; }
if (empty ($str21)) { $str21 = $aryConfig[$strPagename]["21"]; }
if (empty ($str21desc)) { $str21desc = $aryConfig[$strPagename]["21desc"]; }
if (empty ($str22)) { $str22 = $aryConfig[$strPagename]["22"]; }
if (empty ($str22desc)) { $str22desc = $aryConfig[$strPagename]["22desc"]; }
if (empty ($str23)) { $str23 = $aryConfig[$strPagename]["23"]; }
if (empty ($str23desc)) { $str23desc = $aryConfig[$strPagename]["23desc"]; }
if (empty ($str3)) { $str3 = $aryConfig[$strPagename]["3"]; }
if (empty ($str31)) { $str31 = $aryConfig[$strPagename]["31"]; }
if (empty ($str31desc)) { $str31desc = $aryConfig[$strPagename]["31desc"]; }
if (empty ($str32)) { $str32 = $aryConfig[$strPagename]["32"]; }
if (empty ($str32desc)) { $str32desc = $aryConfig[$strPagename]["32desc"]; }
if (empty ($str33)) { $str33 = $aryConfig[$strPagename]["33"]; }
if (empty ($str33desc)) { $str33desc = $aryConfig[$strPagename]["33desc"]; }
?>
<div id="SubNav"><h2 class="first"><?php print $str1; ?></h2>
<p><a href="#" title="<?php print $str1; ?> <?php print $str11; ?>"><?php print $str11; ?></a><br /><em><?php print $str11desc; ?></em></p>
<p><a href="#" title="<?php print $str1; ?> <?php print $str12; ?>"><?php print $str12; ?></a><br /><em><?php print $str12desc; ?></em></p>
<p><a href="#" title="<?php print $str1; ?> <?php print $str13; ?>"><?php print $str13; ?></a><br /><em><?php print $str13desc; ?></em></p>
<h2><?php print $str2; ?></h2>
<p><a href="#" title="<?php print $str2; ?> <?php print $str21; ?>"><?php print $str21; ?></a><br /><em><?php print $str21desc; ?></em></p>
<p><a href="#" title="<?php print $str2; ?> <?php print $str22; ?>"><?php print $str22; ?></a><br /><em><?php print $str22desc; ?></em></p>
<!--<p><a href="#" title="<?php print $str2; ?> <?php print $str23; ?>"><?php print $str23; ?></a><br /><em><?php print $str23desc; ?></em></p> -->
<h2><?php print $str3; ?></h2>
<p><a href="" title="<?php print $str3; ?> web banner"><?php print $str31; ?></a><br /><em><?php print $str31desc; ?></em></p>
<!--<p><a href="#" title="<?php print $str3; ?> <?php print $str32; ?>"><?php print $str32; ?></a><br /><em><?php print $str32desc; ?></em></p> -->
<!--<p><a href="#" title="<?php print $str3; ?> <?php print $str33; ?>"><?php print $str33; ?></a><br /><em><?php print $str33desc; ?></em></p> -->
</div>
</body>
</html>
<!-- the wrapup -- >
Any suggestions? Feeding static print string seems a little odd. I tried using variables, but no luck...
Thanks everyone!