<?php
$subject_id = $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id'];
$PagerReplyNumArr = $PowerBB->DB->sql_num_rows($PowerBB->DB->sql_query("SELECT * FROM " . $PowerBB->table['reply'] . " WHERE subject_id='$subject_id' and delete_topic<>1 AND review_reply<>1 "));
?>
<!-- start perpage stick_subject_list -->
<span dir="rtl">
(
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=0">1</a>
</span>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
{$_CONF['info_row']['perpage']}">2</a>
</span>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']+ $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']+ $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']; ?>
">3</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 3) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 3; ?>
">4</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 4) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 4; ?>
">5</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 5) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 5; ?>
">6</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 6) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 6; ?>
">7</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 7) { ?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 7; ?>
">8</a>
</span>
<?php } ?>
<?php if ($PagerReplyNumArr > $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']* 8) {
$ss_r = $PowerBB->_CONF['template']['_CONF']['info_row']['perpage']/2+1;
$roun_ss_r = round($ss_r, 0);
$reply_number_r = $PagerReplyNumArr-$roun_ss_r;
$pagenum_r = $reply_number_r/$PowerBB->_CONF['template']['_CONF']['info_row']['perpage'];
$round0_r = round($pagenum_r, 0);
$perpage_r = $round0_r*$PowerBB->_CONF['template']['_CONF']['info_row']['perpage'];
$countpage = $perpage_r;
?>
<span class="perpage">
<a href="index.php?page=topic&show=1&id=
<?php echo $PowerBB->_CONF['template']['while']['stick_subject_list'][$this->x_loop]['id']; ?>
&password={$password}&count=
<?php echo $countpage; ?>
">{$lang['Lastperpage']}</a>
</span>
<?php } ?>
)</span>
<!-- end perpage stick_subject_list -->
<?php
unset($PagerReplyNumArr);
$PagerReplyNumArr = @mysql_free_result($PagerReplyNumArr);
?>