function bp_checkins_needs_activity() { if (!bp_is_active('activity')) { $buddy_settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; ?> <div id="message" class="updated"> <p><?php printf(__('If you want to use BP Checkins, you need to activate the Activity Stream BuddyPress component, to do so, please activate it in <a href="%s">BuddyPress settings</a>', 'bp-checkins'), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $buddy_settings_page))); ?> </p> </div> <?php } }
/** * Add the Activity top-level menu link when viewing single activity item. * * @since 2.6.0 * * @return null Null if user does not have access to editing functionality. */ function bp_activity_admin_menu() { global $wp_admin_bar; // Only show if viewing a single activity item. if (!bp_is_single_activity()) { return; } // Only show this menu to super admins if (!bp_current_user_can('bp_moderate')) { return; } $activity_edit_link = add_query_arg(array('page' => 'bp-activity', 'aid' => bp_current_action(), 'action' => 'edit'), bp_get_admin_url('admin.php')); // Add the top-level Edit Activity button. $wp_admin_bar->add_menu(array('id' => 'activity-admin', 'title' => __('Edit Activity', 'buddypress'), 'href' => esc_url($activity_edit_link))); }
/** * Make sure only one Field will hold the member type * * We also use this function to intercept the Member types descriptions * when the field is the one to manage the member types * * @since 1.0.1 */ public function is_unique() { if (!function_exists('get_current_screen')) { return; } // Get current screen $current_screen = get_current_screen(); if (empty($current_screen->id)) { return; } // Check we're on a profile page if (false === strpos($current_screen->id, 'users_page_bp-profile-setup')) { return; } // Check we're saving a member type field if (!isset($_POST['saveField']) || isset($_POST['fieldtype']) && 'member_type' !== $_POST['fieldtype']) { return; } // Get the allowed field id $saved_option = (int) bp_get_option('cfbgr_xfield_id', 0); if (!empty($saved_option)) { if (!empty($_GET['field_id']) && $saved_option === (int) $_GET['field_id']) { // We're saving description for the member type, let's append this to the field // this will be usefull to set the option descriptions as BuddyPress is always // deleting options (???) when a file is edited to recreate them later (???) if (!empty($_POST['_cfbgr_option_description']) && is_array($_POST['_cfbgr_option_description'])) { $this->descriptions = $_POST['_cfbgr_option_description']; foreach ($this->descriptions as $key => $desc) { if (empty($desc)) { unset($this->descriptions[$key]); } } } return; } wp_die(sprintf(__('Only one field can hold the member type. <a href="%s">Please choose another field type</a>', 'buddypress-group-restrictions'), add_query_arg('page', 'bp-profile-setup', bp_get_admin_url('users.php')))); } }
/** * This is the confirmation screen for actions. * * @since 2.0.0 * * @param string $action Delete, activate, or resend activation link. * * @return string */ public function signups_admin_manage($action = '') { if (!current_user_can($this->capability) || empty($action)) { die('-1'); } // Get the user IDs from the URL. $ids = false; if (!empty($_POST['allsignups'])) { $ids = wp_parse_id_list($_POST['allsignups']); } elseif (!empty($_GET['signup_id'])) { $ids = absint($_GET['signup_id']); } if (empty($ids)) { return false; } // Query for signups, and filter out those IDs that don't // correspond to an actual signup. $signups_query = BP_Signup::get(array('include' => $ids)); $signups = $signups_query['signups']; $signup_ids = wp_list_pluck($signups, 'signup_id'); // Set up strings. switch ($action) { case 'delete': $header_text = __('Delete Pending Accounts', 'buddypress'); if (1 == count($signup_ids)) { $helper_text = __('You are about to delete the following account:', 'buddypress'); } else { $helper_text = __('You are about to delete the following accounts:', 'buddypress'); } break; case 'activate': $header_text = __('Activate Pending Accounts', 'buddypress'); if (1 == count($signup_ids)) { $helper_text = __('You are about to activate the following account:', 'buddypress'); } else { $helper_text = __('You are about to activate the following accounts:', 'buddypress'); } break; case 'resend': $header_text = __('Resend Activation Emails', 'buddypress'); if (1 == count($signup_ids)) { $helper_text = __('You are about to resend an activation email to the following account:', 'buddypress'); } else { $helper_text = __('You are about to resend an activation email to the following accounts:', 'buddypress'); } break; } // These arguments are added to all URLs. $url_args = array('page' => 'bp-signups'); // These arguments are only added when performing an action. $action_args = array('action' => 'do_' . $action, 'signup_ids' => implode(',', $signup_ids)); if (is_network_admin()) { $base_url = network_admin_url('users.php'); } else { $base_url = bp_get_admin_url('users.php'); } $cancel_url = add_query_arg($url_args, $base_url); $action_url = wp_nonce_url(add_query_arg(array_merge($url_args, $action_args), $base_url), 'signups_' . $action); ?> <div class="wrap"> <h1><?php echo esc_html($header_text); ?> </h1> <p><?php echo esc_html($helper_text); ?> </p> <ol class="bp-signups-list"> <?php foreach ($signups as $signup) { $last_notified = mysql2date('Y/m/d g:i:s a', $signup->date_sent); ?> <li> <?php echo esc_html($signup->user_name); ?> - <?php echo sanitize_email($signup->user_email); ?> <?php if ('resend' == $action) { ?> <p class="description"> <?php printf(esc_html__('Last notified: %s', 'buddypress'), $last_notified); ?> <?php if (!empty($signup->recently_sent)) { ?> <span class="attention wp-ui-text-notification"> <?php esc_html_e('(less than 24 hours ago)', 'buddypress'); ?> </span> <?php } ?> </p> <?php } ?> </li> <?php } ?> </ol> <?php if ('delete' === $action) { ?> <p><strong><?php esc_html_e('This action cannot be undone.', 'buddypress'); ?> </strong></p> <?php } ?> <a class="button-primary" href="<?php echo esc_url($action_url); ?> "><?php esc_html_e('Confirm', 'buddypress'); ?> </a> <a class="button" href="<?php echo esc_url($cancel_url); ?> "><?php esc_html_e('Cancel', 'buddypress'); ?> </a> </div> <?php }
/** * "In response to" column markup. * * @since BuddyPress (1.6.0) * * @see WP_List_Table::single_row_columns() * * @param array $item A singular item (one full row). */ function column_response($item) { // Is $item is a root activity? /** * Filters default list of default root activity types. * * @since BuddyPress (1.6.0) * * @param array $value Array of default activity types. * @param array $item Current item being displayed. */ if (empty($item['item_id']) || !in_array($item['type'], apply_filters('bp_activity_admin_root_activity_types', array('activity_comment'), $item))) { $comment_count = !empty($item['children']) ? bp_activity_recurse_comment_count((object) $item) : 0; $root_activity_url = bp_get_admin_url('admin.php?page=bp-activity&aid=' . $item['id']); // If the activity has comments, display a link to the activity's permalink, with its comment count in a speech bubble if ($comment_count) { $title_attr = sprintf(_n('%s related activity', '%s related activities', $comment_count, 'buddypress'), number_format_i18n($comment_count)); printf('<a href="%1$s" title="%2$s" class="post-com-count"><span class="comment-count">%3$s</span></a>', esc_url($root_activity_url), esc_attr($title_attr), number_format_i18n($comment_count)); } // For non-root activities, display a link to the replied-to activity's author's profile } else { echo '<strong>' . get_avatar($this->get_activity_user_id($item['item_id']), '32') . ' ' . bp_core_get_userlink($this->get_activity_user_id($item['item_id'])) . '</strong><br />'; } // Activity permalink if (!$item['is_spam']) { printf(__('<a href="%1$s">View Activity</a>', 'buddypress'), bp_activity_get_permalink($item['id'], (object) $item)); } }
/** * Output the correct admin URL based on BuddyPress and WordPress configuration. * * @since BuddyPress (1.5.0) * * @see bp_get_admin_url() For description of parameters. * * @param string $path See {@link bp_get_admin_url()}. * @param string $scheme See {@link bp_get_admin_url()}. */ function bp_admin_url($path = '', $scheme = 'admin') { echo bp_get_admin_url($path, $scheme); }
function bp_forums_bbpress_install_wizard() { $post_url = bp_get_admin_url('admin.php?page=bb-forums-setup'); $bbpress_plugin_is_active = false; $step = isset($_REQUEST['step']) ? $_REQUEST['step'] : ''; // The text and URL of the Site Wide Forums button differs depending on whether bbPress // is running if (is_plugin_active('bbpress/bbpress.php')) { $bbpress_plugin_is_active = true; // The bbPress admin page will always be on the root blog. switch_to_blog() will // pass through if we're already there. switch_to_blog(bp_get_root_blog_id()); $button_url = admin_url(add_query_arg(array('page' => 'bbpress'), 'options-general.php')); restore_current_blog(); $button_text = __('Configure bbPress', 'buddypress'); } else { $button_url = bp_get_admin_url(add_query_arg(array('tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500'), 'plugin-install.php')); $button_text = __('Install bbPress', 'buddypress'); } switch ($step) { case 'existing': if (isset($_REQUEST['doinstall']) && 1 == (int) $_REQUEST['doinstall']) { if (!bp_forums_configure_existing_install()) { _e('The bb-config.php file was not found at that location, please try again.', 'buddypress'); } else { ?> <h3><?php _e('Forums were set up correctly using your existing bbPress install!', 'buddypress'); ?> </h3> <p><?php _e('BuddyPress will now use its internal copy of bbPress to run the forums on your site. If you wish, you can remove your old bbPress installation files, as long as you keep the bb-config.php file in the same location.', 'buddypress'); ?> </p><?php } } else { ?> <form action="" method="post"> <h3><?php _e('Existing bbPress Installation', 'buddypress'); ?> </h3> <p><?php _e("BuddyPress can make use of your existing bbPress install. Just provide the location of your <code>bb-config.php</code> file, and BuddyPress will do the rest.", 'buddypress'); ?> </p> <p><label><code>bb-config.php</code> file location:</label><br /><input style="width: 50%" type="text" name="bbconfigloc" id="bbconfigloc" value="<?php echo str_replace('buddypress', '', $_SERVER['DOCUMENT_ROOT']); ?> " /></p> <p><input type="submit" class="button-primary" value="<?php _e('Complete Installation', 'buddypress'); ?> " /></p> <input type="hidden" name="step" value="existing" /> <input type="hidden" name="doinstall" value="1" /> <?php wp_nonce_field('bp_forums_existing_install_init'); ?> </form> <?php } break; case 'new': if (isset($_REQUEST['doinstall']) && 1 == (int) $_REQUEST['doinstall']) { $result = bp_forums_bbpress_install(); switch ($result) { case 1: _e('<p>All done! Configuration settings have been saved to the file <code>bb-config.php</code> in the root of your WordPress install.</p>', 'buddypress'); break; default: // Just write the contents to screen _e('<p>A configuration file could not be created. No problem, but you will need to save the text shown below into a file named <code>bb-config.php</code> in the root directory of your WordPress installation before you can start using the forum functionality.</p>', 'buddypress'); ?> <textarea style="display:block; margin-top: 30px; width: 80%;" rows="50"><?php echo htmlspecialchars($result); ?> </textarea> <?php break; } } else { ?> <h3><?php _e('New bbPress Installation', 'buddypress'); ?> </h3> <p><?php _e("You've decided to set up a new installation of bbPress for forum management in BuddyPress. This is very simple and is usually just a one click\n\t\t\t\tprocess. When you're ready, hit the link below.", 'buddypress'); ?> </p> <p><a class="button-primary" href="<?php echo wp_nonce_url($post_url . '&step=new&doinstall=1', 'bp_forums_new_install_init'); ?> "><?php _e('Complete Installation', 'buddypress'); ?> </a></p> <?php } break; default: if (!file_exists(BP_PLUGIN_DIR . '/bp-forums/bbpress/')) { ?> <div id="message" class="error"> <p><?php printf(__('bbPress files were not found. To install the forums component you must download a copy of bbPress and make sure it is in the folder: "%s"', 'buddypress'), 'wp-content/plugins/buddypress/bp-forums/bbpress/'); ?> </p> </div> <?php } else { // Include the plugin install add_thickbox(); wp_enqueue_script('plugin-install'); wp_admin_css('plugin-install'); ?> <div style="width: 45%; float: left; margin-top: 20px;"> <h3><?php _e('Forums for Groups', 'buddypress'); ?> </h3> <p><?php _e('Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.', 'buddypress'); ?> </p> <p><?php _e('Note: This component is retired and will not be receiving any updates in the future. Only use this component if your current site relies on it.', 'buddypress'); ?> </p> <h4 style="margin-bottom: 10px;"><?php _e('Features', 'buddypress'); ?> </h4> <ul class="description" style="list-style: square; margin-left: 30px;"> <li><?php _e('Group Integration', 'buddypress'); ?> </p></li> <li><?php _e('Member Profile Integration', 'buddypress'); ?> </p></li> <li><?php _e('Activity Stream Integration', 'buddypress'); ?> </p></li> <li><?php _e('@ Mention Integration', 'buddypress'); ?> </p></li> </ul> <div> <a class="button button-primary" href="<?php echo $post_url . '&step=new'; ?> "><?php _e('Install Group Forums', 'buddypress'); ?> </a> <a class="button" href="<?php echo $post_url . '&step=existing'; ?> "><?php _e('Use Existing Installation', 'buddypress'); ?> </a> </div> </div> <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> <h3><?php _e('New! bbPress', 'buddypress'); ?> </h3> <p><?php _e('bbPress is a brand-new forum plugin from one of the lead developers of BuddyPress.', 'buddypress'); ?> </p> <p><?php _e('It boasts a bunch of cool features that the BP Legacy Discussion Forums does not have including:', 'buddypress'); ?> </p> <ul class="description" style="list-style: square; margin-left: 30px;"> <li><?php _e('Non-group specific forum creation', 'buddypress'); ?> </p></li> <li><?php _e('Moderation via the WP admin dashboard', 'buddypress'); ?> </p></li> <li><?php _e('Topic splitting', 'buddypress'); ?> </p></li> <li><?php _e('Revisions', 'buddypress'); ?> </p></li> <li><?php _e('Spam management', 'buddypress'); ?> </p></li> <li><?php _e('Subscriptions', 'buddypress'); ?> </p></li> <li><?php _e('And more!', 'buddypress'); ?> </p></li> </ul> <p><?php printf(__('If you decide to use bbPress, you will need to deactivate the legacy group forum component. For more info, <a href="%s">read this codex article</a>.', 'buddypress'), 'http://codex.buddypress.org/user/setting-up-a-new-installation/installing-group-and-sitewide-forums/using-bbpress-2-2-with-buddypress/'); ?> </p> <div> <a class="button button-primary <?php if (!$bbpress_plugin_is_active) { echo esc_attr('thickbox'); } ?> " href="<?php echo esc_attr($button_url); ?> "><?php echo esc_html($button_text); ?> </a> </div> </div> <?php } break; } }
function bp_checkins_settings_admin() { global $bp_checkins_logs_slug; $active = __('Activity checkins', 'bp-checkins'); if (!empty($_GET['tab']) && $_GET['tab'] == 'component') { $active = __('Checkins & Places Component', 'bp-checkins'); } if (!empty($_GET['tab']) && $_GET['tab'] == 'foursquare') { $active = __('Foursquare API Settings', 'bp-checkins'); } $upload_size_unit = $max_upload_size = wp_max_upload_size(); $sizes = array('KB', 'MB', 'GB'); for ($u = -1; $upload_size_unit > 1024 && $u < count($sizes) - 1; $u++) { $upload_size_unit /= 1024; } if ($u < 0) { $upload_size_unit = 0; $u = 0; } else { $upload_size_unit = (int) $upload_size_unit; } do_action('bp_checkins_cron_options'); $schedules = wp_get_schedules(); $admin_page = bp_checkins_16_new_admin(); if ($admin_page == 'bp-general-settings.php') { $admin_page = 'admin.php'; } $buddy_settings_page = bp_core_do_network_admin() ? 'settings.php' : 'options-general.php'; ?> <div class="wrap"> <?php screen_icon('bp-checkins'); ?> <h2 class="nav-tab-wrapper"><?php bp_checkins_admin_tabs($active); ?> </h2> <?php if (isset($_POST['bpci-admin'])) { ?> <div id="message" class="updated fade"> <p><?php _e('Settings Saved', 'bp-checkins'); ?> </p> </div> <?php } ?> <form action="" method="post" id="bp-admin-form"> <?php if (empty($_GET['tab'])) { ?> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Disable Activity checkins in profile and group post forms', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-disable-activity-checkins]"<?php if ((int) bp_get_option('bp-checkins-disable-activity-checkins')) { ?> checked="checked"<?php } ?> id="bp-disable-activity-checkins-yes" value="1" /> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-disable-activity-checkins]"<?php if (!(int) bp_get_option('bp-checkins-disable-activity-checkins') || '' == bp_get_option('bp-checkins-disable-activity-checkins')) { ?> checked="checked"<?php } ?> id="bp-disable-activity-checkins-no" value="0" /> <?php _e('No', 'bp-checkins'); ?> </td> </tr> <tr> <th scope="row"><?php _e('Hide position of user's friends in friends list', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-disable-geo-friends]"<?php if ((int) bp_get_option('bp-checkins-disable-geo-friends')) { ?> checked="checked"<?php } ?> id="bp-disable-geo-friends-yes" value="1" /> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-disable-geo-friends]"<?php if (!(int) bp_get_option('bp-checkins-disable-geo-friends') || '' == bp_get_option('bp-checkins-disable-geo-friends')) { ?> checked="checked"<?php } ?> id="bp-disable-geo-friends-no" value="0" /> <?php _e('No', 'bp-checkins'); ?> </td> </tr> </tbody> </table> <?php } elseif ($_GET['tab'] == 'component') { ?> <?php if (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component')) { ?> <input type="hidden" name="bpci-admin[bp-checkins-activate-component]" value="1"> <p> <?php _e('If you want to activate this component, simply click on the 'Save Settings' button, then you will be able to edit its behavior', 'bp-checkins'); ?> </p> <?php } else { ?> <h3><?php _e('Checkins Component', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Enable image uploads in Checkins (it needs at least <b>64M</b> of memory limit)', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-enable-image-uploads]"<?php if ((int) bp_get_option('bp-checkins-enable-image-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-image-uploads-yes" value="1"/> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-enable-image-uploads]"<?php if (!(int) bp_get_option('bp-checkins-enable-image-uploads') || '' == bp_get_option('bp-checkins-enable-image-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-image-uploads-no" value="0"/> <?php _e('No', 'bp-checkins'); ?> </td> </tr> </tbody> </table> <h3><?php printf(__('<a href="%s">Places Component</a>', 'bp-checkins'), admin_url('edit.php?post_type=places')); ?> : </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Enable image uploads in Places', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-enable-place-uploads]"<?php if ((int) bp_get_option('bp-checkins-enable-place-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-image-uploads-yes" value="1"/> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-enable-place-uploads]"<?php if (!(int) bp_get_option('bp-checkins-enable-place-uploads') || '' == bp_get_option('bp-checkins-enable-place-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-image-uploads-no" value="0"/> <?php _e('No', 'bp-checkins'); ?> </td> </tr> <tr> <th scope="row"><?php _e('Max width for the image added via an url in Places', 'bp-checkins'); ?> </th> <td> <input type="text" name="bpci-admin[bp-checkins-max-width-image]" <?php if ((int) bp_get_option('bp-checkins-max-width-image')) { echo 'value="' . intval(bp_get_option('bp-checkins-max-width-image')) . '"'; } else { echo 'value="300"'; } ?> id="bp-checkins-max-width-image"/> </td> </tr> <tr> <th scope="row"><?php _e('Enable image uploads in Places comments (it needs at least <b>64M</b> of memory limit)', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-enable-comment-image-uploads]"<?php if ((int) bp_get_option('bp-checkins-enable-comment-image-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-comment-image-uploads-yes" value="1"/> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-enable-comment-image-uploads]"<?php if (!(int) bp_get_option('bp-checkins-enable-comment-image-uploads') || '' == bp_get_option('bp-checkins-enable-comment-image-uploads')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-comment-image-uploads-no" value="0"/> <?php _e('No', 'bp-checkins'); ?> </td> </tr> <tr> <th scope="row"><?php _e('Enable info box to show friends that checked in a place to logged in user', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-enable-box-checkedin-friends]"<?php if ((int) bp_get_option('bp-checkins-enable-box-checkedin-friends')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-box-checkedin-friends-yes" value="1"/> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-enable-box-checkedin-friends]"<?php if (!(int) bp_get_option('bp-checkins-enable-box-checkedin-friends') || '' == bp_get_option('bp-checkins-enable-box-checkedin-friends')) { ?> checked="checked"<?php } ?> id="bp-checkins-enable-box-checkedin-friends-no" value="0"/> <?php _e('No', 'bp-checkins'); ?> </td> </tr> <tr> <th scope="row"><?php _e('Amount of milliseconds for the timer in Live places', 'bp-checkins'); ?> </th> <td> <input type="text" name="bpci-admin[bp-checkins-live-places-timer]" <?php if ((int) bp_get_option('bp-checkins-live-places-timer')) { echo 'value="' . intval(bp_get_option('bp-checkins-live-places-timer')) . '"'; } else { echo 'value="8000"'; } ?> id="bp-checkins-live-places-timer"/> </td> </tr> <tr> <th scope="row"><?php _e('Disable timer in the comments of live places', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-disable-timer]"<?php if ((int) bp_get_option('bp-checkins-disable-timer')) { ?> checked="checked"<?php } ?> id="bp-checkins-disable-timer-yes" value="1"/> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-disable-timer]"<?php if (!(int) bp_get_option('bp-checkins-disable-timer') || '' == bp_get_option('bp-checkins-disable-timer')) { ?> checked="checked"<?php } ?> id="bp-checkins-disable-timer-no" value="0"/> <?php _e('No', 'bp-checkins'); ?> </td> </tr> </tbody> </table> <h3><?php _e('Shared settings', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php printf(__('Max upload file size for images (%s)', 'bp-checkins'), $sizes[$u]); ?> </th> <td> <input type="text" name="bpci-admin[bp-checkins-max-upload-size]" <?php if ((int) bp_get_option('bp-checkins-max-upload-size')) { echo 'value="' . intval(bp_get_option('bp-checkins-max-upload-size')) . '"'; } else { echo 'value="' . intval($upload_size_unit) . '"'; } ?> id="checkins-max-upload-size"/> </td> </tr> </tbody> </table> <p> </p> <p class="description"><?php _e('Image uploads in checkin component or in the comments of places uses the HTML5 File and File Reader API, it may not work for all users depending on their browser...', 'bp-checkins'); ?> </p> <h3><?php _e('Disable Checkins and Places components', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Check the 'yes' option and save the settings to disable the components', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-activate-component]"<?php if (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component')) { ?> checked="checked"<?php } ?> id="bp-checkins-activate-component-yes" value="0" /> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-activate-component]"<?php if ((int) bp_get_option('bp-checkins-activate-component')) { ?> checked="checked"<?php } ?> id="bp-checkins-activate-component-no" value="1" /> <?php _e('No', 'bp-checkins'); ?> </td> </tr> </tbody> </table> <?php } ?> <?php } elseif ($_GET['tab'] == 'foursquare') { ?> <?php if (!bp_is_active('settings')) { ?> <div id="message" class="updated"> <p> <?php printf(__('If you want to use this feature, you need to activate the Account Settings BuddyPress component, to do so, please activate it in <a href="%s">BuddyPress settings</a>', 'bp-checkins'), bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $buddy_settings_page))); ?> </p> </div> <?php } elseif (!(int) bp_get_option('bp-checkins-activate-component') || '' == bp_get_option('bp-checkins-activate-component')) { ?> <p> <?php printf(__('If you want to use this feature, you need to activate the Checkins and Places component, to do so use <a href="%s">the appropriate tab</a>', 'bp-checkins'), bp_get_admin_url(add_query_arg(array('page' => 'bp-checkins-admin', 'tab' => 'component'), $admin_page))); ?> </p> <?php } else { ?> <h3><?php _e('Foursquare credentials', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Client ID', 'bp-checkins'); ?> </th> <td> <input type="text" name="bpci-admin[foursquare-client-id]" value="<?php if (bp_get_option('foursquare-client-id') && "" != bp_get_option('foursquare-client-id')) { echo bp_get_option('foursquare-client-id'); } ?> " id="foursquare_client_id"> </td> <td> <p class="description"><?php _e('given by Foursquare once you registered an API key.', 'bp-checkins'); ?> </p> </td> </tr> <tr> <th scope="row"><?php _e('Client Secret', 'bp-checkins'); ?> </th> <td> <input type="text" name="bpci-admin[foursquare-client-secret]" value="<?php if (bp_get_option('foursquare-client-secret') && "" != bp_get_option('foursquare-client-secret')) { echo bp_get_option('foursquare-client-secret'); } ?> " id="foursquare_secret_id"> </td> <td> <p class="description"><?php _e('given by Foursquare once you registered an API key.', 'bp-checkins'); ?> </p> </td> </tr> <tr> <th scope="row"><?php _e('Callback Url', 'bp-checkins'); ?> </th> <td> <p style="color:green"><?php echo site_url(bp_get_checkins_root_slug()); ?> </p> </td> <td> <p class="description"><?php _e('The callback url is needed when registering a Foursquare API key.', 'bp-checkins'); ?> </p> </td> </tr> </tbody> </table> <p class="description"><?php printf(__('If you have not registered a Foursquare API Key, yet, you can get one by clicking <a href="%s">here</a>. You will be able to choose your application name, your application website and the callback url displayed in green on this screen.', 'bp-checkins'), 'https://foursquare.com/oauth/register'); ?> </p> <h3><?php _e('Foursquare import preferences', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Use WordPress Cron', 'bp-checkins'); ?> </th> <td> <select name="bpci-admin[foursquare-cron-schedule]" id="foursquare_cron_schedule"> <option value="0"><?php _e('Do not use WP Cron', 'bp-checkins'); ?> </option> <?php foreach ($schedules as $value_interval => $display_interval) { ?> <option value="<?php echo $value_interval; ?> " <?php selected(bp_get_option('foursquare-cron-schedule'), $value_interval); ?> ><?php echo $display_interval['display']; ?> </option> <?php } ?> </select> </td> <td> <p class="description"><?php _e('WordPress Cron is run when a frontend or admin page is loaded on your web site', 'bp-checkins'); ?> </p> <?php if (!empty($bp_checkins_logs_slug)) { ?> <p class="description"><a href="<?php bp_checkins_admin_url($bp_checkins_logs_slug); ?> "><?php _e('Foursquare import logs page', 'bp-checkins'); ?> </a></p> <?php } ?> </td> </tr> <tr> <th scope="row"><?php _e('Enable your members to import manually their checkins', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[foursquare-user-import]"<?php if (!(int) bp_get_option('foursquare-user-import') || '' == bp_get_option('foursquare-user-import')) { ?> checked="checked"<?php } ?> id="foursquare_user_import_yes" value="0" /> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[foursquare-user-import]"<?php if ((int) bp_get_option('foursquare-user-import')) { ?> checked="checked"<?php } ?> id="foursquare_user_import_no" value="1" /> <?php _e('No', 'bp-checkins'); ?> </td> <td> <p class="description"><?php _e('If enabled, members will be able to import their checkins from the checkins tab of their settings area', 'bp-checkins'); ?> </p> </td> </tr> </tbody> </table> <h3><?php _e('Disable Foursquare API', 'bp-checkins'); ?> </h3> <table class="form-table"> <tbody> <tr> <th scope="row"><?php _e('Check the 'yes' option and save the settings to disable foursquare API', 'bp-checkins'); ?> </th> <td> <input type="radio" name="bpci-admin[bp-checkins-deactivate-foursquare]"<?php if ((int) bp_get_option('bp-checkins-deactivate-foursquare') == 1) { ?> checked="checked"<?php } ?> id="bp-checkins-deactivate-foursquare-yes" value="1" /> <?php _e('Yes', 'bp-checkins'); ?> <input type="radio" name="bpci-admin[bp-checkins-deactivate-foursquare]"<?php if (!(int) bp_get_option('bp-checkins-deactivate-foursquare') || '' == bp_get_option('bp-checkins-deactivate-foursquare')) { ?> checked="checked"<?php } ?> id="bp-checkins-deactivate-foursquare-no" value="0" /> <?php _e('No', 'bp-checkins'); ?> </td> </tr> </tbody> </table> <?php } ?> <?php } ?> <p class="submit"> <input class="button-primary" type="submit" name="bp_checkins_admin_submit" id="bp-checkins-admin-submit" value="<?php _e('Save Settings', 'bp-checkins'); ?> " /> </p> <?php wp_nonce_field('bp-checkins-admin'); ?> </form> </div> <?php }
/** * The row actions (delete/activate/email). * * @since BuddyPress (2.0.0) * * @param object $signup_object The signup data object. */ public function column_username( $signup_object = null ) { $avatar = get_avatar( $signup_object->user_email, 32 ); // Activation email link $email_link = add_query_arg( array( 'page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'resend', ), bp_get_admin_url( 'users.php' ) ); // Activate link $activate_link = add_query_arg( array( 'page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'activate', ), bp_get_admin_url( 'users.php' ) ); // Delete link $delete_link = add_query_arg( array( 'page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'delete', ), bp_get_admin_url( 'users.php' ) ); echo $avatar . sprintf( '<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url( $activate_link ), esc_attr__( 'Activate', 'buddypress' ), $signup_object->user_login ); $actions = array(); $actions['activate'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $activate_link ), __( 'Activate', 'buddypress' ) ); $actions['resend'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $email_link ), __( 'Email', 'buddypress' ) ); if ( current_user_can( 'delete_users' ) ) { $actions['delete'] = sprintf( '<a href="%1$s" class="delete">%2$s</a>', esc_url( $delete_link ), __( 'Delete', 'buddypress' ) ); } /** This filter is documented in bp-members/admin/bp-members-classes.php */ $actions = apply_filters( 'bp_members_ms_signup_row_actions', $actions, $signup_object ); echo $this->row_actions( $actions ); }
/** * The row actions (delete/activate/email). * * @since BuddyPress (2.0.0) * * @param object $signup_object The signup data object. */ public function column_username($signup_object = null) { $avatar = get_avatar($signup_object->user_email, 32); // Activation email link $email_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'resend'), bp_get_admin_url('users.php')); // Activate link $activate_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'activate'), bp_get_admin_url('users.php')); // Delete link $delete_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'delete'), bp_get_admin_url('users.php')); echo $avatar . '<strong><a href="' . esc_url($activate_link) . '" class="edit" title="' . esc_attr__('Activate', 'buddypress') . '">' . $signup_object->user_login . '</a></strong><br/>'; $actions['activate'] = '<a href="' . esc_url($activate_link) . '">' . __('Activate', 'buddypress') . '</a>'; $actions['resend'] = '<a href="' . esc_url($email_link) . '">' . __('Email', 'buddypress') . '</a>'; if (current_user_can('delete_users')) { $actions['delete'] = '<a href="' . esc_url($delete_link) . '" class="delete">' . __('Delete', 'buddypress') . '</a>'; } $actions = apply_filters('bp_members_ms_signup_row_actions', $actions, $signup_object); echo $this->row_actions($actions); }
function bp_forums_bbpress_admin() { global $bp; $action = bp_get_admin_url('admin.php?page=bb-forums-setup&reinstall=1'); ?> <div class="wrap"> <?php screen_icon('buddypress'); ?> <h2 class="nav-tab-wrapper"><?php bp_core_admin_tabs(__('Forums', 'buddypress')); ?> </h2> <?php if (isset($_POST['submit'])) { ?> <div id="message" class="updated fade"> <p><?php _e('Settings Saved.', 'buddypress'); ?> </p> </div> <?php } ?> <?php if (isset($_REQUEST['reinstall']) || !bp_forums_is_installed_correctly()) { // Delete the bb-config.php location option bp_delete_option('bb-config-location'); bp_forums_bbpress_install_wizard(); } else { ?> <div style="width: 45%; float: left; margin-top: 20px;"> <h3><?php _e('(Installed)', 'buddypress'); ?> <?php _e('Forums for Groups', 'buddypress'); ?> </h3> <p><?php _e('Give each individual group its own discussion forum. Choose this if you\'d like to keep your members\' conversations separated into distinct areas.', 'buddypress'); ?> </p> <p class="description"><?php _e('You may use an existing bbPress installation if you have one.', 'buddypress'); ?> </p> <h4 style="margin-bottom: 10px;"><?php _e('Features', 'buddypress'); ?> </h4> <ul class="description" style="list-style: square; margin-left: 30px;"> <li><?php _e('Group Integration', 'buddypress'); ?> </p></li> <li><?php _e('Member Profile Integration', 'buddypress'); ?> </p></li> <li><?php _e('Activity Stream Integration', 'buddypress'); ?> </p></li> <li><?php _e('@ Mention Integration', 'buddypress'); ?> </p></li> </ul> <div> <a class="button button-primary" href="<?php echo $action; ?> "><?php _e('Uninstall Group Forums', 'buddypress'); ?> </a> </div> </div> <div style="width: 45%; float: left; margin: 20px 0 20px 20px; padding: 0 20px 20px 20px; border: 1px solid #ddd; background-color: #fff;"> <h3><?php _e('New! Site Wide Forums', 'buddypress'); ?> </h3> <p><?php _e('Your site will have central forums that are not isolated to any specific group. Choose this if you\'d like to have a central forum area for your members.', 'buddypress'); ?> </p> <p class="description"><?php _e('You may activate both Group and Site Wide forums, but this may create a poor experience for your members.', 'buddypress'); ?> </p> <h4 style="margin-bottom: 10px;"><?php _e('Features', 'buddypress'); ?> </h4> <ul class="description" style="list-style: square; margin-left: 30px;"> <li><?php _e('Central Discussion Area', 'buddypress'); ?> </p></li> <li><?php _e('Forum Plugins Available', 'buddypress'); ?> </p></li> <li><?php _e('Activity Stream Integration', 'buddypress'); ?> </p></li> <li><?php _e('@ Mention Integration', 'buddypress'); ?> </p></li> </ul> <div> <a class="button thickbox button-primary" href="<?php bp_admin_url(add_query_arg(array('tab' => 'plugin-information', 'plugin' => 'bbpress', 'TB_iframe' => 'true', 'width' => '640', 'height' => '500'), 'plugin-install.php')); ?> "><?php _e('Install Site Wide Forums', 'buddypress'); ?> </a> </div> </div> <?php } ?> </div> <?php }
/** * Add "Mark as Spam/Ham" button to user row actions. * * @since BuddyPress (2.0.0) * * @param array $actions User row action links. * @param object $user_object Current user information. * @return array $actions User row action links. */ function bp_core_admin_user_row_actions($actions, $user_object) { if (current_user_can('edit_user', $user_object->ID) && bp_loggedin_user_id() != $user_object->ID) { $url = bp_get_admin_url('users.php'); if (bp_is_user_spammer($user_object->ID)) { $actions['ham'] = "<a href='" . wp_nonce_url($url . "?action=ham&user={$user_object->ID}", 'bp-spam-user') . "'>" . __('Not Spam', 'buddypress') . "</a>"; } else { $actions['spam'] = "<a class='submitdelete' href='" . wp_nonce_url($url . "?action=spam&user={$user_object->ID}", 'bp-spam-user') . "'>" . __('Mark as Spam', 'buddypress') . "</a>"; } } return $actions; }
sprintf(_e('%s Complete', 'dln-theme-skill'), '60%'); ?> </span> </div> </div> </li> <li class="divider"></li> <li><a href="<?php echo bp_loggedin_user_domain(); ?> "><span class="icon"><i class="ico-user-plus2"></i></span><?php _e('My Accounts', 'dln-theme-skill'); ?> </a></li> <li><a href="<?php echo bp_get_admin_url('settings.php'); ?> "><span class="icon"><i class="ico-cog4"></i></span><?php _e('Profile Setting', 'dln-theme-skill'); ?> </a></li> <li class="divider"></li> <li><a href="<?php echo wp_logout_url(); ?> "><span class="icon"><i class="ico-exit"></i></span><?php _e('Sign Out', 'dln-theme-skill'); ?> </a></li> </ul> </li>
/** * Rendez-vous tab * * @package Rendez Vous * @subpackage Admin * * @since Rendez Vous (1.2.0) */ public function admin_tab() { $class = false; $current_screen = get_current_screen(); // Set the active class if (!empty($current_screen->id) && strpos($current_screen->id, 'rendez-vous') !== false) { $class = "nav-tab-active"; } ?> <a href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'rendez-vous'), 'admin.php'))); ?> " class="nav-tab <?php echo $class; ?> " style="margin-left:-6px"><?php esc_html_e('Rendez-vous', 'rendez-vous'); ?> </a> <?php }
/** * Welcome screen step two * * @uses get_transient() * @uses delete_transient() * @uses wp_safe_redirect to redirect to the Welcome screen * @uses add_query_arg() to add some arguments to the url * @uses bp_get_admin_url() to build the admin url */ function buddydrive_do_activation_redirect() { // Bail if no activation redirect if (!get_transient('_buddydrive_activation_redirect')) { return; } // Delete the redirect transient delete_transient('_buddydrive_activation_redirect'); // Bail if activating from network, or bulk if (isset($_GET['activate-multi'])) { return; } $query_args = array('page' => 'buddydrive-about'); if (get_transient('_buddydrive_is_new_install')) { $query_args['is_new_install'] = '1'; delete_transient('_buddydrive_is_new_install'); } // Redirect to BuddyDrive about page wp_safe_redirect(add_query_arg($query_args, bp_get_admin_url('index.php'))); }
/** * Renders the Status metabox for the Groups admin edit screen. * * @since 1.7.0 * * @param object $item Information about the currently displayed group. */ function bp_groups_admin_edit_metabox_status($item) { $base_url = add_query_arg(array('page' => 'bp-groups', 'gid' => $item->id), bp_get_admin_url('admin.php')); ?> <div id="submitcomment" class="submitbox"> <div id="major-publishing-actions"> <div id="delete-action"> <a class="submitdelete deletion" href="<?php echo esc_url(wp_nonce_url(add_query_arg('action', 'delete', $base_url), 'bp-groups-delete')); ?> "><?php _e('Delete Group', 'buddypress'); ?> </a> </div> <div id="publishing-action"> <?php submit_button(__('Save Changes', 'buddypress'), 'primary', 'save', false); ?> </div> <div class="clear"></div> </div><!-- #major-publishing-actions --> </div><!-- #submitcomment --> <?php }
/** * Name column, and "quick admin" rollover actions. * * Called "comment" in the CSS so we can re-use some WP core CSS. * * @since BuddyPress (1.7.0) * * @see WP_List_Table::single_row_columns() * * @param array $item A singular item (one full row). */ public function column_comment($item = array()) { // Preorder items: Edit | Delete | View $actions = array('edit' => '', 'delete' => '', 'view' => ''); // We need the group object for some BP functions $item_obj = (object) $item; // Build actions URLs $base_url = bp_get_admin_url('admin.php?page=bp-groups&gid=' . $item['id']); $delete_url = wp_nonce_url($base_url . "&action=delete", 'bp-groups-delete'); $edit_url = $base_url . '&action=edit'; $view_url = bp_get_group_permalink($item_obj); $group_name = apply_filters_ref_array('bp_get_group_name', array($item['name']), $item); // Rollover actions // Edit $actions['edit'] = sprintf('<a href="%s">%s</a>', esc_url($edit_url), __('Edit', 'buddypress')); // Delete $actions['delete'] = sprintf('<a href="%s">%s</a>', esc_url($delete_url), __('Delete', 'buddypress')); // Visit $actions['view'] = sprintf('<a href="%s">%s</a>', esc_url($view_url), __('View', 'buddypress')); // Other plugins can filter which actions are shown $actions = apply_filters('bp_groups_admin_comment_row_actions', array_filter($actions), $item); // Get group name and avatar $avatar = ''; if (buddypress()->avatar->show_avatars) { $avatar = bp_core_fetch_avatar(array('item_id' => $item['id'], 'object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'alt' => sprintf(__('Group logo of %s', 'buddypress'), $group_name), 'width' => '32', 'height' => '32', 'title' => $group_name)); } $content = sprintf('<strong><a href="%s">%s</a></strong>', esc_url($edit_url), $group_name); echo $avatar . ' ' . $content . ' ' . $this->row_actions($actions); }
/** * Output the tabs in the admin area * * @since BuddyPress (1.5) * @param string $active_tab Name of the tab that is active */ function bp_core_admin_tabs($active_tab = '') { // Declare local variables $tabs_html = ''; $idle_class = 'nav-tab'; $active_class = 'nav-tab nav-tab-active'; // Setup core admin tabs $tabs = array('0' => array('href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), 'admin.php')), 'name' => __('Components', 'buddypress')), '1' => array('href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-page-settings'), 'admin.php')), 'name' => __('Pages', 'buddypress')), '2' => array('href' => bp_get_admin_url(add_query_arg(array('page' => 'bp-settings'), 'admin.php')), 'name' => __('Settings', 'buddypress'))); // If forums component is active, add additional tab if (bp_is_active('forums') && class_exists('BP_Forums_Component')) { // enqueue thickbox wp_enqueue_script('thickbox'); wp_enqueue_style('thickbox'); $tabs['3'] = array('href' => bp_get_admin_url(add_query_arg(array('page' => 'bb-forums-setup'), 'admin.php')), 'name' => __('Forums', 'buddypress')); } // Loop through tabs and build navigation foreach (array_values($tabs) as $tab_data) { $is_current = (bool) ($tab_data['name'] == $active_tab); $tab_class = $is_current ? $active_class : $idle_class; $tabs_html .= '<a href="' . $tab_data['href'] . '" class="' . $tab_class . '">' . $tab_data['name'] . '</a>'; } // Output the tabs echo $tabs_html; // Do other fun things do_action('bp_admin_tabs'); }
/** * Save our settings. * * @since 1.6.0 */ function bp_core_admin_settings_save() { global $wp_settings_fields; if (isset($_GET['page']) && 'bp-settings' == $_GET['page'] && !empty($_POST['submit'])) { check_admin_referer('buddypress-options'); // Because many settings are saved with checkboxes, and thus will have no values // in the $_POST array when unchecked, we loop through the registered settings. if (isset($wp_settings_fields['buddypress'])) { foreach ((array) $wp_settings_fields['buddypress'] as $section => $settings) { foreach ($settings as $setting_name => $setting) { $value = isset($_POST[$setting_name]) ? $_POST[$setting_name] : ''; bp_update_option($setting_name, $value); } } } // Some legacy options are not registered with the Settings API, or are reversed in the UI. $legacy_options = array('bp-disable-account-deletion', 'bp-disable-avatar-uploads', 'bp-disable-cover-image-uploads', 'bp-disable-group-avatar-uploads', 'bp-disable-group-cover-image-uploads', 'bp_disable_blogforum_comments', 'bp-disable-profile-sync', 'bp_restrict_group_creation', 'hide-loggedout-adminbar'); foreach ($legacy_options as $legacy_option) { // Note: Each of these options is represented by its opposite in the UI // Ie, the Profile Syncing option reads "Enable Sync", so when it's checked, // the corresponding option should be unset. $value = isset($_POST[$legacy_option]) ? '' : 1; bp_update_option($legacy_option, $value); } bp_core_redirect(add_query_arg(array('page' => 'bp-settings', 'updated' => 'true'), bp_get_admin_url('admin.php'))); } }
/** * Display the single activity edit screen. * * @since 1.6.0 */ function bp_activity_admin_edit() { // @todo: Check if user is allowed to edit activity items // if ( ! current_user_can( 'bp_edit_activity' ) ) if (!is_super_admin()) { die('-1'); } // Get the activity from the database. $activity = bp_activity_get(array('in' => !empty($_REQUEST['aid']) ? (int) $_REQUEST['aid'] : 0, 'max' => 1, 'show_hidden' => true, 'spam' => 'all', 'display_comments' => 0)); if (!empty($activity['activities'][0])) { $activity = $activity['activities'][0]; // Workaround to use WP's touch_time() without duplicating that function. $GLOBALS['comment'] = new stdClass(); $GLOBALS['comment']->comment_date = $activity->date_recorded; } else { $activity = ''; } // Construct URL for form. $form_url = remove_query_arg(array('action', 'deleted', 'error', 'spammed', 'unspammed'), $_SERVER['REQUEST_URI']); $form_url = add_query_arg('action', 'save', $form_url); /** * Fires before activity edit form is displays so plugins can modify the activity. * * @since 1.6.0 * * @param array $value Array holding single activity object that was passed by reference. */ do_action_ref_array('bp_activity_admin_edit', array(&$activity)); ?> <div class="wrap"> <h1><?php printf(__('Editing Activity (ID #%s)', 'buddypress'), number_format_i18n((int) $_REQUEST['aid'])); ?> </h1> <?php if (!empty($activity)) { ?> <form action="<?php echo esc_url($form_url); ?> " id="bp-activities-edit-form" method="post"> <div id="poststuff"> <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?> "> <div id="post-body-content"> <div id="postdiv"> <div id="bp_activity_action" class="postbox"> <h2><?php _e('Action', 'buddypress'); ?> </h2> <div class="inside"> <label for="bp-activities-action" class="screen-reader-text"><?php /* translators: accessibility text */ _e('Edit activity action', 'buddypress'); ?> </label> <?php wp_editor(stripslashes($activity->action), 'bp-activities-action', array('media_buttons' => false, 'textarea_rows' => 7, 'teeny' => true, 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,spell,close'))); ?> </div> </div> <div id="bp_activity_content" class="postbox"> <h2><?php _e('Content', 'buddypress'); ?> </h2> <div class="inside"> <label for="bp-activities-content" class="screen-reader-text"><?php /* translators: accessibility text */ _e('Edit activity content', 'buddypress'); ?> </label> <?php wp_editor(stripslashes($activity->content), 'bp-activities-content', array('media_buttons' => false, 'teeny' => true, 'quicktags' => array('buttons' => 'strong,em,link,block,del,ins,img,code,spell,close'))); ?> </div> </div> </div> </div><!-- #post-body-content --> <div id="postbox-container-1" class="postbox-container"> <?php do_meta_boxes(get_current_screen()->id, 'side', $activity); ?> </div> <div id="postbox-container-2" class="postbox-container"> <?php do_meta_boxes(get_current_screen()->id, 'normal', $activity); ?> <?php do_meta_boxes(get_current_screen()->id, 'advanced', $activity); ?> </div> </div><!-- #post-body --> </div><!-- #poststuff --> <?php wp_nonce_field('closedpostboxes', 'closedpostboxesnonce', false); ?> <?php wp_nonce_field('meta-box-order', 'meta-box-order-nonce', false); ?> <?php wp_nonce_field('edit-activity_' . $activity->id); ?> </form> <?php } else { ?> <p><?php printf('%1$s <a href="%2$s">%3$s</a>', __('No activity found with this ID.', 'buddypress'), esc_url(bp_get_admin_url('admin.php?page=bp-activity')), __('Go back and try again.', 'buddypress')); ?> </p> <?php } ?> </div><!-- .wrap --> <?php }
/** * Add "Mark as Spam/Ham" button to user row actions. * * @since 2.0.0 * * @param array $actions User row action links. * @param object $user_object Current user information. * @return array $actions User row action links. */ function bp_core_admin_user_row_actions($actions, $user_object) { // Setup the $user_id variable from the current user object. $user_id = 0; if (!empty($user_object->ID)) { $user_id = absint($user_object->ID); } // Bail early if user cannot perform this action, or is looking at themselves. if (current_user_can('edit_user', $user_id) && bp_loggedin_user_id() !== $user_id) { // Admin URL could be single site or network. $url = bp_get_admin_url('users.php'); // If spammed, create unspam link. if (bp_is_user_spammer($user_id)) { $url = add_query_arg(array('action' => 'ham', 'user' => $user_id), $url); $unspam_link = wp_nonce_url($url, 'bp-spam-user'); $actions['ham'] = sprintf('<a href="%1$s">%2$s</a>', esc_url($unspam_link), esc_html__('Not Spam', 'buddypress')); // If not already spammed, create spam link. } else { $url = add_query_arg(array('action' => 'spam', 'user' => $user_id), $url); $spam_link = wp_nonce_url($url, 'bp-spam-user'); $actions['spam'] = sprintf('<a class="submitdelete" href="%1$s">%2$s</a>', esc_url($spam_link), esc_html__('Spam', 'buddypress')); } } // Create a "View" link. $url = bp_core_get_user_domain($user_id); $actions['view'] = sprintf('<a href="%1$s">%2$s</a>', esc_url($url), esc_html__('View', 'buddypress')); // Return new actions. return $actions; }
/** * Output the credits screen. * * Hardcoding this in here is pretty janky. It's fine for now, but we'll * want to leverage api.wordpress.org eventually. * * @since BuddyPress (1.7.0) */ public function credits_screen() { $is_new_install = !empty($_GET['is_new_install']); list($display_version) = explode('-', bp_get_version()); ?> <div class="wrap about-wrap"> <h1><?php printf(__('Welcome to BuddyPress %s', 'buddypress'), $display_version); ?> </h1> <div class="about-text"> <?php if ($is_new_install) { ?> <?php printf(__('It’s a great time to use BuddyPress! With a focus on speed, admin tools, and developer enhancements, %s is our leanest and most powerful version yet.', 'buddypress'), $display_version); ?> <?php } else { ?> <?php printf(__('Thanks for updating! With a focus on speed, admin tools, and developer enhancements, BuddyPress %s is our leanest and most powerful version yet.', 'buddypress'), $display_version); ?> <?php } ?> </div> <div class="bp-badge"></div> <h2 class="nav-tab-wrapper"> <a href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-about'), 'index.php'))); ?> " class="nav-tab"> <?php _e('What’s New', 'buddypress'); ?> </a><a href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-credits'), 'index.php'))); ?> " class="nav-tab nav-tab-active"> <?php _e('Credits', 'buddypress'); ?> </a> </h2> <p class="about-description"><?php _e('BuddyPress is created by a worldwide network of friendly folks.', 'buddypress'); ?> </p> <h4 class="wp-people-group"><?php _e('Project Leaders', 'buddypress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-project-leaders"> <li class="wp-person" id="wp-person-johnjamesjacoby"> <a href="http://profiles.wordpress.org/johnjamesjacoby"><img src="http://0.gravatar.com/avatar/81ec16063d89b162d55efe72165c105f?s=60" class="gravatar" alt="John James Jacoby" /></a> <a class="web" href="http://profiles.wordpress.org/johnjamesjacoby">John James Jacoby</a> <span class="title"><?php _e('Project Lead', 'buddypress'); ?> </span> </li> <li class="wp-person" id="wp-person-boonebgorges"> <a href="http://profiles.wordpress.org/boonebgorges"><img src="http://0.gravatar.com/avatar/9cf7c4541a582729a5fc7ae484786c0c?s=60" class="gravatar" alt="Boone B. Gorges" /></a> <a class="web" href="http://profiles.wordpress.org/boonebgorges">Boone B. Gorges</a> <span class="title"><?php _e('Lead Developer', 'buddypress'); ?> </span> </li> <li class="wp-person" id="wp-person-djpaul"> <a href="http://profiles.wordpress.org/djpaul"><img src="http://0.gravatar.com/avatar/3bc9ab796299d67ce83dceb9554f75df?s=60" class="gravatar" alt="Paul Gibbs" /></a> <a class="web" href="http://profiles.wordpress.org/djpaul">Paul Gibbs</a> <span class="title"><?php _e('Lead Developer', 'buddypress'); ?> </span> </li> </ul> <h4 class="wp-people-group"><?php _e('Core Team', 'buddypress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-core-team"> <li class="wp-person" id="wp-person-r-a-y"> <a href="http://profiles.wordpress.org/r-a-y"><img src="http://0.gravatar.com/avatar/3bfa556a62b5bfac1012b6ba5f42ebfa?s=60" class="gravatar" alt="Ray" /></a> <a class="web" href="http://profiles.wordpress.org/r-a-y">Ray</a> <span class="title"><?php _e('Core Developer', 'buddypress'); ?> </span> </li> <li class="wp-person" id="wp-person-imath"> <a href="http://profiles.wordpress.org/imath"><img src="http://0.gravatar.com/avatar/8b208ca408dad63888253ee1800d6a03?s=60" class="gravatar" alt="Mathieu Viet" /></a> <a class="web" href="http://profiles.wordpress.org/imath">Mathieu Viet</a> <span class="title"><?php _e('Core Developer', 'buddypress'); ?> </span> </li> <li class="wp-person" id="wp-person-mercime"> <a href="http://profiles.wordpress.org/mercime"><img src="http://0.gravatar.com/avatar/fae451be6708241627983570a1a1817a?s=60" class="gravatar" alt="Mercime" /></a> <a class="web" href="http://profiles.wordpress.org/mercime">Mercime</a> <span class="title"><?php _e('Navigator', 'buddypress'); ?> </span> </li> </ul> <h4 class="wp-people-group"><?php _e('Recent Rockstars', 'buddypress'); ?> </h4> <ul class="wp-people-group " id="wp-people-group-rockstars"> <li class="wp-person" id="wp-person-dcavins"> <a href="http://profiles.wordpress.org/dcavins"><img src="http://0.gravatar.com/avatar/a5fa7e83d59cb45ebb616235a176595a?s=60" class="gravatar" alt="David Cavins" /></a> <a class="web" href="http://profiles.wordpress.org/dcavins">David Cavins</a> </li> <li class="wp-person" id="wp-person-henry-wright"> <a href="http://profiles.wordpress.org/henry.wright"><img src="http://0.gravatar.com/avatar/0da2f1a9340d6af196b870f6c107a248?s=60" class="gravatar" alt="Henry Wright" /></a> <a class="web" href="http://profiles.wordpress.org/henry.wright">Henry Wright</a> </li> </ul> <h4 class="wp-people-group"><?php _e('Contributors to BuddyPress 2.0', 'buddypress'); ?> </h4> <p class="wp-credits-list"> <a href="https://profiles.wordpress.org/boonebgorges/">boonebgorges</a>, <a href="https://profiles.wordpress.org/Bowromir/">Bowromir</a>, <a href="https://profiles.wordpress.org/burakali/">burakali</a>, <a href="https://profiles.wordpress.org/chouf1/">chouf1</a>, <a href="https://profiles.wordpress.org/cmmarslender/">cmmarslender</a>, <a href="https://profiles.wordpress.org/danbp/">danbp</a>, <a href="https://profiles.wordpress.org/dcavins/">dcavins</a>, <a href="https://profiles.wordpress.org/Denis-de-Bernardy/">Denis-de-Bernardy</a>, <a href="https://profiles.wordpress.org/DJPaul/">DJPaul</a>, <a href="https://profiles.wordpress.org/ericlewis/">ericlewis</a>, <a href="https://profiles.wordpress.org/glyndavidson/">glyndavidson</a>, <a href="https://profiles.wordpress.org/graham-washbrook/">graham-washbrook</a>, <a href="https://profiles.wordpress.org/henrywright/">henrywright</a>, <a href="https://profiles.wordpress.org/henry.wright/">henry.wright</a>, <a href="https://profiles.wordpress.org/hnla/">hnla</a>, <a href="https://profiles.wordpress.org/imath/">imath</a>, <a href="https://profiles.wordpress.org/johnjamesjacoby/">johnjamesjacoby</a>, <a href="https://profiles.wordpress.org/karmatosed/">karmatosed</a>, <a href="https://profiles.wordpress.org/lenasterg/">lenasterg</a>, <a href="https://profiles.wordpress.org/MacPresss/">MacPresss</a>, <a href="https://profiles.wordpress.org/markoheijnen/">markoheijnen</a>, <a href="https://profiles.wordpress.org/megainfo/">megainfo</a>, <a href="https://profiles.wordpress.org/modemlooper/">modemlooper</a>, <a href="https://profiles.wordpress.org/mpa4hu/">mpa4hu</a>, <a href="https://profiles.wordpress.org/needle/">needle</a>, <a href="https://profiles.wordpress.org/netweb/">netweb</a>, <a href="https://profiles.wordpress.org/ninnypants/">ninnypants</a>, Pietro Oliva, <a href="https://profiles.wordpress.org/pross/">pross</a>, <a href="https://profiles.wordpress.org/r-a-y/">r-a-y</a>, <a href="https://profiles.wordpress.org/reactuate/">reactuate</a>, <a href="https://profiles.wordpress.org/rodrigorznd/">rodrigorznd</a>, <a href="https://profiles.wordpress.org/rogercoathup/">rogercoathup</a>, <a href="https://profiles.wordpress.org/rzen/">rzen</a>, <a href="https://profiles.wordpress.org/SergeyBiryukov/">SergeyBiryukov</a>, <a href="https://profiles.wordpress.org/shanebp/">shanebp</a>, <a href="https://profiles.wordpress.org/SlothLoveChunk/">SlothLoveChunk</a>, <a href="https://profiles.wordpress.org/StijnDeWitt/">StijnDeWitt</a>, <a href="https://profiles.wordpress.org/terraling/">terraling</a>, <a href="https://profiles.wordpress.org/trishasalas/">trishasalas</a>, <a href="https://profiles.wordpress.org/tw2113/">tw2113</a>, <a href="https://profiles.wordpress.org/vanillalounge/">vanillalounge</a>. </p> <?php if (current_user_can($this->capability)) { ?> <div class="return-to-dashboard"> <a href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-components'), $this->settings_page))); ?> "><?php _e('Go to the BuddyPress Settings page', 'buddypress'); ?> </a> </div> <?php } ?> </div> <?php }
/** * Handle saving the Component settings. * * @since 1.6.0 * * @todo Use settings API when it supports saving network settings */ function bp_core_admin_components_settings_handler() { // Bail if not saving settings. if (!isset($_POST['bp-admin-component-submit'])) { return; } // Bail if nonce fails. if (!check_admin_referer('bp-admin-component-setup')) { return; } // Settings form submitted, now save the settings. First, set active components. if (isset($_POST['bp_components'])) { // Load up BuddyPress. $bp = buddypress(); // Save settings and upgrade schema. require_once ABSPATH . 'wp-admin/includes/upgrade.php'; require_once $bp->plugin_dir . '/bp-core/admin/bp-core-admin-schema.php'; $submitted = stripslashes_deep($_POST['bp_components']); $bp->active_components = bp_core_admin_get_active_components_from_submitted_settings($submitted); bp_core_install($bp->active_components); bp_core_add_page_mappings($bp->active_components); bp_update_option('bp-active-components', $bp->active_components); } // Where are we redirecting to? $base_url = bp_get_admin_url(add_query_arg(array('page' => 'bp-components', 'updated' => 'true'), 'admin.php')); // Redirect. wp_redirect($base_url); die; }
/** * The row actions (delete/activate/email). * * @since 2.0.0 * * @param object|null $signup_object The signup data object. */ public function column_username($signup_object = null) { $avatar = get_avatar($signup_object->user_email, 32); // Activation email link. $email_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'resend'), bp_get_admin_url('users.php')); // Activate link. $activate_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'activate'), bp_get_admin_url('users.php')); // Delete link. $delete_link = add_query_arg(array('page' => 'bp-signups', 'signup_id' => $signup_object->id, 'action' => 'delete'), bp_get_admin_url('users.php')); echo $avatar . sprintf('<strong><a href="%1$s" class="edit" title="%2$s">%3$s</a></strong><br/>', esc_url($activate_link), esc_attr__('Activate', 'buddypress'), $signup_object->user_login); $actions = array(); $actions['activate'] = sprintf('<a href="%1$s">%2$s</a>', esc_url($activate_link), __('Activate', 'buddypress')); $actions['resend'] = sprintf('<a href="%1$s">%2$s</a>', esc_url($email_link), __('Email', 'buddypress')); if (current_user_can('delete_users')) { $actions['delete'] = sprintf('<a href="%1$s" class="delete">%2$s</a>', esc_url($delete_link), __('Delete', 'buddypress')); } /** * Filters the multisite row actions for each user in list. * * @since 2.0.0 * * @param array $actions Array of actions and corresponding links. * @param object $signup_object The signup data object. */ $actions = apply_filters('bp_members_ms_signup_row_actions', $actions, $signup_object); echo $this->row_actions($actions); }
/** * Render an introduction of BuddyPress tools on Available Tools page. * * @since BuddyPress (2.0.0) */ function bp_core_admin_available_tools_intro() { $query_arg = array('page' => 'bp-tools'); $page = bp_core_do_network_admin() ? 'admin.php' : 'tools.php'; $url = add_query_arg($query_arg, bp_get_admin_url($page)); ?> <div class="tool-box"> <h3 class="title"><?php esc_html_e('BuddyPress Tools', 'buddypress'); ?> </h3> <p> <?php esc_html_e('BuddyPress keeps track of various relationships between users, groups, and activity items. Occasionally these relationships become out of sync, most often after an import, update, or migration.', 'buddypress'); ?> <?php printf(esc_html_x('Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress'), '<a href="' . esc_url($url) . '">' . esc_html__('BuddyPress Tools', 'buddypress') . '</a>'); ?> </p> </div> <?php }
/** * Output tab navigation for `What's New` and `Credits` pages * * @since BuddyPress (2.2.0) * @param string $tab */ public static function tab_navigation($tab = 'whats_new') { ?> <h2 class="nav-tab-wrapper"> <a class="nav-tab <?php if ('BP_Admin::about_screen' === $tab) { ?> nav-tab-active<?php } ?> " href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-about'), 'index.php'))); ?> "> <?php esc_html_e('What’s New', 'buddypress'); ?> </a><a class="nav-tab <?php if ('BP_Admin::credits_screen' === $tab) { ?> nav-tab-active<?php } ?> " href="<?php echo esc_url(bp_get_admin_url(add_query_arg(array('page' => 'bp-credits'), 'index.php'))); ?> "> <?php esc_html_e('Credits', 'buddypress'); ?> </a> </h2> <?php }
/** * Handle saving of the BuddyPress slugs. * * @since 1.6.0 * @todo Use settings API */ function bp_core_admin_slugs_setup_handler() { if (isset($_POST['bp-admin-pages-submit'])) { if (!check_admin_referer('bp-admin-pages-setup')) { return false; } // Then, update the directory pages if (isset($_POST['bp_pages'])) { $directory_pages = array(); foreach ((array) $_POST['bp_pages'] as $key => $value) { if (!empty($value)) { $directory_pages[$key] = (int) $value; } } bp_core_update_directory_page_ids($directory_pages); } $base_url = bp_get_admin_url(add_query_arg(array('page' => 'bp-page-settings', 'updated' => 'true'), 'admin.php')); wp_redirect($base_url); } }
/** * Add a history item to the hover links in an activity's row. * * This function lifted with love from the Akismet WordPress plugin's * akismet_comment_row_action() function. Thanks! * * @param array $actions The hover links * @param array $activity The activity for the current row being processed * @return array The hover links * @since BuddyPress (1.6) */ function comment_row_action($actions, $activity) { $akismet_result = bp_activity_get_meta($activity['id'], '_bp_akismet_result'); $user_result = bp_activity_get_meta($activity['id'], '_bp_akismet_user_result'); $desc = ''; if (!$user_result || $user_result == $akismet_result) { // Show the original Akismet result if the user hasn't overridden it, or if their decision was the same if ('true' == $akismet_result && $activity['is_spam']) { $desc = __('Flagged as spam by Akismet', 'buddypress'); } elseif ('false' == $akismet_result && !$activity['is_spam']) { $desc = __('Cleared by Akismet', 'buddypress'); } } else { $who = bp_activity_get_meta($activity['id'], '_bp_akismet_user'); if ('true' == $user_result) { $desc = sprintf(__('Flagged as spam by %s', 'buddypress'), $who); } else { $desc = sprintf(__('Un-spammed by %s', 'buddypress'), $who); } } // add a History item to the hover links, just after Edit if ($akismet_result) { $b = array(); foreach ($actions as $k => $item) { $b[$k] = $item; if ($k == 'edit') { $b['history'] = '<a href="' . esc_url(bp_get_admin_url('admin.php?page=bp-activity&action=edit&aid=' . $activity['id'])) . '#bp_activity_history"> ' . __('History', 'buddypress') . '</a>'; } } $actions = $b; } if ($desc) { echo '<span class="akismet-status"><a href="' . esc_url(bp_get_admin_url('admin.php?page=bp-activity&action=edit&aid=' . $activity['id'])) . '#bp_activity_history">' . htmlspecialchars($desc) . '</a></span>'; } return apply_filters('bp_akismet_comment_row_action', $actions); }
/** * Name column, and "quick admin" rollover actions. * * Called "comment" in the CSS so we can re-use some WP core CSS. * * @since 1.7.0 * * @see WP_List_Table::single_row_columns() * * @param array $item A singular item (one full row). */ public function column_comment($item = array()) { // Preorder items: Edit | Delete | View $actions = array('edit' => '', 'delete' => '', 'view' => ''); // We need the group object for some BP functions $item_obj = (object) $item; // Build actions URLs $base_url = bp_get_admin_url('admin.php?page=bp-groups&gid=' . $item['id']); $delete_url = wp_nonce_url($base_url . "&action=delete", 'bp-groups-delete'); $edit_url = $base_url . '&action=edit'; $view_url = bp_get_group_permalink($item_obj); /** * Filters the group name for a group's column content. * * @since 1.7.0 * * @param string $value Name of the group being rendered. * @param array $item Array for the current group item. */ $group_name = apply_filters_ref_array('bp_get_group_name', array($item['name']), $item); // Rollover actions // Edit $actions['edit'] = sprintf('<a href="%s">%s</a>', esc_url($edit_url), __('Edit', 'buddypress')); // Delete $actions['delete'] = sprintf('<a href="%s">%s</a>', esc_url($delete_url), __('Delete', 'buddypress')); // Visit $actions['view'] = sprintf('<a href="%s">%s</a>', esc_url($view_url), __('View', 'buddypress')); /** * Filters the actions that will be shown for the column content. * * @since 1.7.0 * * @param array $value Array of actions to be displayed for the column content. * @param array $item The current group item in the loop. */ $actions = apply_filters('bp_groups_admin_comment_row_actions', array_filter($actions), $item); // Get group name and avatar $avatar = ''; if (buddypress()->avatar->show_avatars) { $avatar = bp_core_fetch_avatar(array('item_id' => $item['id'], 'object' => 'group', 'type' => 'thumb', 'avatar_dir' => 'group-avatars', 'alt' => sprintf(__('Group logo of %s', 'buddypress'), $group_name), 'width' => '32', 'height' => '32', 'title' => $group_name)); } $content = sprintf('<strong><a href="%s">%s</a></strong>', esc_url($edit_url), $group_name); echo $avatar . ' ' . $content . ' ' . $this->row_actions($actions); }
/** * Add action links to Stream drop row in admin list screen * * @filter wp_stream_action_links_{connector} * * @param array $links Previous links registered * @param object $record Stream record * * @return array Action links */ public static function action_links($links, $record) { if (in_array($record->context, array('components'))) { $option_key = wp_stream_get_meta($record, 'option_key', true); if ('bp-active-components' === $option_key) { $links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-components'), admin_url('admin.php')); } elseif ('bp-pages' === $option_key) { $page_id = wp_stream_get_meta($record, 'page_id', true); $links[__('Edit setting', 'stream')] = add_query_arg(array('page' => 'bp-page-settings'), admin_url('admin.php')); if ($page_id) { $links[__('Edit Page', 'stream')] = get_edit_post_link($page_id); $links[__('View', 'stream')] = get_permalink($page_id); } } } elseif (in_array($record->context, array('settings'))) { $links[__('Edit setting', 'stream')] = add_query_arg(array('page' => wp_stream_get_meta($record, 'page', true)), admin_url('admin.php')); } elseif (in_array($record->context, array('groups'))) { $group_id = wp_stream_get_meta($record, 'id', true); $group = groups_get_group(array('group_id' => $group_id)); if ($group) { // Build actions URLs $base_url = bp_get_admin_url('admin.php?page=bp-groups&gid=' . $group_id); $delete_url = wp_nonce_url($base_url . '&action=delete', 'bp-groups-delete'); $edit_url = $base_url . '&action=edit'; $visit_url = bp_get_group_permalink($group); $links[__('Edit group', 'stream')] = $edit_url; $links[__('View group', 'stream')] = $visit_url; $links[__('Delete group', 'stream')] = $delete_url; } } elseif (in_array($record->context, array('activity'))) { $activity_id = wp_stream_get_meta($record, 'id', true); $activities = bp_activity_get(array('in' => $activity_id, 'spam' => 'all')); if (!empty($activities['activities'])) { $activity = reset($activities['activities']); $base_url = bp_get_admin_url('admin.php?page=bp-activity&aid=' . $activity->id); $spam_nonce = esc_html('_wpnonce=' . wp_create_nonce('spam-activity_' . $activity->id)); $delete_url = $base_url . "&action=delete&{$spam_nonce}"; $edit_url = $base_url . '&action=edit'; $ham_url = $base_url . "&action=ham&{$spam_nonce}"; $spam_url = $base_url . "&action=spam&{$spam_nonce}"; if ($activity->is_spam) { $links[__('Ham', 'stream')] = $ham_url; } else { $links[__('Edit', 'stream')] = $edit_url; $links[__('Spam', 'stream')] = $spam_url; } $links[__('Delete', 'stream')] = $delete_url; } } elseif (in_array($record->context, array('profile_fields'))) { $field_id = wp_stream_get_meta($record, 'field_id', true); $group_id = wp_stream_get_meta($record, 'group_id', true); if (empty($field_id)) { // is a group action $links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'edit_group', 'group_id' => $group_id), admin_url('users.php')); $links[__('Delete', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'delete_group', 'group_id' => $group_id), admin_url('users.php')); } else { $field = new BP_XProfile_Field($field_id); if (empty($field->type)) { return $links; } $links[__('Edit', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'edit_field', 'group_id' => $group_id, 'field_id' => $field_id), admin_url('users.php')); $links[__('Delete', 'stream')] = add_query_arg(array('page' => 'bp-profile-setup', 'mode' => 'delete_field', 'field_id' => $field_id), admin_url('users.php')); } } return $links; }