Пример #1
0
function bbps_extend_forum_attributes_mb($forum_id)
{
    //get out the forum meta
    $premium_forum = bbps_is_premium_forum($forum_id);
    if ($premium_forum) {
        $checked = "checked";
    } else {
        $checked = "";
    }
    $support_forum = bbps_is_support_forum($forum_id);
    if ($support_forum) {
        $checked1 = "checked";
    } else {
        $checked1 = "";
    }
    ?>
	
	<hr />

<!--
This is not tested enough for people to start using so for now we will only have support forums
<p>
		<strong> Premium Forum:</strong>
		<input type="checkbox" name="bbps-premium-forum" value="1"  echo $checked; />
		<br />
		<small>Click here for more information about creating a premium forum.</small>
	</p>
-->
	
	<p>
		<strong><?php 
    _e('Support Forum:', 'bbps');
    ?>
</strong>
		<input type="checkbox" name="bbps-support-forum" value="1" <?php 
    echo $checked1;
    ?>
/>
		<br />
		<!-- <small>Click here To learn more about the support forum setting.</small> -->
	</p>

<?php 
}
Пример #2
0
    function stachestack_bbps_add_support_forum_features()
    {
        //only display all this stuff if the support forum option has been selected.
        if (bbps_is_support_forum(bbp_get_forum_id())) {
            $can_edit = bbps_get_update_capabilities();
            $topic_id = bbp_get_topic_id();
            $status = bbps_get_topic_status($topic_id);
            $forum_id = bbp_get_forum_id();
            $user_id = get_current_user_id();
            ?>
 <div id="bbps_support_forum_options"> <?php 
            //get out the option to tell us who is allowed to view and update the drop down list.
            if ($can_edit == true) {
                ?>
			<?php 
                bbps_generate_status_options($topic_id, $status);
            } else {
                ?>
			This topic is: <?php 
                echo $status;
            }
            ?>
 </div> <?php 
            //has the user enabled the move topic feature?
            if (get_option('_bbps_enable_topic_move') == 1 && (current_user_can('administrator') || current_user_can('bbp_moderator'))) {
                ?>
		<div id ="bbps_support_forum_move">
			<form id="bbps-topic-move" class="form-horizontal" role="form" name="bbps_support_topic_move" action="" method="post">
				<div class="form-group">
					<label for="bbp_forum_id" class="control-label">Move topic to: </label><?php 
                stachestack_bbp_dropdown();
                ?>
					<input type="hidden" value="bbps_move_topic" name="bbps_action"/>
					<input type="hidden" value="<?php 
                echo $topic_id;
                ?>
" name="bbps_topic_id" />
					<input type="hidden" value="<?php 
                echo $forum_id;
                ?>
" name="bbp_old_forum_id" />
				</div>
				<input type="submit" value="Move" name="bbps_topic_move_submit" class="btn btn-default" />
			</form>
		</div>  <?php 
            }
        }
    }
function bbps_display_claimed_message()
{
    $topic_author_id = bbp_get_topic_author_id();
    global $current_user;
    get_currentuserinfo();
    $user_id = $current_user->ID;
    //we want to display the claimed topic message to the topic owner to
    if (get_option('_bbps_claim_topic') == 1 && (current_user_can('administrator') || current_user_can('bbp_moderator') || $topic_author_id == $user_id) && bbps_is_support_forum(bbp_get_forum_id())) {
        $topic_id = bbp_get_topic_id();
        $claimed_user_id = get_post_meta($topic_id, '_bbps_topic_claimed', true);
        if ($claimed_user_id > 0) {
            $user_info = get_userdata($claimed_user_id);
            $claimed_user_name = $user_info->user_login;
        }
        if ($claimed_user_id > 0 && $claimed_user_id != $user_id) {
            echo "<div class='bbps-support-forums-message'>This topic is currently claimed by " . $claimed_user_name . ", they will be working on it now. </div>";
        }
        //the person who claimed it can unclaim it this will also unsubscribe them when they do
        if ($claimed_user_id == $user_id) {
            $urgent_uri = add_query_arg(array('action' => 'bbps_unclaim_topic', 'topic_id' => $topic_id, 'user_id' => $user_id));
            echo '<div class="bbps-support-forums-message"> You currently own this topic would you like to <a href="' . $urgent_uri . '">Unclame</a> it?</div>';
        }
    }
}