Skip to:
Content

BuddyPress.org

Changeset 7168


Ignore:
Timestamp:
06/06/2013 10:46:43 PM (13 years ago)
Author:
boonebgorges
Message:

Introduces bp_activity_comment_permalink() and implements in comment template

ID anchors have always been available for the purpose of linking directly to
specific activity comments. But these links have never been available directly
in the interface: the timestamp of specific comments lead to the parent thread,
instead of to the specific comment within that thread. This changeset will make
it easier to find the permalink of specific comments.

Fixes #4741

Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-activity/bp-activity-template.php

    r7129 r7168  
    20262026
    20272027/**
     2028 * Echoes the activity comment permalink
     2029 *
     2030 * @since BuddyPress (1.8)
     2031 *
     2032 * @uses bp_get_activity_permalink_id()
     2033 */
     2034function bp_activity_comment_permalink() {
     2035    echo bp_get_activity_comment_permalink();
     2036}
     2037    /**
     2038     * Gets the activity comment permalink
     2039     *
     2040     * @since BuddyPress (1.8)
     2041     *
     2042     * @uses bp_activity_get_permalink()
     2043     * @uses apply_filters() To call the 'bp_get_activity_comment_permalink' hook
     2044     *
     2045     * @return string $link The activity comment permalink
     2046     */
     2047    function bp_get_activity_comment_permalink() {
     2048        global $activities_template;
     2049
     2050        $link = bp_activity_get_permalink( $activities_template->activity->id, $activities_template->activity ) . '#acomment-' . $activities_template->activity->current_comment->id;
     2051
     2052        return apply_filters( 'bp_get_activity_comment_permalink', $link );
     2053    }
     2054
     2055/**
    20282056 * Echoes the activity favorite link
    20292057 *
  • trunk/bp-templates/bp-legacy/buddypress/activity/comment.php

    r6284 r7168  
    2525        <?php
    2626        /* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */
    27         printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() );
     27        printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_comment_permalink(), bp_get_activity_comment_date_recorded() );
    2828        ?>
    2929    </div>
  • trunk/bp-themes/bp-default/activity/comment.php

    r6683 r7168  
    2828        <?php
    2929        /* translators: 1: user profile link, 2: user name, 3: activity permalink, 4: activity timestamp */
    30         printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_thread_permalink(), bp_get_activity_comment_date_recorded() );
     30        printf( __( '<a href="%1$s">%2$s</a> replied <a href="%3$s" class="activity-time-since"><span class="time-since">%4$s</span></a>', 'buddypress' ), bp_get_activity_comment_user_link(), bp_get_activity_comment_name(), bp_get_activity_comment_permalink(), bp_get_activity_comment_date_recorded() );
    3131        ?>
    3232    </div>
Note: See TracChangeset for help on using the changeset viewer.