CVS: web/include footer.php,NONE,1.1 header.php,NONE,1.1 navigation.p...
Brought to you by:
iridium
From: Martin G. <gim...@us...> - 2002-03-18 16:51:40
|
Update of /cvsroot/phpweather/web/include In directory usw-pr-cvs1:/tmp/cvs-serv4308 Added Files: footer.php header.php navigation.php Log Message: Header and footer-files for the website. --- NEW FILE --- <hr> <a href="http://sourceforge.net/projects/phpweather/"><img src="http://sourceforge.net/sflogo.php?group_id=23245" width="88" height="31" border="0" alt="SourceForge Logo" align="right"></a> <p>This page was last modified on <? echo date('F \t\h\e jS, Y', getlastmod()) ?>.</p> </body> </html> --- NEW FILE --- <?php if ($SERVER_NAME == 'gimpster.bolignet-aarhus.dk') { define('ROOT', '/php/phpweather-web'); } else { define('ROOT', ''); } include('navigation.php'); ?> <html> <head> <title>PHP Weather: <?php echo $pages[$PHP_SELF]['title'] ?></title> <link rel="stylesheet" type="text/css" href="<?php echo ROOT ?>/style.css"> <!-- <link rel="shortcut icon" href="/favicon.ico"> --> </head> <body> <?php /* Make the links. */ print_parents(substr($PHP_SELF, strlen(ROOT))); print_siblings(substr($PHP_SELF, strlen(ROOT))); echo "<hr>\n"; print_greeting(substr($PHP_SELF, strlen(ROOT))); ?> --- NEW FILE --- <?php $pages['/index.php'] = array('title' => 'PHP Weather', 'greeting' => 'Welcome to PHP Weather', 'children' => array(//'/downloads.php', '/docs/index.php', '/support.php', '/links.php')); /* $pages['/downloads.php'] = array('title' => 'Downloads', 'parent' => '/index.php'); */ $pages['/docs/index.php'] = array('title' => 'Documentation', 'greeting' => 'Documentaion for PHP Weather', 'parent' => '/index.php', 'children' => array('/docs/1.x/index.php', '/docs/2.x/index.php')); $pages['/docs/1.x/index.php'] = array('title' => 'Version 1.x', 'parent' => '/docs/index.php', 'children' => array('/docs/1.x/demo.php', '/docs/1.x/using.php', '/docs/1.x/dbcaching.php', '/docs/1.x/translation.php', '/docs/1.x/usingwap.php')); $pages['/docs/1.x/demo.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Demo', 'greeting' => 'Demonstration'); $pages['/docs/1.x/using.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Using PHP Weather'); $pages['/docs/1.x/usingwap.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'WAP', 'greeting' => 'How to WAP?'); $pages['/docs/1.x/dbcaching.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Caching', 'greeting' => 'Caching the METARs'); $pages['/docs/1.x/translation.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Translation'); $pages['/docs/1.x/support.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Support', 'greeting' => 'Getting Support'); $pages['/docs/1.x/download.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Download'); $pages['/docs/1.x/links.php'] = array('parent' => '/docs/1.x/index.php', 'title' => 'Links'); $pages['/docs/2.x/index.php'] = array('title' => 'Version 2.x', 'parent' => '/docs/index.php'); $pages['/support.php'] = array('title' => 'Support', 'greeting' => 'Getting Support for PHP Weather', 'parent' => '/index.php'); $pages['/links.php'] = array('title' => 'Links', 'greeting' => 'Links to Related Information', 'parent' => '/index.php'); function find_parents($node) { global $pages; if (!empty($pages[$node]['parent'])) { $parents = find_parents($pages[$node]['parent']); } $parents[$node] = $pages[$node]['title']; return $parents; } function print_parents($start_node) { global $pages; echo '<p class="nav-parents">The Internet'; $parents = find_parents($start_node, $pages); $count = count($parents); if (empty($pages[$start_node]['children'])) { $count--; } for ($i = 0; $i < $count; $i++) { list($node, $title) = each($parents); if ($node == $start_node) { echo " <b>-></b> <b>$title</b>"; } else { echo ' <b>-></b> <a href="' . ROOT . $node . "\">$title</a>"; } } echo ":</p>\n"; } function print_siblings($start_node) { global $pages; echo '<p class="nav-siblings">'; if (empty($pages[$start_node]['children'])) { /* No children. */ $parent = $pages[$pages[$start_node]['parent']]; $pipe = ''; foreach($parent['children'] as $node) { if ($node == $start_node) { if ($pipe != '') { // $pipe == '' at the beginning. $pipe = ' <b>/</b> '; } echo $pipe . '<b>' . $pages[$node]['title'] . '</b>'; $pipe = ' <b>\\</b> '; // We put a \ after the current node. } else { echo $pipe . '<a href="' . ROOT . $node . '">' . $pages[$node]['title'] . '</a>'; $pipe = ' <b>|</b> '; // A normal | after other nodes. } } } else { /* Children */ list($i, $child) = each($pages[$start_node]['children']); echo '<a href="' . ROOT . $child . '">' . $pages[$child]['title'] . '</a>'; while (list($i, $child) = each($pages[$start_node]['children'])) { echo ' <b>|</b> <a href="' . ROOT . $child . '">' . $pages[$child]['title'] . '</a>'; } } echo "</p>\n"; } function print_greeting($node) { global $pages; if (empty($pages[$node]['greeting'])) { echo '<h1>' . $pages[$node]['title'] . "</h1>\n"; } else { echo '<h1>' . $pages[$node]['greeting'] . "</h1>\n"; } } ?> |