• _mf_

    (@_mf_)


    After discussing this briefly, I am releasing a first very preliminar version of my pMachine 2.0 import to WordPress 1.0.1 . This is for the current download version, not any CVS or more advanced/betas. It is released under the GPL.
    The file is available here (update: scroll down for v 0.2).
    PROCEED WITH CAUTION – BACKUP YOUR WP SETUP FIRST!
    For some reason, categories are not displayed OK although database tables & fields seem to match.This may only work on a brand new install of WP, since member IDs are assumed to be sequential.
    I tried it on my own pMachine 2.0 site and this is the result (forgive the broken design under IE). I use Mozilla Firefox (formerly Firebird) 0.8.
    This is what’s working:
    – Import of members AND non-members information, including admin or “active” level
    – Import of categories
    – Categories equivalency so category IDs match when importing posts
    – Importing of posts
    – Importing of comments, including all details (timestamps, IP for anon-posts, full member/non member info)
    Some features:
    – Debug mode for viewing before doing things – will not show categories properly since there are 2 steps in the script
    – Complete trace of everything being done, including every SQL query, even when in Debug mode
    – Since passwords are encrypted in pmachine, I set the password to the first 6 characters of the encrypted thing, which ends up being a unique pwd. Not ideal, but enough to notify users to change it (instead of re-registering)
    Here’s what needs to be fixed:
    – Display of categories (see my resulting site for an example)
    – Translation of special/ISO characters to UTF-8 or HTML entities
    – Translation of pMachine code to whatever WP uses (again, see my target site for examples of URLs and other code being displayed instead of rendered)
    – More validation
    Please email me any code updates, via my website (there’s a contact form), or post here.
    Enjoy!

Viewing 11 replies - 16 through 26 (of 26 total)
  • Thread Starter _mf_

    (@_mf_)

    Yes, Xibe. That can easily be added as new functionality. I didn’t have any “closed” posts in PM so I didn’t implement it. I’ll add that to the “to-do” list.

    That’s great, thanks!

    Thread Starter _mf_

    (@_mf_)

    Ok, so I’ve found a fix for the problem Mr. Peer was having. Turns out the PHP setup in his server must have magic_quotes_gpc to OFF. So, if I fixed all the queries to add slashes to them (so it works for him), it would not work for me (or others whose servers have this setting on). See:
    https://www.zend.com/manual/function.get-magic-quotes-gpc.php
    Check the comments in the code, I think it’s self explanatory. I also added a feature to import all posts to a single user, if wanted. So version 0.3 of the pMachine 2.0 importer is online.
    If anyone’s willing to test it again, pls. comment back here.

    mrpeer

    (@mrpeer)

    ??
    (with version 0.3)
    Inserting post “Welcome”
    INSERT INTO wp_posts (post_author, post_date, post_content, post_title, post_category, post_excerpt, post_name, post_status, post_modified) VALUES (‘1’, ‘2002-08-17 15:37:55’, ‘Bienvenue à moi, à vous… Voilà, c’est le premier message de ce blog… Whaou, quelle émotion… ?? PS : Mettez des commentaires à mes posts, ?a fera plaisir
    ‘, ‘Welcome’, ‘2’, ”, ‘welcome’, ‘publish’, ‘2002-08-17 15:37:55’)
    Invalid query: You have an error in your SQL syntax near ‘est le premier message de ce blog… Whaou, quelle émotion… ?? PS : Mett’ at line 4

    Thread Starter _mf_

    (@_mf_)

    Mr. Peer,
    Can you share your phpinfo() results with us ?
    To solve your particular situation, you can always hard-code the addslashes() functions and remove the magic_quoets detection code.

    Moderator Matt Mullenweg

    (@matt)

    I would stripslashes and then use $wpdb->escape();

    Anonymous
    Thread Starter _mf_

    (@_mf_)

    Xavier: Yes, it’s exactly that. and it specifically mentions:

    That’s the golden rule. You should never have to stripslashes. Ever.

    In my code I test for the magic_quotes environment variable but for some reason it doesn’t work in Mr.Peer’s environment. I hope he can provide more details so we can make the current code work with this kind of exceptions.

    mrpeer

    (@mrpeer)

    https://mr.peer.tribalix.com/phpinfo.php
    I set magic_quote_runtime to on in my php.ini, restart apache, and try to import my PM base and it works
    BUT I’ve got an other problem : for each post, comments have the same author ??

    Tried using the 03 version to import Pmachine into wordpress. When I run the script nothing happens. no error messges, no nothing.
    ?
    Neil

    Thread Starter _mf_

    (@_mf_)

    As mentioned in the announcement, this was for pMachine 2.0 . It’s GPL so you are free to do whatever you want. It’d be nice if you publish the results. I don’t have any short-term plans to update the script as I don’t use pMachine at all anymore.
    I believe there is another pMachine import script that supports 2.3 and the next (1.3) version of WP has new import functionality, you may want to check that.

Viewing 11 replies - 16 through 26 (of 26 total)
  • The topic ‘ANNOUNCE: PMachine 2.0 import (v0.1)’ is closed to new replies.