Forum Replies Created

Viewing 15 replies - 1 through 15 (of 25 total)
  • I assume you guys discovered that the plugin is no longer recording views, since that’s the problem I’m having. Any solutions found?

    Thread Starter hornets2002

    (@hornets2002)

    Did anyone ever make any progress on this?

    Thread Starter hornets2002

    (@hornets2002)

    Anyone ever figure this out?

    Thread Starter hornets2002

    (@hornets2002)

    Thanks for the fast reply, works perfectly!

    Thread Starter hornets2002

    (@hornets2002)

    Nevermind ?? I have figured this out by using

    global $wpdb;
    $topuser = array();
    $html = "";	
    
    // query points by each user
    $users = $wpdb->get_results("SELECT ID FROM $wpdb->users ORDER BY ID");
    foreach ( $users as $user ) {
            $views = get_user_meta( $user->ID, 'rfp_post_karma', 1 );
        $topuser[] = array( 'id' => $user->ID, 'views' => $views);
        wp_reset_query();
    }
    
    // function to sort array based on views count
    function sortViews($a, $b) {
        return $b['views'] - $a['views'];
    }
    usort($topuser, 'sortViews'); // sort the array
    Thread Starter hornets2002

    (@hornets2002)

    I have solved both problems

    1. The duplicate upload button was my fault. I had originally (before the recent update) tried to follow the tutorial here for adding an upload image field: https://alextheafrican.wordpress.com/2012/03/10/how-to-add-an-image-field-to-buddypress-extended-profile-fields/

    When I saw that you added this option, I attempted to undo the code I had added but accidentely left some of it in functions.php. Now that I have deleted it, everything works great!

    2. I was able to accomplish sizing down the original image through css modifications. This is what I used:

    .editfield.field_blog-featured-image img {
    width: 110px;
    }

    Thanks again for this wonderful plugin ??

    Thread Starter hornets2002

    (@hornets2002)

    Thanks for offering an alternative oomskaap. I’m not very knowledgeable in php, would you mind explaining why it’s better? Would it increase speed on my site? Just curious cuz ill use your method if so ??

    Thread Starter hornets2002

    (@hornets2002)

    Thread Starter hornets2002

    (@hornets2002)

    Nevermind!

    I found a solution through buddypress forums. For anybody else looking for this feature, you must go to to the plugin folder, includes and then edit bp-follow-widgets.php.

    Just delete all the code in there and replace it with this:

    <?php
    /**
     * BP Follow Widgets
     *
     * @package BP-Follow
     * @subpackage Widgets
     */
    
    // Exit if accessed directly
    if ( !defined( 'ABSPATH' ) ) exit;
    
    /**
     * Add a "Users I'm following" widget for the logged-in user
     *
     * @subpackage Widgets
     */
    class BP_Follow_Following_Widget extends WP_Widget {
    	function bp_follow_following_widget() {
    		parent::WP_Widget( false, $name = __( "BP Follow - Following", 'bp-follow' ) );
    	}
    
    	function widget( $args, $instance ) {
    
    		extract( $args );
    
    		if ( empty( $instance['max_users'] ) )
    			$instance['max_users'] = 25;
    
    		if ( !$following = bp_get_following_ids( $displayed_user->id ) )
    		{
    			do_action( 'bp_before_follower_widget' );
    
    			echo $before_widget;
    			echo $before_title
    			   . __( 'Following', 'bp-follow' )
    			   . $after_title; ?>
    
    			<div class="avatar-block">
    				<?php echo bp_get_displayed_user_fullname() . " " .  __('is not following anyone yet.', 'bp-follow'); ?>
    			</div>
    
    			<?php echo $after_widget; ?>
    
    			<?php do_action( 'bp_after_follower_widget' ); ?>
    
    		<?php } ?>
    
    		<?php
    
    		if ( bp_has_members( 'include=' . $following . '&max=' . $instance['max_users'] ) ) {
    
    			do_action( 'bp_before_following_widget' );
    
    			echo $before_widget;
    			echo $before_title
    			   . __( 'Following', 'bp-follow' )
    			   . $after_title; ?>
    
    			<div class="avatar-block">
    				<?php while ( bp_members() ) : bp_the_member(); ?>
    					<div class="item-avatar">
    						<a title="<?php bp_member_name() ?>" href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
    					</div>
    				<?php endwhile; ?>
    			</div>
    
    			<?php echo $after_widget; ?>
    
    			<?php do_action( 'bp_after_following_widget' ); ?>
    
    		<?php } ?>
    
    	<?php
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['max_users'] = strip_tags( $new_instance['max_users'] );
    
    		return $instance;
    	}
    
    	function form( $instance ) {
    		$instance = wp_parse_args( (array) $instance, array( 'max_users' => 25 ) );
    		$max_users = strip_tags( $instance['max_users'] );
    		?>
    
    		<p><label for="bp-follow-widget-users-max"><?php _e('Max users to show:', 'bp-follow'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_users' ); ?>" name="<?php echo $this->get_field_name( 'max_users' ); ?>" type="text" value="<?php echo attribute_escape( $max_users ); ?>" style="width: 30%" /></label></p>
    	<?php
    	}
    }
    add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Follow_Following_Widget");' ) );
    
    /**
     * Add a "Users following me" widget for the logged-in user
     *
     * @subpackage Widgets
     */
    class BP_Follow_Follower_Widget extends WP_Widget {
    	function bp_follow_follower_widget() {
    		parent::WP_Widget( false, $name = __( "BP Follow - Followers", 'bp-follow' ) );
    	}
    
    	function widget( $args, $instance ) {
    
    		extract( $args );
    
    		if ( empty( $instance['max_users'] ) )
    			$instance['max_users'] = 25;
    
    		if ( !$follower = bp_get_follower_ids( $displayed_user->id ) )
    		{
    			do_action( 'bp_before_follower_widget' );
    
    			echo $before_widget;
    			echo $before_title
    			   . __( 'Followers', 'bp-follow' )
    			   . $after_title; ?>
    
    			<div class="avatar-block">
    				<?php echo bp_get_displayed_user_fullname() . " " .  __('has no followers yet.', 'bp-follow'); ?>
    			</div>
    
    			<?php echo $after_widget; ?>
    
    			<?php do_action( 'bp_after_follower_widget' ); ?>
    
    		<?php } ?>
    
    <?php
    		if ( bp_has_members( 'include=' . $follower . '&max=' . $instance['max_users'] ) ) {
    
    			do_action( 'bp_before_follower_widget' );
    
    			echo $before_widget;
    			echo $before_title
    			   . __( 'Followers', 'bp-follow' )
    			   . $after_title; ?>
    
    			<div class="avatar-block">
    				<?php while ( bp_members() ) : bp_the_member(); ?>
    					<div class="item-avatar">
    						<a title="<?php bp_member_name() ?>" href="<?php bp_member_permalink() ?>"><?php bp_member_avatar() ?></a>
    					</div>
    				<?php endwhile; ?>
    			</div>
    
    			<?php echo $after_widget; ?>
    
    			<?php do_action( 'bp_after_follower_widget' ); ?>
    
    		<?php } ?>
    
    	<?php
    	}
    
    	function update( $new_instance, $old_instance ) {
    		$instance = $old_instance;
    		$instance['max_users'] = strip_tags( $new_instance['max_users'] );
    
    		return $instance;
    	}
    
    	function form( $instance ) {
    		$instance = wp_parse_args( (array) $instance, array( 'max_users' => 25 ) );
    		$max_users = strip_tags( $instance['max_users'] );
    		?>
    
    		<p><label for="bp-follow-widget-users-max"><?php _e('Max users to show:', 'bp-follow'); ?> <input class="widefat" id="<?php echo $this->get_field_id( 'max_users' ); ?>" name="<?php echo $this->get_field_name( 'max_users' ); ?>" type="text" value="<?php echo attribute_escape( $max_users ); ?>" style="width: 30%" /></label></p>
    	<?php
    	}
    }
    add_action( 'widgets_init', create_function( '', 'return register_widget("BP_Follow_Follower_Widget");' ) );
    
    ?>

    And that’s it, hope it helps someone

    Any progress on this? I tried the tutorial mentioned above but ran into trouble getting it to work. I reeeaaaly need this for my site. I hope it will be available soon. If not is there any other way I could achieve this? It doesn’t even have to be through buddypress.

    All I want to do is allow users to upload one image from the front end of the site (not the backend). Then I call this image through php as the feature image for their author archive.

    Any help or update would be greatly appreciated!

    Forum: Plugins
    In reply to: [Mandatory Field] WP 3.5

    Hey ketanmujumdar,

    I am also not seeing the red show up on categories or featured image when they are not filled out.

    Thread Starter hornets2002

    (@hornets2002)

    Yes, the code will work anywhere you want it to as long as it is placed in the correct file that corresponds to the desired location

    Thread Starter hornets2002

    (@hornets2002)

    Oh yeah forgot, paste the above code in single.php in your theme folder.

    Thread Starter hornets2002

    (@hornets2002)

    Hey faeronsayn,

    I never got a response from the developer of this plugin, so I took it upon myself to figure this out. I played around in PHP and came up with a working solution ??

    <span class="single-post-views"><?php echo get_post_views('normal'); ?><?php _e(' reads', 'gonzo'); ?></span>

    It should display something like this: “233 reads”. If you want to change the wording, just alter the writing in the parenthesis to whatever you’d like.

    Also where it says ‘gonzo’, I’m not sure but you might need to change it to your theme name.

    Hope this helps!

    Thread Starter hornets2002

    (@hornets2002)

    Yeah I would really like a response from the writer of the plugin

Viewing 15 replies - 1 through 15 (of 25 total)