[SMF Converter] Drupal 6.2

Started by SleePy, May 27, 2008, 05:05:28 PM

Previous topic - Next topic

Oskar Calvo

Hello, I'm trying to add the categories in the categories table.
But all the time tell me the same thing: Invalid query: Duplicate entry '255' for key 'PRIMARY'

function drupal2smf_move_cat (){
   //make the conection to the dabatabase
    $link =  smf_db_connect();
    //get drupal's categories
    $container = variable_get('forum_containers', NULL);
    if ($container){
        //if there is containers we will make the cat of smf
          foreach ($container as $tid){
            //$tid -> is the tid of the forum containers, also are taxonomys.
            //  $output .= $tid.'<br>';
              //we get the object of every category with the term_data information.
              $term = taxonomy_get_term($tid);
                   if($link){
                                $insertar = mysql_query("INSERT IGNORE INTO `categories`
                                                    (ID_CAT, name, catorder)
                                                    VALUES ('$tid','$term->name','0');",
                                                    $link);
                                $output .= $tid.'/'.$term->name.'<br>';
                                   if(!$insertar){
                                       drupal_set_message('Invalid query: ' . mysql_error());

                           }//end check if there is problem with the insert
                       
                   }//end inf there is db connetcions

           
            }
   
   



    }

    $output .= '<br>Due to the smf forum structure now we don\'t migrate it yet';
    return $output;
    //cache_clear_all();
   
}





I mean, I don't use the same key,but seems that when I try to insert an ID_CAT, it try to insert 255

Thanks

Oskar

Oskar Calvo

Quote from: sharks on July 07, 2010, 09:11:16 AM
BTW, could you build your module so that it's compatible with SMF 1.1 primarily. I mean, compatibility with SMF 2.0 would also be good, but SMF 1.1 is the stable version, so it is preferred.

It's not hard, I only need time, I hope my boss let me to make a debug of the module, but Drupal forum it's really easy, and know that I understand smf forum database (more or les), It should not be hard.

Oskar


Oskar Calvo

Quote from: TE on July 07, 2010, 11:25:31 AM
Oskar, please take a look at: http://www.simplemachines.org/community/index.php?topic=274252.0#post_high_board_ids

I'm checking it and seems that I will need recount categories and recount boards.

Thanks.

Oskar

Oskar Calvo

Hello I'll need help.

I'd ready a sanbox, so if some one want to help me I'd give access to  a ftp acount to "change" something.

Now the problem is that I load the categories, and you can not see them.
Also I have move the boards, and they seems to have lost the categories.

If there is any function to load boards or categories, it will help me a lot.

Thanks,

Oskar.

Oskar Calvo

I have around of the 85% of the work done.

Oskar

sharks


Oskar Calvo

#67
Hello the module is almost 90% done.

But I have a few problems, the first I don't know how to put a spanish theme to check the spanish specials characters (in the database it works, but in the theme I see it strange characters).
I don't know why I'm not able to load a small part of the main home page:



But as can be see here
in the other part of the forum it's working well.

I need to update the module to let people to add it's ddbb, user ddbb, user pass and prefix

Oskar

sharks

I think it would be simpler and better if you just coded the converter for English only. And then release subsequent updates to make it compatible with other languages. Most people use only English in their forums, so it's a good idea to release it for the majority meanwhile.

Oskar Calvo

Quote from: sharks on July 13, 2010, 07:29:57 PM
I think it would be simpler and better if you just coded the converter for English only. And then release subsequent updates to make it compatible with other languages. Most people use only English in their forums, so it's a good idea to release it for the majority meanwhile.

Hello Sharks, my Idea is to create a function that let people to choose if they want utf8 or not to move the information from one ddbb to another ddbb.

The main problem now is to find why is not print in the home the information of the last post (date) and the last author. There is any kind of cronjob in smf?

Oskar

xenovanis

Oskar, I've seen a lot of conversions where you'll need to run both:

-> Find and repair any errors
-> Recount all forum totals and statistics

in Admin -> Forum Maintenance

Before this shows successfully.
"Insanity: doing the same thing over and over again and expecting different results."

Oskar Calvo

Thanks xenovanis.

I have "change" one smf theme so it can be use as iframe with drupal.  I have comment some code so now it's not posible to login or log out using smf if there is a iframe of Drupal.

The module is near 95%, although I'm thinking in a version x.2 in witch the move of the cat from drupal to smf will through a temporal table.

Thanks

Oskar

Oskar Calvo

To finish the smf theme I' like to know if there is anyway to get the base path or domain of the url.

I need to build a link to login, but as the Master will be Drupal, I need to login through Drupal, and if I get the base_path or domain I can built a link that will works in every Drupal+smf installation.

Thanks

Oskar

Oskar Calvo

I have re-done some part of the module, I make 2 temporal tables, and them to create the new id to category and to boards.

I'd like to migrate the avatar, but I don't understand what it's save in the avatar field in the smf database.

and now I'm with the form to get the smf mysql server connections.

Thanks

Oskar

Norv

Quote from: Oskar Calvo on July 21, 2010, 08:58:10 AM
I'd like to migrate the avatar, but I don't understand what it's save in the avatar field in the smf database.
To what avatar field(s) are you referring?

-----
Thank you very much for the work you've been doing. It is very appreciated and I'm sure many people will think the same way!
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

sharks

Oskar Calvo, you have my gratitude, appreciation and respect for being the only one who is actually willing and able to fix this broken converter.

THANK YOU!

Oskar Calvo

Quote from: Norv on July 21, 2010, 09:05:11 AM
To what avatar field(s) are you referring?

Hello Norv_link

I'm looking at members table to take a look at avatars field, but it's always empty. I have realize today that avatars information is stored in attachments table :0

Oskar

Oskar Calvo

Quote from: sharks on July 21, 2010, 02:49:47 PM
Oskar Calvo, you have my gratitude, appreciation and respect for being the only one who is actually willing and able to fix this broken converter.

THANK YOU!

Thanks sharks, but you now that floss software work like this, some one need something, and when he/she finish with it share with the others.

I hope to upload it soon in drupal.org, I'm fighting now with the drupal's svn, it's my first time with it.

Oskar

Norv

Quote from: Oskar Calvo on July 22, 2010, 03:39:05 AM
Quote from: Norv on July 21, 2010, 09:05:11 AM
To what avatar field(s) are you referring?

Hello Norv_link

I'm looking at members table to take a look at avatars field, but it's always empty. I have realize today that avatars information is stored in attachments table :0

Oskar

Yes, you're right. :) The avatar uploaded by the user is treated more like any attachment and it's stored in the attachments table, for member_id.
The avatar field in members table is used only in the other two cases:
- if the member chooses an avatar from the set available by default with SMF,
- or if he/she chooses an external avatar (and this external avatar is not downloaded to the forum's server, in which case we're basically in the case "uploaded by the user" again).
To-do lists are for deferral. The more things you write down the later they're done... until you have 100s of lists of things you don't do.

File a security report | Developers' Blog | Bug Tracker


Also known as Norv on D* | Norv N. on G+ | Norv on Github

Oskar Calvo

#79
Here is a link to download, I'd would like that someone from smf test it, because I'm not sure it I have move all the information.

The strange thing is that in my computer it works great, in an internet server I move all the information, but the forum don't show it properly, seems that I loose information somewhere.

Please test it to find bug.

Thanks

Oskar

http://www.box.net/shared/oajlh4pd2o

Advertisement: