Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 214 total)
  • Avatar of danbp
    danbp
    Participant

    @danbp

    $this->set_format( ‘/^\d{4}-\d{1,2}-\d{1,2} 00:00:00$/’, ‘replace’ ); // “Y-m-d 00:00:00″
    or for a general usage
    The date format is setable in wordpress admin for the whole site, including BP.
    Dashboard > General (/wp-admin/options-general.php)

    But you prefer perhaps to explain more precisely what YOU want to achieve instead of answering my stupid questions ? ;-)

    So, again:
    Which date do you mean on profile ? There is no date on a profile ! Only a field type called date(box) in the xprofile admin, which let’s you add a birthdate or something like this on profiles.

    Avatar of danbp
    danbp
    Participant

    @danbp

    I recently answered the same question on my french help forum a few days ago and provided a solution Code is commented in french. Hope for you that you understand php and french.

    If not, no worry ! Google translate works well and copy/pasting also so far i know.

    What the code does ?
    - remove admin’s activity from all activity screens
    - remove “admin” from members directory
    - remove “admin” from Friends lists (if exist)

    - remove “admin” from the friends bp core widget and create a new one who doesn’t call “admin”, in case you want to use this widget.
    You can use this last snippet as example for create it yourself if you use the 2 other core plugins (Who’s online and Recently Active Members)

    And last but not least, don’t use “admin” as username, specially if you don’t want it to appear.
    Don’t login to your site to produce a post or a relationship as “admin”. Editor is enough and keep the admin role, aka john doe, only for maintenance work.

    Avatar of danbp
    danbp
    Participant

    @danbp

    Avatar of danbp
    danbp
    Participant

    @danbp

    Weird !
    Try to add this to the ‘body’ CSS in your (child)theme style.css:

    padding-top: 0 !important; /* Remove the top padding space for the admin bar */

    Even if this solution has absolutely nothing to do with logged in users….

    Avatar of danbp
    danbp
    Participant

    @danbp

    Hi @noyzen,

    if you only updated BuddyPress, it’s possible that the translation file contains an error.

    Check your .po file for any strings looking like this one

    https://buddypress.trac.wordpress.org/browser/tags/2.0.1/bp-languages/buddypress.pot#L3464

    Example: Groups <span class=\"%s\">%s</span> or Members <span class=\"%s\">%s</span>
    If correctly translated, perhaps is something wrong in your theme or child theme or even a plugin.
    in this case, you should check the file indicated above the string to translate.
    %s is very important to stay in the translation and in the original file to get the count

    Avatar of danbp
    danbp
    Participant

    @danbp

    If you’re talking about the extended xprofile datebox field, the builder class BP_XProfile_Field_Type_Datebox of the xprofile datebox field is in bp-xprofiles-class.php:1459(bp 2.0.1)

    You can overwite this class with your own for reflecting your needs. The technique (add your own class to…) to use is explained on the Codex

    If you’re meaning another date, you have to be more precise !

    You’ll find also a global date setting in your wordpress admin.

    Avatar of danbp
    danbp
    Participant

    @danbp

    Load more use the Heartbeat API who refresh the activities each 5 minutes.
    In BP 2.0.1, if you search for heartbeat, the result is:

    Search “heartbeat” (57 hits in 6 files)
    bp-activity/bp-activity-filters.php (25 hits)
    bp-activity/bp-activity-functions.php (5 hits)
    bp-core/admin/bp-core-settings.php (6 hits)
    bp-core/bp-core-admin.php (4 hits)
    bp-core/bp-core-options.php (9 hits)
    bp-templates/bp-legacy/js/buddypress.js (8 hits)

    Read the code if you understand it and see what you can do.
    If not or if you estimate that it is a bug or needs an enhancement, open a ticket.

    Avatar of danbp
    danbp
    Participant

    @danbp

    It’s a bbpress question ! ;-)
    And it’s a bad idea, because users will have acces to your media library on the backend. So i warn you to use this option very carefully and allow only trusted users.

    You can use this plugin: https://wordpress.org/plugins/gd-bbpress-attachments/
    or code yourself by following this example.

    Avatar of danbp
    danbp
    Participant

    @danbp

    What is the name of your theme ?
    Do you use the same name for both picture ?
    Check eventully your theme option.

    Avatar of danbp
    danbp
    Participant

    @danbp

    Register is actually used at least in four different places, with 4 different context.
    Register page title, widget title, button name and some admin side registering action. So chaging this is not very easy for the moment.

    If you use the buddypress registration widget, the button code is near buddypress/bp-bp-core/bp-core-widgets.php:94

    If you use BP 2.0, and use custom translation, the .mo file can be put into wp-content/languages/plugins/buddypress.mo

    If you let the mo file in the usual translation folder (aka wp-content/languages/buddypress.mo & buddypress.po), your change will be lost if you have enabled automatic updates.

    Alex is partialy right to invite you to use the translation file to change “register”, but bp-languages never contain the translation, only the pot file (a workig file with the strings you can translate) for the current version.

    Be also aware that this folder will no more be used in 2.1.
    BuddyPress translation are now on Glotpress and avaible for automated updates, implemented in WordPress 3.8

    For any custom work, see above.

    Another way to handle this situation, is to force the translation. This is a workaround and should not be used for plenty strings, as it slows down the gettext request (and your server), but for one or two string it is ok.
    Add this to the theme functions.php or into bp-custom.php

    function bpfr_force_register_button_translation( $translated, $original_text, $domain ) {
    	
    		if ( 'buddypress' !== $domain )  
    		return $translated; 
    	
    	switch ( $original_text ) {
    		case '<a href="%s" title="Register for a new account">Register</a>':
    		return '<a href="%s" title="Register for a new account">ZOUBIDOU</a>';				
    		
    		// just add case for other strings
    		default:
    		return $translated;
    	}
    	
    }
    add_filter( 'gettext', 'bpfr_force_register_button_translation', 10, 3 );
    Avatar of danbp
    danbp
    Participant

    @danbp

    @ganzuelo

    scrolling down the member page provides a funny elastic effect ! ;-) Really cool, but not what you want of course.
    I disabled js on the browser and the effect disapeared immediatly.
    So i think there is a js conflict, probably with some of your theme’s script.
    check for the elements
    `<div class=”col span_3>
    <a>
    <img alt=”Foxtrot Tango” /> `

    You mention salient to be your theme but the source code indicates castle ? Did you rename it for a child theme usage ?
    Some script don’t support this…

    You use also a plugin to remove the admin bar.

    <!--Plugin Global Hide Admin Tool Bar 1.6.1 Build 2014-04-16 Active --->
    <!-- This website is patched against a big problem not solved from WordPress 3.3+ to date -->

    Huh ?

    Don’t know if the second comment belongs to that plugin, but if yes, WP is currently in 4.0 phase, so a 3.3 “problem” maybe solved.
    Google to find a simplier solution to remove the toolbar. There is also a easy and light solution in on the WP codex.

    add_filter('show_admin_bar', '__return_false'); in theme’s function or bp-custom.php would do the job on front-end !

    Don’t use a hammer to kill a fly ! ;-)

    Avatar of danbp
    danbp
    Participant

    @danbp

    Hi @offthepage,

    Put this into bp-custom.php or in your child theme functions.php
    This is only an example ! Don’t forget to change group names and tabs name to your needs.
    Just add/remove a case into the switch for each group you want to modify.

    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 (slug format)
    		$default_tab='forum';
    		break;
    		
    		case 'another-group':
    		$default_tab='members';
    		break;
    		
    		case 'group-test':
    		$default_tab='admin';
    		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');
    Avatar of danbp
    danbp
    Participant

    @danbp

    Avatar of danbp
    danbp
    Participant

    @danbp

    Avatar of danbp
    danbp
    Participant

    @danbp

    @jejemo

    try by adding this at the begin of your function
    $user_id = bp_get_activity_user_id();

    If you’re working on the Toolbar, the correct way to add a menu is like on this example:

    
    /* add links/menus to the admin bar*/
    /* more details here: http://wpengineer.com/2113/add-menus-to-the-admin-bar-of-wordpress/ */
    
    function mytheme_admin_bar_render() {
    global $wp_admin_bar;
    
    	$wp_admin_bar->add_menu( array(
    		'parent' => 'new-content', // use 'false' for a root menu, or pass the ID of the parent menu
    		'id' => 'new_media', // link ID, defaults to a sanitized title value
    		'title' => __('Media'), // link title
    		'href' => admin_url( 'media-new.php') // name of file
    		'meta' => false // array of any of the following options: array( 'html' => '', 'class' => '', 'onclick' => '', target => '', title => '' );
    		)
    	);
    }
    add_action( 'wp_before_admin_bar_render', 'mytheme_admin_bar_render' ); 

    A similar method is used to add a tab. Here on a user profile.

    function bpfr_my_setup_nav() {
        global $bp;
    	
    	$mytab=array(
    	'name'            => 'My Tab',
    	'link'      	  => 'http://example.com/wp-content/themes/twentythirteen/my_extra_page.php',
    	'slug'         	  => 'my-tab',
    	'css_id'          => 'my_custom_tab',
    	'position'        => 100,
    	'user_has_access' => 1,
        'screen_function' => 'xprofile_screen_my_tab'
    	);
    	$bp->bp_options_nav['profile']['my-tab']=$mytab; 	
    }
    add_action('bp_setup_nav', 'bpfr_my_setup_nav');
    Avatar of danbp
    danbp
    Participant

    @danbp

    @flickchicks,

    this is not a BP support, it’s a WP and theming domain.

    1) no !
    2) depends of the number of books and their type
    3) this is default behavior when WP insert a picture into a post
    4) a conditionnal should be added to the page or the post content. WP question anyway.

    FYI see here:

    http://code.tutsplus.com/articles/how-to-create-a-simple-post-rating-system-with-wordpress-and-jquery–wp-24474

    Avatar of danbp
    danbp
    Participant

    @danbp

    I suggest you to read carefully the BP Codex (ie. anything about JS handling). ;-)
    And for the present case: http://codex.buddypress.org/plugindev/bp-custom-php/

    Avatar of danbp
    danbp
    Participant

    @danbp

    I can’t suggest anything because i’m wondering why the code doesn’t work on your site.
    Personnally I use this code from within bp-custom. Have you tried that ?

    You also give much details about what you exactly try to do.

    Adding a button into plugin who contains many by default is like diving in a hay stack !
    Wich button or really really custom for going on another page or what ?

    Where ideally should he appear ?
    Who can use it ?

    Each header has at least 6 or seven placeholder, only for positionning something in case off, so there’s no need effectively to use a more dedicated filter like the one you tell.

    Avatar of danbp
    danbp
    Participant

    @danbp

    Avatar of danbp
    danbp
    Participant

    @danbp

    This code was tested today on BP 2.1 and 2013 theme ! Copy/pasting from here works also.

    Maybe remove the div wich can give some wrong output depending of your theme.
    Anyway you have to style it (css) to see the button correctly.

    Avatar of danbp
    danbp
    Participant

    @danbp

    i guess you have first to debug your theme. No worry about ticketing: hueman is a free wp theme.
    Is it up to date ?
    I use it and see no errors on groups activity or elsewhere.

    Read here fore some dev tips

    Avatar of danbp
    danbp
    Participant

    @danbp

    @dcavins,

    Do you mean the group admin screen on back end ?
    Have you tried to strip the shortcode ?
    $content = strip_shortcodes($content);
    return $content;

    Removing some filters may also work ?

    http://wp-a2z.com/oik_api/kses_remove_filters/

    Or, sorry if i’m wrong, see here a similar question, with a clever answer which maybe help you further.

    Avatar of danbp
    danbp
    Participant

    @danbp

    Hi @jaybee08,

    try this:

    function my_custom_button() {
     // your button here
    echo ' <br/><div class="mcb"><a href="#" title="">blabla</a><div> ';
    
    }
    add_filter( 'bp_before_member_header_meta', 'my_custom_button' );

    Add the function to your child theme’s functions.php or to bp-custom.php

    Avatar of danbp
    danbp
    Participant

    @danbp

    hi @doremdou,

    BP is a few steps away from better js handling, wich can be the cause of your current trouble.

    https://buddypress.trac.wordpress.org/ticket/5735

    Maybe open a ticket and describe the problem ? ;-)

    Avatar of danbp
    danbp
    Participant

    @danbp

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