Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 1,713 total)
  • Profile photo of danbp
    danbp
    Moderator

    @danbp

    Well done. Glad you it by yourself.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    BP use wp_safe_redirect.
    See documentation in bp-core-functions.php:830

    or use

    https://github.com/pixeljar/BuddyPress-Honeypot

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Glad you got it !
    And feel free to edit the codex page and add your experience and how-to story.

    https://codex.buddypress.org/participate-and-contribute/

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    This is a cookie issue. Question is “who disabled this?”.

    The BP code is:
    $bp->groups->completed_create_steps = json_decode( base64_decode( stripslashes( $_COOKIE['bp_completed_create_steps'] ) ) );

    Or you have a browser setting, or a cache rule, or some other security rule somewhere.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Activate wp_debug in wp-config and do a test with Twenty Twelve, Thirteen or Fifteen theme.
    Deactivate all plugins except BP and bbPress.

    Then report given errors here (without server path details if possible – just begin of error message and file name ).

    Other issues with same theme: https://buddypress.org/support/search/onecommunity+theme/

    OMG, lost in the forest… wouh hou !

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    @azedinos

    why do you use the trunk version ? Use the stable version, when you start with BuddyPress.

    Album doesn’t exist in BuddyPress.
    For the button issue, maybe you have a problem with your theme ?

    Please give more details after reading here.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Have you setup a page for groups ?
    Have you setup pretty permalinks ?

    https://codex.buddypress.org/getting-started/configure-components/

    Edit: modifed your topic title to something more accurant as Creating group doesnt work. Because it definetly works. ;-)

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    - keep in mind that I’m not doing a full on translation, just this BuddyPress translation to change Friends to Connections.

    you put only those strings into your custom po. If the concerned string is on a template file, you can also hardcode it there, and use a template overload to get in from your child-theme in that case. So you haven’t to struggle with poEdit. In this case also, you have to take care of the details given by @shanebp.

    - does the language define statement in wp-config.php need to be set for this to work?

    This is no more used since WP 4.0. You can remove it.

    - buddypress-en_US.po and buddpress-en_US.mo files need to be in which folder?

    /wp-content/languages/plugins/ (the po file is not used by gettext, it’s only a human readable work file – you can store it elsewhere if you want. You just have to remind where in that case ;-) ).

    if you put it in /language/ (of course you can), you will see buddypress-en_US as a language setting. Which is of course not the site language.

    But in any case, keep a copy of your work in a safe place outside of WP.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Shouldn’t a User promoted to Group Moderator be able to moderate content in that Group, regardless of their WP Role and capabilities?

    Sounds logic, but No. See documentation in bp-core/bp-core-caps.php for the “why”. ;-)

    Since BP 1.6, group moderators can only delete, move, spam group forum content.

    External reference.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Have you tried to use the shortcode plugin i mentionned previously ?

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    @prometheus-fire,

    this is obvious, but unfortunately despite your details, difficult to help out, because you don’t tell which code is concerned… or what you used to do your change. ;-)

    Generally, when it doesn’t translate, it’s because a typo error. A custom function, a theme using outdated strings and a lot of little details like missing dots, comas or percent sign.

    Here some tricky examples which can produce a missing translation.
    Original code looks like this:

    %d friends
    
    Activity feed for %s's friends.
    
    Friends <span class=\"%s\">%s</span>

    If %d is typed %s, or if the end point after friends is missing or you forgot to anti-slash or a double cote in the html, gettext mismatch the source and the translation and doesn’t execute it.

    First thing to do in your situation, is to compare what is in your po file to what is in the BP code. Assuming BP code is the master, and always right. Po can be wrong: old version, manually modified, corrupted. Po must in any case be saved as text format in utf8 without BOM. This is invisible, but a real source of issues, specially when anything seems the same and desperatly stays untranslated/unmodified.

    To do this, open the po in a text editor. Search for the string, check the file position given above the string, and read carefully and triple check, that the original BP code and the string in the po are strictly identic.

    If nothing found, ensure there is no custom function somwhere, or a theme playing around the buddybar or subnav.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    WordPress is automatically shipped in your language, under condition you tell him which one you want in wp general settings. Once language is set, and saved, it’s ok. WP themes and some of official WP plugins (akismet, bbpress, buddypress…) follow the same way.

    If you engage on your own arabic version, i would recommand that you don’t use this plugin. PoEdit is a very good and powerfull tool for translation, and not at least, WP friendly.

    The pot file shipped with each BP version is a string catalog. A kind of used terms dictionnary.
    The po file looks similar, but with a big difference: the header informations. You need them when you translate from scratch or from a catalog. Both are in plain text format, utf8 without BOM. You can read them with a text editor like Notepad++.

    On the site, php getext tool uses only the compiled .mo. To avoid loosing your work, it’s a good practice to upload also the po. But it’s not necessary.

    GlotPress is an online community translation tool. This software has his own way to work, and a bit diffrently from Code Styling or PoEdit. The problem of the files which are proposed (no matter the language), is that if nobody provides some translation, you’ll never have a complete translation. And because of his own technical rules, when you use the po provided on GlotPress, you have a slightly technical different file when you use it with another software.

    It’s not a big problem if you use that original file to modify one or two strings, but it becames to headache if you want to modify/transform a whole catalog. Not because of missing strings, but because you haven’t the keywords in the header.

    I did try to put the ar.mo file in the location you specified (with this name – buddypress-ar.mo – is that correct?)

    Yes, it is !
    And yes, you can start from the already work avaible on GlotPress. 33% to translate, it wouldn’t be too long.

    I’m not aware of arabic specifics about translation, so i’m not the best to help on this. If you encounter difficulties, try to get directly in touch with the arabic translation team. And once you completed your BP translation, you can send them a copy so they can upload it to GlotPress. And perhaps a good way for you to contribute to BuddyPress. ;-)

    i couldn’t imagine i will waste so much time on this issue /:

    You couldn’t imagine how many times i explained around such kind of issues on this forum. ;-)

    Search for “translation” or “language” or “translation doesn’t work”…

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Salam @daniezz,

    is wordpress set to arabic ?
    Which translation tool do you use ?
    As of glotpress information, BuddyPress Arabic version is only translated to 67%. Question now is, is the whole BP in english or only a part of it (generally non public part, such as dashbord).

    Are you sure you correctly generated your custom .mo file ? Did you used buddypress.pot (the file who contains all strings) to create a .po file, then translate it, and finally saved it as compiled .mo file ?
    I ask this, because If you worked from the po downloaded from glotpress, it could be that you get some header difference. This file must always be updated, or at least compared, with the latest buddypress.pot first. Specially if the version is uncomplete. And most important, you need the keywords, which are not in the glotpress version.

    Is the ar.mo file in the right directory ? (wp-content/languages/plugins/)

    Have you other plugins who aren’t translated or it is only BP who brings you trouble ?

    If you use PoEdit, copy/paste this into the header of your working copy of buddypress-ar.po,
    after the line Plural-Forms for example.

    "X-Poedit-KeywordsList: __;_e;__ngettext:1,2;_n:1,2;__ngettext_noop:1,2;"
    "_n_noop:1,2;_c,_nc:4c,1,2;_x:1,2c;_nx:4c,1,2;_nx_noop:4c,1,2;_ex:1,2c;"
    "esc_attr__;esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c\n"
    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi @jayd94,

    @ is hardcoded in the single member header template.
    Use this snippet to remove @ and username in one go.

    function bpfr_remove_mention_from_profile() {	
    	// hide the hardcoded @ sign and username
    	echo '<style> h2.user-nicename { display:none; } </style>';
    
    	if( bp_is_user() && ! bp_get_member_user_id() ) {
            $user_id = 'displayed: '. bp_displayed_user_id();
        } else {
            $user_id = 'get_member_user: '. bp_get_member_user_id();
        }
    
    	remove_filter( 'bp_get_displayed_user_mentionname', bp_activity_get_user_mentionname( bp_displayed_user_id() ) );
    	
    }
    add_filter( 'bp_get_displayed_user_mentionname', 'bpfr_remove_mention_from_profile' ); 
    Profile photo of danbp
    danbp
    Moderator

    @danbp

    If you want to customize a loop, you simply copy the original file from legacy to your child-theme.

    If you need a custom function to work on it, you add it to bp-custom.php or to your child-theme functions.php

    Guess there is nothing special to call around index.php. Generally it’s entry.php or activity-loop.php which are concerned to customize activities.

    That’s exactly the question why i told you to read carefully the codex first. ;-)

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    No worry. It’s just difficult to follow when a huge amount of snippets must be read to understand what each one does.

    I answered also to your other topic. Happy testing !

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    This question is related to bbPress.
    See bbp_title filter in wp-content/plugins/bbpress/includes/common/template.php:2519
    Similar technique is used by BuddyPress.
    See function bp_modify_page_title in bp-core-filsters.php:514

    Here a usage example to uppercase BP titles.

    function bpfr_profiles_wp_title( $title ='', $sep = '', $seplocation = '' ) {
    	if( bp_get_displayed_user_fullname() ) {
    	$bp = buddypress();
    	
    	// Get the component's ID to try and get it's name
    	$component_id = $component_name = bp_current_component();
    	
    	// Use the actual component name
    	if ( !empty( $bp->{$component_id}->name ) ) {
    	$component_name = $bp->{$component_id}->name;
    	
    	// Fall back on the component ID (probably same as current_component)
    } elseif ( !empty( $bp->{$component_id}->id ) ) {
    	$component_name = $bp->{$component_id}->id;
    	}
    	
    	$title = str_replace( ucwords( $component_name ), '', $title );
    	}  
    	return $title;
    	}
    add_filter( 'bp_modify_page_title', 'bpfr_profiles_wp_title', 20, 3 );
    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Loops are in templates.

    See bp-templates/bp-legacy/buddypress/

    And read carefully template hierarchy to understand how all this is working together.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    OMG !
    @urbanfix, you have warnings due to wrong geodirectory usage. Repair it !
    @mcuk please don’t hijack. Open your own topic as you’re not looking on exactly for the same thing.

    Try from this usage example.

    This code builds a tab, fetch an activity type content (here author post) and show it on a template part.

    function bpfr_post_profile_setup_nav() {
    	global $bp;
    	$parent_slug = 'extraposts';
    	$child_slug = 'posts_sub';	
    	
    	bp_core_new_nav_item( array(
    	'name' => __( 'Extra Posts' ),
    	'slug' => $parent_slug,
    	'screen_function' => 'bpfr_profile_post_screen',
    	'position' => 40,
    	'default_subnav_slug' => $child_slug 
    	) );
    	
    	//Add subnav item 	 
    	bp_core_new_subnav_item( array( 
    	'name' => __( 'Latest extras' ), 
    	'slug' => $child_slug, 
    	'parent_url' => $bp->loggedin_user->domain . $parent_slug.'/', 
    	'parent_slug' => $parent_slug, 
    	'screen_function' => 'bpfr_profile_post_screen'
    	) );
    }
    
    	function bpfr_profile_post_screen() {	
    		add_action( 'bp_template_content', 'bpfr_profile_post_screen_content' );
    		bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    	}
    
    	function bpfr_profile_post_screen_content() {
    		do_action( my_profile_post);
    	}
    
    add_action( 'bp_setup_nav', 'bpfr_post_profile_setup_nav' );
    
    function bpfr_get_stuff() {
    
       $activity_id = bp_activity_get_activity_id( array(
        'user_id' => $post->post_author,
        'type' => 'new_blog_post', // the activity type you want to show. See in activity table
        'component' => 'blogs',
        'item_id' => 1,
        'secondary_item_id' => $post->ID
       ) );
    	
    	if ( ! $activity_id ) {
    		return '';
    	}
    // this is the activity loop, with some options.
    	if ( bp_has_activities( $activity_id . '&action=activity_update&max=5' )  ) :
    		while ( bp_activities() ) : bp_the_activity();
    
    			bp_get_template_part( 'activity/entry');
    
    		endwhile;
    	endif;
    }
    
    add_action ( 'my_profile_post', 'bpfr_get_stuff' ); 

    Note that this is only an example and most probably the best way to do it.

    There is a little plugin which will be more handy eventually, which allows you to use shortcodes to get activities.

    If you add to plugin’s generate_activity_stream function these two lines

    $temp_post = get_post($post_id);
    $user_id = $temp_post->post_author;

    and change user_id in filtering to 'user_id' => $user_id, you’re able to get about anything for the given author, directly on the post page.

    May this help !

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    hi @urbanfix,

    please use the code button if you insert code or use an external service like pastebin or github and post the link to the snippet…

    What do you exactly try to built ?
    You first asked about page author’s activity, and now you want to create a tab.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi Christina @polkadotheart,

    have you tested with one of WP’s default theme ? If nothing change with theme, try to:

    – play with the display position, website before website name for example (use drag’n’drop in admin interface).

    – change the field visibility. Both website fields are required. Use same setting as for Location.

    So far, no other idea.

    Profile photo of danbp
    danbp
    Moderator

    @danbp

    Hi,

    to show only notices (aka updates) on the SWA, try this snippet (place in bp-custom.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' );

    Reference: https://codex.buddypress.org/developer/using-bp_parse_args-to-filter-buddypress-template-loops/

Viewing 25 replies - 1 through 25 (of 1,713 total)