The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#4
|
|||
|
|||
![]()
You're welcome!
About my table, it is done and it is functional (in, fact, I created 2 tables: one for forums and other for threads), but as I put much more data than I need, I will improve the first solution. The first solution was based in the thought: "Once I want to be sure that all my redirection work, I will save them in the DB, then I visit every single link and flag it as successful mapping. At the end, I add the redirection to htaccess". However, I realized I don't need the htaccess at all. Just a reminder: I migrated from Phorum 5.2 to vBulletin. This helped me a lot, because the structure of the link was pretty different. First solution Here it is the structure of the tables, later I will explain how I use them: *note: I removed search indexes for some fields to keep the SQL shorter. [SQL]CREATE TABLE IF NOT EXISTS legacy_forum ( nodeid smallint(5) NOT NULL, nodeparentid smallint(5) NOT NULL, forumid smallint(5) NOT NULL, forumparentid smallint(5) NOT NULL, importforumid smallint(5) NOT NULL, importforumparentid smallint(5) NOT NULL, title varchar(70), phorumSlug varchar(70), `vb5Slug` varchar(70), phorumUrl varchar(150), `vb5Url` varchar(150), UNIQUE KEY uky_objectId (nodeid) ) CHARSET=ucs2 COLLATE=ucs2_general_ci ENGINE=innodb; CREATE TABLE IF NOT EXISTS legacy_thread ( nodeid mediumint(9) NOT NULL, nodeforumid smallint(5) NOT NULL, threadid mediumint(9) NOT NULL, importthreadid mediumint(9) NOT NULL, importforumid smallint(5) NOT NULL, title varchar(70), phorumSlug varchar(150), `vb5Slug` varchar(220), phorumUrl varchar(220), `vb5Url` varchar(330), phorumChecked tinyint(1) DEFAULT NULL, vbChecked tinyint(1) DEFAULT NULL, UNIQUE KEY uky_objectId (nodeid) ) CHARSET=ucs2 COLLATE=ucs2_general_ci ENGINE=innodb;[/SQL] The tables are mainly mappings between ids, slugs and paths of Phorum and vBulletin.
The table legacy_forum was created from forum (forums in vB4) and node (table for all nodes - forums, threads, posts in vB5). The table legacy_thread was created from thread (threads in vB4) and node (table for all nodes - forums, threads, posts in vB5). All fields related to slugs and URLs were derived from the title. As I learned more related to the redirection, I realized I simply need to treat the paths vBulletin can't treat, instead of creating rules or mapping to htaccess. So I do not need all that URL mapping. The paths vBulletin can't treat (Phorum paths) already have the legacy id. So, I get the legacy id with preg_match, then I can fetch vBulletin nodeid from the legacy table and, at the end, get the correspondent route using vBulletin API. Future improvement Once I do not need the mapping, I removed it from the tables. I also removed the references to vB4. At the end, those will be my redirection tables: *note: I removed search indexes for some fields to keep the SQL shorter. [SQL]CREATE TABLE IF NOT EXISTS legacy_forum ( nodeid smallint(5) NOT NULL, nodeparentid smallint(5) NOT NULL, importforumid smallint(5) NOT NULL, importforumparentid smallint(5) NOT NULL, UNIQUE KEY uky_objectId (nodeid) ) CHARSET=ucs2 COLLATE=ucs2_general_ci ENGINE=innodb; CREATE TABLE IF NOT EXISTS legacy_thread ( nodeid mediumint(9) NOT NULL, nodeforumid smallint(5) NOT NULL, importthreadid mediumint(9) NOT NULL, importforumid smallint(5) NOT NULL, UNIQUE KEY uky_objectId (nodeid) ) CHARSET=ucs2 COLLATE=ucs2_general_ci ENGINE=innodb;[/SQL] In those tables, I still have information I do not use. However, I will keep some ids just for the sake of do not throw away some data that might useful. _______________ Edit (1 day after I wrote the post): I tested the solution I wrote as "future improvement". Everything works fine. ![]() |
Благодарность от: | ||
MarkFL |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|