[ Index ] |
|
Code source de e107 0.7.8 |
1 PHPBB2 to E107 Conversion Routine 2 ================================= 3 4 Issue dated: 13.06.2006 5 6 Any updates, bugfixes or comments please send pm to steved at e107.org 7 8 9 Conversion routines from other BBS 10 ================================== 11 phpbb2.php - modified from earlier script, with ability to process and re-map bbcodes, plus more options. 12 13 Note: Only the underlying read/translate routine has been modified, plus some detail changes in the configuration table. The key routines which read and write the databases should be the same as those originally shipped. 14 15 Credits: Based on the script originally shipped with E107 (jalist) 16 Modified to mostly work by aidee 17 Enhanced by steved 18 Reflects mods made by McFly in the "official" script between V1.4 and V1.5 19 Thanks to Rashan for a lot of testing and feedback. 20 21 ********* This is still to some extent a work in progress - please report any problems to steved by PM *********** 22 23 Installation 24 ============ 25 1. Create a fresh install of E107. (Not essential, but it will overwrite rather a lot!) 26 2. Copy the files into the e107_files/convert subdirectory. 27 28 29 To Run 30 ====== 31 1) If there's anything in the e107 user table, you must delete ALL entries, EXCEPT user ID:1 - This is the admin login. (or whatever you named the #1 when you installed e107) 32 2) Make sure the forum plugin is installed (don't define any categories etc) 33 3) login to the e107 as admin (or whatever #1 is) 34 4) browse to e107_files/import/new_phpbb2.php 35 5) fill in the required info for login/password, etc. 36 db to import FROM is your phpbb2 database, with whatever prefix is set - often _phpbb_ 37 6) once the script runs sucessfully, return to the e107 admin, head on over to the Administrators page and set the proper people up with their admin access, delete unnessesary admins 38 7) go to the Forum plugin page, select Tools from the right hand side and tell it to recalculate posts and such for all the forums, and sub-forums and posts. 39 8) double-check forum mods to make sure the proper userclasses are setup as mods for the proper forums 40 9) Head on over to the UserClasses page and doublecheck that the proper users are in the proper classes (Forum Mods, etc...) 41 42 43 44 Known Issues 45 ============ 46 1. Forum polls may not be transferred. At the current time there are various issues with this in the E107 core, and this may be the reason. So this has been put on hold until the core is definitely fixed. 47 48 49 BBCodes 50 ======= 51 BBCode conversion may not always appear to work completely, especially if they were originally not been entered correctly. And there may be bbcodes which are not supported in E107. 52 In some cases it is possible to do a direct translation within the conversion routine (see later). 53 Otherwise download the add_bbcodes plugin from e107coders.org, and create bbcodes to match the originals (its often possible to use an existing bbcode as a template). 54 55 56 =========================================================================== 57 MODIFYING THE BEHAVIOUR 58 =========================================================================== 59 60 File import routine (import_mapper.php) 61 =================== 62 63 The import is based on a processing routine whose behaviour is defined in an array. The rest of these notes deal with that routine. Using the tables in the accompanying file as an example, it should be possible to modify the behavior of the conversion, and adapt to other CMS. 64 65 66 Using the conversion routine 67 ============================ 68 Read one line from your database; pass to: 69 70 function createQuery($convertArray, $dataArray, $table, $maptable default null) 71 72 where: 73 $convertArray is an array defining the translations and lookups to be done 74 $dataArray is an array of input data, keyed by source field name. 75 $table is the table name 76 $maptable if specified is used to translate bbcodes. 77 78 The function returns a line of text which is a mySQL 'INSERT' query. 79 80 81 $convertArray format 82 ==================== 83 This is a 2-dimensional array which relates fields in the source and destination databases. 84 Each row has a number of definition fields which relate to a single data item. The first three are 85 mandatory. The keys must be as specified: 86 87 Field 1 "srcdata" Source field name 88 89 Field 2 "e107" Destination field name 90 91 Field 3 "type" Type of destination field: 92 INT - Integer 93 STRING - Text/string of any sort 94 STRTOTIME - time/date as text string (not yet supported) 95 96 Field 4 "value" (Not always present - should only be if source field is null) 97 Sets a value (sometimes from a function parameter). Overrides all other options. 98 99 Field 5 "default" Sets default if the source field is undefined 100 101 Field 6 "sproc" Various processing options (see below) 102 103 104 Processing Options 105 ------------------ 106 Comma separated string of processing options; options are invoked if present. 107 108 The following are applied to string fields: 109 usebb Allows bbcode, and enables other bbcode processing options. 110 If the $maptable parameter is non-null, translates bbcodes as well 111 phpbb Causes numerics after colons within bbcodes to be stripped 112 bblower All bbcodes are converted to lower case. (Applied before other processing) 113 stripbb Strips all bbcode in a string (i.e. anything between []) 114 115 The following are applied to integer fields: 116 zeronull If the integer value is zero, writes a null string. 117 118 119 BBCode Mapping Table 120 ==================== 121 A mapping table may be passed to the conversion routine, which translates bbcode between the two systems. 122 The table is an array of key/data pairs, for example: 123 124 $mapdata = array("b" => "bold","u" => "ul"); 125 126 The above translates the 'b' bbcode to 'bold', and the 'u' bbcode to 'ul'. 127 It is also possible to delete a specific bbcode (while retaining the text between the start and end of the code) by setting the translated value to an empty string. 128 The above method can also be used to translate bbcodes from upper to lower case. 129 Parameters after the bbcode (identified as following an '=') are retained; 130 131 132 Base routines read one record at a time from the source database, and 133 pass it to createQuery, which uses the above tables to generate an 'insert' 134 line with the appropriate data. 135
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Sun Apr 1 01:23:32 2007 | par Balluche grâce à PHPXref 0.7 |