<?php global $action; ?>

<?php
include("_confirm.php");
global $userInfo, $pageInfo, $id, $locked, $maxPerPage, $p, $oldcount;
?>

<div class="clearfix"></div>
<div class="pagenation">
<div class="pagenation_inner">

<?php
$pagecount = ceil($oldcount / $maxPerPage);
echo "<span class='page'>Page</span>";
if ($p > 1) {
 $prev = $p - 1;
 echo "<span class='previous'><a href=\"?id={$id}&p={$prev}\">Previous</a></span>\n";
}
for ($i=0; $i<$pagecount; $i++) {
 if (($i+1) == $p) {
  echo "<b>{$p}</b>\n";
 }
 else {
  echo "<span class='next'><a href=\"?id={$id}&p=" . ($i+1) . "\">" . ($i+1) . "</a></span>\n";
 }
}
if ($p < $pagecount) {
 $prev = $p + 1;
 echo "<a href=\"?id={$id}&p={$prev}\">Next</a>\n";
}
?>
</div>
</div>
<div class="clearfix"></div>

<?php
if ($locked && @$userInfo['title'] != "Administrator") {
 echo "<b>This forum is locked.</b><br /><br />\n";
}
else {
?>
<div class="forum_center_div">
<a href="reply.php?id=<?php echo "{$id}&p={$p}"; ?>"><img src="templates/<?php echo $pageInfo['theme']; ?>/images/reply.gif" border="0"></a><br /><br />
</div>
<?php
}
?>