WordPress.org

Ready to get started?Download WordPress

Forums

BuddyPress Activity Plus
Any way to add bp activity plus links to whats-new-form? (16 posts)

  1. pathuri
    Member
    Posted 1 month ago #

    I'm using 'bp activity shortcode' for displaying bp activity stream with various options, on any page or post.
    I'm able to display whats-new-form in the activity stream.
    But BP activity plus links are not appearing.
    Any way these links can be attached/added to whats-new-form?
    Otherwise bp activity plus links are appearing in various groups and standard 'activity stream' page.
    Pl let me know if there is any solution to this?

    https://wordpress.org/plugins/buddypress-activity-plus/

  2. WPMU DEV
    Member
    Posted 1 month ago #

    Hi @pathuri,

    Thanks for posting on the forums.

    Could you please share me the page link where the BuddyPress Activity Plus links are not appearing in the whats-new-form so that i can help you to resolve the issue?

    Kind Regards,
    WPMU DEV

  3. pathuri
    Member
    Posted 1 month ago #

    Same question asked on buddypress forums also :
    http://buddypress.org/support/topic/add-activity-form-and-loop-on-my-home-
    page/
    "@szed : Any luck with adding the buddypress-activity-plus icons with the buddypress activity shortcode plugin?"

    Pl check this page :
    http://www.nammavidyaranyapura.org/namma-news/

  4. WPMU DEV
    Member
    Posted 1 month ago #

    Hi @pathuri,

    Thank you for your prompt reply.

    I tried to check it on your site http://www.nammavidyaranyapura.org/login/ by registering and logging in but i got the error message "ERROR: Your account is still pending approval." so i downloaded the plugin 'bp activity shortcode' from the site http://buddydev.com/plugins/bp-activity-shortcode/ and tested it on my test site.

    After testing i found BuddyPress Activity Plus buttons / links are not displaying on the whats new form generated by 'bp activity shortcode' plugin using the solution posted in this reply.

    So to resolve this issue i have just edited the following BuddyPress Activity Plus plugin file on line number 339

    BuddyPress Activity Plus plugin file:
    buddyPress-activity-plus/lib/class_bpfb_binder.php

    Before Editing:

    if (

    After Editing:

    if (
      true
      ||

    Could you please try using the above solution and let me know whether it works for you or not?

    Note: You are making changes in the plugin file and these changes will be overwritten and lost when you update the plugin and you will have to make these again after plugin updation.

    If for anybody the solution posted in this reply doesn't work then try changing the code provided in the solution as below.

    Before Editing:

    <?php locate_template( array( 'activity/post-form.php'), true ); ?>

    After Editing:

    <?php include_once( WP_PLUGIN_DIR.'/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php'); ?>

    Best Regards,
    WPMU DEV

  5. pathuri
    Member
    Posted 3 weeks ago #

    I will check and confirm.

  6. pathuri
    Member
    Posted 3 weeks ago #

    Hi! WPMUDEV!

    First solution is working fine (if (true ||)
    Second solution (mods to bp-activity-shortcode.php) is not working somehow.

    Thanks for all the SUPPORT!

  7. WPMU DEV
    Member
    Posted 2 weeks ago #

    Hi @pathuri,

    That's great news! Glad it's working for you now :)

    Could you please share me the whole code that you have used for second solution(mods to bp-activity-shortcode.php) so that i can troubleshoot it?

    You can share me whole code through Google Drive, Dropbox, http://pastebin.com/ or other code / file sharing service. :)

    Regards,
    WPMU DEV

  8. pathuri
    Member
    Posted 2 weeks ago #

    <?php
    /**
    * Plugin Name: BuddyPress Activity Shortcode
    * Author: Brajesh Singh(BuddyDev)
    * Plugin URI: http://buddydev.com/plugins/bp-activity-shortcode/
    * Author URI: http://buddydev.com/members/sbrajesh/
    * Version: 1.0.2
    * License: GPL
    */
    class BD_Activity_Stream_Shortcodes_Helper{

    private static $instance;

    private function __construct() {

    //register shortcodes
    $this->register_shortcodes();

    }

    /**
    * Register shortcodes
    *
    */
    private function register_shortcodes() {
    //[activity-stream display_comments=threaded|none title=somethimg per_page=something]

    add_shortcode( 'activity-stream', array( $this, 'generate_activity_stream' ) );

    }
    /**
    * Get Instance
    *
    *
    * @return BD_Activity_Stream_Shortcodes_Helper
    */
    public static function get_instance() {

    if ( !isset( self::$instance ) )
    self::$instance = new self();

    return self::$instance;
    }

    public function generate_activity_stream( $atts, $content = null ) {
    //allow to use all those args awesome!
    $atts=shortcode_atts(array(
    'title' => 'Latest Activity',//title of the section
    'pagination' => 'true',//show or not
    'display_comments' => 'threaded',
    'include' => false, // pass an activity_id or string of IDs comma-separated
    'exclude' => false, // pass an activity_id or string of IDs comma-separated
    'in' => false, // comma-separated list or array of activity IDs among which to search
    'sort' => 'DESC', // sort DESC or ASC
    'page' => 1, // which page to load
    'per_page' => 5, //how many per page
    'max' => false, // max number to return

    // Scope - pre-built activity filters for a user (friends/groups/favorites/mentions)
    'scope' => false,

    // Filtering
    'user_id' => false, // user_id to filter on
    'object' => false, // object to filter on e.g. groups, profile, status, friends
    'action' => false, // action to filter on e.g. activity_update, new_forum_post, profile_updated
    'primary_id' => false, // object ID to filter on e.g. a group_id or forum_id or blog_id etc.
    'secondary_id' => false, // secondary object ID to filter on e.g. a post_id

    // Searching
    'search_terms' => false, // specify terms to search on
    'use_compat' => bp_use_theme_compat_with_current_theme()
    ), $atts );

    extract( $atts );

    ob_start(); ?>

    <?php if ( is_user_logged_in() ) : ?>
    <?php include_once( WP_PLUGIN_DIR.'/buddypress/bp-templates/bp-legacy/buddypress/activity/post-form.php'); ?>
    <?php endif; ?>
    <?php if( $use_compat):?>
    <div id="buddypress">
    <?php endif;?>

    <?php if($title): ?>
    <h3 class="activity-shortcode-title"><?php echo $title; ?></h3>
    <?php endif;?>

    <?php do_action( 'bp_before_activity_loop' ); ?>

    <?php if ( bp_has_activities($atts) ) : ?>
    <div class="activity <?php if(!$display_comments): ?> hide-activity-comments<?php endif; ?> shortcode-activity-stream">

    <?php if ( empty( $_POST['page'] ) ) : ?>

    <ul id="activity-stream" class="activity-list item-list">

    <?php endif; ?>

    <?php while ( bp_activities() ) : bp_the_activity(); ?>

    <?php bp_get_template_part( 'activity/entry'); ?>

    <?php endwhile; ?>

    <?php if ( empty( $_POST['page'] ) ) : ?>

    <?php endif; ?>

    <?php if($pagination):?>
    <div class="pagination">
    <div class="pag-count"><?php bp_activity_pagination_count(); ?></div>
    <div class="pagination-links"><?php bp_activity_pagination_links(); ?></div>
    </div>
    <?php endif;?>
    </div>

    <?php else : ?>

    <div id="message" class="info">
    <p><?php _e( 'Sorry, there was no activity found. Please try a different filter.', 'buddypress' ); ?></p>
    </div>

    <?php endif; ?>

    <?php do_action( 'bp_after_activity_loop' ); ?>

    <form action="" name="activity-loop-form" id="activity-loop-form" method="post">

    <?php wp_nonce_field( 'activity_filter', '_wpnonce_activity_filter' ); ?>

    </form>
    <?php if( $use_compat ):?>
    </div>
    <?php endif;?>
    <?php

    $output = ob_get_clean();

    return $output;

    }

    }

    BD_Activity_Stream_Shortcodes_Helper::get_instance();

  9. pathuri
    Member
    Posted 2 weeks ago #

  10. WPMU DEV
    Member
    Posted 2 weeks ago #

    Hi @pathuri,

    Thank you for sharing the code.

    You have added the provided code in the wrong place you should add it just before the following code.

    <?php if($title): ?>
        <h3 class="activity-shortcode-title"><?php echo $title; ?></h3>
    <?php endif;?>

    Is the solution posted in the following reply works for you?

    http://buddypress.org/support/topic/add-activity-form-and-loop-on-my-home-page/#post-172800

    Regards,
    WPMU DEV

  11. pathuri
    Member
    Posted 2 weeks ago #

    I'm using the solution posted in the link mentioned by you to show the new-form as part of bp-activity-short-code.
    The code from the link is added above the 'title' code exactly.
    The solution from the post was working fine but without BP AP+ links.
    That is when I posted this problem here.
    Then i tried your 2 solutions -
    (1) first solution works fine
    (2) second solution still doesn't work even after moving the code to above the 'title' code (earlier it was above 'use_compat code and now i shifted to above 'title' code).
    with my trials, it looks like 2nd solution doesn't work.

  12. pathuri
    Member
    Posted 2 weeks ago #

    in my view, it is better if mod is part of bp-activity-shortcode.php file rather than modifying the bp-activity-plus code.

  13. pathuri
    Member
    Posted 2 weeks ago #

  14. WPMU DEV
    Member
    Posted 2 weeks ago #

    Hi @pathuri,

    The solution is working fine for me using the latest versions of all.

    Could you please tell me which version of WordPress, BuddyPress and BuddyPress Activity plus plugins you are using?

    Are you using WordPress multisite or single site?

    Regards,
    WPMU DEV

  15. pathuri
    Member
    Posted 2 weeks ago #

    I'm using all latest versions of wordpress, buddypress and BP A+.
    Mine is single site.
    Let me investigate further.
    Might be it is a conflict of some plug-in?

  16. WPMU DEV
    Member
    Posted 1 week ago #

    Yes this can be due to plugin conflict. You can just try on your development site deactivating all other plugins and using default WordPress theme like Twenty Thirteen as displayed in this flowchart to know which theme/ plugin is conflicting if any.

Reply

You must log in to post.

About this Plugin

About this Topic