From be851d9c660a12a6ddaeab9f794fceb6c24710c9 Mon Sep 17 00:00:00 2001 From: Bertrand Jacquin Date: Sun, 28 Apr 2013 16:09:15 +0000 Subject: [PATCH] www: warning-- SVN revision: 84525 --- p/news/class.news.php | 2 ++ p/news/en-body | 9 +++++++-- update.php | 4 ++-- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/p/news/class.news.php b/p/news/class.news.php index 8ed9aa9e..8f9d03c2 100644 --- a/p/news/class.news.php +++ b/p/news/class.news.php @@ -84,6 +84,7 @@ class news { return NULL; $new['content'] = NULL; + $i = 0; while (!feof($fp)) { $buffer = fgets($fp, 4096); @@ -120,6 +121,7 @@ class news { return NULL; $name = strrchr($path, "/"); + $date = array(); for($i=1; $name[$i] != NULL; $i++) { if ($i <= 4) diff --git a/p/news/en-body b/p/news/en-body index 98f6b2d3..43c34689 100644 --- a/p/news/en-body +++ b/p/news/en-body @@ -11,12 +11,17 @@ setlocale(LC_ALL, 'en_EN'); $news = new news; $list = $news->get(10); + +$lang = "en"; +if ($_GET['l']) + $lang = $_GET['l']; + foreach($list as $new) { if (($new = $news->read_content($new)) !== NULL) { echo "
\n"; - echo "

".$new['title']."

"; + echo "

".$new['title']."

"; echo "

".$new['author']." - ".$new['date']."

"; echo "
".$new['content']."
\n"; echo "
\n"; @@ -25,7 +30,7 @@ foreach($list as $new) if ($news->has_archives() == true) { - echo "

News archives

"; + echo "

News archives

"; } ?> diff --git a/update.php b/update.php index 0115aa8d..266ab40e 100644 --- a/update.php +++ b/update.php @@ -38,7 +38,7 @@ $data = file_get_contents('php://input', NULL, NULL, 0, 64 * 1024); $lines = explode("\n", $data); $linecount = count($lines); -for ($l = 0; $l <= $linecount; $l++) +for ($l = 0; $l < $linecount; $l++) { $items = explode(" ", $lines[$l]); $res = "OK"; @@ -65,7 +65,7 @@ for ($l = 0; $l <= $linecount; $l++) $nsv = count($vsv); $num = $ncl; if ($nsv < $num) $num = $nsv; - for ($i = 0; $i <= $num; $i++) + for ($i = 0; $i < $num; $i++) { if (intval($vsv[$i]) > intval($vcl[$i])) {