Permalink
Browse files

seeding

  • Loading branch information...
etivite committed Jan 7, 2012
0 parents commit 00235d099c35126cbed3d2cc7dcc856a4af13d6b
@@ -0,0 +1,11 @@
+K 25
+svn:wc:ra_dav:version-url
+V 60
+/!svn/ver/459578/buddypress-member-profile-stats/trunk/admin
+END
+bp-member-profile-stats-admin.php
+K 25
+svn:wc:ra_dav:version-url
+V 94
+/!svn/ver/459578/buddypress-member-profile-stats/trunk/admin/bp-member-profile-stats-admin.php
+END
@@ -0,0 +1,62 @@
+10
+
+dir
+486150
+http://plugins.svn.wordpress.org/buddypress-member-profile-stats/trunk/admin
+http://plugins.svn.wordpress.org
+
+
+
+2011-11-05T01:22:38.147550Z
+459578
+etivite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+b8457f37-d9ea-0310-8a92-e5e31aec5664
+
+bp-member-profile-stats-admin.php
+file
+
+
+
+
+2012-01-07T13:03:03.351720Z
+925d7adc506a794e6da1eb1de038b4e0
+2011-11-05T01:22:38.147550Z
+459578
+etivite
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+4808
+
@@ -0,0 +1,120 @@
+<?php
+
+function etivite_bp_member_profile_stats_admin_counts( ) {
+
+ $counts = array( 'status','topics','posts','comments','userblogs' );
+
+ return $counts;
+}
+
+function etivite_bp_member_profile_stats_admin_count_check( $type, $currenttypes ) {
+ if ( is_multisite() && ( $type == 'comments' || $type == 'posts' ) ) {
+ echo 'disabled';
+ return;
+ }
+
+ if ( !is_multisite() && $type == 'userblogs' ) {
+ echo 'disabled';
+ return;
+ }
+
+ if ( in_array( $type, $currenttypes) )
+ echo 'checked';
+
+ return;
+}
+
+function etivite_bp_member_profile_stats_admin() {
+ global $bp;
+
+ /* If the form has been submitted and the admin referrer checks out, save the settings */
+ if ( isset( $_POST['submit'] ) && check_admin_referer('etivite_bp_member_profile_stats_admin') ) {
+
+ if( isset($_POST['ab_profile_counts'] ) && !empty($_POST['ab_profile_counts']) ) {
+ update_option( 'bp_member_profile_stats_displaycounts', $_POST['ab_profile_counts'] );
+ } else {
+ update_option( 'bp_member_profile_stats_displaycounts', '' );
+ }
+
+ if( isset($_POST['ab_profile_sidebarme'] ) && !empty($_POST['ab_profile_sidebarme']) && (int)$_POST['ab_profile_sidebarme'] == 1 ) {
+ update_option( 'bp_member_profile_stats_display_sidebarme', true );
+ } else {
+ update_option( 'bp_member_profile_stats_display_sidebarme', false );
+ }
+
+ $updated = true;
+ }
+
+ // Get the proper URL for submitting the settings form. (Settings API workaround) - boone
+ $url_base = function_exists( 'is_network_admin' ) && is_network_admin() ? network_admin_url( 'admin.php?page=bp-member-profile-stats-settings' ) : admin_url( 'admin.php?page=bp-member-profile-stats-settings' );
+
+?>
+ <div class="wrap">
+ <h2><?php _e( 'Member Profile Stats', 'bp-member-profile-stats' ); ?></h2>
+
+ <?php if ( isset($updated) ) : echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bp-member-profile-stats' ) . "</p></div>"; endif; ?>
+
+ <form action="<?php echo $url_base; ?>" name="bp-member-profile-stats-settings-form" id="bp-member-profile-stats-settings-form" method="post">
+
+ <h4><?php _e( 'Display total counts for:', 'bp-member-profile-stats' ); ?></h4>
+
+ <table class="form-table">
+ <?php
+
+ $enabledcounts = (array) get_option( 'bp_member_profile_stats_displaycounts');
+ $totalcounts = etivite_bp_member_profile_stats_admin_counts();
+
+ foreach ($totalcounts as $count) { ?>
+ <tr>
+ <th><label for="type-<?php echo $count ?>"><?php echo $count ?></label></th>
+ <td><input id="type-<?php echo $count ?>" type="checkbox" <?php etivite_bp_member_profile_stats_admin_count_check( $count, $enabledcounts ); ?> name="ab_profile_counts[]" value="<?php echo $count ?>" /></td>
+ </tr>
+ <?php } ?>
+
+ <?php if ( defined( 'ACHIEVEMENTS_IS_INSTALLED' ) ) { ?>
+ <tr>
+ <th><label for="type-dpa">Achievements</label></th>
+ <td><input id="type-dpa" type="checkbox" <?php etivite_bp_member_profile_stats_admin_count_check( 'dpa', $enabledcounts ); ?> name="ab_profile_counts[]" value="dpa" /></td>
+ </tr>
+ <?php } ?>
+
+ <tr>
+ <th><label for="ab_profile_sidebarme"><?php _e('Display under login sidebar?','bp-community-stats') ?></label></th>
+ <td><input type="checkbox" name="ab_profile_sidebarme" id="ab_profile_sidebarme" value="1"<?php if ( get_option( 'bp_member_profile_stats_display_sidebarme' ) ) { ?> checked="checked"<?php } ?> /></td>
+ </tr>
+
+ </table>
+
+ <?php wp_nonce_field( 'etivite_bp_member_profile_stats_admin' ); ?>
+
+ <p class="description">Please note: Comments is only for the main buddypress blog - if multisite is used - this does not count comments across the network. (nothing available within wordpress for this). Posts is forum posts within Groups.</p>
+
+ <p class="submit"><input type="submit" name="submit" value="Save Settings"/></p>
+
+ </form>
+
+ <h3>About:</h3>
+ <div id="plugin-about" style="margin-left:15px;">
+
+ <p>
+ <a href="http://etivite.com/wordpress-plugins/buddypress-member-profile-stats/">Activity Member Profile Stats - About Page</a><br/>
+ </p>
+
+ <div class="plugin-author">
+ <strong>Author:</strong> <a href="http://profiles.wordpress.org/users/etivite/"><img style="height: 24px; width: 24px;" class="photo avatar avatar-24" src="http://www.gravatar.com/avatar/9411db5fee0d772ddb8c5d16a92e44e0?s=24&amp;d=monsterid&amp;r=g" alt=""> rich @etivite</a><br/>
+ <a href="http://twitter.com/etivite">@etivite</a> <a href="https://plus.google.com/114440793706284941584">+etivite</a>
+ </div>
+
+ <p>
+ <a href="http://etivite.com">Author's site</a><br/>
+ <a href="http://etivite.com/api-hooks/">Developer Hook and Filter API Reference</a><br/>
+ <a href="http://etivite.com/wordpress-plugins/">WordPress Plugins</a><br/>
+ </p>
+ </div>
+
+
+ </div>
+<?php
+}
+
+?>
@@ -0,0 +1,120 @@
+<?php
+
+function etivite_bp_member_profile_stats_admin_counts( ) {
+
+ $counts = array( 'status','topics','posts','comments','userblogs' );
+
+ return $counts;
+}
+
+function etivite_bp_member_profile_stats_admin_count_check( $type, $currenttypes ) {
+ if ( is_multisite() && ( $type == 'comments' || $type == 'posts' ) ) {
+ echo 'disabled';
+ return;
+ }
+
+ if ( !is_multisite() && $type == 'userblogs' ) {
+ echo 'disabled';
+ return;
+ }
+
+ if ( in_array( $type, $currenttypes) )
+ echo 'checked';
+
+ return;
+}
+
+function etivite_bp_member_profile_stats_admin() {
+ global $bp;
+
+ /* If the form has been submitted and the admin referrer checks out, save the settings */
+ if ( isset( $_POST['submit'] ) && check_admin_referer('etivite_bp_member_profile_stats_admin') ) {
+
+ if( isset($_POST['ab_profile_counts'] ) && !empty($_POST['ab_profile_counts']) ) {
+ update_option( 'bp_member_profile_stats_displaycounts', $_POST['ab_profile_counts'] );
+ } else {
+ update_option( 'bp_member_profile_stats_displaycounts', '' );
+ }
+
+ if( isset($_POST['ab_profile_sidebarme'] ) && !empty($_POST['ab_profile_sidebarme']) && (int)$_POST['ab_profile_sidebarme'] == 1 ) {
+ update_option( 'bp_member_profile_stats_display_sidebarme', true );
+ } else {
+ update_option( 'bp_member_profile_stats_display_sidebarme', false );
+ }
+
+ $updated = true;
+ }
+
+ // Get the proper URL for submitting the settings form. (Settings API workaround) - boone
+ $url_base = function_exists( 'is_network_admin' ) && is_network_admin() ? network_admin_url( 'admin.php?page=bp-member-profile-stats-settings' ) : admin_url( 'admin.php?page=bp-member-profile-stats-settings' );
+
+?>
+ <div class="wrap">
+ <h2><?php _e( 'Member Profile Stats', 'bp-member-profile-stats' ); ?></h2>
+
+ <?php if ( isset($updated) ) : echo "<div id='message' class='updated fade'><p>" . __( 'Settings Updated.', 'bp-member-profile-stats' ) . "</p></div>"; endif; ?>
+
+ <form action="<?php echo $url_base; ?>" name="bp-member-profile-stats-settings-form" id="bp-member-profile-stats-settings-form" method="post">
+
+ <h4><?php _e( 'Display total counts for:', 'bp-member-profile-stats' ); ?></h4>
+
+ <table class="form-table">
+ <?php
+
+ $enabledcounts = (array) get_option( 'bp_member_profile_stats_displaycounts');
+ $totalcounts = etivite_bp_member_profile_stats_admin_counts();
+
+ foreach ($totalcounts as $count) { ?>
+ <tr>
+ <th><label for="type-<?php echo $count ?>"><?php echo $count ?></label></th>
+ <td><input id="type-<?php echo $count ?>" type="checkbox" <?php etivite_bp_member_profile_stats_admin_count_check( $count, $enabledcounts ); ?> name="ab_profile_counts[]" value="<?php echo $count ?>" /></td>
+ </tr>
+ <?php } ?>
+
+ <?php if ( defined( 'ACHIEVEMENTS_IS_INSTALLED' ) ) { ?>
+ <tr>
+ <th><label for="type-dpa">Achievements</label></th>
+ <td><input id="type-dpa" type="checkbox" <?php etivite_bp_member_profile_stats_admin_count_check( 'dpa', $enabledcounts ); ?> name="ab_profile_counts[]" value="dpa" /></td>
+ </tr>
+ <?php } ?>
+
+ <tr>
+ <th><label for="ab_profile_sidebarme"><?php _e('Display under login sidebar?','bp-community-stats') ?></label></th>
+ <td><input type="checkbox" name="ab_profile_sidebarme" id="ab_profile_sidebarme" value="1"<?php if ( get_option( 'bp_member_profile_stats_display_sidebarme' ) ) { ?> checked="checked"<?php } ?> /></td>
+ </tr>
+
+ </table>
+
+ <?php wp_nonce_field( 'etivite_bp_member_profile_stats_admin' ); ?>
+
+ <p class="description">Please note: Comments is only for the main buddypress blog - if multisite is used - this does not count comments across the network. (nothing available within wordpress for this). Posts is forum posts within Groups.</p>
+
+ <p class="submit"><input type="submit" name="submit" value="Save Settings"/></p>
+
+ </form>
+
+ <h3>About:</h3>
+ <div id="plugin-about" style="margin-left:15px;">
+
+ <p>
+ <a href="http://etivite.com/wordpress-plugins/buddypress-member-profile-stats/">Activity Member Profile Stats - About Page</a><br/>
+ </p>
+
+ <div class="plugin-author">
+ <strong>Author:</strong> <a href="http://profiles.wordpress.org/users/etivite/"><img style="height: 24px; width: 24px;" class="photo avatar avatar-24" src="http://www.gravatar.com/avatar/9411db5fee0d772ddb8c5d16a92e44e0?s=24&amp;d=monsterid&amp;r=g" alt=""> rich @etivite</a><br/>
+ <a href="http://twitter.com/etivite">@etivite</a> <a href="https://plus.google.com/114440793706284941584">+etivite</a>
+ </div>
+
+ <p>
+ <a href="http://etivite.com">Author's site</a><br/>
+ <a href="http://etivite.com/api-hooks/">Developer Hook and Filter API Reference</a><br/>
+ <a href="http://etivite.com/wordpress-plugins/">WordPress Plugins</a><br/>
+ </p>
+ </div>
+
+
+ </div>
+<?php
+}
+
+?>
@@ -0,0 +1,69 @@
+<?php
+/*
+Plugin Name: BuddyPress Member Profile Stats
+Plugin URI: http://wordpress.org/extend/plugins/buddypress-member-profile-stats/
+Description: Adds a few basic count stats and per day avg under member's profile
+Author: rich @etiviti
+Author URI: http://etivite.com
+License: GNU GENERAL PUBLIC LICENSE 3.0 http://www.gnu.org/licenses/gpl.txt
+Version: 0.5.0
+Text Domain: bp-member-profile-stats
+Network: true
+*/
+
+//pull in sitewide forums count
+
+/* Only load code that needs BuddyPress to run once BP is loaded and initialized. */
+function etivite_bp_member_profile_stats_init() {
+
+ if ( file_exists( dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' ) )
+ load_textdomain( 'bp-member-profile-stats', dirname( __FILE__ ) . '/languages/' . get_locale() . '.mo' );
+
+ require( dirname( __FILE__ ) . '/bp-member-profile-stats.php' );
+
+ //hook on to profile page
+ add_action( 'bp_before_member_header_meta', 'etivite_bp_member_profile_stats_header_meta', 1);
+
+ if ( get_option( 'bp_member_profile_stats_display_sidebarme' ) )
+ add_action( 'bp_after_sidebar_me', 'etivite_bp_member_profile_stats_sidebar_me', 1);
+
+ add_action( bp_core_admin_hook(), 'etivite_bp_member_profile_stats_admin_add_admin_menu' );
+
+}
+add_action( 'bp_include', 'etivite_bp_member_profile_stats_init', 88 );
+
+//add admin_menu page
+function etivite_bp_member_profile_stats_admin_add_admin_menu() {
+ global $bp;
+
+ if ( !is_super_admin() )
+ return false;
+
+ //Add the component's administration tab under the "BuddyPress" menu for site administrators
+ require ( dirname( __FILE__ ) . '/admin/bp-member-profile-stats-admin.php' );
+
+ add_submenu_page( 'bp-general-settings', __( 'Member Profile Stats', 'bp-member-profile-stats' ), __( 'Profile Stats', 'bp-member-profile-stats' ), 'manage_options', 'bp-member-profile-stats-settings', 'etivite_bp_member_profile_stats_admin' );
+
+ //set up defaults
+
+}
+
+/* Stolen from Welcome Pack - thanks, Paul! then stolen from boone*/
+function etivite_bp_member_profile_stats_admin_add_action_link( $links, $file ) {
+ if ( 'buddypress-member-profile-stats/bp-member-profile-stats-loader.php' != $file )
+ return $links;
+
+ if ( function_exists( 'bp_core_do_network_admin' ) ) {
+ $settings_url = add_query_arg( 'page', 'bp-member-profile-stats-settings', bp_core_do_network_admin() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );
+ } else {
+ $settings_url = add_query_arg( 'page', 'bp-member-profile-stats-settings', is_multisite() ? network_admin_url( 'admin.php' ) : admin_url( 'admin.php' ) );
+ }
+
+ $settings_link = '<a href="' . $settings_url . '">' . __( 'Settings', 'bp-activity-extras' ) . '</a>';
+ array_unshift( $links, $settings_link );
+
+ return $links;
+}
+add_filter( 'plugin_action_links', 'etivite_bp_member_profile_stats_admin_add_action_link', 10, 2 );
+
+?>
Oops, something went wrong.

0 comments on commit 00235d0

Please sign in to comment.