Announcement

Collapse
No announcement yet.

Importing Custom Fields...

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

  • Importing Custom Fields...

    I just got everything up and running and so far I love it! After I imported my UBB 6 forum I noticed the user's custom fields were not showing up. (i.e. graduation year, real name, ect.)

    Is the importer supposed to do this? If not, how can it be done?

    Also, while I'm at it, the importer didn't import one forum. You can take a look @ http://johnsworld.com/tattlerboard "The Dungeon" Nothing there??

    Other then that the importer did as it was supposed to, except for a few style settings. I doubt it's supposed to import thread views, (installed mod on UBB), right?

    Capture more registrations - Advanced Guest Posting & Registration
    Cell Phone Forums | Nikonites

  • #2
    oh okay..

    Capture more registrations - Advanced Guest Posting & Registration
    Cell Phone Forums | Nikonites

    Comment


    • #3
      I just got everything up and running and so far I love it! After I imported my UBB 6 forum I noticed the user's custom fields were not showing up. (i.e. graduation year, real name, ect.)

      Is the importer supposed to do this? If not, how can it be done?
      You'll have to do some hacking to add that -- you'll have to add some PHP code to assign the variables, some rows to 'profilefield', and columns to 'userfield'.

      Also, while I'm at it, the importer didn't import one forum. You can take a look @ http://johnsworld.com/tattlerboard "The Dungeon" Nothing there??
      If it's an ex-private forum, rename the private directory in the forum's ForumX directory so it doesn't have the word "private" in there.

      Other then that the importer did as it was supposed to, except for a few style settings. I doubt it's supposed to import thread views, (installed mod on UBB), right?
      Right.

      Comment


      • #4
        Unfortunately I'm not too familiar with php. Can anyone point me to what exactly in the scripting needs to be changed? I did take a look at the scripting for the import file and I can unserstand some of it, however, I'll probably leave something out if I attempt anything.

        Do these specific fields need to be added in vBulletin before everything is imported?

        The forum isn't ex-private. I've imported the database twice, deleting it each time, and for some reason it doesn't import this forum. I just reset the database because of template problems, so it can't be seen at the moment. Does it have anything to do with UBB's cache file?

        Thanks!

        Capture more registrations - Advanced Guest Posting & Registration
        Cell Phone Forums | Nikonites

        Comment


        • #5
          Unfortunately I'm not too familiar with php. Can anyone point me to what exactly in the scripting needs to be changed? I did take a look at the scripting for the import file and I can unserstand some of it, however, I'll probably leave something out if I attempt anything.
          Check out the stuff from lines 300 - 326 in bbimport_ubb5.php to see how the other fields are processed. Check out the importuser() function in bbimport.php (~line 526). (UBB6's line number is different of course)

          Do these specific fields need to be added in vBulletin before everything is imported?
          It'd probably be easier to add the fields through vB's custom field section, and hack the importuser() function to insert the values into the userfield table.

          The forum isn't ex-private. I've imported the database twice, deleting it each time, and for some reason it doesn't import this forum. I just reset the database because of template problems, so it can't be seen at the moment. Does it have anything to do with UBB's cache file?
          It doesn't have a "private[something]" directory within it's Forum# directory? Does it have the threadlist file (forum#.threads I think).

          Comment


          • #6
            Okay, I'll have to try this when I'm ready to import everything again. I'm looking at the code now (bbimport_ubb6.php):

            PHP Code:
            $user[username] = trim($memberfile[0]);
                        
            $user[password] = trim($memberfile[1]);
                        
            $user[email] = trim($memberfile[2]);
                        
            $user[homepage] = trim($memberfile[3]);
                        
            $user[usergroupid] = getubbperms(trim($memberfile[4]),$bannedgroup[id]);
                        
            $user[occupation] = trim($memberfile[5]);
                        
            $user[location] = trim($memberfile[6]);
                        
            $user[posts] = trim($memberfile[7]);
                        
            $user[usertitle] = trim($memberfile[8]);
                        
            $user[interests] = trim($memberfile[9]);
                            
            $datebits explode("-",trim($memberfile[10]));
                        
            $user[joindate] = mktime(0,0,0,$datebits[0],$datebits[1],$datebits[2]);
                        
            $user[showemail] = option2bin(trim($memberfile[11]));
                        
            $user[signature] = html2bb(trim($memberfile[12]));
                        
            $user[icq] = trim($memberfile[13]);
                        
            $user[adminemail] =  option2bin(trim($memberfile[14]));
                        
            $user[displayname] = trim($memberfile[15]);
                        
            $user[userimage] = trim($memberfile[20]);
                        
            $user[daysprune] = trim($memberfile[21]);
                        
            $user[aim] = trim($memberfile[22]);
                        
            $user[showrating] =  option2bin(trim($memberfile[25]));
                        
            $user[receivepm] =  option2bin(trim($memberfile[27]));
                        
            $user[emailnotification] =  option2bin(trim($memberfile[28]));
                        
            $user[adminallowpm] =  option2bin(trim($memberfile[29])); 
            I'm gussing I find the specific fields (in UBB) I want to import and add them to the end? Starting with 30? If the custom fields are added before import how will I know what the corrosponding number is?

            Also in bbimport.php do the corresponding values get added after:
            PHP Code:
            '".addslashes(htmlspecialchars($user[occupation]))."'
            ?

            Same format?

            Sorry, I'm a little slow with this one. I only have one shot to import the database and I want to do it right

            Capture more registrations - Advanced Guest Posting & Registration
            Cell Phone Forums | Nikonites

            Comment


            • #7
              Why do you only have one shot? yoururl.com/forums/admin/bbimport.php?action=reset will (or should ) remove all imported data to allow you to import again if necessary.

              I'm gussing I find the specific fields (in UBB) I want to import and add them to the end? Starting with 30? If the custom fields are added before import how will I know what the corrosponding number is?
              Logically, you would start with 30, but I'm not sure if UBB's data format has anything that we don't import attached to the end...

              If you take a member file and count down, you should see what the field number is (start with the username as 0, password 1, email 2, etc).

              If the custom fields are added before import how will I know what the corrosponding number is?
              That's relating to vB's field# in the "userfield" table... (below)

              Also in bbimport.php do the corresponding values get added after: <snip>
              Same format?
              Yes to both, although you need to alter the query a bit more. For example:

              Code:
              	$DB_site->query("INSERT INTO userfield
              		(userid,field1,field2,field3,field4,field5,field6,field7,field8,importuserid,isnew)
              		VALUES
              		('$userid',
              		'".addslashes(htmlspecialchars($user[biography]))."',
              		'".addslashes(htmlspecialchars($user[location]))."',
              		'".addslashes(htmlspecialchars($user[interests]))."',
              		'".addslashes(htmlspecialchars($user[occupation]))."',
              		'".addslashes(htmlspecialchars($user[whatever1]))."',
              		'".addslashes(htmlspecialchars($user[whatever2]))."',
              		'".addslashes(htmlspecialchars($user[whatever3]))."',
              		'".addslashes(htmlspecialchars($user[whatever4]))."',
              		'$user[importuserid]',1
              		)");
              Added stuff is in bold.

              As for knowing what field# goes with what UBB field, in your CP, go to user profile fields -> modify. In that list, mouse over the "[edit]" link and you'll see something like this:

              .../profilefield.php?s=&action=edit&profilefieldid=5

              The bold part is what you're looking for. In the above example, that field would go into "field5" in the userfield table.

              Comment


              • #8
                Thanks!

                Thanks for your help Ed! I'll definitely take a shot (more then one) at importing my database.

                While I have your attention can you take a look at this thread I started?:
                http://www.vbulletin.com/forum/showt...threadid=24453

                It's the last couple things I need to get right before I import.

                Thanks again!
                Last edited by tpearl5; Fri 3 Aug '01, 6:22pm.

                Capture more registrations - Advanced Guest Posting & Registration
                Cell Phone Forums | Nikonites

                Comment

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