| 1 |
<?php |
<?php |
| 2 |
// $Id: ranking.inc,v 1.8.2.37.2.2 2008/12/08 04:19:20 chriskennedy Exp $ |
// $Id: ranking.inc,v 1.8.2.37.2.3 2009/01/01 00:20:41 chriskennedy Exp $ |
| 3 |
|
|
| 4 |
/** |
/** |
| 5 |
* @file |
* @file |
| 186 |
$ranking[$i]->choices = array(); |
$ranking[$i]->choices = array(); |
| 187 |
foreach ($choice_list as $choice_i) { |
foreach ($choice_list as $choice_i) { |
| 188 |
$ranking[$i]->choices[] = $choice_i; |
$ranking[$i]->choices[] = $choice_i; |
| 189 |
$ranking[$i]->view_score = $choices[$choice_i]['view_score']; |
if (isset($choices[$choice_i]['view_score'])) { |
| 190 |
$ranking[$i]->raw_score = $choices[$choice_i]['raw_score']; |
$ranking[$i]->view_score = $choices[$choice_i]['view_score']; |
| 191 |
if ($choices[$choice_i]['percentage']) { |
} |
| 192 |
|
if (isset($choices[$choice_i]['raw_score'])) { |
| 193 |
|
$ranking[$i]->raw_score = $choices[$choice_i]['raw_score']; |
| 194 |
|
} |
| 195 |
|
if (isset($choices[$choice_i]['percentage'])) { |
| 196 |
$ranking[$i]->percentage = $choices[$choice_i]['percentage']; |
$ranking[$i]->percentage = $choices[$choice_i]['percentage']; |
| 197 |
} |
} |
| 198 |
} |
} |
| 232 |
} |
} |
| 233 |
|
|
| 234 |
// Show the ranking's score if it exists (depends on algorithm). |
// Show the ranking's score if it exists (depends on algorithm). |
| 235 |
if ($ranking[$i]->view_score) { |
if (isset($ranking[$i]->view_score)) { |
| 236 |
$output .= ' ('. $ranking[$i]->view_score .'%)'; |
$output .= ' ('. $ranking[$i]->view_score .'%)'; |
| 237 |
} |
} |
| 238 |
$output .= '</li>'; |
$output .= '</li>'; |
| 296 |
for ($i = 0; $i < count($results->ranking); $i++) { |
for ($i = 0; $i < count($results->ranking); $i++) { |
| 297 |
foreach ($results->ranking[$i]['choices'] as $choice) { |
foreach ($results->ranking[$i]['choices'] as $choice) { |
| 298 |
$cache[$choice][0]['ranking'] = $i; |
$cache[$choice][0]['ranking'] = $i; |
| 299 |
$cache[$choice][0]['raw_score'] = $results->ranking[$i]['raw_score']; |
if (isset($results->ranking[$i]['raw_score'])) { |
| 300 |
$cache[$choice][0]['view_score'] = $results->ranking[$i]['view_score']; |
$cache[$choice][0]['raw_score'] = $results->ranking[$i]['raw_score']; |
| 301 |
|
} |
| 302 |
|
if (isset($results->ranking[$i]['view_score'])) { |
| 303 |
|
$cache[$choice][0]['view_score'] = $results->ranking[$i]['view_score']; |
| 304 |
|
} |
| 305 |
if (isset($results->ranking[$i]['percentage'])) { |
if (isset($results->ranking[$i]['percentage'])) { |
| 306 |
$cache[$choice][0]['percentage'] = $results->ranking[$i]['percentage']; |
$cache[$choice][0]['percentage'] = $results->ranking[$i]['percentage']; |
| 307 |
} |
} |