DragonFly BSD
DragonFly submit List (threaded) for 2004-01
[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]

Website tablecg fix


From: Dylan Reinhold <dylan@xxxxxxxxxxxxxxxx>
Date: Sat, 31 Jan 2004 15:36:48 -0800

Attached is a patch of tablecg.c to show the page title in the browser's title bar.

Changes:
Moved the table generation to after the point where the page it self is processed.


To see new output...
http://dragonfly.ocnetworking.com/Main/index.cgi

Thanks,
Dylan
Index: tablecg.c
===================================================================
RCS file: /home/dragonfly/cvsroot/site/src/tablecg.c,v
retrieving revision 1.9
diff -u -r1.9 tablecg.c
--- tablecg.c   12 Jan 2004 21:01:28 -0000      1.9
+++ tablecg.c   31 Jan 2004 23:29:50 -0000
@@ -137,15 +137,6 @@
     fflush(stdout);

     /*
-     * Generate table structure
-     */
-    printf("<HTML>\n");
-    printf("<HEAD>\n");
-    printf("<TITLE></TITLE>\n");
-    printf("<LINK REL=\"stylesheet\" HREF=\"/stylesheet.css\" TYPE=\"text/css\">");
-    printf("</HEAD>\n");
-    printf("<BODY>\n");
-    /*
      * Process body
      */
     if (FilePath[0] && (fi = fopen(FilePath, "r")) != NULL) {
@@ -182,6 +173,24 @@
        }
        fclose(fi);
     }
+    /*
+     * Generate table structure
+     * dr: Moved table structure below the reading of the web page to allow the title tags to populate.
+     */
+    printf("<HTML>\n");
+    printf("<HEAD>\n");
+
+       if (Title) {
+    printf("<TITLE>%s</TITLE>\n", Title);
+       }
+       else {
+    printf("<TITLE>DragonFly</TITLE>\n");
+       }
+
+    printf("<LINK REL=\"stylesheet\" HREF=\"/stylesheet.css\" TYPE=\"text/css\">");
+    printf("</HEAD>\n");
+    printf("<BODY>\n");
+
     printf("<TABLE BORDER=0 WIDTH=100%% BGCOLOR=\"#FFFFFF\">\n");
     printf("<TR><TD ALIGN=CENTER COLSPAN=2>");



[Date Prev][Date Next]  [Thread Prev][Thread Next]  [Date Index][Thread Index]