Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 13 replies - 1 through 13 (of 13 total)

  • trinzia
    Participant

    @trinzia

    I’m new so I don’t know what trac is, and whether this is an issue or if I’m doing it wrong.


    trinzia
    Participant

    @trinzia

    Same issue (details below)

    In this file {themename}\members\single\member-header.php, is the following code:

    		<?php
    		/***
    		 * If you'd like to show specific profile fields here use:
    		 * bp_member_profile_data( 'field=About Me' ); -- Pass the name of the field
    		 */
    		 do_action( 'bp_profile_header_meta' );
    
    		 ?>
    

    I have some custom profile fields, so I replaced the ‘do_action’ with these:

    		<h3>About Me<h3>
    		<?php bp_member_profile_data( 'field=About' ); ?>
    
    		<h3>Birthday</h3>
    		<?php bp_member_profile_data( 'field=Birthday' ); ?>
    

    When I click on the Edit Profile link, I can change visibility settings, and it appears to save them. BUT the saved settings don’t do anything. In another browser where I’m not logged in at all, I can always see all of the fields listed, no matter which settings were chosen.

    Advice?


    trinzia
    Participant

    @trinzia

    Update:
    I searched through BP files for ‘bp_activity_latest_update’. When you find it you see it’s echo of the function ‘bp_get_activity_latest_update’. I copied this function into my theme, renamed it, and removed one line.

    In theme file, where you want to place status, put the following:

    	<?php if ( bp_is_active( 'activity' ) ) : ?>
    
    		<div class="statusnote" style="border:1px solid;">
    
    			<?php //override 'View' button
    			function tty_get_activity_latest_update( $user_id = false ) {
    
    			if ( empty( $user_id ) )
    			$user_id = bp_displayed_user_id();
    
    			if ( bp_is_user_inactive( $user_id ) )
    			return false;
    
    			if ( !$update = bp_get_user_meta( $user_id, 'bp_latest_update', true ) )
    			return false;
    
    			$latest_update = apply_filters( 'bp_get_activity_latest_update_excerpt', trim( strip_tags( bp_create_excerpt( $update['content'], 358 ) ) ) );
    			return apply_filters( 'tty_get_activity_latest_update', $latest_update  );
    			}
    			?>
    
    			<?php echo tty_get_activity_latest_update(); ?>
    
    		</div>
    
    	<?php endif; ?>
    

    Then remove the old one from members/single/member-header.php:

    		<?php if ( bp_is_active( 'activity' ) ) : ?>
    
    			<div id="latest-update">
    
    				<?php bp_activity_latest_update( bp_displayed_user_id() ); ?>
    
    			</div>
    
    		<?php endif; ?>
    

    trinzia
    Participant

    @trinzia

    The patch seems to be working – I pasted it into functions.php.
    Thanks!


    trinzia
    Participant

    @trinzia

    I tried this solution, with no effect:
    https://buddypress.org/support/topic/resolved-wordpress-blog-comments-not-appearing-in-buddypress-activity-stream/

    Are my WP comments not appearing because my dev site is behind a password, or maybe because of our other security measures?


    trinzia
    Participant

    @trinzia

    I tried to do this. I created bp-custom.php, and placed it in plugins directory (not in plugins/buddypress). the function gets as far as //return $user_id, and will display it, but doesn’t seem to know what $update is.

    	<?php
    
    	//Remove view button on status update
    
    	function tty_activity_latest_update( $user_id = false ) {
    		echo tty_get_activity_latest_update( $user_id );
    	}
    
    	function tty_get_activity_latest_update( $user_id = false ) {
    		global $bp;
    
    		if ( !$user_id ) {
    		$user_id = $bp->displayed_user->id;
    		}
    
    		//return $user_id;
    
    		if ( !$update = get_usermeta( $user_id, 'bp_latest_update' ) ) {
    			return false;
    		}
    
    	$latest_update = trim( strip_tags( $update ) );
    
    	return apply_filters( 'bp_get_activity_latest_update', $latest_update );
    	}
    
    	?>
    
    

    trinzia
    Participant

    @trinzia

    wp-content\plugins\buddypress\bp-themes\bp-default\members\single\home.php
    wp-content\themes\MYTHEME\members\single\home.php

    In case it saves anyone else 5 hours of looking, here’s what worked for me. Copy the files from the default theme and do NOT put them all in a folder named buddypress, which was how I interpreted the codex entry. Also, for my theme, I needed to comment out line 80 of home.php:

    <?php //get_sidebar( 'buddypress' ); ?>

    Since my theme has no sidebars, this was making my site go splat.


    trinzia
    Participant

    @trinzia

    I’m trying to edit home.php, and specifically the nav menu. Copied file:
    wp-content\plugins\buddypress\bp-templates\bp-legacy\buddypress\members\single\home.php
    wp-content\themes\mytheme\buddypress\members\single\home.php

    Edited this line:

    <div style="border:5px solid red">
    <?php do_action( 'bp_member_options_nav' ); ?>
    </div>

    Should I see a red border around the nav menu? Nothing happens.


    trinzia
    Participant

    @trinzia

    Which file(s) would I use to edit the default layout for this URL:
    http://www.mysite.com/members/membername

    I am assuming this is Xprofile (the page that I get when I click on someone’s name). I want to edit how this profile looks for all members. So far, all the file structures that I tried, failed to produce an edit to this main page.

    @ davni:
    If this helps, the following structure produced an edit on the Profile tab inside the Member profile. I copied this file and made an edit:
    wp-content\plugins\buddypress\bp-themes\bp-default\members\single\profile.php

    Then I created this directory structure:
    wp-content\themes\mytheme\buddypress\members\single\profile.php

    This doesn’t edit the main profile page, but instead, the tab inside it. Still don’t know how to edit main layout.


    trinzia
    Participant

    @trinzia

    I have similar confusion. I have read the BP codex entry here:
    https://codex.buddypress.org/theme-development/theme-compatibility-1-7/template-hierarchy/

    It says to create files inside your theme, in a folder called /buddypress. I am unable to match this template hierarchy against the plugin files, in order to do edits in my theme. I downloaded several themes to look for an example, but none of them had a /buddypress folder. So, I cannot figure out what directory structure I should have, and which files to copy.

    I guess I will try copying the files from bp-themes/bp-default into {mytheme}/buddypress.


    trinzia
    Participant

    @trinzia

    If anyone needs this snippet, here’s how I displayed ProfileX data in my theme’s comments.php. Inside your custom comments layout, add this:

    
    <?php
    $author_id = get_comment(get_comment_ID())->user_id;
    if (function_exists('bp_get_profile_field_data')) {
    	$bp_location = bp_get_profile_field_data('field=Location&user_id='.$author_id);
    	if ($bp_location) {
    		echo '<div class="authorinfo">'. $bp_location . '</div>';
    	}
    }
    ?>
    

    You will need to change ‘location’ to the name of your ProfileX field.
    Note that, if you allow users to comment who are not logged in, the $author_id will be zero.


    trinzia
    Participant

    @trinzia

    This is for customized comments on custom post types. The specific question is what user ID I would use, to display an xProfile field for each comment author.

    I found WP’s comment author name and link, but not ID. If I did manage to get the comment author ID somehow (haven’t managed that yet), would it work with BP’s fields?


    trinzia
    Participant

    @trinzia

    I would like to display data from Xprofile next to member’s comments.

    I added an Xprofile field for Location, and can show it in my theme:

    $bp_location = bp_get_profile_field_data(‘field=Location&user_id=’.bp_loggedin_user_id());
    echo $bp_location;

    This is showing the location of the logged in user, not the comment author.
    Any idea how I could show the Location field for each comment author? WP codex didn’t have comment-author-ID, and I wasn’t sure if BP uses the same IDs anyway.

    Thanks!

Viewing 13 replies - 1 through 13 (of 13 total)
Skip to toolbar