Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 2,051 through 2,075 (of 2,756 total)
  • @henrywright

    Moderator

    I was thinking the same (i.e. just used internally). It’s when you start doing things like last_profile_update( $_GET['user_id'] ) you have to worry lol. I suppose it’s worth it for the record…? here goes…

    $last_update = $wpdb->get_var( $wpdb->prepare( 
    	"
    		SELECT date_recorded 
    		FROM {$wpdb->prefix}bp_activity 
    		WHERE user_id = %d 
                    AND type = 'updated_profile' 
                    ORDER BY date_recorded DESC 
                    LIMIT 1 
    	", 
    	$user_id
    ) );

    @henrywright

    Moderator

    @shanebp is it worth escaping $user_id in the SQL statement? think you can use the prepare() method for that?

    @henrywright

    Moderator

    Hi @somethingelse

    Have you ever thought about a custom solution using user meta? Something like:

    // Hook this to a particular action.
    update_user_meta( get_current_user_id(), 'active', current_time( 'mysql' ) );

    Then you’d get that for display using something like this:

    // $last_active will be a date-time string.
    $last_active = get_user_meta( get_current_user_id(), 'active', true );

    Refs:
    https://codex.wordpress.org/Function_Reference/get_user_meta
    https://codex.wordpress.org/Function_Reference/update_user_meta

    In reply to: Total number of posts

    @henrywright

    Moderator

    I must admit, the template hierarchy was slightly confusing at first for me too but once you get your head around it, it is a very powerful way of using templates. It works similarly to the WordPress template hierarchy if that helps.

    In reply to: Total number of posts

    @henrywright

    Moderator

    No. It goes into your template. So for example, if you wanted to display the count in your member profile header, then you’d put it in member-header.php.

    Take a look at this article for more info on the BP template hierarchy for how to set up templates (if you don’t have them already).

    In reply to: Total number of posts

    @henrywright

    Moderator

    Hey @fugglet

    Pop this into your template:

    echo count_user_posts( bp_displayed_user_id() )

    Note, if bp_displayed_user_id() doesn’t work in that particular context then you’ll need an alternative way of getting the member’s ID.

    @henrywright

    Moderator

    Hi @enigmaweb

    You have a couple of options regarding your requirements here.

    1. You could try searching the Plugin Directory to see if anything is available that meets your needs. If nothing then you could try option 2…

    2. Implement a custom solution yourself. Restricting content is fairly easy if you make use of some WordPress functions such as current_user_can() and wp_redirect(). You’ll also need to make yourself familiar with hooks. Here’s a very basic example of how to restrict content depending on a particular user’s role.

    function my_restrict_content() {
    
        // Check if the current page is the group creation page AND the currently logged-in user is a subscriber
        if ( bp_is_group_create() && current_user_can( 'edit_posts' ) )
            return;
    
        // If we get to here, the current user is not authorised to view this content so redirect them to the homepage.
        wp_redirect( home_url() );
        exit;
    }
    add_action( 'init', 'my_restrict_content' );

    Helpful refs:

    In reply to: Display memberlist

    @henrywright

    Moderator

    Hi @htown

    1. Will buddy press allow me to print out a list of members and customize it the way I’d like?

    BuddyPress may do. By default, BuddyPress provides a members directory which displays all active members (users that have activated their account). If you need more control over exactly which users are displayed then you’ll need to use the WP_User_Query class provided by WordPress.

    Ref: https://codex.wordpress.org/Class_Reference/WP_User_Query

    2. Will buddy press allow me to export users in a CSV file?

    I’m not sure this is do-able out-of-the-box. However, there may be plugins available in the WordPress Plugin Directory that can help.

    In reply to: Share Button

    @henrywright

    Moderator

    Hi @panezio

    Check out the Share Buttons by AddThis plugin

    In reply to: Help: User limit

    @henrywright

    Moderator

    Hi @aakashs

    Further to @shanebp’s post, and your question about 3m users, a lot comes down to what those 3m users are doing. If 3,000,000 users register, then logout, and only return once every 6 months then maintaining the site going forward will be quite easy. However, if each of the 3,000,000 return every day, upload some media, comment often and favourite a lot of activity items then you’ll need a much more powerful infrastructure in place.

    @henrywright

    Moderator

    Hi @irieside

    JavaScript can go inside a PHP file (via use of the <script> tag) or it can go into a .js file. In the case of the latter, you don’t need to use the <script> tag.

    In reply to: Profile BuddyPress

    @henrywright

    Moderator

    Hi @icaroferreira

    That’s how your theme styles the page. It’s done via HTML and CSS. Regarding your question, you have a few options:

    1. Write HTML and CSS yourself so that the style looks the same. See here and here for a guide to get you started
    2. Find a theme from the Themes Directory that does this for you. Note that you’ll want a theme that includes styles for the BuddyPress profile page (unfortunately, there’s not many around right now but more and more are slowly being released)
    3. Hire a designer to write some custom styles. The BP Jobs Forum is a good place to start if you decide to take this option.

    @henrywright

    Moderator

    But you’re saying comments_template() is also possible on BuddyPress-sites?

    Yes definitely, but as far as I know, only inside singular contexts (i.e. page.php and single.php templates).

    Where were you pasting the function? And what does your comments.php file look like (that’s the file comments_template() uses)?

    @henrywright

    Moderator

    Hi @yokosix

    comments_template() will work inside page.php or single.php

    Ref: https://codex.wordpress.org/Function_Reference/comments_template

    @henrywright

    Moderator

    Hi @worldholder

    The fatal error indicates you’re declaring the BP_XProfile_Field_Type_Datebox class twice. For example, you’re declaring it once then on the second attempt, you get the fatal error. Your job is now to debug – to find out what may be causing it to be declared twice. As @mercime mentioned, a good place to start is to deactivate (and remove completely by deleting all of their files) all plugins and installing a theme such as Twenty Fourteen.

    @henrywright

    Moderator

    Welcome Pack was written by one of the Lead Developers of BuddyPress so I have no hesitation in recommending it. My advice would be to set up a test site, install the plugin and play around with it to see if it works for you

    @henrywright

    Moderator

    Hi @iryna_b

    Have you tried Welcome Pack? Even though it is no longer supported, it should still work

    @henrywright

    Moderator

    Hi @ggsalas

    Have you increased the size to 250 x 250 or did you reduce the size to 250 x 250? Just thinking, if you increased the size, a re-upload might be needed to avoid blurring.

    @henrywright

    Moderator

    Does the problem happen with the Twenty Fourteen theme enabled? if not, then it surely is your theme causing the problem.

    @henrywright

    Moderator

    Hi @johnnyjonjon

    I tried submitting the form via a) Chrome and b) IE

    a) This worked.

    b) This seemed to fail? The console errors I get are:

    DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
    File: bbpress-register
    HTML1300: Navigation occurred.
    File: bbpress-register
    DOM7011: The code on this page disabled back and forward caching. For more information, see: http://go.microsoft.com/fwlink/?LinkID=291337
    File: bbpress-register

    I’m not entirely sure what this means, but perhaps someone else here will know?

    In reply to: How to Change Names

    @henrywright

    Moderator

    Hi @gibbsp999

    Certain slugs are changeable. Check out this article for info on how to do it:

    Customizable Slugs in BuddyPress

    In reply to: Live Notifications

    @henrywright

    Moderator

    Here’s a list of all of the changes made in BP 2.1.1 (from version 2.1):

    https://buddypress.trac.wordpress.org/query?status=closed&group=resolution&milestone=2.1.1

    In reply to: Live Notifications

    @henrywright

    Moderator

    Yeah, if you can identify the last version of BP and WP the plugin worked with, that will be a great start.

    In reply to: Live Notifications

    @henrywright

    Moderator

    Do you know what exactly isn’t working with the plugin? Great that you’ve contacted the developer – it’s worth providing as much info as you can – the less investigative work they need to do to diagnose the problem the better, and the more chance there will be of them fixing it 🙂

    In reply to: Live Notifications

    @henrywright

    Moderator

    From a regular users point of view, I find it unlikely they’ll even bother to acknowledge new email notifications,

    Agreed but I think it depends somewhat on the community. I can see email alerts being highly useful in some communities and not so useful elsewhere.

    BuddyPress is first and foremost a platform. It puts foundations in place for people to build on (hence why we have plugins and themes). The Live Notifications plugin is a good example. It makes use of the bp_notifications database table put in place by BuddyPress. If a webmaster wants to have ‘live’ notification functionality, then they can use that particular plugin. Keep in mind some webmasters may have no need for live notifications and may not want them on their site. Each (WordPress) AJAX request makes a call to admin-ajax.php – which results in a very slight delay in page load speed due to the extra processing required. This delay might not be very noticeable on sites with low activity or extremely powerful servers, but could be very noticeable on a site using a clunky hosting infrastructure or on a site with tons of activity. Imagine packing feature after feature into core by default – it would bloat the plugin unnecessarily.

Viewing 25 replies - 2,051 through 2,075 (of 2,756 total)
Skip to toolbar