Announcement

Collapse
No announcement yet.

More import problems: Field mapping

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • More import problems: Field mapping

    The moderators of my UBB forum are correctly identified as moderators after importing to UBB, however they don't have the ability to moderate. Checking their permissions as moderators reveals that all permissions are set to "no". Since I need to manually go in and edit the permissions of all moderators in all forums (about 200 combinations), this sorta obviates the usefullness of the import of moderators.

    Any way to change the import to give all imported moderators some default set of permissions?

  • #2
    More import problems: Field mapping

    UBB 6.5 -> vB 3.0.7, latest impex.

    UBB custom user title not imported.

    UBB custom fields not pulled in to the correct vB fields. How do I ensure that mapping is correct?

    Comment


    • #3
      Originally posted by Gary Fischman
      Any way to change the import to give all imported moderators some default set of permissions?
      I have now added $_default_mod_permissions which imports moderators with a default permissions setting as if they had been added via the admincp.

      Will require downloading impex again and over writing ImpExFunction and systems/ubb_classic/012.php


      Originally posted by Gary Fischman
      UBB custom user title not imported.

      UBB custom fields not pulled in to the correct vB fields. How do I ensure that mapping is correct?
      Line 198 to 201 of impex/systems/ubb_classic/003.php.

      Its traditionaly on line 32 in the user file.
      I wrote ImpEx.

      Blog | Me

      Comment


      • #4
        Originally posted by Jerry
        I have now added $_default_mod_permissions which imports moderators with a default permissions setting as if they had been added via the admincp.

        Will require downloading impex again and over writing ImpExFunction and systems/ubb_classic/012.php
        Thanks, Jerry.

        Originally posted by Jerry
        Line 198 to 201 of impex/systems/ubb_classic/003.php.

        Its traditionaly on line 32 in the user file.
        Right now, it has the following that I assume needs a tweak:
        Code:
                               $this->add_custom_field($Db_target, $tdt, $ttp, 'displayname','the ubb displayname');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'loginname','the ubb loginname');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'forename','the ubb forename');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'surname','the ubb surname');
        
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'custom1','Custom Field 1');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'custom2','Custom Field 2');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'custom3','Custom Field 3');
                                $this->add_custom_field($Db_target, $tdt, $ttp, 'custom4','Custom Field 4');
        and a bit further down
        Code:
                                        $try->add_custom_value('loginname',             addslashes(trim($userarray[15])));
                                        $try->add_custom_value('displayname',           addslashes(trim($userarray[0])));
                                        $try->add_custom_value('forename',              addslashes(trim($userarray[16])));
                                        $try->add_custom_value('surname',               addslashes(trim($userarray[17])));
        
                                        $try->add_custom_value('custom1',               addslashes(trim($userarray[18])));
                                        $try->add_custom_value('custom2',               addslashes(trim($userarray[19])));
                                        $try->add_custom_value('custom3',               addslashes(trim($userarray[20])));
                                        $try->add_custom_value('custom4',               addslashes(trim($userarray[21])));
        I assume the "standard" UBB fields are pulled in, followed by the custom stuff. Since UBB doesn't have a "forename" or "surname", I suspect I can remove those two lines above. And since I have 3 custom fields defined in my UBB, I can drop "custom4" above, and simply rename custom 1 through 3 with the names I want to use.

        Sound about right?

        Comment


        • #5
          Custom Title

          The existing code for custom title looks like this:
          Code:
                                          if($userarray[31])
                                          {
                                                  $try->set_value('nonmandatory', 'customtitle',                  addslashes(trim($userarray[31])));
                                          }
          However, looking at the database, it seems that the "customtitle" field should be set to "1" if there is a custom title, "0" otherwise. If its a "1", the the "usertitle" field would contain the custom title.

          Soooo, should the code look like this:
          Code:
                                          if($userarray[31])
                                          {
                                                  $try->set_value('nonmandatory', 'customtitle',                  1);
                                                  $try->set_value('nonmandatory', 'usertitle',                  addslashes(trim($userarray[31])));
                                          }

          Comment


          • #6
            Originally posted by Gary Fischman
            I assume the "standard" UBB fields are pulled in, followed by the custom stuff. Since UBB doesn't have a "forename" or "surname", I suspect I can remove those two lines above. And since I have 3 custom fields defined in my UBB, I can drop "custom4" above, and simply rename custom 1 through 3 with the names I want to use.

            Sound about right?
            Yup the block at the top with the add_custom_field() sets up where the data can go.

            The the second block is there to grab the varariables from each user file and save them, you'll have to change the numbers to where ever in the user file (line number -1 as its an array) the custom data is.
            I wrote ImpEx.

            Blog | Me

            Comment


            • #7
              How 'bout the custom title code? Did I find the bug?

              Comment


              • #8
                Originally posted by Gary Fischman
                How 'bout the custom title code? Did I find the bug?
                Yup you found it Though I turned it into this :

                PHP Code:
                if($userarray[31] AND strlen($title trim($userarray[31])))
                {
                    
                $try->set_value('nonmandatory''customtitle',    '1');
                    
                $try->set_value('nonmandatory''usertitle',    $title);
                }
                else
                {
                    
                $try->set_value('nonmandatory''customtitle',    '0');

                Though I had to update ImpExDatabase.php as well due to the way user data is saved to make sure that is now correct, so you'll need to grab that again.
                I wrote ImpEx.

                Blog | Me

                Comment

                widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
                Working...
                X