Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 25 replies - 2,451 through 2,475 (of 2,756 total)
  • @henrywright

    Moderator

    I’m guessing I’ll have to use a hook of some kind to accomplish this

    You’re right. But the hook would be supplied by the Amen plugin. You could start by asking the plugin’s support if one is available. I’m guessing here but it will probably be called something like after_submit_prayer_request.

    Then you’d build your own function which you can ‘hook’ on to the ‘after_submit_prayer_request’ hook (don’t forget I’m guessing at the hook name).

    Your function would simply add an item to the BP activity stream and will look something like this:

    function add_prayer_request_to_stream() {
        bp_activity_add( $args )
    }
    add_action( 'add_prayer_request_to_stream', 'actual_hook_name' );

    Note: This won’t work until you have the actual hook name and have supplied the $args as an array that describes the activity item you’re creating.

    See here for more info on the bp_activity_add() function

    bp_activity_add()

    @henrywright

    Moderator

    Take a look at bp_dtheme_mark_activity_favorite and bp_dtheme_unmark_activity_favorite in bp-themes/bp-default/_inc/ajax.php

    In reply to: Permalink Structure

    @henrywright

    Moderator

    Hey @mcpeanut

    Hopefully your new server is working well for you! Just thought I’d give an update on how mine is going.

    I went for the managed option to try to save a little time but that was a mistake. I should have opted for the root server because 1and1 refuse to make any changes to the config of the managed servers. I should have guessed that before I signed up. An example is Fast CGI isn’t enabled. And their support team has confirmed the advanced settings panel for the managed option doesn’t work. That said, and aside from bad support (the dedicated server support team aren’t interested in helping if you have a non-trivial problem) the server seems to be quite reliable, and fast. Checking via Pingdom Tools, a basic WordPress page load takes ~ 0.2 seconds. Oh and one last thing, their £3.99 per month SSL certificates (minimum 12 month contract) can’t be migrated if you decide to upgrade your package. My mini-review might sound very negative but I’m persevering with them because the hardware is good for the price (as you already know). Hope this helps you!

    @henrywright

    Moderator

    Take a look at this article from the BP Codex on the Template Hierarchy:

    Template Hierarchy

    To summarise, you’d create a folder called /buddypress/ in your theme’s directory. Then a subfolder called ‘members’. Then a file called ‘index-register.php’. You should end up with:

    /buddypress/members/index-register.php

    Your register page’s code will go in that file and any customisations you make will take effect.

    @henrywright

    Moderator

    Hi @djsteveo

    I don’t know of a plugin that can do this but if one was to be built, it would need the following parts:

    • The button which does the flagging: The most stylish way for the button to work would be through AJAX. Like a toggle button. If the reporting user clicks by mistake then they can undo the flag by clicking again. Would the reporting user be able to submit text along with the flag click?
    • A list which outputs all of the flagged users: This should be accessible to admin users only
    • Notifications: Would you want an admin user to receive an email each time a user is flagged?

    I doubt a custom database table would be needed for something like this. Recording the flags can be done via user meta. I was thinking of building something like this a while ago but haven’t had the time recently.

    In reply to: No of posts in stream

    @henrywright

    Moderator

    @scifikriss glad you got it working! This is what I would have done:

    if ( bp_has_activities( bp_ajax_querystring( 'activity' ) . '&per_page=15' ) ) {
        // code
    }

    Sorry I’m a few hours too late 🙂 – I think that should work but its untested.

    In reply to: No of posts in stream

    @henrywright

    Moderator

    You can set a per_page parameter when you use the bp_has_activities() function. See here for more info: https://codex.buddypress.org/developer/loops-reference/the-activity-stream-loop/

    @henrywright

    Moderator

    Are you sure the email is failing to send? Could the email have arrived in the user’s spam mailbox?

    @henrywright

    Moderator

    Check out Facebook meta tags or ‘open graph’ as Facebook likes to call them:

    Facebook Open Graph META Tags

    @henrywright

    Moderator

    @bhekzin actually, instead of adding the ad as an activity item, you could just modify the activity loop to insert the ad dynamically on every 8th item. This is how you’d do that using a for loop:

    for ( $i = 1; $i < 1000; $i++ ) {
        if ( $i % 8 == 0 ) {
           // this is the 8th item so insert your ad code
        }  
    }

    @henrywright

    Moderator

    @bhekzin you’ll need to decide if you’re going to add an ad after X number of items have been added to the stream or if you’re going to add an ad every X number of seconds (or minutes, or hours). If you choose the interval approach, check out wp_schedule_event

    https://codex.wordpress.org/Function_Reference/wp_schedule_event

    @henrywright

    Moderator

    There’s a function you can use to do that called bp_activity_add(). See here for the usage:

    bp_activity_add()

    @henrywright

    Moderator

    @jerryskate great! glad you got it working 🙂

    @henrywright

    Moderator

    OK, I think I might know what is happening. Try this as the whole thing put together:

    function add_body_classes( $classes ) {
        
        if ( bp_is_member() ) {
            $classes[] = 'this-is-a-member-profile';
            $classes[] = 'member-profile-of-' . bp_get_displayed_user_username();
        }
    
        return $classes;
    }
    add_filter( 'body_class', 'add_body_classes', 12 );

    @henrywright

    Moderator

    In bp-custom right after the line $classes[] = 'member-profile-of-' . bp_displayed_user_username();

    add this:

    return $classes;

    @henrywright

    Moderator

    @jerryskate if you could post your filter (what you have in bp-custom) and your body tag (from your header.php) i’ll take a look…

    cc @modemlooper @hnla – anyone for some healthy foods from the food-pyramid guy? I prefer a good old fashioned burger and fries myself 🙂

    @henrywright

    Moderator

    Can you paste your code? The original classes shouldn’t be lost. The filter just adds new ones whilst retaining what classes are already in place.

    @henrywright

    Moderator

    bp_activity_get_specific() should be used like this:

    // get activity
    $activity_get = bp_activity_get_specific( array( 'activity_ids' => YOURACTIVITYID ) );
    
    // single out the activity
    $activity = $activity_get[0];
    
    // grab specific activity item
    $activity_body = $activity->content;

    Ref: https://buddypress.org/support/topic/gettinng-id-of-the-activity-status/#post-112943

    @henrywright

    Moderator

    <body jerryclass="" class=" customize-support" seems weird. You shouldn’t be getting that. You should be getting something like <body class="classname">

    In your CSS file, you’d use:

    body.classname {
        // whatever
    }

    @henrywright

    Moderator

    If you want something unique you just have to modify the filter function.

    For example, this is very generic:

    if ( bp_is_member() )
        $classes[] = 'this-is-a-member-profile';

    This is unique:

    if ( bp_is_member() )
        $classes[] = 'member-profile-of-' . bp_displayed_user_username();

    @henrywright

    Moderator

    Oops, didn’t see your second post. Glad you solved the problem!

    @henrywright

    Moderator

    Hi @godavid33

    I’m 99% sure you can. I do believe it’s store in secondary_item_id.

    I think you can access it by doing something like this:

    $notifications = BP_Notifications_Notification::get( array(
        'id' => $notification_id,
        'user_id' => $user_id
    ) );
    
    // I assume there will only be one result but i'll do a loop anyway
    if ( $notifications ) {
        foreach( $notifications as $notification ) {
            // this should output the friendship ID
            echo $notification->secondary_item_id;
        }
    }

    @henrywright

    Moderator

    @jerryskate the body tag in your theme’s header.php file should be <body <?php body_class( $class ); ?>> – if it is just something like <body> then the filter I suggested above won’t work. Perhaps that was why it wasn’t working?

    @henrywright

    Moderator

    And you’re sure you have <body <?php body_class( $class ); ?>> in your template?

    @henrywright

    Moderator

    Have you tried viewing the page source? <body class"...">

Viewing 25 replies - 2,451 through 2,475 (of 2,756 total)
Skip to toolbar