[m-rev.] www diff: Fix all the PHP errors and warnings

Paul Bone paul at bone.id.au
Mon Oct 24 16:52:26 AEDT 2016


download/include/old-release.inc:
download/include/release.inc:
index.php:
rss.php:
    Fix various PHP warnings.

include/functions.inc:
    The split() function has been removed from PHP, this code must now use
    explode()

include/globals.inc:
    Update the stable version (which is currently unsed since we changed the
    downloads site).

    Remove the ROTD version, since it is tracked on the new downloads site.

about/events.php:
about/Makefile:
    Remove old file
---
 about/Makefile                   |  1 -
 about/events.php                 | 10 ----------
 download/include/old-release.inc |  3 ++-
 download/include/release.inc     |  2 +-
 include/functions.inc            |  6 +++---
 include/globals.inc              |  9 ++++++---
 index.php                        |  1 +
 rss.php                          |  3 +++
 8 files changed, 16 insertions(+), 19 deletions(-)
 delete mode 100644 about/events.php

diff --git a/about/Makefile b/about/Makefile
index c796bcd..68dae9e 100644
--- a/about/Makefile
+++ b/about/Makefile
@@ -8,7 +8,6 @@ HTML= 	benchmarks.html 	\
 	deep_demo.html		\
 	developer.html 		\
 	documentation.html 	\
-	events.html		\
 	features.html 		\
 	motivation.html		\
 	papers.html		\
diff --git a/about/events.php b/about/events.php
deleted file mode 100644
index 78453f0..0000000
--- a/about/events.php
+++ /dev/null
@@ -1,10 +0,0 @@
-<HTML>
-<?php
-    $menu="Information";
-    $title="Event Information";
-    $dir="information";
-    $root="..";
-    $include="events.inc";
-    include "$root/include/template.inc"
-?>
-</HTML>
diff --git a/download/include/old-release.inc b/download/include/old-release.inc
index de75bfe..0db4042 100644
--- a/download/include/old-release.inc
+++ b/download/include/old-release.inc
@@ -26,11 +26,12 @@ function link_to ($directory, $filename, $description)
 	echo "   \n";
 }
 
-function links_to_file ($filename, $release, $Sunsite)
+function links_to_file ($filename, $release)
 {
 	global $aus_ftp, $aus_http, $usa_sourceforge_http, $usa_sunsite_ftp,
 		$usa_sunysb_ftp, $sweden_ftp;
 	global $Uppsala, $Stonybrook;
+	$Sunsite = "no";
 
 	$aus_ftp_dir = $aus_ftp . "old-releases/" . $release . "/";
 	$aus_http_dir = $aus_http . "old-releases/" . $release . "/";
diff --git a/download/include/release.inc b/download/include/release.inc
index c71d2f1..59106a0 100644
--- a/download/include/release.inc
+++ b/download/include/release.inc
@@ -38,7 +38,7 @@ function links_to_file ($filename, $onSunsite)
 	global $aus_ftp, $aus_http, $usa_sourceforge_http, $usa_sunsite_ftp,
 		$usa_sunysb_ftp, $sweden_ftp;
 	global $Uppsala, $Stonybrook;
-	global $Sunsite, $SourceForge;
+	global $Sunsite, $Sourceforge;
 
 	link_to ($aus_ftp, $filename, "Australia (FTP)");
 	link_to ($aus_http, $filename, "Australia (HTTP)");
diff --git a/include/functions.inc b/include/functions.inc
index 189d8c0..34625b9 100644
--- a/include/functions.inc
+++ b/include/functions.inc
@@ -10,7 +10,7 @@ function newsitem($date, $item) {
 	echo "<p>";
 	echo $news;
 	echo "</p>";
-	list($day, $month, $year) = split(" ",$date);
+	list($day, $month, $year) = explode(" ",$date);
 	echo "<span class='newsdate'>";
 	printf("%02d $month $year", $day);
 	echo "</span>";
@@ -20,7 +20,7 @@ function newsitem($date, $item) {
 function rssitem($date, $item) {
 
 	list($title, $news) = $item;
-	list($day, $month, $year) = split(" ",$date);
+	list($day, $month, $year) = explode(" ",$date);
 	$month = substr($month, 0, 3);
 	$news = htmlspecialchars($news);
 
@@ -39,7 +39,7 @@ function reportitem($date, $item) {
 
 	list($filename, $descr) = $item;
 	echo "<tr>";
-	list($day, $month, $year) = split(" ",$date);
+	list($day, $month, $year) = explode(" ",$date);
 
 	echo "<td valign=top><tt>[";
 	printf("%02d $month $year", $day);
diff --git a/include/globals.inc b/include/globals.inc
index 0b3d95b..b8fa939 100644
--- a/include/globals.inc
+++ b/include/globals.inc
@@ -1,8 +1,8 @@
 <?php
 	$installed_path="/srv/www/mercurylang";
 
-	$current_release="11.07.2";
-	$next_beta_version="12.08-beta";
+	$current_release="14.01.1";
+//	$next_beta_version="12.08-beta";
 
 	$release_doc_dir="$root/information/doc-release";
 	$latest_doc_dir="$root/information/doc-latest";
@@ -17,11 +17,14 @@
 	$faq_release="$release_doc_dir/mercury_faq/index.html";
 	$faq_latest="$latest_doc_dir/mercury_faq/index.html";
 
+/*
 	$rotd_basedir="download/files/beta-releases/rotd";
 	$rotd_files_path="$installed_path/$rotd_basedir";
 	exec("cat $rotd_files_path/latest-unstable-version", $exec_output);
 	$rotd_version=$exec_output[0];
-	
+*/
+	$rotd_version = "none";
+
  	$ftp_domain="ftp.mercurylang.org";
  	$www_domain="www.mercurylang.org";
 ?>
diff --git a/index.php b/index.php
index 70cf081..bca7d87 100644
--- a/index.php
+++ b/index.php
@@ -1,6 +1,7 @@
 <!DOCTYPE html>
 <html>
 <?php
+    $menu="Home";
     $title="Home";
     $dir=".";
     $root=".";
diff --git a/rss.php b/rss.php
index f78818f..0aa2b02 100644
--- a/rss.php
+++ b/rss.php
@@ -6,6 +6,9 @@
   <description>News from the Mercury programming language project.</description>
 <?php
 
+$root = "";
+
+include "include/globals.inc";
 include "include/functions.inc";
 include "news/newsdb.inc";
 
-- 
2.7.4



More information about the reviews mailing list