Permalink pointing to last forum topic… NEED HELP!
-
Peeps,
Can someone help me. I’ve created a permalink that makes the permalink go to the last page and topic of the forum discussion. But there something wrong and after 3 or 4 page it links to the wrong page… Does anybody know a fix??
Code:
function bp_the_topic_permalink() {
echo bp_get_the_topic_permalink();
}
function bp_get_the_topic_permalink() {
global $forum_template, $bp;if ( $forum_template->topic->object_slug )
$permalink = $bp->root_domain . ‘/’ . BP_GROUPS_SLUG . ‘/’ . $forum_template->topic->object_slug . ‘/’;
else if ( $bp->is_single_item )
$permalink = $bp->root_domain . ‘/’ . $bp->current_component . ‘/’ . $bp->current_item . ‘/’;
else
$permalink = $bp->root_domain . ‘/’ . $bp->current_component . ‘/’ . $bp->current_action . ‘/’;$topicpage = round($forum_template->topic->topic_posts / 14)+1;
return apply_filters( ‘bp_get_the_topic_permalink’, $permalink . ‘forum/topic/’ . $forum_template->topic->topic_slug . ‘/?topic_page=’.$topicpage.’&num=15#post-‘.$forum_template->topic->topic_last_post_id );
}
- The topic ‘Permalink pointing to last forum topic… NEED HELP!’ is closed to new replies.