From 963fa5ca9303d146d635e2fba04814f4f791c559 Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 10 Nov 2008 08:49:51 +1100 Subject: [PATCH] Upload now works, with a bit of hackery. Also, fixed "Archieve" typo in header (Thanks Tim Connors) --- Makefile | 8 ++++++-- web/logo.html | 3 +-- web/menulist.html | 1 - web/static-configuration | 2 +- web/{uploader.php => uploader.php.cpp} | 12 +++++++----- 5 files changed, 15 insertions(+), 11 deletions(-) rename web/{uploader.php => uploader.php.cpp} (74%) diff --git a/Makefile b/Makefile index e11ddc27..d3e05e9f 100644 --- a/Makefile +++ b/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 > $@ diff --git a/web/logo.html b/web/logo.html index 61c8f7e7..9a15f28a 100644 --- a/web/logo.html +++ b/web/logo.html @@ -1,5 +1,4 @@ @@ -14,7 +13,7 @@ $url_prefix = getenv("URLPREFIX"); -

Comprehensive C Archieve Network

+

Comprehensive C Archive Network

diff --git a/web/menulist.html b/web/menulist.html index aa5993f5..bd15a08e 100644 --- a/web/menulist.html +++ b/web/menulist.html @@ -1,5 +1,4 @@ diff --git a/web/static-configuration b/web/static-configuration index 3ff84923..f0fcb89e 100644 --- a/web/static-configuration +++ b/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"; diff --git a/web/uploader.php b/web/uploader.php.cpp similarity index 74% rename from web/uploader.php rename to web/uploader.php.cpp index 40e29445..ed7f76a6 100644 --- a/web/uploader.php +++ b/web/uploader.php.cpp @@ -1,8 +1,10 @@ +#include "logo.html" +#include "menulist.html" +#include "static-configuration" + 0) { @@ -20,6 +22,6 @@ $message = "File type: ".$_FILES["uploadedfile"]["type"]."\n". "File destination: ".$dest."\n"; mail($ccanadmin, $subject, $message, "From: $frommail"); -echo "
Thanks!
Stored to temporary location. - Mail will be send to admin to get verification of the code."; +echo "
Thanks!
+ Mail will be send to admin to publish the code."; ?> -- 2.39.2