Skip to:
Content
Pages
Categories
Search
Top
Bottom

Permalink pointing to last forum topic… NEED HELP!

  • @ruffrazor

    Member

    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??

    Link format = http://www.puna.nl/beta/groups/muziek/forum/topic/nieuwe-video-triple-cs-diamonds-maybachs-pt-2-feat-suede-royale/?topic_page=4&num=15#post-112

    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 );
    }

Viewing 1 replies (of 1 total)
  • @nuprn1

    Participant

    download group forums extras – i have a function in there to pull out the anchor link to the last post

Viewing 1 replies (of 1 total)
  • The topic ‘Permalink pointing to last forum topic… NEED HELP!’ is closed to new replies.
Skip to toolbar