function 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">

        <br> <?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><div style="clear:both;"></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" name="bbps_support_topic_move" action="" method="post">
				<label for="bbp_forum_id">Move topic to: </label><?php 
            bbp_dropdown();
            ?>
				<input type="submit" value="Move" name="bbps_topic_move_submit" />
				<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" />
			</form>
		</div><div style="clear:both;"></div>  <?php 
        }
    }
}
function bbps_bbp_theme_before_reply_form_submit_button()
{
    //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();
        if ($can_edit) {
            $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 class="row">
            <div class="col-md-6">
            <div id="bbps_support_forum_options" class="well"> <?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, false);
            } else {
                ?>
                This topic is: <?php 
                echo $status;
            }
            ?>
 </div> <?php 
            ?>
 </div>
            <div class="col-md-6">
            <div id="bbps_support_forum_options_mod" class="well"> <?php 
            //get out the option to tell us who is allowed to view and update the drop down list.
            if ($can_edit == true) {
                ?>
	            <label for="bbps_minutes_spent">Time spent on this thread: </label>
	            <br/>
	            <input type="button" name="gogotimer" onclick="jQuery(this).hide(); return bbps_ticktock();" value="Start Timer">
				<input type="text" name="bbps_minutes_spent" id="bbps_minutes_spent" value="0.00" size="10"> minutes
	            <script type="text/javascript">
		            var bbps_ticktock_seconds = 0, bbps_ticktock_run = true, bbps_ticktock_doing = false;
		            jQuery(function(){
			            jQuery('#bbps_minutes_spent').change(function(){
				            if(!bbps_ticktock_doing)bbps_ticktock_run=false;
			            });
		            });
		            function bbps_ticktock(){
			            // runs every seconds.
			            bbps_ticktock_doing = true;
			            bbps_ticktock_seconds++;
			            var minutes = Math.floor(bbps_ticktock_seconds / 60);
			            var seconds = bbps_ticktock_seconds - (minutes * 60);
			            jQuery('#bbps_minutes_spent').val( Math.floor( (minutes + (seconds / 60)) * 100) / 100);
			            if(bbps_ticktock_run){
				            setTimeout(bbps_ticktock,1000);
			            }
			            bbps_ticktock_doing = false;
			            return false;
		            }
		            //setTimeout(bbps_ticktock,1000);
	            </script>
                <?php 
                // get a history of items for this thread.
                $thread_time = get_post_meta($topic_id, '_bbps_topic_minutes', true);
                if (!is_array($thread_time)) {
                    $thread_time = array();
                }
                if (count($thread_time)) {
                    ?>
	                <ul>
		                <?php 
                    foreach ($thread_time as $thread_tim) {
                        $user_info = get_userdata($thread_tim['user_id']);
                        ?>
	                        <li>
		                        User <?php 
                        echo $user_info->user_login;
                        ?>
 spent <?php 
                        echo htmlspecialchars($thread_tim['time']);
                        ?>
 minutes on <?php 
                        echo date('Y-m-d', $thread_tim['recorded']);
                        ?>
	                        </li>
	                    <?php 
                    }
                    ?>
	                </ul>
	            <?php 
                }
            }
            ?>
 </div> <?php 
            ?>
 </div> </div> <!-- row --><?php 
        }
    }
}
function bbps_bbp_theme_before_reply_form_submit_button()
{
    //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();
        if ($can_edit) {
            $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 class="row">
            <div class="col-md-6">
            <div id="bbps_support_forum_options" class="well"> <?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, false);
            } else {
                ?>
                This topic is: <?php 
                echo $status;
            }
            ?>
 </div> <?php 
            ?>
 </div> </div> <!-- row --><?php 
        }
    }
}