コード例 #1
0
 function forum_topic_print_link()
 {
     $link = bpModFrontend::get_link(array('type' => 'forum_topic', 'author_id' => 0, 'id' => $GLOBALS['bp']->groups->current_group->id, 'id2' => bp_get_the_topic_id(), 'unflagged_text' => __('Flag Whole Topic', 'bp-moderation'), 'custom_class' => 'bpm-no-images'));
     echo "<span class='links-separator'> | </span>{$link}";
 }
コード例 #2
0
/**
 * Output the ID of the current topic in the loop.
 */
function bp_the_topic_id()
{
    echo bp_get_the_topic_id();
}
コード例 #3
0
function ass_topic_follow_or_mute_link()
{
    global $bp;
    //echo '<pre>'; print_r( $bp ); echo '</pre>';
    if (empty($bp->groups->current_group->is_member)) {
        return;
    }
    $topic_id = bp_get_the_topic_id();
    $topic_status = ass_get_topic_subscription_status(bp_loggedin_user_id(), $topic_id);
    $group_status = ass_get_group_subscription_status(bp_loggedin_user_id(), bp_get_current_group_id());
    if ($topic_status == 'mute' || $group_status != 'supersub' && !$topic_status) {
        $action = 'follow';
        $link_text = __('Follow', 'bp-ass');
        $title = __('You are not following this topic. Click to follow it and get email updates for new posts', 'bp-ass');
    } else {
        if ($topic_status == 'sub' || $group_status == 'supersub' && !$topic_status) {
            $action = 'mute';
            $link_text = __('Mute', 'bp-ass');
            $title = __('You are following this topic. Click to stop getting email updates', 'bp-ass');
        } else {
            echo 'nothing';
            // do nothing
        }
    }
    if ($topic_status == 'mute') {
        $title = __('This conversation is muted. Click to follow it', 'bp-ass');
    }
    if ($action && bp_is_action_variable('topic', 0)) {
        // we're viewing one topic
        echo '<div class="generic-button ass-topic-subscribe"><a title="' . $title . '"
			id="' . $action . '-' . $topic_id . '-' . bp_get_current_group_id() . '">' . $link_text . ' ' . __('this topic', 'bp-ass') . '</a></div>';
    } else {
        if ($action) {
            // we're viewing a list of topics
            echo '<td class="td-email-sub"><div class="generic-button ass-topic-subscribe"><a title="' . $title . '"
			id="' . $action . '-' . $topic_id . '-' . bp_get_current_group_id() . '">' . $link_text . '</a></div></td>';
        }
    }
}