Browse Source

Upload now works, with a bit of hackery.
Also, fixed "Archieve" typo in header (Thanks Tim Connors)

Rusty Russell 17 years ago
parent
commit
963fa5ca93
5 changed files with 15 additions and 11 deletions
  1. 6 2
      Makefile
  2. 1 2
      web/logo.html
  3. 0 1
      web/menulist.html
  4. 1 1
      web/static-configuration
  5. 7 5
      web/uploader.php.cpp

+ 6 - 2
Makefile

@@ -2,7 +2,7 @@
 # V=--verbose for verbose tests.
 
 # This can be overridden on cmdline to generate pages elsewhere.
-WEBDIR=webpages/
+WEBDIR=~/www/html/ccan/
 
 CFLAGS=-g -Wall -Wstrict-prototypes -Wold-style-definition -Wmissing-prototypes -Wmissing-declarations -Werror -Iccan -I.
 
@@ -22,7 +22,7 @@ distclean: clean
 	rm -f $(ALL_DEPENDS)
 	rm -rf $(WEBDIR)
 
-webpages: $(WEB_SUBDIRS) $(WEBDIR)/junkcode $(ALL_PAGES) $(WEBDIR)/list.html $(WEBDIR)/index.html $(WEBDIR)/upload.html $(WEBDIR)/example-config.h $(WEBDIR)/ccan.jpg $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(WEBDIR)/Makefile-ccan
+webpages: $(WEB_SUBDIRS) $(WEBDIR)/junkcode $(ALL_PAGES) $(WEBDIR)/list.html $(WEBDIR)/index.html $(WEBDIR)/upload.html $(WEBDIR)/uploader.php $(WEBDIR)/example-config.h $(WEBDIR)/ccan.jpg $(DIRECT_TARBALLS) $(DEPEND_TARBALLS) $(WEBDIR)/ccan.tar.bz2 $(WEBDIR)/Makefile-ccan
 
 $(WEB_SUBDIRS):
 	mkdir -p $@
@@ -45,6 +45,10 @@ $(WEBDIR)/list.html: web/staticall.php tools/doc_extract $(DIRECT_TARBALLS) $(DE
 $(WEBDIR)/upload.html: web/staticupload.php
 	php5 web/staticupload.php > $@
 
+# cpp inserts gratuitous linebreaks at start of file, makes for php problems.
+$(WEBDIR)/uploader.php: web/uploader.php.cpp
+	cpp -w -C -P $< | grep . > $@
+
 $(WEBDIR)/index.html: web/staticindex.php
 	php5 web/staticindex.php > $@
 

+ 1 - 2
web/logo.html

@@ -1,5 +1,4 @@
 <?php
-session_start();
 // Pages created in subdirs need ../ appended.
 $url_prefix = getenv("URLPREFIX");
 ?>
@@ -14,7 +13,7 @@ $url_prefix = getenv("URLPREFIX");
 	<img src="<?=$url_prefix?>ccan.jpg" width="250" height="80">
   </th>
   <th>
-	<h1>Comprehensive C Archieve Network <h1>
+	<h1>Comprehensive C Archive Network <h1>
   </th>
  </tr>
 </table>

+ 0 - 1
web/menulist.html

@@ -1,5 +1,4 @@
 <?php
-session_start();
 // Pages created in subdirs need ../ appended.
 $url_prefix = getenv("URLPREFIX");
 ?>

+ 1 - 1
web/static-configuration

@@ -25,7 +25,7 @@ function extract_field($field,$module)
    return htmlspecialchars(shell_exec('tools/doc_extract '.$field.' '.$module.'/_info.c'));
 }
 
-# Convert double line breaks into paragraphs, and blank spaces into preformat.
+// Convert double line breaks into paragraphs, and blank spaces into preformat.
 function htmlize_field($field,$module)
 {
    $state="inpara";

+ 7 - 5
web/uploader.php → web/uploader.php.cpp

@@ -1,8 +1,10 @@
 <?php
 session_start();
-include('logo.html');
-include('menulist.html');
-include('static-configuration');
+?>
+#include "logo.html"
+#include "menulist.html"
+#include "static-configuration"
+<?php
 
 // We just email notification for now.  Auto-analysis RSN.
 if ($_FILES["uploadedfile"]["error"] > 0) {
@@ -20,6 +22,6 @@ $message = "File type: ".$_FILES["uploadedfile"]["type"]."\n".
 	"File destination: ".$dest."\n";
 
 mail($ccanadmin, $subject, $message, "From: $frommail");
-echo "<div align=\"center\"> Thanks!<br>Stored to temporary location. 
-	Mail will be send to admin to get verification of the code.<//div>";
+echo "<div align=\"center\"> Thanks!<br>
+	Mail will be send to admin to publish the code.<//div>";
 ?>