Ejemplo n.º 1
0
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\">&nbsp;&nbsp;";
    echo formatnum($lastQ, false);
    echo "&nbsp;&nbsp;</td><td class=\"" . numclass($accepted) . "\">&nbsp;&nbsp;";
    if ($accepted > 0) {
        echo "+A";
    } else {
        if ($accepted < 0) {
            echo "-A";
        } else {
            if ($answer['newacc']) {
                echo "A";
            }
        }
    }
    echo "&nbsp;&nbsp;</td><td align=\"right\">&nbsp;&nbsp;" . $answer['newscore'] . "&nbsp;&nbsp;</td>";
    echo "<td><a ";
    if ($answer['new']) {
        echo "class=\"new\" ";
Ejemplo n.º 2
0
$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\">&nbsp;&nbsp;";
    echo formatnum($lastQ, false);
    echo "&nbsp;&nbsp;</td><td colspan=\"2\" align=\"right\">&nbsp;&nbsp;" . $post['newscore'] . "&nbsp;&nbsp;</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}&nbsp;&nbsp;</i></td>";
echo "<td><i>unchanged not shown</i></td></tr>";