Get last page in bb_init
Hi there. I’m writing a small plugin and I need to check if the actual page is the last page of a topic. I’ve seen that this is the standard way:
if(bb_current_user_can('write_posts') && bb_is_topic())
global $topic, $page;
$add = topic_pages_add();
$last_page = get_page_number( $topic->topic_posts + $add );
if($last_page == $page) do whatever you want
but I want to use this code during the bb_init callback. It doesn’t work and after some simple tests I’ve seen that $topic isn’t defined (yet). Is there a way to get last page during this callback?
Thanks in advance.
You must be logged in to reply to this topic.