Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1 through 25 (of 962 total)
  • Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    1. untested by me, but try http://pastebin.com/JcesLN8U

    2. You want auto-suggest with the body of a pm reply as you create it?
    If so, that is not currently available in BP.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    There is no built-in way at the moment, but there are efforts to do so in the future.
    More info:

    http://wptavern.com/new-plugin-adds-taxonomies-to-buddypress-groups

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    @lerneree11111

    It’s unclear whether you want to create a group + group forum for each of your movies.
    Or create a forum or forum topic for each movie.

    Creating groups via code is fairly easy.
    Take a look at this article, untested by me but provides info re functions:

    http://tannermoushey.com/2014/08/create-groups-buddypress/

    You’ll probably also have to set some meta data, like so:

     groups_update_groupmeta( $id, 'total_member_count', 1 );
     groups_update_groupmeta( $id, 'last_activity', time() );

    If you run into problems, use http://pastebin.com/ to share the code you are trying.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    I can guess why author may != the meta value, but it would be a lot easier if you stored the user id in that meta value field.

    Anyhow, you could use get_user.
    $person = get_user_by('id', bp_displayed_user_id());

    then

    ...
    'meta_value' =>  $person->user_login
    ...
    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    afaik – bp_displayed_user_id() requires an echo for display.

    So in your template overload of this file:
    buddypress\bp-templates\bp-legacy\buddypress\members\single\member-header.php

    paste: echo bp_displayed_user_id();

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    afaik, this call in bp-members-admin.php is causing the issue.

    add_action( 'pre_user_query', array( $this, 'remove_signups_from_user_query'), 10, 1 );

    You might try hooking admin_init early, 1 or 2,
    then doing a remove action, run your code and the replace the action?

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    What version of BP are you using to test this?

    Is this what you see on /bp-members-admin.php:829
    if ( $this->users_page != get_current_screen()->id ) {

    Just guessing, but…

    You’re using the admin_init hook to call hmn_cp_trigger_upgrades which calls hmn_cp_v121_upgrade which seems to call remove_signups_from_user_query() in class BP_Members_Admin

    So maybe the screen id or users_page doesn’t exist yet.

    Perhaps try a hook other than admin_init?
    Or give it a high number for priority?

    Other than the warning, is your plugin executing as expected?

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    In bp-custom.php, paste this:

    remove_filter( 'bp_get_the_profile_field_value', 'xprofile_filter_link_profile_data', 9, 2 );

    Info re bp-custom.php

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    @csimpson

    You may be interested in one of my premium plugins: BuddyNotes

    It allows site admins to make notes per member.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    >I can post my updated code?

    It would be best if you posted a pastebin or gist url to the code.

    Or even better, create a plugin and share a github repo.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Take a look at this hook
    do_action( 'groups_created_group', $group->id, $group );

    in buddypress\bp-groups\bp-groups-functions.php ~L. 161

    Use that hook to connect to a function that changes the submitted name.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    No, it will use the first word in the display name.

    To use the last word, follow danbp’s instructions and then paste this function in your child-theme/functions.php

    function alphabetize_by_last_name( $bp_user_query ) {
        if ( 'alphabetical' == $bp_user_query->query_vars['type'] )
            $bp_user_query->uid_clauses['orderby'] = "ORDER BY substring_index(u.display_name, ' ', -1)";
    }
    add_action ( 'bp_pre_user_query', 'alphabetize_by_last_name' );
    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Prior to BP 1.7, last_activity was stored usermeta.
    Now it is stored in the activity table, (although you may see it still in usermeta for legacy purposes).

    Moving it to the activity table resulted in much improved performance.
    You’ll probably see similar results.

    also – sometimes 2 queries are faster than one massive one with multiple joins, ands, ors.

    also 2 – Have you studied this?

    https://wordpress.org/plugins/bp-profile-search/

    It’s been around for several years and the query has become more efficient with each release.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    >Okay, it worked!!!

    You mean using the register_activation_hook ?
    btw – you should still check to see if the field exists before you create it – to avoid duplications if they deactivate / reactivate the plugin.

    Or delete the field by using this hook:

    http://codex.wordpress.org/Function_Reference/register_deactivation_hook

    >can you please tell me what if it’s in the functions.php file, do I need to use the bp_init then or something else?

    Perhaps bp_loaded is more appropriate, you’ll have to try it and find out.

    BP related functions are usually placed in bp-custom.php

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    For a plugin, instead of bp_init, use:

    http://codex.wordpress.org/Function_Reference/register_activation_hook

    note: I’m not sure BP is loaded before that hook is called.

    Or you could use bp_init, but in your function, check for the existence of the xprofile field before you create it.

    btw – you don’t need the global in that function.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    This isn’t a BuddyPress question, but…

    WPEngine is a very accomplished hosting company.

    I can’t imagine that they haven’t had customers that migrated from a godaddy WP installation.

    Have you posed this question to WPEngine?

    Hope your migration goes fairly smoothly.
    When you get BuddyPress installed, we await any questions you may have.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Interesting thread.
    This would be my approach:

    function bpfr_add_page_to_group() {
    	
    	if ( class_exists( 'BP_Group_Extension' ) ) :
    		  
    		class Bongo_Group_Extension extends BP_Group_Extension {
    		 
    		    function __construct() {
    		        $args = array(  
    		  	    'slug'              => 'bongo',
    			    'parent_slug'       => 'admin', 
    		            'nav_item_position' => 100,
    		
    		            'screens' => array(
    		                'edit' => array(
    		                    'name' => 'Bongo', // the tab name                 
    		                ),
    		            ),
    		        );
    		        parent::init( $args );
    		    }
    		 
    		
    		    function settings_screen( $group_id = NULL ) {
    				// don't remove this function
                                    //  = NULL is necessary to avoid Strict Standards warning
    		    }  
    		} // end of class
    
    		bp_register_group_extension( 'Bongo_Group_Extension' );
     
    	endif;
    }
    add_filter('bp_groups_default_extension', 'bpfr_add_page_to_group' );

    Then, to avoid loading the form, create a template overload of
    \buddypress\bp-templates\bp-legacy\buddypress\groups\single\admin.php

    And add a conditional check of the action_variable.
    Just before the form tag, add:

    <?php 
    global $bp; 
    if( $bp->action_variables[0] != 'bongo' ) :
    ?>

    Right after the form close tag, add:

    <?php else :
    	echo 'this is the bongo page'; 
    endif;
    ?>

    Awkward, but seems to work.
    The Group_Extension_API does need some work re making it easier to add tabs and tab counts.
    I think the core devs are aware of this, but perhaps an enhancement ticket is in order?

    @danbp
    >The 1st function let you add custom content on the tab.
    afaik – that function adds the content on every page under ‘Admin’.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    You’ll have a better chance of getting an answer if you use the support forum for that plugin:

    https://wordpress.org/support/plugin/buddypress-links

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    > it seems as complicated as re-writing the bp_get_activities

    It’s not even close to being that complicated.

    This examples are re members, but should give you an idea of the general approach to a custom process:

    http://codex.buddypress.org/developer/loops-reference/the-members-loop/#code-examples

    http://codex.buddypress.org/developer/bp_user_query/#code-examples

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    If I was doing this, I would write a custom function(s) to gather the activity ids.
    And that function would most likely contain one or more custom db queries.

    If you are unable to write such queries, you may want to consider hiring a developer.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    No.
    Create the activity ids string in a separate custom process – not bp_has_activities.
    Then pass the string into bp_has_activities via the include parameter.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Your avatars are the correct size.
    Your theme is stretching the avatars.
    Look at your theme css re item-header and item-header-avatar

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    No, do not use user_ids as a filter.

    Use ‘include’ as the filter – ONCE – after you gather the activity ids in a separate process.

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    Try using the ‘include’ parameter.

    Gather user_ids for bp_loggedin_user_id() + friend ids.
    Use those ids to get activity ids.

    Then gather activity ids for groups you belong to.

    Kick out dupes and pass them in via ‘include’ with scope=false.

    Awkward?
    Yes, but much less so than ‘remove everything but group posts by group member id’s that are not your friends.’

    Avatar of shanebp
    shanebp
    Moderator

    @shanebp

    >However, it doesn’t show activity from your groups that have members which are not your friends

    >Again, bp_loggedin_user_id() + ids of their friends.

    Of course, this will only show friends.

    If you want friends & group members, then collect
    bp_loggedin_user_id() + group member ids + friend ids,
    kick out dupes and pass in a csv string of the ids.

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