www: warning--

SVN revision: 84525
This commit is contained in:
Bertrand Jacquin 2013-04-28 16:09:15 +00:00
parent b575024cd9
commit be851d9c66
3 changed files with 11 additions and 4 deletions

View File

@ -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)

View File

@ -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 "<div class='post'>\n";
echo "<p class='news-title'><a href='p.php?p=news/show&l=".$_GET['l']."&news_id=$new[id]'>".$new['title']."</a></p>";
echo "<p class='news-title'><a href='p.php?p=news/show&l=$lang&news_id=$new[id]'>".$new['title']."</a></p>";
echo "<p class='tiny'><a href='mailto:".$new['email']."'>".$new['author']."</a> - ".$new['date']."</p>";
echo "<div class='news-content'>".$new['content']."</div>\n";
echo "</div>\n";
@ -25,7 +30,7 @@ foreach($list as $new)
if ($news->has_archives() == true)
{
echo "<p><a href='p.php?p=news/archives&l=".$_GET['l']."' title='Read archives'>News archives</a></p>";
echo "<p><a href='p.php?p=news/archives&l=$lang' title='Read archives'>News archives</a></p>";
}
?>

View File

@ -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]))
{