Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
01/26/2010 05:49:48 PM (16 years ago)
Author:
apeatling
Message:

Fixed forum post activity tracking, now links directly to the forum post. Only show post form on the last page of posts.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-forums/bp-forums-templatetags.php

    r2448 r2460  
    738738            'mid_size' => 1
    739739        ));
     740        $this->pag->total_pages = ceil($this->total_post_count / $this->pag_num);
    740741    }
    741742
     
    914915        extract( $r, EXTR_SKIP );
    915916
    916         $links  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id, 'bp_forums_edit_post' ) . '">' . __( 'Edit Post', 'buddypress' ) . '</a> ' . $seperator . ' ';
    917         $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete Post', 'buddypress' ) . '</a>';
     917        if ( $_SERVER['QUERY_STRING'] )
     918            $query_vars = '?' . $_SERVER['QUERY_STRING'];
     919
     920        $links  = '<a href="' . wp_nonce_url( bp_get_the_topic_permalink() . $topic_template->post->id . 'edit/post/' . $topic_template->post->post_id . '/' . $query_vars, 'bp_forums_edit_post' ) . '">' . __( 'Edit', 'buddypress' ) . '</a> ' . $seperator . ' ';
     921        $links .= '<a class="confirm" id="post-delete-link" href="' . wp_nonce_url( bp_get_the_topic_permalink() . 'delete/post/' . $topic_template->post->post_id, 'bp_forums_delete_post' ) . '">' . __( 'Delete', 'buddypress' ) . '</a> | ';
    918922
    919923        return $links;
     
    950954<?php
    951955}
     956
     957function bp_the_topic_is_last_page() {
     958    echo bp_get_the_topic_is_last_page();
     959}
     960    function bp_get_the_topic_is_last_page() {
     961        global $topic_template;
     962
     963        return apply_filters( 'bp_get_the_topic_is_last_page', $topic_template->pag_page == $topic_template->pag->total_pages );
     964    }
    952965
    953966function bp_directory_forums_search_form() {
Note: See TracChangeset for help on using the changeset viewer.