cvs: php-gtk-web /include layout.php /manual browse-errata.php

[email protected] ("Colin Viebrock") Thu, 09 Aug 2001 18:39:00 -0000
Newsgroups php.gtk
Message-ID <cvscmv997382340@cvsserver>
cmv		Thu Aug  9 14:39:00 2001 EDT

  Modified files:              
    /php-gtk-web/include	layout.php 
    /php-gtk-web/manual	browse-errata.php 
  Log:
  fixes and testings
  
  
Index: php-gtk-web/include/layout.php
diff -u php-gtk-web/include/layout.php:1.11 php-gtk-web/include/layout.php:1.12
--- php-gtk-web/include/layout.php:1.11	Thu Aug  9 13:02:17 2001
+++ php-gtk-web/include/layout.php	Thu Aug  9 14:39:00 2001
@@ -1,5 +1,5 @@
 <?php
-/* $Id: layout.php,v 1.11 2001/08/09 17:02:17 cmv Exp $ */
+/* $Id: layout.php,v 1.12 2001/08/09 18:39:00 cmv Exp $ */
 
 
 # spacer()
@@ -311,3 +311,18 @@
 	return $text;
 }
 
+
+function sect_to_file($string) {
+        $string = strtolower($string);
+        $string = str_replace(' ','-',$string);
+        $string = str_replace('_','-',$string);
+        $func = "function.$string.php";
+        $chap = "ref.$string.php";
+        $feat = "features.$string.php";
+        $struct = "control-structures.$string.php";
+        if(is_file($func)) return $func;
+        else if(is_file($chap)) return $chap;
+        else if(is_file($feat)) return $feat;
+        else if(is_file($struct)) return $struct;
+        else return "$string.php";
+}
Index: php-gtk-web/manual/browse-errata.php
diff -u php-gtk-web/manual/browse-errata.php:1.1 php-gtk-web/manual/browse-errata.php:1.2
--- php-gtk-web/manual/browse-errata.php:1.1	Thu Aug  9 14:03:12 2001
+++ php-gtk-web/manual/browse-errata.php	Thu Aug  9 14:39:00 2001
@@ -28,8 +28,9 @@
 	$let = 'a';
 }
 
-$query = "SELECT *,UNIX_TIMESTAMP(ts) AS my_when FROM note where sect like '$let%' ORDER BY sect, ts ";
-if (($result = mysql_query($query)) && mysql_num_rows($result) > 0) {
+$query = "SELECT *, UNIX_TIMESTAMP(ts) AS my_when FROM note where sect like '$let%' ORDER BY sect, ts";
+$result = mysql_query($query) or die(mysql_error());
+if ( mysql_num_rows($result) > 0) {
 	$last = '';
 	while ($row = mysql_fetch_array($result)) {
 		if ($row['sect'] != $last)  {
@@ -41,7 +42,7 @@
 
 } else {
 
-	echo '<TR><TD COLSPAN="2"><B>No entries.</B><BR></TD></TR>';
+	echo '<TR><TD COLSPAN="2">No entries for <B>'.$let.'</B>.<BR></TD></TR>';
 
 }