I'm trying to port from DragonflyCMS which does this weird thing where all of the PHPBB tables aside from users are prefixed "cms_bb" but that one is just "cms_" -- I can't therefore use the module without hacking it use a special prefix in for the users table.

So allowing people to either specify prefixes and/or table names on a per-table basis, or else making a special exception for users, would allow this module to be used with Dragonfly CMS, and I suspect other *Nuke-based derivatives, as well.

CommentFileSizeAuthor
#5 dragonflycms_0.patch4.54 KBwebchick
#4 dragonflycms.patch2.77 KBwebchick

Comments

beginner’s picture

Title: Specify prefix on a per-table basis » DragonflyCMS / *Nuke CMS: phpBB modification problems.

Specifying a prefix on a per-table basis would be an overkill.
Apparently, nuke based cms override the phpBB user table and replace it with their own, which is also the problem behind this issue:
http://drupal.org/node/78514

Currently, I am only supporting vanilla phpBB.
Supporting modified phpBB (to work with other CMS) may be possible, but:
1) does each *Nuke CMS modify phpBB in the same way?
2) are the changes in the user table important compared to a vanilla phpBB. If yes, major parts of the module may need to be rewritten to include if(){ } statements... :(

If you include a patch with all the modifications you have made to make the module work for you:
1) other Nuke users could apply use the patch.
2) I can see how difficult it would be to add a few extra checks.

FYI: here is a dump of the user table schema:

--
-- Table structure for table `phpbb_users`
--

CREATE TABLE `phpbb_users` (
  `user_id` mediumint(8) NOT NULL default '0',
  `user_active` tinyint(1) default '1',
  `username` varchar(25) NOT NULL default '',
  `user_password` varchar(32) NOT NULL default '',
  `user_session_time` int(11) NOT NULL default '0',
  `user_session_page` smallint(5) NOT NULL default '0',
  `user_lastvisit` int(11) NOT NULL default '0',
  `user_regdate` int(11) NOT NULL default '0',
  `user_level` tinyint(4) default '0',
  `user_posts` mediumint(8) unsigned NOT NULL default '0',
  `user_timezone` decimal(5,2) NOT NULL default '0.00',
  `user_style` tinyint(4) default NULL,
  `user_lang` varchar(255) default NULL,
  `user_dateformat` varchar(14) NOT NULL default 'd M Y H:i',
  `user_new_privmsg` smallint(5) unsigned NOT NULL default '0',
  `user_unread_privmsg` smallint(5) unsigned NOT NULL default '0',
  `user_last_privmsg` int(11) NOT NULL default '0',
  `user_emailtime` int(11) default NULL,
  `user_viewemail` tinyint(1) default NULL,
  `user_attachsig` tinyint(1) default NULL,
  `user_allowhtml` tinyint(1) default '1',
  `user_allowbbcode` tinyint(1) default '1',
  `user_allowsmile` tinyint(1) default '1',
  `user_allowavatar` tinyint(1) NOT NULL default '1',
  `user_allow_pm` tinyint(1) NOT NULL default '1',
  `user_allow_viewonline` tinyint(1) NOT NULL default '1',
  `user_notify` tinyint(1) NOT NULL default '1',
  `user_notify_pm` tinyint(1) NOT NULL default '0',
  `user_popup_pm` tinyint(1) NOT NULL default '0',
  `user_rank` int(11) default '0',
  `user_avatar` varchar(100) default NULL,
  `user_avatar_type` tinyint(4) NOT NULL default '0',
  `user_email` varchar(255) default NULL,
  `user_icq` varchar(15) default NULL,
  `user_website` varchar(100) default NULL,
  `user_from` varchar(100) default NULL,
  `user_sig` text,
  `user_sig_bbcode_uid` varchar(10) default NULL,
  `user_aim` varchar(255) default NULL,
  `user_yim` varchar(255) default NULL,
  `user_msnm` varchar(255) default NULL,
  `user_occ` varchar(100) default NULL,
  `user_interests` varchar(255) default NULL,
  `user_actkey` varchar(32) default NULL,
  `user_newpasswd` varchar(32) default NULL,
  PRIMARY KEY  (`user_id`),
  KEY `user_session_time` (`user_session_time`)
) TYPE=MyISAM;


beginner’s picture

btw, I searched but couldn't find any relevant information on the Dragonfly web site.
the wikipeadia article, however, said that Dragonfly included phpBB "with enhancements".

webchick’s picture

Wow, I totally forgot I created this issue until I sat down tonight to port this site again. ;)

Here's the structure dump for dragonflycms. I *think* this is vanilla, no hacks. It does indeed differ from the phpbb user schema:

CREATE TABLE `cms_users` (
  `user_id` mediumint(8) unsigned NOT NULL auto_increment,
  `name` varchar(60) default NULL,
  `username` varchar(50) NOT NULL default '',
  `user_email` varchar(255) NOT NULL default '',
  `femail` varchar(255) default NULL,
  `user_website` varchar(255) default NULL,
  `user_avatar` varchar(255) NOT NULL default '',
  `user_regdate` varchar(20) NOT NULL default '',
  `user_icq` varchar(15) default NULL,
  `user_occ` varchar(100) default NULL,
  `user_from` varchar(100) default NULL,
  `user_interests` varchar(150) default NULL,
  `user_sig` varchar(255) default NULL,
  `user_viewemail` tinyint(4) NOT NULL default '0',
  `user_aim` varchar(35) default NULL,
  `user_yim` varchar(40) default NULL,
  `user_msnm` varchar(40) default NULL,
  `user_password` varchar(40) NOT NULL default '',
  `storynum` tinyint(4) NOT NULL default '10',
  `umode` varchar(10) default NULL,
  `uorder` tinyint(4) NOT NULL default '0',
  `thold` tinyint(4) NOT NULL default '0',
  `noscore` tinyint(4) NOT NULL default '0',
  `bio` tinytext,
  `ublockon` tinyint(4) NOT NULL default '0',
  `ublock` tinytext,
  `theme` varchar(255) NOT NULL default '',
  `commentmax` int(11) NOT NULL default '4096',
  `counter` int(11) NOT NULL default '0',
  `newsletter` tinyint(4) NOT NULL default '0',
  `user_posts` int(11) NOT NULL default '0',
  `user_attachsig` tinyint(4) NOT NULL default '1',
  `user_rank` int(11) NOT NULL default '0',
  `user_level` tinyint(4) NOT NULL default '1',
  `user_active` tinyint(4) default '1',
  `user_session_time` int(11) NOT NULL default '0',
  `user_lastvisit` int(11) NOT NULL default '0',
  `user_timezone` varchar(6) NOT NULL default '0',
  `user_dst` smallint(6) NOT NULL default '0',
  `user_style` tinyint(4) default NULL,
  `user_lang` varchar(255) NOT NULL default 'english',
  `user_dateformat` varchar(14) NOT NULL default 'D M d, Y g:i a',
  `user_new_privmsg` smallint(5) unsigned NOT NULL default '0',
  `user_unread_privmsg` smallint(5) unsigned NOT NULL default '0',
  `user_last_privmsg` int(11) NOT NULL default '0',
  `user_emailtime` int(11) default NULL,
  `user_allowhtml` tinyint(4) default '1',
  `user_allowbbcode` tinyint(4) default '1',
  `user_allowsmile` tinyint(4) default '1',
  `user_allowavatar` tinyint(4) NOT NULL default '1',
  `user_allow_pm` tinyint(4) NOT NULL default '1',
  `user_allow_viewonline` tinyint(4) NOT NULL default '1',
  `user_notify` tinyint(4) NOT NULL default '0',
  `user_notify_pm` tinyint(4) NOT NULL default '0',
  `user_popup_pm` tinyint(4) NOT NULL default '0',
  `user_avatar_type` tinyint(4) NOT NULL default '3',
  `user_sig_bbcode_uid` varchar(10) default NULL,
  `user_actkey` varchar(32) default NULL,
  `user_newpasswd` varchar(32) default NULL,
  `user_group_cp` int(11) NOT NULL default '2',
  `user_group_list_cp` varchar(100) NOT NULL default '2',
  `user_active_cp` tinyint(4) NOT NULL default '1',
  `susdel_reason` text,
  PRIMARY KEY  (`user_id`),
  KEY `uname` (`username`),
  KEY `user_session_time` (`user_session_time`),
  KEY `user_regdate` (`user_regdate`),
  KEY `user_email` (`user_email`),
  KEY `user_id_level` (`user_id`,`user_level`),
  KEY `user_active_level` (`user_active`,`user_level`)
) 

I'll hack the crap out of this module and post a patch. ;)

webchick’s picture

Status: Active » Needs work
StatusFileSize
new2.77 KB

Ok, here are the changes that I needed to do to get this module working properly for DragonflyCMS:

- hard-code the users table as "cms_users"; all other tables were fine with the cms_bb prefix.
- remove the check for the comment_files table (http://drupal.org/node/114425)
- use the cms_users.user_level field rather than cms_users.user_active field to base the user's status on. (blocked vs. non-blocked) (http://drupal.org/node/114438)
- Decode HTML entities in the text, as it was stored in the db encoded. (http://drupal.org/node/114451)

Those changes are incorporated into this patch.

Also, make sure to check "Convert Registration Date" under "Misc. settings" (thanks, beginner; I don't think that was there last time I tried this).

Known issues:
- Polls don't import properly. I haven't had a chance to look into this and might not, since my users don't really care about the polls.

Overall though, this module probably shaved 600 hours off what I would've otherwise had to do by hand with SQL/PHP. You've covered a very impressive amount of edge cases with this module! Hopefully this patch can help other people who are migrating from "almost-but-not-quite" PHPBB systems.

webchick’s picture

StatusFileSize
new4.54 KB

Here's an update of this patch that applies to the Drupal 5 version once http://drupal.org/node/112032 is applied. There was a failed hunk due to a bug fix.

hardlocke’s picture

where can i get the modiefied phpbb2drupal.info file?
i can't apply the .patch file... always errors :-(

please, i need help ;-)

naheemsays’s picture

That is an old patch that will no longer apply to phpbb2drupal.

Have you tried to import using the plain module? what errors have you encountered? The main changes I can see in that patch are that instead of using a modifiable prefix for the database tables, the patch changes the prefix to cms_ (ths standard prefix in the module is phpbb_) - and you can enter that into the settings.

If you do want to import from dragonflyCMS your best bet is trial and error. try the module as is and see what works and what breaks.

naheemsays’s picture

Status: Needs work » Closed (fixed)

Marking as closed. This module is only to support import from vanilla phpbb, however DragonflyCMS / *Nuke CMS may use the same schema in which case the module will work. If however they use a different database schema, there will be problems.

(Looking at that patch suggest that there will be no problems, as only one line touches tables names - the status. the rest is separate.)