The MU forums have moved to WordPress.org

Has anyone got a verswion of wp-newblog.php which works with the nightlies? (29 posts)

  1. Farms
    Member
    Posted 18 years ago #

    If you do and you could email it to me at james /at/ incsub [dot] org or post it here I would be more than eternally grateful!

    -fixing it is just too far beyond me technically :(

  2. arnott
    Inactive
    Posted 18 years ago #

    i need it also~~ does anyone can help us out?

  3. NetAndif
    Inactive
    Posted 18 years ago #

    The error happens in wp-newblog.php, line 307:

    require_once('./wp-config.php');

    At this stage, our url looks like this:

    http://server.com/wpmupath/wp-inst/wp-newblog.php?stage=1

    What i don't understand is the 'wp-inst' in this url.
    Should'nt wp-inst be hidden from the web? Or is this a special case?

    However, if wp-config is loaded inside your main blog path, you get the settings from your main blog and not from the new one.
    So if wp-newblog would continue at this point, it would try to set some options in the main blog and then die:

    require_once('./wp-config.php');
    require_once('./wp-admin/upgrade-functions.php');
    $wpdb->hide_errors();
    $installed = $wpdb->get_results("SELECT * FROM wpdb->users");
    if ($installed) die(__('<h1>Already Installed</h1>You appear to have already installed WordPress. To reinstall please clear your old database tables first.') . '</body></html>');
    $wpdb->show_errors();
    flush();

    I know, the old wp-newblog did work. But it didn't do the db stuff.
    It just called install.php inside the new blog path.

    I have a different approach for this.
    For me, the users should login to the main blog, and create a new blog from their admin panel. This blog could then be associated with the user on main.
    If anyone is interested in trying my files, please let me know. However, it would require a little bit code hacking.

  4. Farms
    Member
    Posted 18 years ago #

    Thanks NetAndif, that's certainly a good option for the commited and thanks for offering to share but I really need a simple box filling exercise...

    Do you reckon the old wp-newblog could work or have there been too many changes?

  5. donncha
    Key Master
    Posted 18 years ago #

    I'm looking at the wp-newblog. One of the reasons it doesn't work is because WP files and variables depend on a global scope. When I created the setupDBTables() function any included files didn't create global variables. I'm ripping out the classes and functions and simplifying the script now..

  6. donncha
    Key Master
    Posted 18 years ago #

    I rewrote it, used almost all of Dasher's code and then some of my own. It works, it's basic and simple. I added a rule to the .htaccess so it can be used from the install directory.
    ie. if you installed wpmu into /wpmu/ on example.com then the url will be:

    http://example.com/wpmu/wp-newblog.php

  7. arnott
    Inactive
    Posted 18 years ago #

    i try what u said, but it told me"redirection limit for this url exceeded. unable to load the requested page. this may be caused by cookies that are blocked."
    what does it mean? and how can i solve it? thx for help

  8. donncha
    Key Master
    Posted 18 years ago #

    Try tomorrow's snapshot, unless you downloaded htaccess.dist and wp-newblog.php from svn it won't work.

  9. NetAndif
    Inactive
    Posted 18 years ago #

    Seems i got into trouble with php < 4.3 now

    Fatal error: Call to undefined function: file_get_contents() in /.../wp-inst/wp-newblog.php on line 224

    Could it be possible to replace this call?

  10. NetAndif
    Inactive
    Posted 18 years ago #

    'file()' gives the same results, except it reads the content into an array. It should then be easy to get the string from the array instead.

  11. donncha
    Key Master
    Posted 18 years ago #

    Oh yeah, Dasher used that function, I'll go find his replacement file_get_contents() function and pop that in!

  12. NetAndif
    Inactive
    Posted 18 years ago #

    Thanks. But there's quickly another issue.
    I'v worked around this function and got a blog created.
    But, the site url of this blog contains 'wp-newblog' at the end.

  13. Farms
    Member
    Posted 18 years ago #

    Thanks guys, all of this is amazing stuff! Mucho gracias!

  14. donncha
    Key Master
    Posted 18 years ago #

    Got that problem fixed NetAndif!

  15. Farms
    Member
    Posted 18 years ago #

    Wonderful stuff... works a dream, sends me the email (with full and accurate address) but...

    Then I can't login (it says that admin isn't correct) & The blog has no formatting.

    Have a go and see what I mean: http://melbourneblogs.org/wp-inst/wp-newblog.php

    Any ideas?

    Cheers, James

  16. NetAndif
    Inactive
    Posted 18 years ago #

    Did you get the latest wp-newblog from svn?
    And the updated rewrite rule?
    Then you don't need the wp-inst in your url
    But I noticed a login issue, too.
    It sounds strange, but you should just try using your blogname as the login name...

  17. donncha
    Key Master
    Posted 18 years ago #

    Fixes applied last night:
    1. Fixed the siteurl.
    2. The login name as NetAndif pointed out is the blog ID, I updated the email to reflect this.
    3. Fixed a problem with the style sheet "BASE" stuff too. There was a missing "/", that might be what affected you Farms.

  18. arnott
    Inactive
    Posted 18 years ago #

    it's work very well~~ thx~~

  19. Farms
    Member
    Posted 18 years ago #

    Likewise, muchos gracias again... legends!

  20. rld1025
    Inactive
    Posted 18 years ago #

    I installed the latest update from 06-01, and am having the same issue that arnott had..

    "Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."

    What do I need to do to correct this?

    Thanks for the help

    Bob

  21. morepork
    Member
    Posted 18 years ago #

    Just want to report that I installed the 06-02 nightly and tried the newblog setup ... and it all worked 'out of the box'.

  22. morepork
    Member
    Posted 18 years ago #

    sorry about multiple posts

  23. rld1025
    Inactive
    Posted 18 years ago #

    hmm.. I installed the 06-02 nightly and am still having the same problem. Not a cookie issue with my pc. Anything else I can check?

  24. rld1025
    Inactive
    Posted 18 years ago #

    Ok, today (6-11) I downloaded the latest nightly build and I am still unable to log in to newly created blogs.. getting the

    "Redirection limit for this URL exceeded. Unable to load the requested page. This may be caused by cookies that are blocked."
    message.

    So my questions are:

    1. Does this feature work yet?

    If so, to get it working,

    1. Is the newblog.php that comes with the download the version I should be using, or should I donwload and use version from svn?

    2. Does it require any of the edits above and if so, which ones?

    Thanks for the help!

    Bob

  25. donncha
    Key Master
    Posted 18 years ago #

    It works fine for me!

    If WPMU is installed at http://localhost/wpmu/ then call the newblog script at http://localhost/wpmu/wp-newblog.php

  26. rld1025
    Inactive
    Posted 18 years ago #

    Hmm does not do it for me.. anyone else had this problem or know what I should check for this?

  27. blog-sg
    Inactive
    Posted 18 years ago #

    hi rld1025,

    Where is your site? I noticed that a backslash "/" need to be included after the wpmu folder or the error message will appear. Do not ask me why.

    http://www.Blog-sg.com/wpmu

    http://www.Blog-sg.com/wpmu/

    See the difference?

  28. donncha
    Key Master
    Posted 18 years ago #

    The unstable version today is a *very* different beast to that from a month ago. Give it a go again and it may work.

  29. Farms
    Member
    Posted 18 years ago #

    So, having figured out that the old approach doesn't allow me to create a new blog... is there a simple way to display a 'create a new blog' form (using wp-newblog.php I guess?) with the 'all-new' WPMU?

About this Topic