</label> <select id="topic_group_id" name="topic_group_id"> <option value=""><?php /* translators: no option picked in select box */ _e('----', 'buddypress'); ?> </option> <?php while (bp_groups()) { bp_the_group(); ?> <?php if (bp_group_is_forum_enabled() && (is_super_admin() || 'public' == bp_get_group_status() || bp_group_is_member())) { ?> <option value="<?php bp_group_id(); ?> "><?php bp_group_name(); ?> </option> <?php } ?> <?php
/** * enable_forum_assignment_screen( $vars ) * * Hooks into screen_handler * If forum is active for group, creates a thread for assignment * * @param Array $vars a set of variables received for this screen template * @return Array $vars a set of variable passed to this screen template */ function enable_forum_assignment_screen($vars) { global $bp; $e_forum_nonce = 'assignment_enable_forum'; $is_nonce = false; if (isset($_POST['_wpnonce'])) { $is_nonce = wp_verify_nonce($_POST['_wpnonce'], $e_forum_nonce); } // Nonce will take care of dublicates if ($is_nonce && bp_group_is_forum_enabled()) { $assignment = $this->is_assignment($this->current_assignment); $assignment_forum_id = groups_get_groupmeta($bp->groups->current_group->id, 'forum_id'); // Append assignment link to the content $assignment->post_content = $assignment->post_content . "\n\n" . "<a href=\"" . $vars['current_uri'] . '/assignment/' . $assignment->post_name . "\">" . __('Courseware Assignment Link', 'bpsp') . "</a>"; // Create tags from title and append 'assignment' to it $assignment->tags = str_replace('-', ', ', $assignment->post_name) . __(", assignment", 'bpsp'); // Create a topic for current assignment $topic = groups_new_group_forum_topic($assignment->post_title, $assignment->post_content, $assignment->tags, $assignment_forum_id); // Create topic for assignment and save in post_meta topic link if ($topic) { $topic_permalink = bp_get_group_permalink($bp->groups->current_group) . 'forum/topic/' . $topic->topic_slug; if (update_post_meta($assignment->ID, 'topic_link', $topic_permalink)) { $vars['message'] = __('Assignment forum created.', 'bpsp'); } // Force saving the new permalink to $vars, since it doesn't show up $vars['forum_link'] = $topic_permalink; } } else { $vars['error'] = __('Forum was not created.', 'bpsp'); } return $this->single_assignment_screen($vars); }
<p><?php bp_group_news(); ?> </p> </div> <?php } ?> <?php do_action('groups_custom_group_fields'); ?> <?php if (bp_group_is_visible() && bp_group_is_forum_enabled() && function_exists('bp_forums_setup')) { ?> <div class="info-group"> <h4><?php _e('Active Forum Topics', 'buddypress'); ?> <a href="<?php bp_group_forum_permalink(); ?> "><?php _e('See All »', 'buddypress'); ?> </a></h4> <p><?php bp_group_active_forum_topics();
<input type="text" name="topic_title" id="topic_title" value="" /> <label><?php _e( 'Content:', 'buddypress' ) ?></label> <textarea name="topic_text" id="topic_text"></textarea> <label><?php _e( 'Tags (comma separated):', 'buddypress' ) ?></label> <input type="text" name="topic_tags" id="topic_tags" value="" /> <label><?php _e( 'Post In Group Forum:', 'buddypress' ) ?></label> <select id="topic_group_id" name="topic_group_id"> <option value="">----</option> <?php while ( bp_groups() ) : bp_the_group(); ?> <?php if ( bp_group_is_forum_enabled() && 'public' == bp_get_group_status() ) : ?> <option value="<?php bp_group_id() ?>"><?php bp_group_name() ?></option> <?php endif; ?> <?php endwhile; ?> </select><!-- #topic_group_id --> <?php do_action( 'groups_forum_new_topic_after' ) ?> <div class="submit"> <input type="submit" name="submit_topic" id="submit" value="<?php _e( 'Post Topic', 'buddypress' ) ?>" /> <input type="button" name="submit_topic_cancel" id="submit_topic_cancel" value="<?php _e( 'Cancel', 'buddypress' ) ?>" /> </div>
</label> <select id="topic_group_id" name="topic_group_id"> <option value=""><?php /* translators: no option picked in select box */ _e('----', 'buddypress'); ?> </option> <?php while (bp_groups()) { bp_the_group(); ?> <?php if (bp_group_is_forum_enabled() && (bp_current_user_can('bp_moderate') || 'public' == bp_get_group_status() || bp_group_is_member())) { ?> <option value="<?php bp_group_id(); ?> "><?php bp_group_name(); ?> </option> <?php } ?> <?php
/** * Add a hidden input field on the group settings page if the group forum is * enabled. * * Due to the way BuddyPress' group admin settings page saves its settings, * we need to let BP know that bbPress added a forum. * * @since bbPress (r5026) * * @link http://bbpress.trac.wordpress.org/ticket/2339/ * @see groups_screen_group_admin_settings() */ public function group_settings_hidden_field() { // if a forum is not enabled, we don't need to add this field if (!bp_group_is_forum_enabled()) { return; } ?> <input type="hidden" name="group-show-forum" id="group-show-forum" value="1" /> <?php }
/** * bp_groupblog_options_nav() * * Manually create the navigation for the group since we can't fetch any other way. * You should manually add items if you have third party plugins that add a menu item. * * The BuddyPress function we duplicate is called bp_get_options_nav() */ function bp_groupblog_options_nav() { global $bp; $checks = get_site_option('bp_groupblog_blog_defaults_options'); ?> <li id="home-personal-li"<?php if ($checks['deep_group_integration']) { ?> class="current selected"<?php } ?> > <a id="home" href="<?php bp_group_permalink(); ?> "><?php _e('Home', 'groupblog'); ?> </a> </li> <?php if (groups_is_user_admin($bp->loggedin_user->id, bp_get_group_id()) || groups_is_user_mod($bp->loggedin_user->id, bp_get_group_id())) { ?> <li id="admin-personal-li" > <a id="admin" href="<?php bp_group_permalink(); ?> admin/"><?php _e('Admin', 'groupblog'); ?> </a> </li> <?php } ?> <?php if (bp_group_is_visible()) { ?> <?php if (bp_groupblog_is_blog_enabled(bp_get_group_id())) { ?> <?php if (!$checks['deep_group_integration']) { ?> <li id="<?php echo BP_GROUPBLOG_SLUG; ?> -personal-li"<?php //if ( is_page() ) : ?> class="current selected"<?php //endif; ?> > <a id="<?php echo BP_GROUPBLOG_SLUG; ?> " href="<?php bp_group_permalink(); ?> blog/"><?php _e('Blog', 'groupblog'); ?> </a> </li> <?php } ?> <?php } ?> <?php if (bp_is_active('forums') && (function_exists('bp_forums_is_installed_correctly') && bp_group_is_forum_enabled() && !(int) bp_get_option('bp-disable-forum-directory')) && bp_forums_is_installed_correctly()) { ?> <li id="<?php echo BP_FORUMS_SLUG; ?> -personal-li" > <a id="<?php echo BP_FORUMS_SLUG; ?> " href="<?php bp_group_permalink(); ?> forum/"><?php _e('Forum', 'groupblog'); ?> </a> </li> <?php } ?> <li id="<?php echo BP_MEMBERS_SLUG; ?> -personal-li" > <a id="<?php echo BP_MEMBERS_SLUG; ?> " href="<?php bp_group_permalink(); ?> members/"><?php _e('Members', 'groupblog'); ?> (<?php bp_group_total_members(); ?> )</a> </li> <li id="invite-personal-li" > <a id="invite" href="<?php bp_group_permalink(); ?> send-invites/"><?php _e('Send Invites', 'groupblog'); ?> </a> </li> <?php } elseif (!bp_group_is_visible() && bp_get_group_status() != 'hidden') { ?> <li id="request-membership-personal-li" > <a id="request-membership" href="<?php bp_group_permalink(); ?> request-membership/"><?php _e('Request Membership', 'groupblog'); ?> </a> </li> <?php } ?> <?php }
if ($is_teacher) { ?> <a href="<?php echo $nav_options[__('Home', 'bpsp')] . '/new_bibliography'; ?> " class="alignright action"> <?php _e('Manage bibliography', 'bpsp'); ?> </a> <?php } ?> </li> <?php if (bp_group_is_forum_enabled()) { ?> <li> <?php printf(__('<em>%d</em> Assignment discussions started', 'bpsp'), $assignment_topics_count); ?> <a href="<?php bp_group_forum_permalink(); ?> " class="alignright action"> <?php _e('Visit forums', 'bpsp'); ?> </a> </li> <?php
/** * Show forums and new forum form when editing a group * * @since bbPress (r3563) * @uses bbp_get_template_part() */ public function edit_screen() { $checked = bp_get_new_group_enable_forum() || bp_group_is_forum_enabled(bp_get_group_id()); ?> <h4><?php _e('Enable Group Forum', 'bbpress'); ?> </h4> <p><?php _e('Create a discussion forum to allow members of this group to communicate in a structured, bulletin-board style fashion.', 'bbpress'); ?> </p> <div class="checkbox"> <label><input type="checkbox" name="bbp-edit-group-forum" id="bbp-edit-group-forum" value="1"<?php checked($checked); ?> /> <?php _e('Yes. I want this group to have a forum.', 'bbpress'); ?> </label> </div> <p class="description"><?php _e('Saying no will not delete existing forum content.', 'bbpress'); ?> </p> <input type="submit" value="<?php esc_attr_e('Save Settings', 'bbpress'); ?> " /> <?php // Verify intent wp_nonce_field('groups_edit_save_' . $this->slug); }