This tool helped me a lot but I faced some bugs coming either from my imported data and/or from lack of robustness of the import procedure. In addition it did not import all I wanted to import. So I debugged the problems, fixed bug, improved error messages to find errors in my data, added the additional functions that I was missing. That was a very interesting tutorial to phpBB MOD development.
Now I have finished to import my data I repackaged this updated MOD in a package I tagged V1.1 and that contains the following changes:
- Add capability to import the user rank
- Allow to specify a TAB as the CSV delimiter
- Allow to specify the Registration date format
- Add a second preview mode
- Simplify input of Birthday format and allow more formats
- Add the display of the count of imported user names
- Add AIM optional field in list of imported fields
- Avoid a fatal error when a user name contains a quote (') which is legal
- Suppress an extra </fieldset> (no visible effect since browsers ignore such errors)
Robustness and Clarifications:
- Verify and signal error if delimiter is not defined
- Verify and signal error (even in both preview modes) if user name is missing in user data
- Verify and warn (even in both preview modes) if email is missing in user data
- Verify and warn (even in both preview modes) if birth date or reg date doesn't match format
- Clarify the user name conflict message
- Suppress * after preview field labels
- Add * after mandatory input field labels
- Zip rebuilt without invalid empty directory avoiding incompatibility with WinZip
More on main new functions:
The corresponding field in the imported CSV file must contains the rank name as defined in phpBB. It is probably better to import special ranks than ranks managed by phpBB because else they will be probably overwritten at some point. Though no check is made at importation time so any defined rank will be recognized.
Using TAB as delimiter
TAB is often used as a delimiter in CSV files but it was not possible to specify this character. Now if the delimiter is \t, it is interpreted as the TAB character.
Note: The PHP CSV parsing function used to read the input file is quite weak and does not ignore the delimiters that are between enclose characters (unlike most CSV parsers). It has no escape character management either. Therefore using TAB
as delimiter is usually the only way to avoid a file corruption by delimiters contained in the text. Open Office can convert any CSV file to a TAB delimiter CSV.
Registration date format
The format can be specified with the following place holders: %Y: 4-digit year, %m: 2-digit month, %d: day(1-31), %H: hour(0-23), %M: minute, %S: second'. If nothing is provided for the format, the field is decoded as the integer number of seconds since UNIX Epoch (compatibility with the format of reg date accepted in V1.0)
Second preview mode
The first preview mode still displays the content of the first row of the imported CSV file. This allows to verify if the fields are correctly mapped and the formats are matching.
The new second mode reads all the rows of the input file and decodes all the fields, listing all the errors or warnings detected on the data. An exception: the user name conflicts are not checked. After all verifications are completed, the last record decoded data are displayed. It should be used after a successful initial check with first preview mode to avoid multiplying mapping or format specification errors.
In attachment you will find the V1.1 MOD package and the V1.1 French language pack. I hope this can be useful and that I did not introduce any regression...
Edited to signal that a Version V1.2 in now available here with additional capability to import user' websites.