foreach ($answers as $answer) { $lastQ = $answer['newscore'] - $answer['oldscore']; $accepted = $answer['newacc'] - $answer['oldacc']; if (!$lastQ && !$accepted) { $skipped += $answer['qty']; continue; } else { $shown += $answer['qty']; } echo "<tr"; if ($answer['new']) { echo " class=\"new\""; } echo "><td class=\"" . numclass($lastQ) . "\" align=\"right\"> "; echo formatnum($lastQ, false); echo " </td><td class=\"" . numclass($accepted) . "\"> "; if ($accepted > 0) { echo "+A"; } else { if ($accepted < 0) { echo "-A"; } else { if ($answer['newacc']) { echo "A"; } } } echo " </td><td align=\"right\"> " . $answer['newscore'] . " </td>"; echo "<td><a "; if ($answer['new']) { echo "class=\"new\" ";
$shown = 0; //print_r($answers); usort($posts, "scoresort"); foreach ($posts as $post) { $lastQ = $post['newscore'] - $post['oldscore']; $post['text'] = preg_replace('/\\\\u(\\d{4})/', '&#x$1;', $post['text']); if (!$lastQ && !$post['new']) { $skipped++; continue; } else { $shown++; } echo "<tr"; if ($post['new']) { echo " class=\"new\""; } else { if ($post['id'] == $post['qid']) { echo " class=\"question\""; } } echo "><td class=\"" . numclass($lastQ) . "\" align=\"right\"> "; echo formatnum($lastQ, false); echo " </td><td colspan=\"2\" align=\"right\"> " . $post['newscore'] . " </td>"; echo "<td><a "; if ($post['new']) { echo "class=\"new\" "; } echo "href=\"http://{$site}/questions/" . $post['qid'] . '/' . $post['id'] . '#' . $post['id'] . "\">" . $post['text'] . "</td></tr>\n"; } echo "<tr><td colspan=\"3\" align=\"right\"><i>{$skipped} </i></td>"; echo "<td><i>unchanged not shown</i></td></tr>";