From 35642157dc5b17bb06f803189ab9c7dff01c7425 Mon Sep 17 00:00:00 2001 From: David Aspinall Date: Wed, 30 Jun 1999 13:50:48 +0000 Subject: Simple hit counter --- html/counter.php3 | 43 +++++++++++++++++++++++++++++++++++++++++++ html/doc.phtml | 2 +- html/download.phtml | 1 - html/functions.php3 | 38 +++++++++++++++++++++++++++++--------- html/header.phtml | 8 ++++---- html/hits.phtml | 26 ++++++++++++++++++++++++++ html/htmlshow.phtml | 13 +------------ html/index.shtml | 4 +++- html/main.phtml | 15 +++++++++++---- html/proofgen.css | 2 +- html/smallheader.phtml | 7 ++----- 11 files changed, 121 insertions(+), 38 deletions(-) create mode 100644 html/counter.php3 create mode 100644 html/hits.phtml (limited to 'html') diff --git a/html/counter.php3 b/html/counter.php3 new file mode 100644 index 00000000..285dc88d --- /dev/null +++ b/html/counter.php3 @@ -0,0 +1,43 @@ +"; + } else { + print ""; + }; + } else { + $num = fgets($fp,$maxlen); + $num += 1; + print ""; + }; + rewind($fp); + fputs($fp,$num); + fclose($fp); +} else { + print ""; +}; +?> + diff --git a/html/doc.phtml b/html/doc.phtml index 7f11e471..cfc68d30 100644 --- a/html/doc.phtml +++ b/html/doc.phtml @@ -9,7 +9,7 @@ appear in the system info pages.

For convenience, the manual is available in HTML - +
For printing you can download the . diff --git a/html/download.phtml b/html/download.phtml index adce6a02..f7381446 100644 --- a/html/download.phtml +++ b/html/download.phtml @@ -98,7 +98,6 @@ Check the - file for a summary of changes since the last stable version.
Please test with the latest pre-release before reporting any problems diff --git a/html/functions.php3 b/html/functions.php3 index 5a86984c..2a547dae 100644 --- a/html/functions.php3 +++ b/html/functions.php3 @@ -12,6 +12,7 @@ $pg_email = "proofgen@dcs.ed.ac.uk"; $pg_list = "proofgeneral@dcs.ed.ac.uk"; +$dtd = "\n"; $pg_title = "Proof General --- Organize your Proofs!"; @@ -98,14 +99,23 @@ $separator = ' . '; function link_root($page,$text) { print ""; print $text; - print "\n"; + print ""; } function small_header($title) { + print $dtd; + print ""; + include('head.phtml'); include('smallheader.phtml'); print "

" . $title . "

\n\n\n"; } +function small_header_body($title) { + include('smallheader.phtml'); + print "

" . $title . "

\n\n\n"; + print "

"; /* FIXME: hack to get CSS to work with bad HTML from texi2html */ +} + /* FIXME: improve this function */ function footer($filemodified=".") { @@ -139,10 +149,11 @@ function fileshow($filename,$text="",$title="") { function htmlshow($filename,$text="",$title="") { if ( $text == "") { $text=$filename; }; $message=$title; - $urlbits = parse_url($filename); if ( $message == "") { $message=$filename; }; - hlink("htmlshow.phtml?file=" . urlencode($urlbits["path"]) - . "&title=" . urlencode($title) + $urlbits = parse_url($filename); + hlink("htmlshow.phtml" + . "?title=" . urlencode($title) + . "&file=" . urlencode($urlbits["path"]) . ($urlbits["fragment"]=="" ? "" : "#" . $urlbits["fragment"]), $text, $message); } @@ -179,6 +190,7 @@ function hack_html($filename,$title="") { print "-->\n\n"; /* End style sheet paste in */ print $line; + $i++; break; } else { print $line; }; } @@ -196,18 +208,26 @@ function hack_html($filename,$title="") { $urlbits = parse_url($linebits[4]); if ($urlbits["host"]=="") { /* Assume a relative link, let's hack it. */ - $newurl = "htmlshow.phtml?file=" - . urlencode(dirname($filename)) . "/" - . $urlbits["path"] - . ($urlbits["fragment"]=="" ? "" : "#" . $urlbits["fragment"]); + /* Use same title */ + $newurl = "htmlshow.phtml?title=" . urlencode($title); + if ($urlbits["path"]=="") { + /* A fragment in same file */ + $newurl = $newurl . "&file=" + . urlencode($filename) . "#" . $urlbits["fragment"]; + } else { + /* Another file */ + $newurl = $newurl . "&file=" + . urlencode(dirname($filename) . "/" . $urlbits["path"]) + . ($urlbits["fragment"]=="" ? "" : "#" . $urlbits["fragment"]); + }; print "",$line)) { /* Assume there's nothing else interesting on the line, whoops. */ - small_header(""); print $line; + small_header_body($title); } elseif (eregi("",$line)) { /* Assume there's nothing else interesting on the line, whoops. */ click_to_go_back(); diff --git a/html/header.phtml b/html/header.phtml index 1cf0f36a..4d62176a 100644 --- a/html/header.phtml +++ b/html/header.phtml @@ -1,10 +1,10 @@
- -[ Proof General logo ] - + +Proof General + diff --git a/html/hits.phtml b/html/hits.phtml new file mode 100644 index 00000000..6d5c2be6 --- /dev/null +++ b/html/hits.phtml @@ -0,0 +1,26 @@ +"; + if (is_readable($counterFile)) { + print "These pages have been accessed "; + readfile($counterFile); + print " times "; + if (is_readable($counterStart)) { + $fp=fopen($counterStart,"r"); + $start=fgets($fp,20); + print "since "; + print strftime("%d %B %Y",$start); + print ".\n"; + } else { + print "
\n(could not access time stamp file $counterStart)\n"; + }; + } else { + echo "Could not access hit counter file $counterFile\n"; + }; + print "

"; + footer(); +?> diff --git a/html/htmlshow.phtml b/html/htmlshow.phtml index 8f6788f0..d9cb8b46 100644 --- a/html/htmlshow.phtml +++ b/html/htmlshow.phtml @@ -1,16 +1,5 @@
\n"; */
-  hack_html($filename);
-/*  print "

\n"; - print "
"; - click_to_go_back(); + hack_html($file,$title); footer(); -*/ ?> diff --git a/html/index.shtml b/html/index.shtml index 9e1b5a5a..30b85d89 100644 --- a/html/index.shtml +++ b/html/index.shtml @@ -1 +1,3 @@ - + + diff --git a/html/main.phtml b/html/main.phtml index 9ff9d505..b08b0d2d 100644 --- a/html/main.phtml +++ b/html/main.phtml @@ -28,7 +28,9 @@ Proof General is ready-customized for several proof assistants: + ","The Coq Home Page") ?> + + ", + "The LEGO Home Page") ?> + + ", + "The Isabelle Home Page"); ?> +
- Coq badge Coq Proof General for
- LEGO badge LEGO Proof General @@ -63,8 +68,10 @@ Proof General is ready-customized for several proof assistants:
- Isabelle badge Isabelle Proof General for diff --git a/html/proofgen.css b/html/proofgen.css index ef06d38f..c2cefb30 100644 --- a/html/proofgen.css +++ b/html/proofgen.css @@ -27,7 +27,7 @@ pre{ h1{ font-family: Verdana, Arial, LucidaSans, sans-serif; color: #FFFFFF; - font-size: large + font-size: large; } h2{ diff --git a/html/smallheader.phtml b/html/smallheader.phtml index 9313300e..ddfbf281 100644 --- a/html/smallheader.phtml +++ b/html/smallheader.phtml @@ -1,12 +1,9 @@ - - -
-[ Home ] +Proof General Home -- cgit v1.2.3