The MU forums have moved to WordPress.org

[HACK] Forcing 'ANYONE CAN REGISTER' (10 posts)

  1. Nekusagi
    Member
    Posted 17 years ago #

    I did this to the ones who want some public stuff.

    Open wpdir/wp-content/general-template.php

    go to line 39

    You may find:

    function wp_register( $before = '<li>', $after = '</li>' ) {
    if ( ! is_user_logged_in() ) {
    if ( get_settings('users_can_register') )
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-register.php">' . __('Register') . '</a>' . $after;
    else
    $link = '';
    } else {
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
    }

    echo apply_filters('register', $link);
    }

    add '//' in the lines 42, 44 and 45

    looking like this

    function wp_register( $before = '<li>', $after = '</li>' ) {
    if ( ! is_user_logged_in() ) {
    // if ( get_settings('users_can_register') )
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-register.php">' . __('Register') . '</a>' . $after;
    // else
    // $link = '';
    } else {
    $link = $before . '<a href="' . get_settings('siteurl') . '/wp-admin/">' . __('Site Admin') . '</a>' . $after;
    }

    echo apply_filters('register', $link);
    }

  2. Nekusagi
    Member
    Posted 17 years ago #

    then add in your template 'wp_register()'

  3. samchng
    Member
    Posted 17 years ago #

    What is this register for? I thought everyone can register as a user without a blog already?

  4. Nekusagi
    Member
    Posted 17 years ago #

    this is a tag that add a link that is used for REGISTER or GO TO ADMIN PANEL. In WPMU it only show the ADMIN link.

  5. Xen
    Member
    Posted 17 years ago #

    I was thinking of another way to do this
    which was adding a checkbox on the signup form which says "Allow User Registration:" and simply sets teh user option in the database... more info soon :-D

  6. Xen
    Member
    Posted 17 years ago #

    Done the Above Hack, Here's how!

    (Note that you CANNOT use this with the original hack)

    OPEN:

    wp-admin/options-general.php

    FIND:


    <tr valign="top">
    <th scope="row"><?php _e('Membership:') ?></th>
    <td> <label for="comment_registration">
    <input name="comment_registration" type="checkbox" id="comment_registration" value="1" <?php checked('1', get_settings('comment_registration')); ?> />
    <?php _e('Users must be registered and logged in to comment') ?></label>

    AFTER ADD:


    <label for="users_can_register">
    <input name="users_can_register" type="checkbox" id="users_can_register" value="1" <?php checked('1', get_settings('users_can_register')); ?> />
    <?php _e('Allow User Registration') ?>
    </label>

    Then in each blog under:

    Options > General

    You will find:

    http://bloggi.org/images/bloggi-userscanregister.png

    (See ScreenShot)

    Enjoy!

  7. Nekusagi
    Member
    Posted 17 years ago #

    way better than mine

    note: add a <br /> before the hack label

  8. mrjcleaver
    Member
    Posted 17 years ago #

    Did this make it into the codebase?

  9. billdennis5
    Member
    Posted 17 years ago #

    Bummer. I added this hack and when I logout and try to register, I get send back to the front page of the blog. Not at all useful.

  10. mrjcleaver
    Member
    Posted 17 years ago #

    This is characteristic of most unintegrated hacks or patches, regardless of the software package: they rot. Even if they don't rot they can be tricky to install and even if not tricky to install they fragment the install base as some installs have patch X installed, others patch Y, yet others patch Z. This is trouble enough without consideration for combinations X&Z, Y&Z, Y & half-of X, etc.

    How can we make at least some of these troubles would go away? Would integration and enabling by configuration switch an option? How can we ensure we fit the WPMU Development Methodology?

About this Topic

  • Started 17 years ago by Nekusagi
  • Latest reply from mrjcleaver