if ($topic->status()) { $canreply = $xoopsUser ? $forum->isModerator($xoopsUser->uid()) || $xoopsUser->isAdmin() : 0; } else { $canreply = true; } if ($forum->isAllowed($xoopsUser ? $xoopsUser->getGroups() : XOOPS_GROUP_ANONYMOUS, 'topic')) { $tpl->assign('lang_newtopic', __('New Topic', 'bxpress')); $tpl->assign('can_topic', 1); } $tpl->assign('can_reply', $canreply); $tpl->assign('lang_reply', __('Reply', 'bxpress')); $tpl->assign('lang_approved', __('Approved', 'bxpress')); $tpl->assign('lang_noapproved', __('Not approved', 'bxpress')); } // Obtenemos los rangos para usar posteriormente $ranks = bXFunctions::getRanks(); // Obtenemos los mensajes $sql = "SELECT COUNT(*) FROM " . $db->prefix("mod_bxpress_posts") . " a, " . $db->prefix("mod_bxpress_posts_text") . " b WHERE\n\t\ta.id_topic='" . $topic->id() . "' AND b.post_id=a.id_post"; list($num) = $db->fetchRow($db->query($sql)); $page = isset($_GET['pag']) ? $_GET['pag'] : ''; $limit = $mc['perpage']; $limit = $limit <= 0 ? 15 : $limit; $page = isset($page) ? $page : 0; if ($page > 0) { $page -= 1; } $start = $page * $limit; $tpages = ceil($num / $limit); $pactual = $page + 1; if ($pactual > $tpages) { $rest = $pactual - $tpages;