The MU forums have moved to WordPress.org

Create new blog via php script (16 posts)

  1. beatbox433
    Member
    Posted 17 years ago #

    Hi all,
    I would like to be able to create new blogs by passing user details to wpmu via a php script.
    Before I start looking at the wpmu code, has anyone already done this, or can anyone suggest where I might start?
    Thanks.

  2. andrea_r
    Moderator
    Posted 17 years ago #

    And how would it differ from the included signup process?

  3. beatbox433
    Member
    Posted 17 years ago #

    The main difference is that I have a username, password, email address etc for my users already, as they will be accessing the wpmu blog from inside another application. (a Virtual Learning Environment.)
    So I want them to be able to create a blog just by clicking on a link. Their details would then be passed to wpmu and the blog created, with a default name, eg. John Smith's Blog. (Joe Bloggs' blog?!) Thereafter they would be able to access the blog from inside the VLE, but without having to log in to wpmu. Login would be done automatically using the VLE username and pass.
    Hope that makes sense. It's all about ease of use for users, and single sign-on.

  4. bethgranter
    Member
    Posted 17 years ago #

    Hi, if you do find/write this script I would be very interested also. I am looking at using WPMU for a similar purpose.

  5. beatbox433
    Member
    Posted 17 years ago #

    I have done this already with LifeType, which has an API for this kind of thing. However I would prefer to use WordPress if possible because I think more people are familiar with it.
    Having an API for blog creation etc. would really extend WordPress, and make it a lot more connectable with other applications. Web 2.0 anyone?

  6. mdgross
    Member
    Posted 15 years ago #

    Has anyone figured out how to do this yet?

    I'm going to work on it today or tomorrow...

  7. jskov
    Member
    Posted 15 years ago #

    any news here?

  8. d0k
    Member
    Posted 15 years ago #

    try to look at:
    wpmu_validate_blog_signup();
    wpmu_signup_blog();
    confirm_blog_signup();

  9. gries
    Member
    Posted 15 years ago #

    I wrote a script which you'll have to put into /wp-admin/ it takes a password via GET and 4 POST parameters
    username -> this user will be created and assingned to the blog
    blog[domain] -> the name that appears in the url like mywordpress.com/blogs/domain
    blog[email] -> email address
    blog[title] -> blog title

    the script will autocreate a blog / user with the given data using the wordpress functions

    it also has a password-auth because i commented the wp auth out, so I don't have to mess arround with cookie stuff etc.

    if some1 is intrested write me a mail or reply here.

  10. VentureMaker
    Member
    Posted 15 years ago #

    Can you share your code with me? :)
    venturemaker [at] gmail [dot] com

  11. clinicalthinker
    Member
    Posted 15 years ago #

    Please I would like to have your code also.
    I am pretty new at this so would also need to know where this goes :)

    Thank you!

    support [at] clinicalthinker [dot] com

  12. medianetwork
    Member
    Posted 15 years ago #

    I would also be interested in receiving the script.
    Thank you!

    dreamsandaspirations [at] yahoo.com

  13. gries
    Member
    Posted 15 years ago #

    I'll be back @ work on thursday I'll post the code here.
    with a little how-to that explains the script.

  14. tdjcbe
    Member
    Posted 15 years ago #

    Actually, no, please don't post the code here as the forums usually eat code. Please consider using a service like pastebin or load it online somewhere as *.phps or *.txt files and link to it.

    Thank you though for following up on this,.

  15. gries
    Member
    Posted 15 years ago #

    alright so here's the script you have to put into /wp-admin/ of the wordpress directory:
    http://pastebin.com/f1c6693d0

    and a small example on how to use it:
    http://pastebin.com/f2c933295

    as I said I disabeld the wordpress authetification so I dont have to deal with cookies,

    in the first script it checks the password that is given by a GET parameter against a MD5 hash, so if you want to change the password just replace the md5 hash with your hash and send the correct password via GET if any questions are left post them here

  16. VentureMaker
    Member
    Posted 15 years ago #

    Thanks a lot! I'll test it shortly. Bugs report will follow if any :)

About this Topic

  • Started 17 years ago by beatbox433
  • Latest reply from VentureMaker