Modules: Xoops Importer Alpha Released

Posted by: tedsmithOn 2006/3/20 6:54:20 7216 reads
I am very proud to announce an Alpha release of my very first Xoops development and it is in fact my first effort at writing PHP!

I've been involved with Xoops for approaching two years and although I've built four sites and offer support in the forums when I can, my expertise seldom realms into development or anything like that. So I decided to embark on a project to force myself to learn how to write PHP as opposed to just being able to read (some) of it in the hope that I can contribute to the Xoops project too.

Xoops Importer is it! It is based on the original PHP script written by Christian of Xoops France (for which I give full credit for the original idea and a big chunk of the code although it's been heavily modified for Xoops Importer).

Christians script required the users to modify the variables and enabled the import of several user values. Xoops Importer has a GUI (in the form of an HTML index file) and it imports all of the appropriate Xoops user registration details from a delimited text file making it easy for every day Xoopers to use. With appropriate adjustment of your delimited file you can import the data from any CMS user based directly into Xoops! It is vital that the input file is carefully prepared as stated in the intructions without errors otherwise the script will fail.

Currently, it's just an index html file and a PHP script but I do hope to make it into a module once I understand that process (any tips in the meantime will be much appreciated). I tried to embark on the module side from the outset, but learning PHP itself proved to be a big enough step for me without trying to learn module structures too!

Xoops Importer is only for Xoops 2.0 but again, I do hope to make it compatible for 2.2 + in the near future. I've not looked into Xoops 2.2 but it may work with that if anyone is willing to test it.


I've tried to test it using the maximum sized spreadsheet of 65000 records (a 15Mb delimited file) but it's too big for uploading to my commercially hosted server. 10Mb is the limit on many commercially hosted servers. So I've tested it with a delimited input file concisting of 20,000 which is 5Mb in size (provided in the zip for testing purposes called 'DemoInputSource_5Mb_20000Records.csv'). That worked a treat! I doubt there will be many instances where people are trying to exceed this number of user imports but I have no reason to believe that it wouldn't cope with a larger source. If you have a larger source just adjust the name="MAX_FILE_SIZE" value="10000000" entry of index.html to whatever size you need.

Known issues

For some reason, an empty blank entry is inserted into the database from the end of the file. So if there's 20,000 users to import 20,001 get imported. I will look into this – maybe some one can help me resolve it?

To Do in Future :

These are probably not going to be built into the project until after an offical stable version has been released. The alpha, beta and release candidates will involve just corrections of problems in this release and making the code better in light of feedback received from you guys, but I wanted people to know that I do have longer term plans for it.

1) Create a function to parse the source file intelligently so that the user does not have to order their delimited file in the specified format. Currently, if the columns are not placed as stated the wrong values will be imported into the wrong database columns.

Enhance interface

Make moduler for installation on an Xoops site

Create dynamic progress bar or some kind of 'status' indicator

Add timer to time the length of the process

Possible create onClick event for Submit button so it changes to 'Please Wait' or something.

Improve error checking. For example, develop MIME Type loop to prevent accidental use of jpegs or whatever (was built in but removed for now).

Get Xoops Importer from my project page at here.