The MU forums have moved to WordPress.org

Imports Working !! (27 posts)

  1. wugga
    Member
    Posted 19 years ago #

    Starting a new thread because they work now.

    I have imports working now for member blogs. I only have it working for RSS imports at the moment and still need to get it linked in the menu. You can check out my first successful run at http://test.wugga.com

    This post is just a teaser until I get it all worked out and can post the code.

    I got the RSS from http://kevin.wugga.com/feed and imported it from the webpage to the test account. It appears to have gotten everything as expected.

  2. wugga
    Member
    Posted 19 years ago #

    Update: As I mentioned in the previous post. I have imports working and will be able to complete this but I'm actually one step ahead of myself.

    The problem with the redirects being exceeded will go away *IF* you comment out the auth_redirect() function call in admin.php.

    Blog owners still won't be able to import from that page but that's the part I do have worked out. As soon as I track down what in auth_redirect() is giving the grief I'll post another update.

  3. Konstantin
    Inactive
    Posted 19 years ago #

    Waiting impatiently for imports to be fully working :D

    I'll be expecting updates! :P

  4. comforteaglespaceman
    Inactive
    Posted 19 years ago #

    All hail wugga!

  5. tubablogs
    Inactive
    Posted 19 years ago #

    Hi there,

    Am I correct in understanding that I will be able to import a regular Word Press blog into a MU account via RSS?

    I would like to set up some blogs for users on my site manually right now using individual installations...but when WPMU gets a bit more finished, eventually switch over to that. I'm having installation problems at this time.

    So this is great, I can run individual blogs for now, and by the time I get more users, import them into WPMU. Right? -Rose

  6. wugga
    Member
    Posted 19 years ago #

    UPDATE - I have the RSS imports working for individual user blogs and it seems to work perfectly but I *think* it introduces a security threat at the moment. The only way I can get it to work is to disable the call to the function auth_redirect() in admin.php and thats not something I'm willing to do.

    What seems to be happening is that import.php has a require_once('admin.php'); and admin.php calls auth_redirect() from pluggable-functions.php and auth_redirect() thinks that you are not logged in (I think) and tries to redirect the browser to wp-login.php. This redirect to wp-login is resulting in an endless mod_rewrite and giving us the error.

    As soon as I can figure out why auth_redirect() thinks we are not logged in I should have this completed.

  7. Konstantin
    Inactive
    Posted 19 years ago #

    Any news?

  8. wugga
    Member
    Posted 19 years ago #

    Latest Update is: I figured out why the redirect is happening. Not sure why it was coded that way but it probably has something to do with WordPress single user.

    wp-congfig.php sets the cookie to "" if admin/import. admin.php calls auth_redirect() to see if we are authenticated and redirects to wp-login if we're not. You'll have to do some reading between the lines here and follow the code and it will all actually make soe sense.

    I've been out of town for a couple of days and will start working on this again late today or this evening and hopefully can post all of the changes.

    Just a note that fixing the auth and redirects still does not fix the problem for a MU installation. I have the part of getting individual blog-admin imports where they bel0ng but now the import script is not looping properly and works differantly depending on which theme you import *from*.

    More later.

  9. mspecht
    Member
    Posted 19 years ago #

    wugga, once you have something going I am more than happy to test it out a bit.

  10. wugga
    Member
    Posted 19 years ago #

    Feel free to check it out. You can use the test.wugga.com blog for testing. The username is test and the password is 629498 and will of course be changed at some later date. Go to the dashboard click import and follow the instructions as see where you get. It is only working with RSS 2.0 feeds at the moment. Leave comments and feedback at http://kevin.wugga.com/2005/09/24/import-testing/ please.

  11. Konstantin
    Inactive
    Posted 19 years ago #

    How's it going?

  12. 80g
    Member
    Posted 19 years ago #

    I'm curious how it's going as well. (been keeping and eye on this thread)

  13. Konstantin
    Inactive
    Posted 19 years ago #

    Me as well.

  14. mspecht
    Member
    Posted 19 years ago #

    I tested the RSS import process out over at test.wugga.com and it worked reasonably well. However the site is no longer active, Kevin how are things going.

  15. mspecht
    Member
    Posted 19 years ago #

    wugga any news on the import code?

  16. ergate
    Member
    Posted 19 years ago #

    I am trying to import from a wordpress site. I have used the suggestion above, but it is not working. I am recieving this error
    "Import RSS
    The file you specified does not seem to exist. Please check the path you've given."

    I commented out auth_redirect()

    I edited the following line in this file (import/rss.php)
    define('RSSFILE', 'rss.xml');
    I changed the rss.xml with the address of my feed, I tried chanign the 'RSSFILE', I tried changing them both.

    Any suggestions?

  17. 80g
    Member
    Posted 19 years ago #

    Any word on this? If not I think I'll starting hacking it myself...?

  18. wugga
    Member
    Posted 19 years ago #

    The imports actually work. The problem was that wp-settings was redirecting anything in the import directory so that had to be changed. The next issue is getting the users rss, or other import, file into their directory. I also got that working using the old upload facility and allowing specific file extensions. After this was done it was only a matter of tweaking the exisiting import/xxxxx.php files. That should get everyone going in the right direction. I dropped work on it several revs back because workload on other projects got to high.

  19. Invizz
    Inactive
    Posted 19 years ago #

    the problem with not existing rss path can be solved by replacing:

    if (!file(RSSFILE))
    die("The file you specified does not seem to exist. Please check the path you've given.");
    .
    .
    .
    by
    if (!fopen(RSSFILE,'r'))
    die("The file you specified does not seem to exist. Please check the path you've given.");

  20. ergate
    Member
    Posted 19 years ago #

    Invizz: I made your suggested change and it worked perfectly.

    all:anybody:everybody:
    Do you think this is something that should be left with the !fopen, or should we revert it back tot he !file? Also, if it should stay (at least until after I finish the imports), will this change make it into the nightly builds, or is this just a temporary fix until a better implementation comes around?

  21. ergate
    Member
    Posted 19 years ago #

    Import instructions and two questions at the end.
    I did get the import to work, and it didnt take to much work. You need to modify two files.
    This was a lot easier then another method, I have imported one user through this method, and I have imported another blog by importing the tables directly into the db.

    1) First, you will need to open: / wp-inst / wp-admin / import / rss.php
    (this file tells the rss import script where to get the goods you want to import, you just need to point it in the right direction)

    At the top look for

    // Example:
    // define('RSSFILE', '/home/example/public_html/rss.xml');
    define('RSSFILE', 'rss.xml');

    and you will need to make a change similar to this

    // Example:
    // define('RSSFILE', '/home/example/public_html/rss.xml');
    define('RSSFILE', 'http://www.domain.com/blog/feed/');

    2) Also in this same file, look for this near the bottom,

    if (!file(RSSFILE))
    die("The file you specified does not seem to exist. Please check the path you've given.");

    and change it to this

    if (!fopen(RSSFILE,'r'))
    die("The file you specified does not seem to exist. Please check the path you've given.");

    Save and close this file.

    3) open: / wp-inst / wp-admin / admin.php
    find this line, (should be around line 11)
    auth_redirect();

    Comment it out like so
    //auth_redirect();

    Save and close file.

    4) Login as the user you need to import (not as admin or anything else)
    click on the import tab,
    the choose RSS,
    then choose "Begin RSS Import"
    the you get "All done. Have fun!" which links to the main page of the blog.

    5) go back to
    admin.php and uncomment
    //auth_redirect();

    and go back to rss.php and un-point this
    define('RSSFILE', 'http://www.domain.com/blog/feed/');
    Leave the other change you made as is, or until someone who is in the know tells us otherwise.

    Then you are all good to go.

    A couple of things about using the import, maybe somebody more in the know can help
    1. I cannot get it to import the comments (I tried to import comments seperatley but it imported them as posts, not as comments)
    2. it does not get all of the posts (most of them but not all)

    I dont know why on both accounts.

  22. zigx
    Member
    Posted 18 years ago #

    should the imports from the nightly build work or do i have to hack it up like above?

  23. wugga
    Member
    Posted 18 years ago #

    I'm working from memory here but I think the fix finally wound up being to just add a slash "/" after import in the wp-settings file so that the modified line 302 looks like this:

    if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import/')) :

  24. NickR
    Member
    Posted 18 years ago #

    Just adding that slash made my imports work like a dream :)

  25. samchng
    Member
    Posted 18 years ago #

    Adding the slash didn't work for me. Instead I delete the wp-admin line

    if (!strstr($_SERVER['PHP_SELF'], 'install.php') && !strstr($_SERVER['PHP_SELF'], 'wp-admin/import/')) :

    To look like this.

    if (!strstr($_SERVER['PHP_SELF'], 'install.php')) :

    Then it worked fine. Any ideas what are the implcations?

  26. zigx
    Member
    Posted 18 years ago #

    Wugga, thank you for the detailed response... line number from memory!!? dood you need a break! lol

    I just made that minor change and BLAM works like a charm.

    thanks to all who made this script free and maintain the code!

  27. suleiman
    Member
    Posted 18 years ago #

    just wondering if this same technique could be used to import posts from the SiteWide Feed plugin via RSS into the homepage blog for setup with Ultimate Tag Warrior?

About this Topic