CVS update: phpweb/include

From: Date: Sun, 05 Sep 1999 20:57:34 +0000
Subject: CVS update: phpweb/include
Groups: php.mirrors 
Request: Send a blank email to php-mirrors+get-416@lists.php.net to get a copy of this message
Date: Sunday September 5, 1999 @ 16:57 Author: rasmus Update of /repository/phpweb/include In directory php:/local/Web/sites/phpweb/include Modified Files: shared-manual.inc Log Message: Send Last-Modified headers from manual pages. If page has a user comment use date of comment, and otherwise just use the file's timestamp. Should help people going through proxies. Index: phpweb/include/shared-manual.inc diff -u phpweb/include/shared-manual.inc:1.28 phpweb/include/shared-manual.inc:1.29 --- phpweb/include/shared-manual.inc:1.28 Sat Jun 19 18:41:41 1999 +++ phpweb/include/shared-manual.inc Sun Sep 5 16:57:33 1999 @@ -1,4 +1,25 @@ <?php // -*- C++ -*- +function manualLastModified($title) { + global $MYSITE, $SCRIPT_FILENAME; + if(strstr($MYSITE,"www.php.net")) { + $host = 'localhost'; + $user = ''; + $pass = ''; + $db_id = mysql_pconnect($host, $user, $pass); + $query = "SELECT UNIX_TIMESTAMP(ts) AS stamp FROM note WHERE sect = '$title' ORDER BY ts DESC limit 1"; + $result_id = mysql_db_query("php3", $query, $db_id); + } else { + $result_id = 0; + } + if($result_id && mysql_num_rows($result_id)) { + $t = mysql_fetch_row($result_id); + Header("Last-Modified: ".gmdate("D, d M Y H:i:s",$t[0])." GMT"); + } else { + Header("Last-Modified: ".gmdate("D, d M Y H:i:s",filemtime($SCRIPT_FILENAME))." GMT"); + } + if($result_id) mysql_free_result($result_id); +} + require("shared.inc"); $FRAMEMODE="manual"; @@ -171,7 +192,6 @@ <? }; - function manualUserNotes($title) { global $MYSITE; if(strstr($MYSITE,"www.php.net")) { @@ -204,6 +224,7 @@ function manualHeader($title) { global $FRAMEMODE, $HTDIG; + manualLastModified($title); commonHeader("Manual: $title"); if (!$HTDIG): navigationBar($title);

« previous php.mirrors (#416) next »