Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 20 replies - 3,801 through 3,820 (of 3,820 total)
  • @shanebp

    Moderator

    Easier and more flexible to add a function to bp-custom.php.
    Example:

    `
    function login_intercepts(){

    if ( is_user_logged_in() ) {
    bp_core_redirect( get_option(‘siteurl’).”/activity” );
    }

    }

    add_action( ‘wp’, ‘login_intercepts’, 3 );
    `

    @shanebp

    Moderator

    Thanks for the pointer. Got the listener working.
    Here it is, for other noobs…

    `
    function bp_send_private_bzzt() {
    global $bp;

    if ( $bp->profile->slug != $bp->current_component || ‘bzzt’ != $bp->current_action || ‘send’ != $bp->action_variables[0] )
    return false;

    $sender_id = $bp->action_variables[1];
    $recip_id = $bp->action_variables[2];
    $recip_name = htmlspecialchars(urldecode($bp->action_variables[3]));
    $sender_name = $bp->loggedin_user->fullname;

    $alert_message = “You just sent a BZZT! to ” . $recip_name;
    bp_core_add_message( __( $alert_message, ‘buddypress’ ) );

    $subject = $sender_name . ” just sent you a BZZT!”;
    messages_new_message( array(‘sender_id’ => $sender_id, ‘subject’ => $subject, ‘content’ => “BZZT!”, ‘recipients’ => $recip_id ) );

    bp_core_redirect( wp_get_referer() );
    }
    add_action( ‘wp’, ‘bp_send_private_bzzt’, 3 );

    function bp_send_private_bzzt_link() {
    echo bp_get_send_private_bzzt_link();
    }
    function bp_get_send_private_bzzt_link() {
    global $bp;

    if ( bp_is_my_profile() || !is_user_logged_in() )
    return false;

    $sender_id = $bp->loggedin_user->id;
    $recip_id = $bp->displayed_user->id;
    $recip_name = $bp->displayed_user->fullname;

    return apply_filters( ‘bp_get_send_private_bzzt_link’, wp_nonce_url( $bp->displayed_user->domain . $bp->profile->slug . ‘/bzzt/send/’ . $sender_id . ‘/’ . $recip_id . ‘/’ . $recip_name . ‘/’) );
    }
    `

    @shanebp

    Moderator

    You are in the right file, so if you are not seeing your changes, then the file is not being overwritten.

    Try something simple to see if your edited file is being loaded.
    Change this:
    `

    `
    To:
    `
    HELLO HELLO HELLO HELLO HELLO HELLO
    `

    @shanebp

    Moderator

    Argh – much faster, coding and parsing-wise, to do this in members_single_profile/edit.php
    as opposed to doing an add_filter on ‘bp_get_the_profile_field_options_select

    @shanebp

    Moderator

    Error caused by checking for ‘acceptable value’ before save.
    See
    /* Check the value is an acceptable value */
    around Line 735 in bp-xprofile.php

    I removed ‘selectbox’ from the ‘if’ and profile save now works.

    @shanebp

    Moderator

    Great – very helpful.

    @shanebp

    Moderator

    Sorry – to an href url.

    I echo out pagination links and I’m trying to figure out how to add a string to the url in each link so I can parse it as a $_GET when clicked on.

    Or is there a better approach to custom pagination?

    @shanebp

    Moderator

    global $blog_id;
    echo $blog_id;

    Or
    In WordPress 3.1, your $blog_id can be found by navigating to the “Network Admin > Sites” page and hovering over the blog in question. You should see a link that resembles this:

    http://example.com/wp-admin/network/site-info.php?id=1

    Your $blog_id, in this instance, would be 1.

    For WordPress 3.0, the $blog_id can be found in the “ID” column of the “Super Admin > Blogs” page.

    @shanebp

    Moderator

    Set your time to UTC or UTC+[your offset].
    If you use the “pick a city in your timezone”, all birthdays will be off by one day in Public Profile.

    @shanebp

    Moderator

    The pack is installed.
    Disable BP Template Pack JS / AJAX is checked.
    Don’t know why, perhaps some conflict, will ask other devs.
    Thanks for the pointer.

    @shanebp

    Moderator

    Fixed, so far, by doing this:

    Created a directory called _inc under themes/my theme and copied in ajax.php and global.js from bp-default/_inc

    Put this in your theme/functions.php
    /* Load the AJAX functions for the theme */
    require_once( TEMPLATEPATH . ‘/_inc/ajax.php’ );

    /* Load the javascript for the theme */
    wp_enqueue_script( ‘dtheme-ajax-js’, get_template_directory_uri() . ‘/_inc/global.js’, array(‘jquery’) );

    @shanebp

    Moderator

    On Events -> Events Map (which shows the global map) …

    Our layout uses a narrower column than most, so the Events Map defaults to a view centered on Africa and zoomed in so that North America is barely visible.

    How can we adjust the map to zoom it out one notch further ? So that it shows a full global view?

    Or how can we adjust the map to appear centered over North America ?

    @shanebp

    Moderator

    This always works for me.
    http://interconnectit.com/719/migrating-a-wordpresswpmubuddypress-website/

    also – change the name of your beta folder so that links going there are easier to see

    @shanebp

    Moderator

    Try this…
    Create bp-custom.php, it will go in /wp-content/plugins
    Add this code to it, change “/login-or-join” to whatever your page name is :

    function login_intercepts(){
    /*  if not logged in, user is sent to another page  */
    if ( !is_user_logged_in() ) {
    bp_core_redirect( get_option('siteurl')."/login-or-join" );
    }
    }
    add_action( 'wp', 'login_intercepts', 3 );

    @shanebp

    Moderator

    Thank you both very much for this code – very helpful.

    And it is disturbing that there is no kill-switch for gravatars in the browser admin.

    @shanebp

    Moderator

    There is probably a better way to do this, but this works:

    In bp-follow.php, remove or comment out the action calls to ‘bp_follow_setup_nav’ at around Line 80.

    @shanebp

    Moderator

    Thanks for the info.

    Yes, we saw div#message and .error in default.css.

    But there must be a place in the code where the div is rendered to the page.
    Anyone know where that place is?

    @shanebp

    Moderator

    I see no instance of <div class="error" in bp-core files.
    But there are plenty of bp_core_add_message calls.

    Anyone know where bp_core_add_message is defined?

    @shanebp

    Moderator

    Perfect – Thanks David

    @shanebp

    Moderator

    Tried using get_permalink.
    It worked for nav buttons, but any sidebar icons, links, etc returned the home page post from get_permalink although they went to the correct page as shown in the browser url.

    Could not figure that out, so I just went with some basic php in bp-custom.php using $_SERVER and meta refresh.

Viewing 20 replies - 3,801 through 3,820 (of 3,820 total)
Skip to toolbar