function entries($id, $num, $style)
{
    $rows = getposts($id);
    $entries = count($rows);
    $count = $entries;
    while ($count > 0 && $entries - $count < $num) {
        $currentvalue = $rows[$count - 1];
        $DATA = getdbpost($currentvalue);
        $category = ID_BOARDtoCat($DATA['ID_BOARD']);
        $filenum = array_search($currentvalue, $rows) + 1;
        // Content
        if ($style == 0) {
            echo "      <h2><a class = \"lightbg\" href = \"http://www.turkiball.com/feed/" . $filenum . ".php\">" . $DATA['subject'] . "</a></h2>\n";
            echo "      <h3>Category: <a class = \"lightbg\" href = \"http://www.turkiball.com/feed/" . $category[1] . ".php\">" . $category[0] . "</a></h3>\n";
            echo "      <p style = \"text-indent: 0px;\">\n";
            echo $DATA['body'];
            echo "      </p>\n";
            echo "      <h3 style = \"text-align: left;\"><a class = \"lightbg\" href = \"http://www.turkiball.com/board/index.php/topic," . $DATA['ID_TOPIC'] . ".0.html\">Discussion (" . getreplies($DATA['ID_TOPIC']) . " comments)</a></a></h3>\n";
            echo "      <h3 style = \"text-align: right;\">Posted " . timeformat($DATA['posterTime']) . " by <a class = \"lightbg\" href = \"http://www.turkiball.com/feed/people/index.php?name=" . $DATA['posterName'] . "\">" . $DATA['posterName'] . "</a></h3>\n";
            echo "      <br><br><br>\n";
            echo "      <div class = \"contentline\"></div>\n";
        } elseif ($style == 1) {
            echo "      <div class = \"newsitem\">\n";
            echo "         <a href = \"http://www.turkiball.com/feed/" . $category[1] . "/index.php\">\n";
            echo "            <img src = \"http://www.turkiball.com/images/cat" . $category[1] . "w.jpg\" alt = \"" . $category[0] . "\" width = \"150px\" height = \"30px\" border = \"0\" style = \"position: relative; top: -1px; left: -1px;\">\n";
            echo "         </a>\n";
            echo "         <h5>Posted " . dateShrink(timeformat($DATA['posterTime'])) . "</h5>\n";
            echo "         <h4><a href = \"http://www.turkiball.com/feed/" . $filenum . ".php\">" . $DATA['subject'] . "</a></h4>\n";
            echo "         <h6>By <a href = \"http://www.turkiball.com/feed/people/index.php?name=" . $DATA['posterName'] . "\">" . $DATA['posterName'] . "</a></h6>\n";
            echo "      </div>\n";
        } elseif ($style == 2) {
            // Setup the table
            if ($count == $entries) {
                echo "      <table height=\"87\" cellspacing=\"8\" cellpadding=\"4\" width=\"530\" border=\"0\">\n";
                echo "      <tbody>\n";
                echo "      <tr><td><b>Title</b></td>\n";
                echo "      <td><b>Category</b></td>\n";
                echo "      <td><b>Date</b></td>\n";
                echo "      <td><b>By</b></td></tr>\n";
                echo "      <tr><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td><td>&nbsp;</td></tr>\n";
            }
            echo "      <tr><td><a class = \"lightbg\" href = \"http://www.turkiball.com/feed/" . $filenum . ".php\"><b>" . $DATA['subject'] . "</b></a></td>\n";
            echo "      <td><a class = \"lightbg\" href = \"http://www.turkiball.com/feed/" . $category[1] . ".php\"><b>" . $category[0] . "</b></a></td>\n";
            echo "      <td><b>" . dateShrink(timeformat($DATA['posterTime'])) . "</b></a></td>\n";
            echo "      <td><a class = \"lightbg\" href = \"http://www.turkiball.com/feed/people/index.php?name=" . $DATA['posterName'] . "\"><b>" . $DATA['posterName'] . "</b></td></tr>\n";
            // Close out the table
            if ($count == 1) {
                echo "      </tbody>\n";
                echo "      </table>\n";
            }
        } else {
            echo "Error: invalid {$style} parameter received\n";
        }
        $count--;
    }
}
}
head(1);
// Means we're in the feed
?>
																								

</head>

<body>

<?php 
title();
newsbar(1);
// Means we're in the feed
navbarleft();
content(1, 0, 1, 0, $filename);
// in feed, for the fn entries, filename for echoContent
if (!$_GET["num"]) {
    // Makes $num be the newest news item of any type
    $num = end(getposts(0));
} else {
    $num = $_GET["num"];
}
bottom($num);
?>
			

</body>

</html>
function getNext($ID_MSG, $ID_BOARD)
{
    $choices = getposts($ID_BOARD);
    $count = 0;
    while ($choices[$count] != $ID_MSG) {
        $count++;
    }
    // Will return 0 if no next exists
    return $choices[$count];
}