function bb_quote_link($link_text = 'Quote') { global $bb, $page, $topic, $forum, $bb_post; $add = topic_pages_add(); if (!topic_is_open($bb_post->topic_id) || !bb_is_user_logged_in()) { return; } $post_id = get_post_id(); $last_page = get_page_number($topic->topic_posts + $add); echo '<a href="' . get_topic_link(0, $last_page) . '"e=' . $post_id . '#postform" id="quote_' . $post_id . '">' . __($link_text) . '</a>'; }
/** * bb_get_topic_pagecount() - Get the total page count for a topic * * @since 0.9 * @param int $topic_id The topic id of the topic being queried * @return int The total number of pages in the topic */ function bb_get_topic_pagecount($topic_id = 0) { $topic = get_topic(get_topic_id($topic_id)); return bb_get_page_number($topic->topic_posts + topic_pages_add()); }