Skip to:
Content
Pages
Categories
Search
Top
Bottom

Search Results for 'custom activity page'

Viewing 25 results - 251 through 275 (of 838 total)
  • Author
    Search Results
  • kmligue
    Participant

    I found this function ‘bp_dtheme_post_update’ in ‘/wp-content/plugins/buddypress/bp-themes/bp-default/_inc/ajax.php’. Im guessing this is the one who handles new post in activity page. I just would like to make the textarea in the activity page always required even when uploading image. Im using rtmedia plugin, btw.

    #257046
    bigkahunaburger
    Participant

    Try this (the second function adds the course title):

    
    function customize_page_tracking_args() {
        if ( ! bp_is_active( 'activity' ) ) {
            return;
        }
         add_post_type_support( 'sfwd-courses', 'buddypress-activity' );
     
     
        bp_activity_set_post_type_tracking_args( 'sfwd-courses', array(
            'action_id'                         => 'new_sfwd-courses',
            'bp_activity_admin_filter'          => __( 'Published a new course', 'custom-textdomain' ),
            'bp_activity_front_filter'          => __( 'Course', 'custom-textdomain' ),
            'bp_activity_new_post'              => __( '%1$s wrote a new course, <a href="%2$s">[Course]</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'           => __( '%1$s wrote a new course, <a href="%2$s">[Course]</a>, on the site %3$s', 'custom-textdomain' ),
            'contexts'                          => array( 'activity', 'member' ),
            'comment_action_id'                 => 'new_sfwd-courses_comment',
            'bp_activity_comments_admin_filter' => __( 'Commented on a course', 'custom-textdomain' ),
            'bp_activity_comments_front_filter' => __( 'Course Comments', 'custom-textdomain' ),
            'bp_activity_new_comment'           => __( '%1$s commented on a <a href="%2$s">Course</a>', 'custom-textdomain' ),
            'bp_activity_new_comment_ms'        => __( '%1$s commented on a <a href="%2$s">Course</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                          => 100,
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 1000 );
    
    function new_sfwd-courses_include_post_type_title( $action, $activity ) {
    	if ( empty( $activity->id ) ) {
    		return $action;
    	}
    
    	if ( 'new_sfwd-courses' != $activity->type ) {
    		return $action;
    	}
    
    	preg_match_all( '/<a.*?>([^>]*)<\/a>/', $action, $matches );
    
    	if ( empty( $matches[1][1] ) || '[Course]' != $matches[1][1] ) {
    		return $action;
    	}
    
    	$post_type_title = bp_activity_get_meta( $activity->id, 'post_title' );
    
    	if ( empty( $post_type_title ) ) {
    
    		switch_to_blog( $activity->item_id );
    
    		$post_type_title = get_post_field( 'post_title', $activity->secondary_item_id );
    
    		// We have a title save it in activity meta to avoid switching blogs too much
    		if ( ! empty( $post_type_title ) ) {
    			bp_activity_update_meta( $activity->id, 'post_title', $post_type_title );
    		}
    
    		restore_current_blog();
    	}
    
    	return str_replace( $matches[1][1], esc_html( $post_type_title ), $action );
    }
    add_filter( 'bp_activity_custom_post_type_post_action', 'new_sfwd-courses_include_post_type_title', 10, 2 );
    #257034
    anthlon
    Participant

    Hi, I’m using Buddypress (2.6.1.1) and LearnDash (2.2.1.1) and the BuddyPress for LearnDash add-on (1.1.0.0) with WordPress (4.5.3) to create a website that allows users to learn more about certain subjects and also gives them a place where they can speak about the content that’s on the website, for this I decided to use BuddyPress since it’s Activity Feed and use of Groups seemed like a very good fit for what I was looking for.

    I’m having a bit of trouble getting comments made on the LearnDash Courses appearing in the BuddyPress Activity feed, I was following this:
    Post Types Activities Page
    When I add:
    add_post_type_support( 'sfwd-courses', 'buddypress-activity' );
    to bp-custom.php the creation of a new course is posted to the activity feed, however you can’t comment on it from the activity feed and comments on the Course Page don’t show on the Activity Feed.

    Adding the function Customize_page_tracking_args() to my bp-custom.php also doesn’t change anything and I’m still told that “Admin has added a new item”
    Activity Feed Post

    Pastebin of bp-custom.php

    #256818
    knowitallnz
    Participant

    Hi Jrzvw,

    Were you able to fix this?

    I can’t find where to start a new questions so i will just add to this one?

    My current site only shows the members that were active. There is 50 WP members registered but only 22 showing on ALL MEMBERS page. I feel the amount of members showing will influence the amount that will join up. SO this one time I would like to have it show all registered members and after it can just add them as they are active.

    I tried : add_filter( ‘bp_get_total_member_count’, ‘bp_core_get_total_member_count’ ); in the theme function.php and also bp-custom.php BUT it did nothing.

    I tried a few other suggestions e.g one that did make the last activity of all users registered to be a certain time, however this made all the Members look as they are logged in. Is there any code I can insert in function.php that will show the members registered and not just the active ones?

    Cheers.

    Link to my test site:

    BP 2.6.11
    WP 4.5.3

    #256817
    buddycore
    Participant

    If you look at wp-content/plugins/buddypress/bp-templates/bp-legacy/buddypress/activity/index.php That’s the template you need to edit in order to change that text.

    Inside wp-content/themes/your-theme/ Make a file called buddypress.php. In that file add the following…

    <?php get_header(); ?>
    <?php the_post(); the_content(); ?>
    <?php get_footer(); ?>

    By default BuddyPress will use a file located in your theme that currently exists, something like page.php as you can read about here.

    By creating a buddypress.php we’re telling BuddyPress to use a custom template loader for all BuddyPress pages and components. Inside that file (buddypress.php) you can do anything you like for the “wrapper” around your BuddyPress stuff. In the code example above for buddypress.php we’re grabbing the content but not bringing in things like <?php the_title(); ?> like you will find in a typical page.php that most WordPress themes will have.

    This will remove ALL page titles from BuddyPress pages, as you now have a custom “wrapper” for those areas the plugin will use.

    If you wish to remove the title on a per page basis you may simply want to do a CSS solution and do target the body tag with CSS and then any suitable elements in the HTML. This means you could do something like…

    body.activity.directory div.page-inner h2 { display: none; }

    If you don’t want to do a CSS solution you can then look into component detection.

    Hope that helps.

    #256721
    shanehidir
    Participant

    Hi, I’m using WordPress 4.5.3–en_GB, with BuddyPress version 2.6.1.1, running on a Customizr child theme.

    I wish to apologise if my following details are too long winded, I wish to include as much details as possible.

    I have included a link in my side menu to view site activity.

    Site-Wide Activity

    It displays all recent site activity. New members, new group creations, new media uploaded, comments on photos etc.. All is displayed well except for the comment on photo part in the activity list.

    When user posts an ‘update’ / photo in group, the thumbnail is there on the activity page, and when clicked it displays lightbox feature along with photo details and comments on the right. But when user has commented on the photo, the update displayed in the activity page is correct (user has commented on a Photo in the group xxx, but upon clicking the link, it shows only lots of words.

    This is the link to the many words displayed instead of the same lightbox effect as stated above.
    http://vacahost.info/groups/sg-24hr-halal-foodfinders/media/7/
    Message displayed: Dedicated to shift workers that have to source for food in the wee hours of the night or morning. Group Admins HomeMembers 2Send InvitesMedia 4Manage All4Albums1Photos4Videos0Music0 20160616_232320 EditDelete Like Comment 0 people like this AyraAdelia 12 July 2016 Selling […]

    Once again, apologies for the detailed description.

    Kindly help me, did I enable or disable something by mistake?

    Regards,
    shanehidir

    #256620
    Ben Riga
    Participant

    Dan,

    I spent some time on this and have figured out the loop that will give me the activity entries I need. I’m trying to add the list of activities on the same page I display the Beer custom post type. So show the beer info at the top and the list of related activities below it. I’m doing that on a theme page and would need to call the activity/entry.php for each of the entries. Is there a way to do that or would I need to copy the code from there?

    The query will look something like this:

    $args = array(
    	'post_type' => 'check_in',
    	'posts_per_page' => '-1',
    	'post_status' => array(
    		'publish',
    	),
    	'meta_key' => 'check_in_details_beer-id',
    	'meta_value' => $current_post
    
    );
    
    // run the query
    $query_checkins = new WP_query ( $args );
    
    // check the query returns posts
    if ( $query_checkins->have_posts() ) :
    
    	while ( $query_checkins->have_posts() ) : $query_checkins->the_post();
    
    		$ci_postid = get_the_ID(); 
    
    		if ( bp_has_activities( bp_ajax_querystring( 'activity' )  . '&secondary_id='. $ci_postid ) ) : 
    

    Thanks for the help and support,
    Ben

    Jeremy Pry
    Participant

    Under certain circumstances, there is an infinite loop inside the bp_legacy_theme_new_activity_comment() function. Specifically, when all of the secondary_item_id fields are zero, the $parent_id will continually be set to zero. An infinite loop ensues and eventually the script will time out. This causes new activity items to not display until the page is refreshed, as mentioned here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/.

    This error happens when attempting to add a comment to a group post. I believe this is a similar problem as the one expressed here: https://buddypress.org/support/topic/activity-comments-post-blank-until-refresh/

    For information:

    • WordPress 4.5.3
    • BuddyPress 2.6.1.1
    • Single site install in web root
    • There are indeed other plugins activated on this site. The full list is below. This site is for a client, and I’m unsure of which plugins can be safely deactivated to test.
    • We’re using a customized theme, but I have tested with the TwentySixteen theme and found the same results.
    • The core BuddyPress files have not been modified to my knowledge.
    • The site is hosted on Page.ly, but I can reproduce the problems in a local VVV install
    • The live site is http://www.lifeofdad.com/

    I believe that this may be a problem inside BuddyPress itself, as the function with the infinite loop is part of BuddyPress. The Javascript that makes the Ajax request is part of the BuddyPress Wall plugin, but from what I can tell the problem is in the aforementioned bp_legacy_theme_new_activity_comment() function.

    My specific concern is this loop:

    
    	// Load the new activity item into the $activities_template global.
    	bp_has_activities( 'display_comments=stream&hide_spam=false&show_hidden=true&include=' . $comment_id );
    
    	// Swap the current comment with the activity item we just loaded.
    	if ( isset( $activities_template->activities[0] ) ) {
    		$activities_template->activity = new stdClass();
    		$activities_template->activity->id              = $activities_template->activities[0]->item_id;
    		$activities_template->activity->current_comment = $activities_template->activities[0];
    
    		// Because the whole tree has not been loaded, we manually
    		// determine depth.
    		$depth = 1;
    		$parent_id = (int) $activities_template->activities[0]->secondary_item_id;
    		while ( $parent_id !== (int) $activities_template->activities[0]->item_id ) {
    			$depth++;
    			$p_obj = new BP_Activity_Activity( $parent_id );
    			$parent_id = (int) $p_obj->secondary_item_id;
    		}
    		$activities_template->activity->current_comment->depth = $depth;
    	}
    

    I’ve run XDebug locally to inspect the items in the loop as it is running. If some of the raw variable data is required, I can provide that.

    I have tried making some changes to the code in this loop to prevent the infinite loop from occurring. While successful in that endeavor with a few tweaks, the result is that the comment sent back through the Ajax response is the wrong comment, and a page refresh is still needed.

    I considered filing a bug in Trac, but I wasn’t certain whether something else could possibly be interfering.

    
    +--------------------------------------+--------+-----------+---------+
    | name                                 | status | update    | version |
    +--------------------------------------+--------+-----------+---------+
    | akismet                              | active | none      | 3.1.11  |
    | all-in-one-seo-pack                  | active | available | 2.3.7   |
    | appbuddy                             | active | available | 2.0.7   |
    | appcamera                            | active | available | 2.0.0   |
    | appfbconnect                         | active | none      | 2.3.0   |
    | apppresser                           | active | none      | 2.5.0   |
    | apppush                              | active | available | 2.1.0   |
    | appshare                             | active | none      | 2.1.0   |
    | appswiper                            | active | available | 2.2.1   |
    | bp-profile-search                    | active | none      | 4.5.2   |
    | buddypress                           | active | none      | 2.6.1.1 |
    | buddypress-activity-plus             | active | none      | 1.6.4   |
    | bp-moderation                        | active | none      | 0.1.7   |
    | buddypress-nocaptcha-register-box    | active | none      | 1.1.3   |
    | buddypress-toolbar                   | active | none      | 1.6.0   |
    | buddypress-wall                      | active | none      | 0.9.4   |
    | buddypress-xprofile-image-field      | active | none      | 2.0.1   |
    | category-posts                       | active | none      | 4.6.1   |
    | contact-form-7                       | active | none      | 4.4.2   |
    | contact-form-7-to-database-extension | active | none      | 2.10.20 |
    | cubell-themes-functionality          | active | none      | 3.1     |
    | envato-wordpress-toolkit             | active | none      | 1.7.3   |
    | hashbuddy                            | active | none      | 1.5.2   |
    | login-with-ajax                      | active | none      | 3.1.6   |
    | mailchimp-for-wp                     | active | none      | 3.1.11  |
    | nav-menu-roles                       | active | none      | 1.8.2   |
    | nextend-facebook-connect             | active | none      | 1.5.9   |
    | buddypress-media                     | active | none      | 4.0.4   |
    | vine-embed                           | active | none      | 0.2     |
    | wds-lod-automatic-friends            | active | none      | 0.1.0   |
    | wds-lod-base                         | active | none      | 0.1.0   |
    | wds-lod-bp                           | active | none      | 0.1.0   |
    | wds-lod-post-types                   | active | none      | 0.1.0   |
    | wds-lod-widgets                      | active | none      | 0.1.0   |
    | wordpress-importer                   | active | none      | 0.6.1   |
    +--------------------------------------+--------+-----------+---------+
    
    #256490
    danbp
    Participant

    The Home tab is the default one. If you remove that tab, BP has no way to know where to output the other group tabs content. If you remove Home(aka activity) you should define another landing tab.

    But when you want to modify groups, you shouldn’t define ‘profile’, but ‘groups’. (read what you wrote!)
    For the profile landing tab, see this codex page.

    For groups, you can try this snippet. This let you define a different landing tab for each of your groups (not profile, ok ?). 😉

    function bpfr_custom_group_default_tab($default_tab){
    	/**
    	 * class_exists() is recommanded to avoid problems during updates 
    	 * or when Groups Component is deactivated
    	 */
    	if ( class_exists( 'BP_Group_Extension' ) ) : // 
    	
    	$group=groups_get_current_group();//get the current group
    	
    	if(empty($group))
    	return $default_tab;
    	
    	switch($group->slug){
    		
    		case 'kill-bill': // group name (use slug format)
    		$default_tab='forum';
    		break;
    		
    		case 'groupe-2014':
    		$default_tab='members';
    		break;
    		
    		default:		
    		$default_tab='home';// the original default landing tab
    		break;
    		
    	}
    	
    	return $default_tab;
    	
    	endif; // end if ( class_exists( 'BP_Group_Extension' ) )
    }
    add_filter('bp_groups_default_extension','bpfr_custom_group_default_tab');
    #256408
    mgenjoker
    Participant

    Wordpress: 4.5.3
    Buddypress: 2.6.1.1
    Theme: Child of Twentyfourteen
    Site: http://social.tgdgaming.com/activity/ (to get you past the login)

    Plugins:
    Bowe Codes
    Buddypress Activity Plus
    Buddypress Friend of a Friend (FOAF)
    BuddyPress Groups Extras
    BuddyPress Profile Shortcodes —-(Has a bad profile link as well, {site.com/members/user//} has //)
    Custom Admin Footer Text
    Custom Menu Wizard
    iFlyChat ————– (Stopped working around the same time as the other issues)
    jonradio Multiple Themes
    Menu Icons
    Mutual Buddies
    Peter’s Login Redirect
    Scrollbar
    WYSIWYG Widgets / Widget Blocks

    Problem Pages:
    Profile Edit: site.com/members/user/profile/edit/
    Profile Activity: site.com/members/user/activity/ (on profile view site.com/members/user/ —works)
    Group Manage: site.com/groups/group/admin/

    More Info:
    I believe the issues started when I was screwing around trying to add a extra sidebar. I did try to add one manually and with plugins (that may have been the cause). Trying to go to these links gives a white screen with nothing loaded in when inspecting with chrome.

    Troubleshooting:
    Disabling plugins one by one.
    Disabling all non-essential plugins (all but buddypress and jonradio Multiple Themes).
    Re-installing the Base Theme.
    Re-installing Buddypress.
    Overwriting WordPress with Fresh files.

    Any help is greatly appreciated. I can try to get anymore info you need
    Ps. Please excuse the bad styling had a bad upload with a style.css that overwrote the main theme with another theme and it’s being reworked with better css practices.

    #256157
    jaaahaaa
    Participant

    Hi,

    I’m running a plugin called ignitiondeck for wordpress. This plugin creates a custom post type for projects called ‘ignition_product’. These pages allow for comments, but I can’t get buddypress to track mentions in these comments.

    Site tracking is on and comment notifications works for my page comments. I’ve tried using in my functions.php but it doesn’t help.

    add_filter ( ‘bp_blogs_record_post_post_types’, ‘activity_publish_custom_post_types’,1,1 );
    function activity_publish_custom_post_types( $post_types ) {
    $post_types[] = ‘ignition_product’;
    return $post_types;
    }

    Running 2.6.1.1

    #256029
    sharmavishal
    Participant

    dont think there is a ready plugin for this..there is a plugin by imath which offers sticky activity …but that has to be done manually by the admin…maybe in future we can have custom activity pages like groups/members have right now

    #255676
    danbp
    Participant

    Hi,

    tested the theme – Load More is working on all activity pages. Unable to reproduce.

    Deactivate all plugins except BP.
    If you use custom functions (in child or bp-custom), remove them and test again.

    Check also your custom CSS. Sometimes, renaming an element make JS unable to find the load more button.

    #255581

    In reply to: Buddypress

    kizzpatrick
    Participant

    Thank Sharmavishal,

    I would like to provide the dashboard or a private page for the group where only users of that group will be able to download the package, it’s not digital download it is just a zipped folder they will have to download.

    the problem with BuddyPress is that when you create a private group, they can be seen by other users who aren’t in the group even though they can’t view their information but due to competition purpose I don’t want to allow other members to see all the groups. I want only members who are in that group to be able to see their group and I would like to allow the group administrator to add users on the front page, not by invitation. I would also like to remove that site activity panel because I don’t want to appear like a social network and I don’t want to allow comment.

    is there a plugin or a way to customize BuddyPress to meet with this requirement
    Thanks

    ashikai
    Participant

    I’ve been attempting to customize the feed item generated for my custom post type on my buddypress/multisite installation. I’m really just trying to change the default text.

    I’ve found what SHOULD be the correct code and I’ve set it up for my site, but… the changes never take. I’m not caching anything so that’s one potential complication excluded.

    This is my current code (placed in bp_custom.php in my /plugins folder) :

    add_post_type_support( 'webcomic', 'buddypress-activity' );
    
    function customize_webcomic_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( 'webcomic', array(
            'component_id'             => buddypress()->blogs->id,
            'action_id'                => 'new_webcomic_update',
            'bp_activity_admin_filter' => __( 'Updated the Comic', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Webcomic', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'activity_comment'         => true,
            'bp_activity_new_post'     => __( '%1$s posted a new <a href="%2$s">comic page</a>', 'custom-textdomain' ),
            'bp_activity_new_post_ms'  => __( '%1$s posted a new <a href="%2$s">comic page</a>, on the site %3$s', 'custom-textdomain' ),
            'position'                 => 100,
        ) );
    }
    add_action( 'bp_init', 'customize_webcomic_tracking_args' );

    So the custom post type “webcomic” is generated via a plugin (called Webcomic), it’s not something I’m registering in my functions.php file. I’ve tried every “fix” I can find, and none of the changes can make this code stick! (this includes changing bp_init to just init).

    I’m running buddypress 2.6. I would really appreciate it if someone could help me troubleshoot this. Even just confirming that the above code is correct would be a big help!

    Thank you very much!

    #255401
    knownocode
    Participant

    Hi, I am working with this code I found to show a CPT of fb_url_submit links. It works great but I would like to add other CPT’s to display in the same way on the Buddypress activity feeds, but with a different link of course.

    When I try it says I cannot duplicate one of the CPT activity actions, and I am not a coder, so could someone please help me figure how to add the CPT’s of “news” and “images” while also showing them in the activity stream, and able to change the link that is displayed?

    Thank you in advance!


    <?php
    function inspired_record_more_types( $types ) {
    $types[] = 'fb_url_submit';
    return $types;
    }
    add_filter( 'bp_blogs_record_post_post_types', 'inspired_record_more_types');
    ?>

    <?php
    add_filter('bp_blogs_activity_new_post_action', 'record_cpt_activity_action', 1, 3);
    function record_cpt_activity_action( $activity_action, $post, $post_permalink ) {
    global $bp;
    if( $post->post_type == 'fb_url_submit' ) {
    if ( is_multisite() )
    $activity_action = sprintf( __( '%1$s added a new Facebook Page', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '', '' . get_blog_option( $blog_id, 'blogname' ) . '' );

    else
    $activity_action = sprintf( __( '%1$s added a new Facebook Page', 'buddypress' ), bp_core_get_userlink( (int) $post->post_author ), '' . $post->post_title . '' );

    }

    return $activity_action;
    }

    #255336
    danbp
    Participant

    @daltontastic,

    color buttons are TinyMCE tools and not html tags. The only way to get them would be to use the editor toolbar.

    Here a scenario you could use:
    – create a child-theme and add post-form.php to it (copy from bp-templates/bp-legacy/buddyPress/activity/post-form.php).
    Result: your-child-theme/buddypress/activity/post-form.php

    In that file, go to line:40 where textarea start.
    Inser this action hook:

    <?php if ( bp_is_groups_component() ) : ?>
    	<?php do_action( 'blablabla' ); ?>
    <?php endif ?>

    Then add this <?php if ( ! bp_is_groups_component() ) : ?>
    <textarea class="bp-suggestions"......bla...bla...</textarea>
    and add <?php endif ?> after the textarea closing tag.

    This contionnals will show a custom area for the desired group and prevent update area to appear on all other groups home pages.

    So if a user is member of different groups, he will get a texteditor for group_id 13 and the normal update area on all others.

    The custom template is ready. Now the fonctions we need.

    Open bp-custom.php (or create it) and paste in those snippets.

    Adding the texteditor:

    function bpfr_whats_new_tiny_editor() {
    	// deactivation of the visual tab, so user can't play with style tools
    //add_filter ( 'user_can_richedit' , create_function ( '$a' , 'return false;' ) , 50 );
    
    $content = "";
    
    	// building the what's new textarea
    	if ( isset( $_GET['r'] ) ) :
    	$content = esc_textarea( $_GET['r'] ); 
    	endif;
    
    	// adding tinymce tools
    	$editor_id = 'whats-new';
    
    	$settings = array( 
    			'textarea_name' => 'whats-new', 
    			'teeny' => false, 
    			'media_buttons' => true, 
    			'drag_drop_upload' => true, 
    			'quicktags' => array(
    			'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close'
    		));	 
    	
    	// get the editor	
    	wp_editor( $content, $editor_id, $settings );
    }
    add_action( 'whats_new_textarea', 'bpfr_whats_new_tiny_editor' );

    A simple function who add the original textarea for users who are group members, but not allowed to rich edit.

    function my_textarea() { ?>
    			<textarea class="bp-suggestions" name="whats-new" id="whats-new" cols="50" rows="10"
    				<?php if ( bp_is_group() ) : ?>data-suggestions-group-id="<?php echo esc_attr( (int) bp_get_current_group_id() ); ?>" <?php endif; ?>
    			><?php if ( isset( $_GET['r'] ) ) : ?>@<?php echo esc_textarea( $_GET['r'] ); ?> <?php endif; ?></textarea>
    <?php
    }

    And the last one, where you set up the group allowed to publish updates using edit tools.

    function trotro() {
    
    if ( bp_is_groups_component() ) :
    
    $check = groups_is_user_member( bp_loggedin_user_id(), bp_get_group_id() );
    $check_group = bp_get_group_id(); 
    
    	if ($check != 0 && $check_group == 21 && 'leon' == bp_current_item() ){
    		echo 'Wow! You can rich edit in this group.';
    			bpfr_whats_new_tiny_editor();
    	} else {
    		echo 'Sorry, you cannot rich edit in this group';
    		my_textarea();
    	}
    
    endif;
    }
    add_action( 'blablabla', 'trotro' );

    Now, any member which is part of the group leon, group id 23 can publish updates and use the color picker and all other things which are on the edit bar.

    Only thing you have to do is to adjust leon and id to your rules.

    Successfully tested on 2.6 and 2016.

    May this help you to go further with your BuddyPress project. 🙂

    Andrew
    Participant

    I just found out there was a parameter called ‘since’ to use with the activity loop to get activities since a certain date and time.

    ‘since’ => // Y-m-d H:i:s

    Just looking for some quick help with this time function I created. I’m not great with code and don’t understand the workings of how WordPress/Buddypress works with the date and time, but I wanted to create a function that converts ‘hours ago’ into the Y-m-d H:i:s format so it can be used with the ‘since’ parameter.

    function get_time_since( $hours_ago='' ) { 
    
    	// Local date and time right now
    	$current_date = date('Y-m-d H:i:s');
    	
    	// convert 'hours ago' to 'Y-m-d H:i:s'
    	$date = date_create($current_date);
    	date_sub($date, date_interval_create_from_date_string($hours_ago));
    	
    	return date_format($date, 'Y-m-d H:i:s');
    }
    // example use
    // display posts in the last 6 hours
    	function my_filter_activity( $loop ) { 
    
    		if ( is_page( 'custom-page' )) {
    			$loop['since'] = get_time_since( '6 hours' );
    		}
    
    		return $loop;
    	}
    	add_filter( 'bp_after_has_activity_parse_args', 'my_filter_activity' );

    This works correctly where I am. The only thing I’m confused about is I don’t know if I have to detect a user’s time zone in the function for it to work correctly?

    #254834
    bradturvey01
    Participant

    Hi, is anyone able to help me? i need a custom background where comments are distinguished from the standard background. At the moment my page has the one color for the background and there is no border for the where activity and comments go. I have no idea how to insert css so am hopeful on a plugin?
    smartphone classifieds/com/au

    Ben Riga
    Participant

    I’m trying to build a page to show a filtered activity stream but am completely unsure how to approach the problem. I’ve built my solution using CPTs and would like to be able to query based on custom meta box info in the CPTs.

    For example, my CPTs include Beer and Check-In. So a user could “check-in” and mention which Beer they are drinking. The check-ins are recorded as activities and these display just fine in the activity stream (“Ben is drinking Molson Export Ale and rated it a 5”). Now I’d like to build a page that shows information about a Beer and the list of check-in activities for that particular Beer.

    I think I know how to query the CPTs to get the info I want but don’t want to have to duplicate the BP functions. Ideally I’d like to filter the activity stream based on the info from the CPT custom meta info but I haven’t found a way to do that.

    Have any of you seen something like that? Or could you provide an educated guess of where I might look for more info?

    Any help or support would be greatly appreciated as I am stumped.

    Thanks,
    Ben

    #254221
    ineedyou
    Participant

    Dear @danbp

    Maybe i should explain more detail. And what i want to do…I really must solve this future of my project 🙂 Sorry long sentences really sorry

    BP update via what’s new form and add embed is working. No problem.
    Our members can create new post (food) with toolset types on frontend. They can add image or video or custom fields. when anyone visit abc.com/foodarchive and click food 1 and open new window and Ok can see everything. At the moment, this published new post displaying on buddypress activity (also can added filter with bp-custom.php)… Buddypress activity display all kind food post body such as if there is only text show text, if there are text+image, ok BP activity show this also… At the moment, if only text and no image but author add featured image, well BP also show text+this featured image on activity stream… But never show video on activity stream if its in post body…

    I dont undestand (because i am copypaste coode user) how can BP update via add form can show embed video but not display video from custom post embed? No way to solve this?

    Why? Because my member want to see video on activity stream before visit this post. BP just show MRx Published new Food..

    If i use Visual composer (extension add on pluging) features add youtube video to post, yes this is showing embed video on buddypress activity.But this is problem because when anyone click bp show filter and turn back another filter (comment to post, or post to updates or group updates), visual composer short codes broken and display like this [vc]textblock[vc]. If refresh page, yes eveything normal, so my theme remove shortcodes from visual composer.

    Thanks for giving your time…

    #254111
    ineedyou
    Participant

    Hi,

    I am just copypaste code user – just simple user and need someone to help me. Please. I found below code, i am adding to bp-custom its working. But i need to extend this code, if i want to add second or more custom post type, how will i do? I read lots of article , try to solve 2 days but i cant. Try it 100 different version but no no no….Can anyone can show me how to add moe than one… Thanks and sorry my bad English..

    
    <?php
    add_post_type_support( ‘book’, ‘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( ‘book’, array(
            ‘component_id’             => ‘activity’,
            ‘action_id’                => ‘new_book’,
            ‘bp_activity_admin_filter’ => __( ‘My Book’, ‘custom-domain’ ),
            ‘bp_activity_front_filter’ => __( ‘Book’, ‘custom-domain’ ),
            ‘contexts’                 => array( ‘activity’, ‘member’ ),
            ‘bp_activity_new_post’     => __( ‘%1$s published <a href="”%2$s”">Book Suggest</a>’, ‘custom-textdomain’ ),
    
            ‘bp_activity_new_post_ms’  => __( ‘%1$s published <a href="”%2$s”">Book</a>, on the site %3$s’, ‘custom-textdomain’ ),
    ‘comment_action_id’                 => ‘new_book_comment’,
            ‘bp_activity_comments_admin_filter’ => __( ‘Commented Book’, ‘custom-textdomain’ ),
            ‘bp_activity_comments_front_filter’ => __( ‘Book Comments’, ‘custom-textdomain’ ),
            ‘bp_activity_new_comment’           => __( ‘%1$s commented on the <a href="”%2$s”">Book</a>’, ‘custom-textdomain’ ),
            ‘bp_activity_new_comment_ms’        => __( ‘%1$s commented on the <a href="”%2$s”">Book</a>, on the site %3$s’, ‘custom-textdomain’ ),
            ‘position’                          => 100,
           ) );
    }
    add_action( ‘init’, ‘customize_page_tracking_args’, 1000 );
     ?>
    #254042
    sharmavishal
    Participant

    How did you install buddupress? This is a custom theme right? You see activity page in your pages? In settings-buddypress have you activated activity component? Have you associated your activity page in the pages setting of buddypress?

    #254020
    ineedyou
    Participant

    Sorry for my english…
    I can show everything about Music CPT buddypress activity (site-wide and members activity) with below code by @imath -also thanks for all other plugings 🙂 –

    My Question or Problem.

    I am using types tools pluging and i have a – frontend – add new music form (about music CPT) and members use this form to add new music with different fields. Also using rich editor and can add media from URL… Buddypress activity stream can show this form body (actually show post body normally). If i add also image from URL to this frontend music CPT form, we can see this image also on buddypress activity. Well i love buddypress.. Flexiable, great..

    1 – But if i add video URL on this form do not show embed video on activity stream. I mean that, i tried 100 times frontend or backend, embed video (if use in any CPT) do not show on buddypress. When i click this activty open page and i can see video. I know missing something.

    2 – If my author create any music CPT –backend admin side– with Visual Composer, there 3 different actions.

    Action:1 – First, Buddypress activty show all font color or image, or texts created by visual composer. Its ok. Love buddypress. But when i select (site-wide or members activty) show post, friendship or comment than turn to everything or music cpt, buddypress now do not display this music CPT, so i must refresh the page. I mean that when a user select everything to post (or comment) or commet to everything: page must otomatically refresh to display my visual composer codes. If i dont refresh the page, activiy stream show like that [vc_row][vc_column][vc_text][/vc_column][/vc_row].

    Action 2: When i edit this CPT -backend and created by VC-, buddypress sometimes dont load any activity.. If i delete this post from again backend, everything is ok, all activity is coming back. I dont know how try search this on forum.

    Action 3: I am on backend admin and creating a new music CPT without visual composer.. No problem, all edit can show on buddypress again. Such as i shared music 3 hours ago but now editing. I can see this new edit when i scroll actvity page 3 hours ago… BUT, What i want, buddypress activtiy can create a new music post (for this edit) and can say “edited music” … Maybe we can put icon or color original (3 hours ago) cpt, also same time can create clone music for same cpt 🙂 on activity stream… I dont know how to search this 🙂

    Long sentences long, i know 🙂 … Maybe someone help me… Becuase i am not developer just copypaste code user 🙂

    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' => __( 'My Music', 'custom-domain' ),
            'bp_activity_front_filter' => __( 'Music', 'custom-domain' ),
            'contexts'                 => array( 'activity', 'member' ),
            'bp_activity_new_post'     => __( '%1$s published <a href="%2$s">Music Suggest</a>', 'xxx' ),
            'bp_activity_new_post_ms'  => __( '%1$s published <a href="%2$s">Musik/a>, on the site %3$s', 'xxx' ),
                   
           
        ) );
    }
    add_action( 'init', 'customize_page_tracking_args', 1000 );
    #253811
    shanebp
    Moderator

    You’ll probably want to create a new page and then load a custom template.

    In your custom template, you’ll need to create an Activity loop with the parameters that you want.

    Sounds like this is your first time performing these tasks.
    Give it a serious and thorough attempt and see how far you can get.
    If you get stuck, use gist or pastebin to share the code in your custom template.

    Please do not paste all the code on these forums.

Viewing 25 results - 251 through 275 (of 838 total)
Skip to toolbar