fix imdb in new structure

This commit is contained in:
xiaomlove
2021-01-14 20:44:24 +08:00
parent f4d887531c
commit 9d1dff2a62
11 changed files with 131 additions and 85 deletions
+9 -4
View File
@@ -300,13 +300,18 @@ if ($CURUSER && $showpolls_main == "yes")
$os = array();
// Count votes
while (($arr2 = mysql_fetch_row($res) !== null) && isset($arr2[0]) && isset($vs[$arr2[0]]))
$vs[$arr2[0]] ++;
while ($arr2 = mysql_fetch_row($res)) {
if (!isset($vs[$arr2[0]])) {
$vs[$arr2[0]] = 0;
}
$vs[$arr2[0]] ++;
}
reset($o);
for ($i = 0; $i < count($o); ++$i){
if (isset($vs[$i]) && isset($o[$i]) && $o[$i])
$os[$i] = array($vs[$i], $o[$i], $i);
if ($o[$i])
$os[$i] = array($vs[$i] ?? 0, $o[$i], $i);//field 1: options vote count, field 2: option name, field 3: option index
}
function srt($a,$b)