cvs: phpweb /include layout.inc prepend.inc

From: Date: Thu, 07 Aug 2003 09:30:05 +0000
Subject: cvs: phpweb /include layout.inc prepend.inc
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-19866@lists.php.net to get a copy of this message
goba Thu Aug 7 05:30:05 2003 EDT Modified files: /phpweb/include prepend.inc layout.inc Log: Adding the new CSS based header and footer on an experimenting page (thanks.php), also removing time measurement code from prepend.inc and layout.inc Index: phpweb/include/prepend.inc diff -u phpweb/include/prepend.inc:1.29 phpweb/include/prepend.inc:1.30 --- phpweb/include/prepend.inc:1.29 Tue Jul 29 08:55:24 2003 +++ phpweb/include/prepend.inc Thu Aug 7 05:30:05 2003 @@ -1,9 +1,6 @@ <?php // -*- C++ -*- -// $Id: prepend.inc,v 1.29 2003/07/29 12:55:24 goba Exp $ - -// Start measuring time spent on page -$page_creation_start = getmicrotime(); +// $Id: prepend.inc,v 1.30 2003/08/07 09:30:05 goba Exp $ // See http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.9 // for cache control header descriptions (used in many places on the site). @@ -86,13 +83,6 @@ unset($GLOBALS[$name]); } } -} - -// Utility function used for time measuring -function getmicrotime() -{ - list($usec, $sec) = explode(" ", microtime()); - return ((float) $usec + (float) $sec); } // Load in the user preferences Index: phpweb/include/layout.inc diff -u phpweb/include/layout.inc:1.173 phpweb/include/layout.inc:1.174 --- phpweb/include/layout.inc:1.173 Sun Aug 3 13:23:03 2003 +++ phpweb/include/layout.inc Thu Aug 7 05:30:05 2003 @@ -1,5 +1,5 @@ <?php -/* $Id: layout.inc,v 1.173 2003/08/03 17:23:03 goba Exp $ */ +/* $Id: layout.inc,v 1.174 2003/08/07 09:30:05 goba Exp $ */ // Set the static content root differently on php.net $_SERVER['STATIC_ROOT'] = ($MYSITE == 'http://www.php.net/') ? @@ -45,6 +45,113 @@ else { echo $highlighted; } } +/* These functions are only used on the new XHTML 1.0 Strict compatible + pages, and are used as an experiment, but are going to replace the + commonHeader and commonFooter functions in the future altogether */ +function site_header($title = '', $onload = '') +{ + global $EXPL_LANG; + + if (!empty($title)) { $title = ": $title"; } + if (empty($onload)) { $onload = "searchHistory(); tocImages();"; } + if (isset($EXPL_LANG)) { + $lang_input = '<input type="hidden" name="lang" value="'. $EXPL_LANG . '" />'; + } else { $lang_input = ''; } + + print <<<END_HEADER +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" + "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> +<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> +<head> + <title>PHP.net{$title}</title> + <style type="text/css">@import url("{$_SERVER['STATIC_ROOT']}/sitewide.css");</style> + <link rel="shortcut icon" href="{$_SERVER['STATIC_ROOT']}/favicon.ico" /> + <script type="text/javascript" src="{$_SERVER['STATIC_ROOT']}/userprefs.js"></script> + <base href="{$_SERVER['BASE_HREF']}" /> +</head> +<body onload="{$onload}"> +<div id="headnav"> + <a href="/"><img src="{$_SERVER['STATIC_ROOT']}/images/php.gif" + alt="PHP" width="120" height="67" /></a> + <div id="headmenu"> + <a href="/downloads.php">downloads</a> | + <a href="/docs.php">documentation</a> | + <a href="/FAQ.php">faq</a> | + <a href="/support.php">getting help</a> | + <a href="/mailing-lists.php">mailing lists</a> | + <a href="http://bugs.php.net/">reporting bugs</a> | + <a href="/sites.php">php.net sites</a> | + <a href="/links.php">links</a> | + <a href="/my.php">my php.net</a> + </div> +</div> + +<div id="headsearch"> + <form method="post" action="/search.php" id="topsearch"> + <p> + <span title="Keyboard shortcut: Alt+S (Win), Ctrl+S (Apple)"> + <span class="shortkey">s</span>earch for + </span> + <input type="text" name="pattern" value="" size="30" accesskey="s" /> + <span>in the</span> + <select name="show"> + <option value="quickref" selected="selected">function list</option> + <option value="wholesite">whole site</option> + <option value="manual" >online documentation [en]</option> + <option value="bugdb" >bug database</option> + <option value="maillist" >general mailing list</option> + <option value="devlist" >developer mailing list</option> + <option value="phpdoc" >documentation mailing list </option> + </select> + <input type="image" + src="{$_SERVER['STATIC_ROOT']}/images/small_submit_white.gif" + class="submit" alt="search" /> + {$lang_input} + </p> + </form> +</div> + +<div id="content"> +END_HEADER; +} + +// See the comment for site_header() above +function site_footer() +{ + global $LAST_UPDATED; + + $stats = (have_stats() ? "\n <a href=\"/stats/\">stats</a> |" : ""); + $provider_url = mirror_provider_url(); + $provider_name = mirror_provider(); + $last_updated = strftime("%c %Z", $LAST_UPDATED); + + print <<<END_FOOTER +</div> + +<div id="footnav"> + <a href="/source.php?url=/{$SERVER['BASE_PAGE']}">show source</a> | + <a href="/credits.php">credits</a> |$stats + <a href="/mirrors.php">mirror sites</a> +</div> + +<div id="pagefooter"> + <div id="copyright"> + <a href="/copyright.php">Copyright &copy; 2001-2003 The PHP Group</a><br /> + All rights reserved. + </div> + + <div id="thismirror"> + <a href="/mirror.php">This mirror</a> generously provided by: + <a href="{$provider_url}">{$provider_name}</a><br /> + Last updated: {$last_updated} + </div> +</div> + +</body> +</html> +END_FOOTER; +} + // Print an image for a sized spacer function spacer($width = 1, $height = 1, $return = FALSE, $align = FALSE, $extras = FALSE) { @@ -396,7 +503,6 @@ </body> </html> <?php - echo "<!-- " . (getmicrotime() - $page_creation_start) . " -->\n"; } function sect_to_file($string) {

« previous php.mirrors (#19866) next »