Skip to:
Content
Pages
Categories
Search
Top
Bottom

Forum Replies Created

Viewing 7 replies - 6,151 through 6,157 (of 6,157 total)
  • blogs.dir and some other folders will probably need to be chown’d to the user and group that runs the webserver. Apache2 by default (I think) uses the nobody user account, so I’m assuming that’s what your host uses.

    Whilst 777 will let everything access it, from a security perspective, you should really go for 755 permissions and check that the owner/group of the files is the same as that of the webserver.

    BTW if you’d have tested uploading an avatar on a plain WordPress MU install, you’d have had exactly the same problem. This isn’t buddypress.

    sgrunt: if there is a suspected problem with IE, you should detail a report at https://trac.buddypress.org/ so people can check and confirm and fix it.

    Vida

    Email me at djpaul at gmail dot com. I’ve spent sometime shoehorning this into a “proper” plugin – it’s not complete but would appreciate it if you could test with what I’ve got so far.

    life2000: Make a new file in your wp-content/mu-plugins/ folder. Call it what you want but make the extension .php.

    Put this tag at the top of the file: <?php

    Copy and paste the code from above underneath it

    And at the bottom of the file, put this: ?>

    Save it and it should work immediately. Make a new test user to see if the message changes.

    <?php

    /*

    Plugin Name: BP Default Friend

    Author: DJPaul

    Author URI: djpaul@gmail.com

    Original Author: Nicola Greco

    Original Author URI: http://notsecurity.com

    Description: Automatically add a specified user as friend after SignUp

    Plugin URI: http://djpaul.dangerous-minds.org

    Version: 0.2

    */

    require_once(WP_CONTENT_DIR . '/mu-plugins/bp-core.php');

    function default_friend($user_id) {

    global $wpdb, $bp;

    $wpdb->query("INSERT INTO " . $bp . " ( initiator_user_id, friend_user_id, is_confirmed, is_limited, date_created ) VALUES (".$user_id.", ".get_option('bp-default-friend-id').", 1, 0, NOW())");

    }

    function default_friend_control() {

    add_submenu_page("wpmu-admin.php", 'Default Friend', 'Default Friend', 8, 'bp-default-friend', 'default_friend_options');

    }

    function default_friend_options() {

    if(isset($_POST)) {

    $default_friend_id = $_POST;

    update_option( 'bp-default-friend-id', $default_friend_id );

    echo "<div id="message" class="updated fade">Options updated.</div>";

    }

    ?>

    <div class="wrap">

    <h2><?php _e( 'Default Friend', 'buddypress' ) ?></h2>

    <form action="<?php $_SERVER ?>" method="post" id="options">

    <table class="form-table">

    <tbody>

    <tr>

    <th scope="row">Default Friend ID:</th>

    <td><input name="bp-default-friend-id" id="bp-default-friend-id" value="<?php echo get_option('bp-default-friend-id') ?>" />

    </td>

    </tr>

    </tbody>

    </table>

    <p class="submit">

    <input name="submitted" type="hidden" value="yes" />

    <input type="submit" name="bp-default-friend" id="bp-default-friend" value="<?php _e( 'Save Settings', 'buddypress' ) ?>"/>

    <?php wp_nonce_field( 'bp-default-friend') ?>

    </form>

    </div>

    <?php

    }

    add_action('wpmu_activate_user', 'default_friend', 1, 1);

    add_action('admin_menu', 'default_friend_control');

    ?>

    Sorry, forgot to add. Use these tokens in your update_welcome_user_email function to tell WordPress where to insert the relevant values: USERNAME PASSWORD LOGINLINK SITE_NAME

    Hi life2000

    You need to write a filter to hook into the update_welcome_user_email action, like so:

    add_filter('update_welcome_user_email', 'filter_newuseremail_dm', 1, 4);

    function filter_newuseremail_dm($welcome_email, $user_id, $password, $meta) {

    return "body text of your email";

    }

    If you want to send an email formatted with HTML, you also need to do this:

    add_filter('wp_mail_content_type', 'newuseremail_content_type_dm', 1);

    function newuseremail_content_type_dm() {

    return 'text/html';

    }

Viewing 7 replies - 6,151 through 6,157 (of 6,157 total)
Skip to toolbar