* @package Achievements * @subpackage admin * @see dpa_add_admin_menu() * * $Id: achievements-admin.php 972 2011-04-03 10:09:47Z DJPaul $ */ /** * Adds a notification message to the wp-admin screens if the installed version of Achievements doesn't match * what version the database thinks is installed. For example, if you upgrade by SVN. * * @global int $blog_id Site ID (variable is from WordPress and hasn't been updated for 3.0; confusing name is confusing) * @global object $bp BuddyPress global settings * @since 2.0 */ function dpa_activation_notice() { global $blog_id, $bp; if ( !$bp->loggedin_user->is_super_admin || BP_ROOT_BLOG != $blog_id ) return; $version = get_site_option( 'achievements-db-version' ); if ( false !== $version && ACHIEVEMENTS_DB_VERSION == $version ) return; ?>

Achievements is almost ready. Have you just upgraded to a new version? Go to the Plugins page and re-activate the plugin.', 'dpa' ), admin_url( 'plugins.php' ) ) ?>

' . __( 'Settings', 'dpa' ) . ''; array_unshift( $links, $settings_link ); return $links; } add_filter( 'plugin_action_links', 'dpa_admin_add_settings_link', 10, 2 ); /** * Registers admin settings API * * @since 2.0 */ function dpa_register_admin_settings() { register_setting( 'dpa-settings-group', 'achievements', 'dpa_admin_screen_validate' ); } /** * Admin settings API validation function * * @param array $input New form values * @since 2.0 */ function dpa_admin_screen_validate( $input ) { $current_settings = get_blog_option( BP_ROOT_BLOG, 'achievements' ); if ( is_string( $input ) ) // wpmu-edit.php return get_blog_option( BP_ROOT_BLOG, 'achievements' ); if ( isset( $input['mediakeywords'] ) ) $input['mediakeywords'] = apply_filters( 'dpa_admin_settings_mediakeywords_before_save', stripslashes( $input['mediakeywords'] ) ); return wp_parse_args( $input, $current_settings ); } /** * Tells WP that we support two columns * * @param array $columns Column settings for WordPress admin pages * @param string WordPress' admin page "name" * @since 2.0 */ function dpa_admin_screen_layout_columns( $columns, $screen ) { if ( 'buddypress_page_achievements' == $screen ) $columns['buddypress_page_achievements'] = 2; return $columns; } add_filter( 'screen_layout_columns', 'dpa_admin_screen_layout_columns', 10, 2 ); /** * Add metaboxes and contextual help to admin screen * * @since 2.0 */ function dpa_admin_screen_on_load() { // Configure tab add_meta_box( 'dpa-admin-metaboxes-sidebox-1', __( 'Like this plugin?', 'dpa' ), 'dpa_admin_screen_socialmedia', 'buddypress_page_achievements', 'side', 'core' ); add_meta_box( 'dpa-admin-metaboxes-sidebox-2', __( 'Latest news from the author', 'dpa' ), 'dpa_admin_screen_news', 'buddypress_page_achievements', 'side', 'core' ); add_meta_box( 'dpa-admin-metaboxes-settingsbox', __( 'Settings', 'dpa' ), 'dpa_admin_screen_settings', 'buddypress_page_achievements', 'normal', 'core' ); // Support tab add_meta_box( 'dpa-admin-metaboxes-email', __( 'Contact us', 'dpa' ), 'dpa_admin_screen_contactform', 'buddypress_page_achievements-support', 'normal', 'core' ); add_meta_box( 'dpa-admin-metaboxes-helpushelpyou', __( 'Help us help you', 'dpa' ), 'dpa_admin_screen_siteinfo', 'buddypress_page_achievements-support', 'side', 'core' ); add_meta_box( 'dpa-admin-metaboxes-sidebox-1', __( 'Like this plugin?', 'dpa' ), 'dpa_admin_screen_socialmedia', 'buddypress_page_achievements-support', 'side', 'core' ); add_meta_box( 'dpa-admin-metaboxes-sidebox-2', __( 'Latest news from the author', 'dpa' ), 'dpa_admin_screen_news', 'buddypress_page_achievements-support', 'side', 'core' ); // Help panel add_filter( 'default_contextual_help', 'dpa_admin_screen_contextual_help' ); } /******************************************************************************** * Screen Functions * * Screen functions are the controllers of BuddyPress. They will execute when their * specific URL is caught. They will first save or manipulate data using business * functions, then pass on the user to a template file. */ /** * Create the Achievements admin page. * * @global object $bp BuddyPress global settings * @global int $screen_layout_columns Number of columns shown on this admin page * @see dpa_admin_screen_layout_columns() * @since 2.0 */ function dpa_admin_screen() { global $bp, $screen_layout_columns; if ( !$settings = get_blog_option( BP_ROOT_BLOG, 'achievements' ) ) update_blog_option( BP_ROOT_BLOG, 'achievements', array() ); $is_support_tab = false; if ( !empty( $_GET['tab'] ) && DPA_SLUG_ADMIN_SUPPORT == stripslashes( $_GET['tab'] ) ) $is_support_tab = true; // Email contact form if ( !empty( $_POST['contact_body'] ) && !empty( $_POST['contact_type'] ) && !empty( $_POST['contact_email'] ) ) { $body = force_balance_tags( wp_filter_kses( stripslashes( $_POST['contact_body'] ) ) ); $type = force_balance_tags( wp_filter_kses( stripslashes( $_POST['contact_type'] ) ) ); $email = sanitize_email( force_balance_tags( wp_filter_kses( stripslashes( $_POST['contact_email'] ) ) ) ); if ( $body && $type && $email && is_email( $email ) ) $email_sent = wp_mail( array( 'paul@byotos.com', $email ), "Achievements support request: " . $type, $body ); } ?>

  1. >
  2. >

our website.", 'dpa' ) ?>

Achievements Directory.", 'dpa' ), dpa_get_achievements_permalink() ) ?>

BuddyPress.org, or use the form below to get in contact. We're listening.", 'dpa' ), 'http://buddypress.org/community/groups/achievements/forum/' ) ?>

'; $items = $rss->get_items( 0, $rss->get_item_quantity( 3 ) ); foreach ( $items as $item ) $content .= '
  • ' . apply_filters( 'dpa_admin_get_rss_feed', stripslashes( $item->get_title() ) ) . '

  • '; $content .= '
  • ' . __( 'Subscribe with RSS', 'dpa' ) . '

  • '; echo $content; } else { echo ''; } } /** * Adds WP Help panel link (the "Help" dropdown in the top-right of the page) * * @param string $default_text * @since 2.0 */ function dpa_admin_screen_contextual_help( $default_text ) { return '' . __( 'Support Forums', 'dpa' ) . ''; } /** * Site info box * * @global wpdb $wpdb WordPress database object * @global string $wp_version WordPress version number * @global WP_Rewrite $wp_rewrite WordPress Rewrite object for creating pretty URLs * @global object $wp_rewrite * @param array $settings Site's options 'achievements' meta * @since 2.0 */ function dpa_admin_screen_siteinfo( $settings ) { global $wpdb, $wp_rewrite, $wp_version; $active_plugins = array(); $all_plugins = apply_filters( 'all_plugins', get_plugins() ); foreach ( $all_plugins as $filename => $plugin ) { if ( 'Achievements' != $plugin['Name'] && 'BuddyPress' != $plugin['Name'] && is_plugin_active( $filename ) ) $active_plugins[] = $plugin['Name'] . ': ' . $plugin['Version']; } natcasesort( $active_plugins ); if ( !$active_plugins ) $active_plugins[] = __( 'No other plugins are active', 'dpa' ); if ( defined( 'MULTISITE' ) && constant( 'MULTISITE' ) == true ) { if ( defined( 'SUBDOMAIN_INSTALL' ) && constant( 'SUBDOMAIN_INSTALL' ) == true ) $is_multisite = __( 'subdomain', 'dpa' ); else $is_multisite = __( 'subdirectory', 'dpa' ); } else { $is_multisite = __( 'no', 'dpa' ); } if ( 1 == constant( 'BP_ROOT_BLOG' ) ) $is_bp_root_blog = __( 'standard', 'dpa' ); else $is_bp_root_blog = __( 'non-standard', 'dpa' ); $is_bp_default_child_theme = __( 'no', 'dpa' ); $theme = current_theme_info(); if ( 'BuddyPress Default' == $theme->parent_theme ) $is_bp_default_child_theme = __( 'yes', 'dpa' ); if ( 'BuddyPress Default' == $theme->name ) $is_bp_default_child_theme = __( 'n/a', 'dpa' ); if ( empty( $wp_rewrite->permalink_structure ) ) $custom_permalinks = __( 'default', 'dpa' ); else if ( strpos( $wp_rewrite->permalink_structure, 'index.php' ) ) $custom_permalinks = __( 'almost', 'dpa' ); else $custom_permalinks = __( 'custom', 'dpa' ); ?>

    WordPress Media Library contains a lot of content, it may be hard to find the images which you want to use for your Achievements' pictures.", 'dpa' ), admin_url( 'upload.php' ) ) ?>