website: fix warnings when no popularity for an entry, and whitespace removal
This commit is contained in:
@ -25,7 +25,7 @@ function loadPopularity()
|
|||||||
{
|
{
|
||||||
$items = explode ( ' ', $line );
|
$items = explode ( ' ', $line );
|
||||||
$popularity[$items[0]] = (int)$items[1];
|
$popularity[$items[0]] = (int)$items[1];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $popularity;
|
return $popularity;
|
||||||
@ -33,7 +33,7 @@ function loadPopularity()
|
|||||||
|
|
||||||
function popularity_cmp ( $a, $b )
|
function popularity_cmp ( $a, $b )
|
||||||
{
|
{
|
||||||
if ( $a['popularity'] == $b['popularity'] )
|
if ( @$a['popularity'] == @$b['popularity'] )
|
||||||
return 0;
|
return 0;
|
||||||
// sort from highest to lowest
|
// sort from highest to lowest
|
||||||
return ($a['popularity'] > $b['popularity']) ? -1 : 1;
|
return ($a['popularity'] > $b['popularity']) ? -1 : 1;
|
||||||
|
Reference in New Issue
Block a user