Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 401 through 425 (of 1,252 total)
  • Author
    Search Results
  • #237459
    danbp
    Participant

    Hi @andrew55,
    add this snippet to bp-custom.php. Now you can use shortcode [profilo] in any blog post, blog comment, page and BP notice. Note that activity walls are stripped, the shortcode will not work/appear there.

    For bbPress topics and replies, use this plugin. Read the doc, as you’ll have to check user capacity to get it to work for participant.

    function bpfr_link_to_profile() {	
    
    	return ' <a href="'. bp_get_loggedin_user_link() .'">View my profile</a>';			
    }
    add_shortcode( 'profilo', 'bpfr_link_to_profile' );
    add_filter( 'comment_text', 'do_shortcode' );
    #237453
    Svend Rugaard
    Participant

    Hello

    I have finally get Buddypress installed but after i have done that its like my browser is freezing everytime im going in to some Buddypress related sites like member pages and Activity page.

    http://www.playstationforum.dk/members/nistelroy78 <– My profil page
    or just activity page http://www.playstationforum.dk/activity/

    I have follow installed.
    1. WordPress 4.11 Installed
    2. Buddypress 2.2.1
    3. Add Meta Tags
    4. Advanced Excerpt
    5. Advanced Responsive Video Embedder
    6. Akismet
    7. bbPress
    8. bbPress Votes
    9. bbp style pack
    10. BuddyPress
    11. Code Snippets
    12. CodeStyling Localization
    13. CodeStyling Localization Preserver
    14. Customize Posts
    15. Disqus Conditional Load
    16. Disqus Recent Comments Widget
    17. Enhanced Media Library
    18. GD bbPress Tools
    19. Jetpack af WordPress.com
    20. Kraken Image Optimizer
    21. Live Stream Badger

    There wasnt any load issue before i installed bbpress and its only on the bbpress releated sites.

    I Use ThemeFuse GameZone.

    mrgiblets
    Participant

    I want to add a custom filter that displays only activity updates from friends.

    So I’m reading this…

    Add custom filters to loops and enjoy them within your plugin

    Firstly…. Seriously? You have to create an entire plug-in just to add a simple filter?

    Secondly…. I’ve read this tutorial about 4 times now and I can see how the list item is being added in both the front & backends, but I can’t for the life of me see the actual function that is returning the random order? Where is the database being queried for this new function? All I can see is a new list item being created in the dropdown menu. This doesn’t show me how to add any new functionality whatsoever.

    Similarly I was browsing the following in the codex :

    Activity Loop

    Posted in 2009? 6 years old and this is the official doc for the Activity Stream Loop?
    Also, plenty of “things” that you can do on this page, but no examples of how to implement them apart from one that apparently “Filters the activity loop to show only activity updates in the activity stream”…

    <?php if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&action=activity_update' ) ) : ?>

    … Which is something that buddypress is already doing by default if i’m not mistaken?

    I am constantly finding that it’s other websites and blogs that are actually explaining how buddypress works because I can’t find straight answers in the BP codex. It’s like it’s been written solely for the buddypress dev team and not meant to be understood by anybody else.

    Come on guys, please throw us a few crumbs here, this is so frustrating.

    #237370
    Roger Coathup
    Participant

    Changing these titles isn’t the easiest thing, but BuddyPress does provide 2 ways you can do it. However, hacking core files like bp-activity-loader.php is definitely not one of them. [Never hack core files — have a Google if it’s not obvious to you why you shouldn’t]

    Ok the 2 solutions are:

    1. Use a language / translation file
    2. Use the template hierarchy

    The string “Site-Wide Activity” is translatable — all the strings are. You can implement a language file that translates ‘Site-Wide Activity’ into whatever string you’d like. Have a search for translating BuddyPress strings / POT files / poedit. There’s also a documentation (they call it the Codex) page on it: https://codex.buddypress.org/getting-started/customizing/customizing-labels-messages-and-urls/

    The second solution is to use the template hierarchy. If you don’t provide a specific template for your activity directory, BuddyPress will use the page.php file from your theme and ‘inject’ the title “Site-Wide Activity” where page.php makes a call to the_title().

    You can override this by implementing your own template — create a file called index-directory.php inside /buddypress/activity in your site’s theme. Copy the basics of page.php into that file, and replace the_title() with your hardcoded title for the page.

    You can read more about the template hierarchy here: https://codex.buddypress.org/themes/theme-compatibility-1-7/template-hierarchy/

    Neither solution is simple, you’ll either have to get your head around using poedit, or need some basic PHP coding skills and an understanding of the principles of templates and themes in WordPress. In the future, it would be nice to see a settings panel in wp-admin to configure these basic strings.

    [p.s. if you don’t want to use poedit, you could take a look at plugin solutions for string translation, e.g. codestyling localisation]

    auston1
    Participant

    When I installed BP, I unfortunately had user registration disabled in settings (cuz of bot spammers – I have no content FFS and I’m already getting spammed.)

    Anyways, what do I need to do to fix this now? I’ve created the pages and associated them in the buddypress settings –> pages tab, but they still are completely blank. The other 3 pages all work (members, activity, groups.)

    I also realized, I do not have a registration folder in buddypress. I believe this is required? I tried uninstalling, then deleting all the bp_ tables from the database, and then re-installing BP with “allow anyone to register” checked; but alas no dice. 🙁

    Still no page content for the two pages, still no folders in the buddypress directory.

    Side note: I’ve created the bp-custom.php and placed it in the plugins directory, but it’s still empty.

    I’m quite the noob. Please help.

    sjaakkuil
    Participant

    Hello,

    I’m having trouble with buddypress, I can’t see the save buttons at the components and pages page. I get the error:

    The following active BuddyPress Components do not have associated WordPress Pages: Members, Activity Streams. Repair

    But i can’t repair it because I cant save it, I’ve tried to create blank pages with the titles of the missing pages.

    I can give you the following information:
    Version wordpress: 4.1.1.
    BuddyPress by first intall: I think it worked fine, but I messed up and I don’t remember exactly.
    Version BP: 2.2.1.
    Other plugins: Social Login
    Theme: Customizr
    Modified core: Yes I tried to copy it from another website of a friend of mine, where it worked correctly.. I think I need to reinstall BP but when I do I still get the same errors and settings.
    Host: GoDaddy
    Server running: Windows

    I hope someone can help me out. Looking forward to a reaction!

    Many Thanks

    #237066
    IHaveToDoThis
    Participant

    Hey,

    I’m a newcomer to all of this and I can’t answer your overall question, but I can tell you how to change the name “Site-Wide Activity” on the activity page. You go to: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and the title is towards the top the in $GLOBAL array. And you can change it from “Site-Wide Activity” to whatever you want.

    I’ll be following this tho. I’ve been looking for way to customize my BP wall and make it look not so bland. I hope someone else can help you further!

    #236465
    danbp
    Participant

    hi @mjc82in,

    BuddyPress is continuously evolving. 2 years back it was a mess trying to use CPT on SWA. That’s no more the case with BP 2.2

    Maybe this example will help you. It creates a CPT called Music which will show up on the SWA where you can comment it.

    Add the code to bp-custom.php

    // allow tracking of our CPT
    add_post_type_support( 'music', 'buddypress-activity' );
    
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'music', array(
            'component_id'             => 'activity',
            'action_id'                => 'new_music',
            'bp_activity_admin_filter' => __( 'Published a new music', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'text-domain' ),
    			'contexts'                 => array( 'activity', 'member' ),
    			'activity_comment'         => true,
    			'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">Music</a>', 'text-domain' ),
    			'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Music</a>, on the site %3$s', 'text-domain' ),
    			'position'                 => 800,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 999 );
    
    function bpfr_create_post_type() {
      register_post_type( 'music',
        array(
          'labels' => array(
            'name' => __( 'Music', 'text-domain' ),
            'singular_name' => __( 'Music', 'text-domain' )
          ),
          'public' => true,
          'has_archive' => true,
        )
      );
    }
    add_action( 'init', 'bpfr_create_post_type' );

    Ref: https://codex.buddypress.org/plugindev/post-types-activities/

    #236437
    Manoj Chacko
    Participant

    Did do that,

    I also enabled below for pages, but pages dont show up.

    // Add custom post type to activity record
    add_filter ( ‘bp_blogs_record_post_post_types’, ‘activity_publish_custom_post_types’,1,1 );
    // Add custom post type comments to activity record
    add_filter ( ‘bp_blogs_record_comment_post_types’, ‘activity_publish_custom_post_types’,1,1 );

    function activity_publish_custom_post_types( $post_types ) {
    // add any custom post-type here
    $post_types[] = ‘page’;
    return $post_types;
    }

    #236414
    IHaveToDoThis
    Participant

    Hey Everyone,

    I still haven’t found out how to save edits in chrome inspector or how to customize my wall more…BUT I did find out how to do what was most important to me, which is change the text ‘Site-Wide Activity’ on the activity stream page. I found the solution here on a forum through a google search. Unfortunately I was on a work computer and left before copying the link and now of course I can’t find that forum anymore. Thank god I wrote it down!

    Anywho, you find it in: wp-content>plugins>buddypress>bp-activity/bp-activity-loader.php and its toward the top the in $GLOBAL array.

    Thanks to the stranger who found this!

    And any help on how to design or what files to mess with to play the design of the activity stream is greatly appreciated!

    leanneoleary
    Participant

    Hi,

    I want to implement a Facebook style timeline for my activity stream. So something like the below would be great but instead of blog posts it would be the activity posts:

    http://demo.designwall.com/dw-timeline/
    http://www.timeline-wp.com/

    I would also want to be able to view activity for all friends, or be able to select a friend and view only their activity.

    Does anyone know of any existing plugins that would do this? If not, does anyone know how would I create a custom template for the activity stream page?

    I would be really grateful if anyone could help get me started.

    rosyteddy
    Participant

    works the same way for me – you only get about 4 lines of the comment in the AS. I think only for Activity Updates there is a ‘More’ link.

    True – I missed that. Long comments are truncated with […] at the end and that does not link to the original comment. W.r.t usability that is a critical bug for me. Thanks

    activity entry for that comment does link directly to the post comment using the page anchor

    It does not – default install of WP,BP latest versions, default theme – it does not for me. Any demo link with latest WP and BP that does this? Thanks

    WAIT : […] does not link to, there is no ‘more’ link that does this BUT the time stamp does this. So I think UI and Userfriendiless tea should link […] to the same link as the time-stamp. Most users are accustomed with ‘more’ or ‘…’ – they won’t know they have to click time-stamp. Please submit an enhancement request. Thanks

    #236020
    danbp
    Participant

    Recently introduced function bp_parse_args allows since 2.0 to modify easely your templates. Faster and lighter than a plugin.

    Using bp_parse_args() to filter BuddyPress template loops

    As example, show only updates on the SWA (add snippet to bp-custom.php or child-theme functions.php)

    function make_swa_show_notice_only( $retval ) {	
    	
    	if ( bp_is_page( 'activity' ) ) {
    	$retval['action'] = 'activity_update';					
    	}
    	
    	return $retval;
    	
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'make_swa_show_notice_only' );
    #236006
    MonkimoE
    Participant

    Hi.. thank you to keep guiding me.
    I don’t know why those code for single groups page doesn’t working in my site.

    Then I tried to modify nav tab in single members page those can working good.
    This what I have in bp-custom.php:

    <?php
    function edit_tabs_options() {
        global $bp;
    // MODIFY GROUP TABS
    $bp->bp_options_nav['groups']['home']['name'] = 'Group Activity'; //NOT WORK
    $bp->bp_nav['groups']['home']['name'] = 'Member Activity 2'; //NOT WORK
    
    //MODIFY MEMBERS TABS
    $bp->bp_nav['home']['name'] = 'Member Activity'; //IT'S WORK
    bp_core_remove_nav_item( 'forums' ); //IT'S WORK
    bp_core_remove_subnav_item( 'profile', 'change-avatar' ); //IT'S WORK
    
    }
    add_action( 'bp_setup_nav', 'edit_tabs_options' );
    ?>

    Last try on fresh install wp + bp with default theme. I will let you know if those code works or not.

    danbp
    Participant

    Both snippets are working. If really not for you, double-check that bp-custom.php is correctly using open/close php tags and if your theme doesn’t use some custom rss functions.

    To remove the All members button :
    remove line 19 in buddypress/activity/index.php from within your child theme.

    
    <li class="selected" id="activity-all"><a href="<?php bp_activity_directory_permalink(); ?>" title="<?php esc_attr_e( 'The public activity for everyone on this site.', 'buddypress' ); ?>"><?php printf( __( 'All Members <span>%s</span>', 'buddypress' ), bp_get_total_member_count() ); ?></a></li>

    and add class='selected' to the li containing friends item

    If you remove the feeds display using the snippet, people won’t see anything even if they know the page url. And if this is not satisfying for you, you can write a rewrite rule to add to htaccess.

    danbp
    Participant

    Try this to remove ALL activity feeds

    function bpfr_hide_rss_feeds() {	
       remove_action( 'bp_actions', 'bp_activity_action_sitewide_feed' );
       remove_action( 'bp_actions', 'bp_activity_action_personal_feed' );
       remove_action( 'bp_actions', 'bp_activity_action_friends_feed' );
       remove_action( 'bp_actions', 'bp_activity_action_my_groups_feed' );
       remove_action( 'bp_actions', 'bp_activity_action_mentions_feed' );
       remove_action( 'bp_actions', 'bp_activity_action_favorites_feed' );
       remove_action( 'groups_action_group_feed', 'groups_action_group_feed' );    
    }
    add_action('init', 'bpfr_hide_rss_feeds');

    This snippet will only show logged in users friends activities (on all activity pages of the site)

    
    function bpfr_filtering_activity( $retval ) {
    	$retval['scope'] = 'friends';		
    		return $retval;
    	}
    add_filter( 'bp_after_has_activities_parse_args', 'bpfr_filtering_activity' );

    Add to bp-custom.php or child-theme functions.php

    More details about this on Codex

    #235875
    rosyteddy
    Participant
    #235768
    antpowerWD
    Participant

    Hi

    Quick One!

    I cannot get the BuddyMenu Shortcode to output on the relevant BuddyPress pages, activity, members etc….If I output it on any non BuddyPress page it outputs. Nothing I enter into the BuddyPress pages gets outputted.

    I can’t understand why the menu isn’t there in core anyway and when you try and get get it to output it won’t. Do I have to rewrite a custom template just for this small functionality which I can’t understand at all why it doesn’t exist in core as it is essential for the user.

    This is my first time using BuddyPress and honestly it is very good, but simple oversights like this put me off using it again.

    Can someone tell me why the menu isn’t loaded into core and why outputting it is not possible from the PageAdmin area.

    The whole thing is a bit archaic and unwieldy.

    #235536

    In reply to: Member Count

    rosyteddy
    Participant

    Hi you may check these threads – not sure if they can help you but you may consider to have a look. Have you any custom code and/or various plugins? Thanks.

    https://buddypress.org/support/topic/member-counter-on-activity-page-not-working/
    https://buddypress.trac.wordpress.org/ticket/5228
    https://buddypress.trac.wordpress.org/ticket/4061

    danbp
    Participant

    Please read here, it’s better explained.

    The example given on Codex is related to ‘page’, and you want to show something on ‘activity’.

    Instead of 'component_id' => buddypress()->activity->id,
    use 'component_id' => 'activity',
    and instead of
    add_action( 'bp_init', 'customize_page_tracking_args' );
    use init with a very late priority
    add_action( 'init', 'customize_page_tracking_args', 999 );

    Pfuiiiiii, taked me a while to find this.

    Here a working example of a CPT called Music and how to get it in the SWA

    // allow tracking of our CPT
    add_post_type_support( 'music', 'buddypress-activity' );
    
    // creating the dropdown filter on activity and members page
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
     
        bp_activity_set_post_type_tracking_args( 'music', array(
            'component_id'             => 'activity', // unique ID
            'action_id'                => 'new_music', // new_$post_type where new_ is mandatory
            'bp_activity_admin_filter' => __( 'Published a new music', 'text-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'text-domain' ),
    			'contexts'                 => array( 'activity', 'member' ), // swa & member activity page
    			'activity_comment'         => true,
    			'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">Music</a>', 'text-domain' ),
    			'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">Music</a>, on the site %3$s', 'text-domain' ),
    			'position'                 => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 999 );
    
    // creating the CPT
    function bpfr_create_post_type() {
      register_post_type( 'music',
        array(
          'labels' => array(
            'name' => __( 'Music', 'text-domain' ),
            'singular_name' => __( 'Music', 'text-domain' )
          ),
          'public' => true,
          'has_archive' => true,
        )
      );
    }
    add_action( 'init', 'bpfr_create_post_type' );
    

    FYI, i added the mentionned topic to the Codex page. Would probably help more than one. 😉

    #235279
    megabait12
    Participant

    Hello, I would like to know how to synchronize custom post type comments and activity stream comments. What I mean when somebody comment on the cpt page then comment should appear on the activity stream, and backward if somebody comment cpt activity post then comment should appear on cpt page. Also question is it possible to add featured image of cpt to activity? And one more question in the activity stream link to cpt showing url with parameters ?p=, but if you go to this page there is normal url (user friendly). Thank you
    BuddyPress 2.2.1, WordPress 4.1.1

    add_post_type_support('portfolio', 'buddypress-activity');
    
    function customize_page_tracking_args() {
        // Check if the Activity component is active before using it.
        if (!bp_is_active('activity')) {
            return;
        }
    
        bp_activity_set_post_type_tracking_args('portfolio', array(
            'component_id' => buddypress()->activity->id,
            'action_id' => 'new_portfolio',
            'bp_activity_admin_filter' => __('Published a new recommendation', 'scuppies'),
            'bp_activity_front_filter' => __('Recommendations', 'scuppies'),
            'contexts' => array('activity', 'member'),
            'activity_comment' => true,
            'bp_activity_new_post' => __('%1$s posted a new <a href="%2$s">recommendation</a>', 'scuppies'),
            'bp_activity_new_post_ms' => __('%1$s posted a new <a href="%2$s">recommendation</a>, on the site %3$s', 'scuppies'),
            'position' => 100,
        ));
    }
    
    add_action('bp_init', 'customize_page_tracking_args');
    #235083
    leanneoleary
    Participant

    Thanks for your help with this but I am still not sure what I need to do. The function I posted was just an example that I had found from an earlier forum, I do not need to add videos and pictures to the activity stream.

    I need to add details of a custom post type every time a custom form is submitted from the frontend by a user. The custom post type is “Files”. Below is a class for the form and it is within the CMB (custom meta boxes) plugin folder. Can you advise on how to implement the code to record these forms posts in the activity stream?

    class uploadForm {
    
        // Set prefix
        public $prefix = '_cmb_'; 
    
        /**
         * Construct the class.
         */
        public function __construct() {
            add_filter( 'cmb_meta_boxes', array( $this, 'cmb_metaboxes' ) );
            add_shortcode( 'cmb-form', array( $this, 'do_frontend_form' ) );
            add_action( 'init', array( $this, 'initialize_cmb_meta_boxes' ), 9 );
           /* add_action( 'cmb_save_post_fields', array( $this, 'save_fields' ), 10, 4 );*/
            add_action( 'save_post', array( $this, 'save_fields' ), 10, 4 );
           /*add_filter( 'bp_blogs_record_comment_post_types', 'add_activity' );   IS THIS CORRECT?  */ 
        }
    
        /**
         * Define the metabox and field configurations.
         */
        public function cmb_metaboxes( array $meta_boxes ) {
    
            /**
             * Metabox for the "Memorials" front-end submission form
             */
            $meta_boxes['upload_files_metabox'] = array(
                'id'         => 'files',
                'title'      => __( 'Upload files', 'cmb' ),
                'pages'      => array( 'Files' ), // Post type
                'context'    => 'normal',
                'priority'   => 'high',
                'show_names' => true, // Show field names on the left
                'fields'     => array(
                    array(
                        'name'       => __( 'File description', 'cmb' ),
                        'desc'       => __( 'File title or description', 'cmb' ),
                        'id'         => $this->prefix . 'title',
                        'type'       => 'text',
                    ),
                    array(
                        'name'     => __( 'Project stage', 'cmb' ),
                        'desc'     => __( 'select stage (optional)', 'cmb' ),
                        'id'       => $this->prefix . 'category',
                        'type'     => 'taxonomy_select',
                        'taxonomy' => 'stages', // Taxonomy Slug
                    ),
                    array(
                        'name' => __( 'Link to website', 'cmb' ),
                        'desc' => __( 'Add url to website (optional)', 'cmb' ),
                        'id'   => $this->prefix . 'url',
                        'type' => 'text_url',
                        'protocols' => array('http', 'https', 'ftp', 'ftps', 'mailto', 'news', 'irc', 'gopher', 'nntp', 'feed', 'telnet'), // Array of allowed protocols
                        // 'repeatable' => true,
                    ),
                   array(
                        'name' => __( 'Upload image', 'cmb' ),
                        'desc' => __( 'Upload an image or enter a URL.', 'cmb' ),
                        'id'   => $this->prefix . 'image',
                        'type' => 'file',
                    ),
    
                  array(
                      'name'         => __( 'Upload files', 'cmb' ),
                      'desc'         => __( 'Upload or add multiple images/attachments.', 'cmb' ),
                      'id'           => $this->prefix . 'file_list',
                      'type'         => 'file_list',
                  ),
                  array(
                    'name' => __( 'oEmbed', 'cmb' ),
                    'desc' => __( 'Enter a youtube, twitter, or instagram URL. Supports services listed at <a href="https://codex.wordpress.org/Embeds">https://codex.wordpress.org/Embeds</a>.', 'cmb' ),
                    'id'   => $this->prefix . 'embed',
                    'type' => 'oembed',
                 ), 
                ),
            );
    
            return $meta_boxes;
        }
    
        /**
         * Shortcode to display a CMB form for a post ID.
         */
        public function do_frontend_form() {
    
            // Default metabox ID
            $metabox_id = 'upload_files_metabox';
    
            // Get all metaboxes
            $meta_boxes = apply_filters( 'cmb_meta_boxes', array() );
    
            // If the metabox specified doesn't exist, yell about it.
            if ( ! isset( $meta_boxes[ $metabox_id ] ) ) {
                return __( "A metabox with the specified 'metabox_id' doesn't exist.", 'cmb' );
            }
    
            // This is the WordPress post ID where the data should be stored/displayed.
            $post_id = 0;
    
            if ( $new_id = $this->intercept_post_id() ) {
                $post_id = $new_id;
                echo 'Thank You for your submission.';
            } 
    
            // Shortcodes need to return their data, not echo it.
            $echo = false;
    
            // Get our form
            $form = cmb_metabox_form( $meta_boxes[ $metabox_id ], $post_id, $echo );
    
            return $form;
        }
    
        /**
         * Get data before saving to CMB.
         */
        public function intercept_post_id() {
    
            // Check for $_POST data
            if ( empty( $_POST ) ) {
                return false;
            } 
             
            
    
            // Check nonce
            if ( ! ( isset( $_POST['submit-cmb'], $_POST['wp_meta_box_nonce'] ) && wp_verify_nonce( $_POST['wp_meta_box_nonce'], cmb_Meta_Box::nonce() ) ) ) {
                return;
            }
            
            // Setup and sanitize data
            if ( isset( $_POST[ $this->prefix . 'title' ] ) ) {
                           
              
                //add post data to database    
                $this->new_submission = wp_insert_post( array(
                    'post_title'            => sanitize_text_field( $_POST[ $this->prefix . 'title' ] ),
                    'post_author'           => get_current_user_id(),
                    'post_status'           => 'publish', // Set to draft so we can review first
                    'post_type'             => 'file',
                ), true );
    
                // If no errors, save the data into a new post draft
                if ( ! is_wp_error( $this->new_submission ) ) {
                    
                    return $this->new_submission;
                    
                   
                } 
    
            }
    
            return false;
        }
    
        /**
         * Grant temporary permissions to subscribers.
         */
        public function grant_publish_caps( $caps, $cap, $args ) {
    
            if ( 'edit_post'  == $args[0] ) {
                $caps[$cap[0]] = true;
            }
    
            return $caps;
        }
        
       
        
    
        /**
         * Save custom fields and uploaded files 
         */
        public function save_fields( $post_id, $post  ) {
    
                if($_POST['_cmb_category'] != ''){
                    add_post_meta( $post_id, '_cmb_category', $_POST['_cmb_category'], true );
                }
                if($_POST['_cmb_url'] != ''){
                    add_post_meta( $post_id, '_cmb_url', $_POST['_cmb_url]'], true );
                }
                if($_POST['_cmb_image'] != ''){
                    add_post_meta( $post_id, '_cmb_image', $_POST['_cmb_image'], true );
                }
                if($_POST['_cmb_image_id'] != ''){
                    add_post_meta( $post_id, '_cmb_image_id', $_POST['_cmb_image_id'], true );
                }
                if($_POST['_cmb_file_list'] != ''){
                    add_post_meta( $post_id, '_cmb_file_list', $_POST['_cmb__file_list'], true );
                }
                if($_POST['_cmb_embed'] != ''){
                    add_post_meta( $post_id, '_cmb_embed', $_POST['_cmb_embed'], true );
                }
           
    
        }
    
        /**
         * Initialize CMB.
         */
        public function initialize_cmb_meta_boxes() {
    
            if ( ! class_exists( 'cmb_Meta_Box' ) ) {
                require_once 'init.php';
            }
    
        }
        
        /**
         * Add to buddypress activity timeline. - HOW???
         */
        public function add_activity($post_types) {
    
           /* $activity_id = bp_activity_add( $args );
            
            return $activity_id;*/
    
           /*   $post_types[] = 'file'; 
              return $post_types;*/
        }  
        
    
    } // end class
    
    $uploadForm = new uploadForm();
    
    Rapforthemoment
    Participant

    I cannot add widgets to any pages fused with Buddypress (activity, groups, members). The only way I can put a widget on that page is if I put it under Single Post Page. If I do that, then all the Buddypress pages show that widget. I do not want that. I want different widgets on different BP pages. I downloaded the Buddypress Custom Sidebar but my widgets do not even show up when I place them there, no matter what page I put it on. What do I do?

    I’ve read the relevant codex page https://codex.buddypress.org/plugindev/post-types-activities/ and have copied the code given there, but it doesn’t seem to want to work for me.

    My custom post type is “music”, and I want it on the activity stream, so I amended the code to:

    add_post_type_support( 'music', 'buddypress-activity' );
     
    function customize_page_tracking_args() {
        if ( ! bp_is_active( 'activity' ) ) return;
     
        bp_activity_set_post_type_tracking_args( 'music', array(
        	'component_id' => buddypress()->activity->id,
    	'action_id' => 'new_music',
            'bp_activity_admin_filter' => __( 'Added a new Music Resource', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'custom-domain' ),
            'contexts' => array( 'activity', 'member' ),
            'activity_comment' => true,
            'bp_activity_new_post' => __( '%1$s added a new <a href="%2$s">music resource</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms' => __( '%1$s added a new <a href="%2$s">music resource</a>, on the site %3$s', 'custom-textdomain' ),
            'position' => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_page_tracking_args' );

    But all I get in the activity stream is the generic Site Admin wrote a new item 10 seconds ago and Music does not appear in the Show drop-down menu.

    What am I missing?

    Cheers

    #234753
    mathijs84
    Participant

    Thanks danbp,

    You think Buddypress is the right way to go ??

    With point 2 i mean, that at the start of each month every user has to upload a new picture.
    So this will be custom development i guess!

    We are only going to use the member (wall)pages, kinda like a facebook wall. Is it possible to somehow get the elements like activity, photo’s, documents and messages on 1 page without the tabs?

Viewing 25 results - 401 through 425 (of 1,252 total)
Skip to toolbar