Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 1,551 through 1,575 (of 2,427 total)
  • @venutius

    Moderator

    Try this:

    $wpdb->get_col("SELECT value FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 7 AND user_id = $r->ID);

    @venutius

    Moderator

    The bp_core_template_plugin function is loading plugins.php from the bp-templates directory, which can be overloaded by placing your own template file in themes/child-theme/buddypress/members/single/plugins.php that’s one way of doing it. another way is to register your own template directory (inside plugin for example) and tell bp to load that.

    @venutius

    Moderator

    Yes I’ve not played with that yet but from what I can see that’s the name of the function that will be called to display your content, it can call a template file.

    Here’s an example, posted by Shanebp in the archives:

    function add_iuda_tab() {
    	global $bp;
    	
    	bp_core_new_nav_item( array(
    		'name'                  => 'Iuda',
    		'slug'                  => 'iuda',
    		'parent_url'            => $bp->displayed_user->domain,
    		'parent_slug'           => $bp->profile->slug,
    		'screen_function'       => 'iuda_screen',			
    		'position'              => 200,
    		'default_subnav_slug'   => 'iuda'
    	) );
    
    }
    add_action( 'bp_setup_nav', 'add_iuda_tab', 100 );
    
    function iuda_screen() {
        add_action( 'bp_template_title', 'iuda_screen_title' );
        add_action( 'bp_template_content', 'iuda_screen_content' );
        bp_core_load_template( apply_filters( 'bp_core_template_plugin', 'members/single/plugins' ) );
    }
    
    function iuda_screen_title() { 
    	echo 'iuda Title<br/>';
    }
    
    function iuda_screen_content() { 
    	echo 'iuda Content<br/>';
    }

    @venutius

    Moderator

    That’s great! Coding brings these regular victories, it’s why it can be so addictive. That and the constant challenge.

    @venutius

    Moderator

    one I’ve used in similar circumstances is bp_get_member_user_id()

    @venutius

    Moderator

    Ah sorry, in the loop you would use bp_member_user_id()

    @venutius

    Moderator

    Did you try calling:

    $bp = buddypress();
    $user_id = $bp->displayed_user->id;

    @venutius

    Moderator

    That’s great, glad you found a solution.

    @venutius

    Moderator

    I think the key to what you want to do revolves around this:

    global $wpdb;
    $user_id = ??
    
    $user_phone = $wpdb->get_col("SELECT value FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 206 AND user_id = $user_id");
    $worker_phone = $wpdb->get_col("SELECT value FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 7 AND user_id = $user_id");

    Does the template have a way of passing the user id to be used?

    @venutius

    Moderator

    By the looks of things you just need to change this:

    
    global $wpdb;
    $user_id = bp_displayed_user_id(); 
    $dateOfBirth = array();
    $dateOfBirth = $wpdb->get_col("SELECT value FROM {$wpdb->prefix}bp_xprofile_data WHERE field_id = 2 AND user_id = $user_id");
    $dob = $dateOfBirth[0];
    
    /*This will work when I finally get the date of birth
    $today = date("Y-m-d");
    $diff = date_diff(date_create($dob), date_create($today));
    $state = bp_get_member_profile_data( 'field=State' );
    echo 'Age '.$diff->format('%y')  . ' - In ' . $state;
    */
    }
    add_action( 'bp_directory_members_item', 'add_info_to_members_loop' );

    Think that should do it.

    @venutius

    Moderator

    I don’t have WPMU Appointments, or a clear understanding of your requirements. Have yu tried asking WPMU?

    @venutius

    Moderator

    Hi there,

    I have a plugin called BP Profile Shortcodes Extra. I’ve added a shortcode to provide you with a configurable Private Message link [bpps_profile_private_message_link] you can use the user_id=”” setting to determine a specific user to private message. Let me know what you think.

    @venutius

    Moderator

    If BP is not saving your settings I’d say it’s definitely down to a conflict of some kind, have you tried running only the BP plugin and with the 2017 theme?

    @venutius

    Moderator

    I loaded this code on a test site and it worked for me, is it your customisations that are not working or the code as is?

    @venutius

    Moderator

    Hi Glenn,

    I’ve never tried Peepso or Social Engine, so I@m not speaking from a point of balance. I have tried other dedicated hosted platforms such as Ning though so I do have some wider experience.

    I think your issues can be boiled down into two areas: Maintenance, and features.

    Any WordPress site, any site for that matter is going to require maintenance the main question is who does that maintenance, how well is it done and how quickly new issues can be resolved.

    With a WordPress/BuddyPress installation I’d say that the level of maintenance that you yourself have to do (or pay for) is going to be higher than with peepso. Much depends on what features your add to the basic installation, in my experience in general WP and BP updates are solid and cause few issues, it’s usually the other plugins that can cause issues (prime eample recently was a SiteOrigin Page Builder update that wrecked my front page and they did not fix it for several months).

    My expectation with Peepso is that what you sacrifice in the way of variety of options available to you I’d hope that in return the options you do get will be reasonably well integrated with each other and less likely to cause conflicts resulting in feature or site loss that you would need to take a hand in resolving. The downside is if you find there are specific feature you need, or issues that are not getting resolved, you have few alternatives to go to, you may find yourself stuck.

    I once had a paid hosted site costing $50 per month which pretty much ground to halt and the provider refused to see the problem. It made me feel pretty helpless and it was the reason I moved to BuddyPress – I figured the money I saved on hosting I could use to fund feature additions to the basic BP setup.

    Anyway getting back to the point, so I reckon peepso will be less maintenance but with less features, and this brings me on to the second point – features.

    I think it would probably be a good idea to map out exactly which features you want in quite some detail and see how that drives your thoughts. For example you say you want video, would this be you hosting the video files or libraries of YouTube style embeds? Would you need group galleries, user galleries, sitewide gallery etc?

    Here’s what I tend to use:

    Chat – IfyChat – free version limited to 10 concurrent users but an excellent chat engine
    Video/photos/audio – Either MediaPress or rtMedia, rtMedia is more stylish but add-ons are quite expensive.
    Groups/xprofiles, activity, friends – BuddyPress.
    News areas – probably more general workpress based solutions for this, are you thinking RSS feeds from other sites or internal news (could be done with a simple News category?).
    Polls – never really looked at polls, I note there is this – https://themekraft.com/new-plugin-buddypress-polls/ for starters, looks interesting but I’ve not tried it.

    Regarding supporting mobile, BP is coming out with a new theme – BP Nouveau, this has options for vertical menus which I think will be a lot more mobile friendly.

    The bulk of being mobile friendly comes down to the theme you are using and whilst most are responsive these days I personally find that having a mobile responsive theme is not good enough for phones, what I do is run a second mobile specific theme and use a theme switcher to detect and switch themes.

    Another point to bear in mind with BP is that there are a great many plugins that help you choose how your site is going to work, there’s a range of plugins that change the may notifications and email subscriptions work. This is a benefit of BP, but it does also increase the plugin count.

    @venutius

    Moderator

    Sorry I’ve no idea how to pull it into the email template.

    @venutius

    Moderator

    I’ve got a plugin called BP Profile Shortcodes Extra that has a shortcode to display the value of an xprofile field, you could take a look at how I did that and use that as a basis for your code?

    In reply to: Profile image sizes

    @venutius

    Moderator

    whoops, wrong thread, please ignore my last comment.

    In reply to: Profile image sizes

    @venutius

    Moderator

    I’ve got a plugin called BP Profile Shortcodes Extra that has a shortcode to display the value of an xprofile field, you could take a look at how I did that and use that as a basis for your code?

    In reply to: Profile image sizes

    @venutius

    Moderator

    That’s interesting, I’m not aware of how you would get BP to create and use a third avatar size, maybe you have a third party plugin/code that is creating that?

    In reply to: Profile image sizes

    @venutius

    Moderator

    BP only has a thumb avatar and a full size avatar, there’s no other avatar images it uses.

    In reply to: Profile image sizes

    @venutius

    Moderator

    Look for a file in wp-content/plugins/bp-custom.php this contains the code to set the avatar sizes.

    @venutius

    Moderator

    It’s got to be a conflict of some sort somewhere, translations are usually very reliable from my experience.

    @venutius

    Moderator

    Hi Glenn, welcome aboard.

    I’m pretty new to BuddyPress myself, at least on the in-depth side of things but I’ve been a user for a few years now. Just recently started writing plugins. I know what you mean regarding integration, I guess that’s what you get with a private system, less features but better integrated.

    I’ve just created a plugin that I hope will take a step in the right direction integration wise. It’s called BP Post Status and it integrates WordPress posts with BP, allowing posts to be shared in groups and to friends. It’s also got a neat group homepage feature. If you intend to give your members the ability to blog it’s worth taking a look at. Still got a few teething problems though, nothing major, just my lack of experience shining through 🙂

    @venutius

    Moderator

    I’ve been looking at this today, the function in question is bp_activity_create_summary() this runs an algorithm that determines what part of the content is shown. It’s not easily possible to over-ride the way this works.

Viewing 25 replies - 1,551 through 1,575 (of 2,427 total)
Skip to toolbar