Avatars, attachments and general Impex questions

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • mgaretz
    New Member
    • Apr 2012
    • 9
    • 4.1.x

    Avatars, attachments and general Impex questions

    We are importing a board from WowBB and it's going pretty smoothly with a few exceptions:

    1. Avatars are not showing up. I have entered the full path to the images directory as http://www.mystite.com/forumdir/wowbb_images/ under which is the images/avatars directory. Do I need the whole path including images/avatars? Or what else could be the problem?

    2. Any attachments with an apostrophe in the "file name" kills the import. For now I just removed the apostrophe from name stored in the taget database.

    3. If I have already imported all the "dependent" data and have deleted the import ids and session, how do I just rerun say the avatar import module and have it use what's in the database?

    4. How do we remove the "imported message" tag from the posts? I would have assumed deleting the import ids would do that but it doesn't seem to.

    Thanks!
  • Jake Bunce
    Senior Member
    • Dec 2000
    • 46598
    • 3.6.x

    #2
    1) It's possible the avatars imported but are not being displayed. See my post in this thread:



    There are instructions regarding imported groups and avatar permissions.

    2) Probably this bug (code fix included):



    3) You can't rerun a module once the session has been closed. Ideally you should redo the entire import until you get it right. However, ImpEx does have the option to automatically associate imported users by email address, so running up to the user module in a new session might work to fix the avatars.

    4) I'm not sure I know what you are talking about. Can you post a URL showing the problem? Or a picture?

    Comment

    • mgaretz
      New Member
      • Apr 2012
      • 9
      • 4.1.x

      #3
      Originally posted by Jake Bunce
      1) It's possible the avatars imported but are not being displayed. See my post in this thread:



      There are instructions regarding imported groups and avatar permissions.

      2) Probably this bug (code fix included):



      3) You can't rerun a module once the session has been closed. Ideally you should redo the entire import until you get it right. However, ImpEx does have the option to automatically associate imported users by email address, so running up to the user module in a new session might work to fix the avatars.

      4) I'm not sure I know what you are talking about. Can you post a URL showing the problem? Or a picture?
      1) The avatar section of the database is completely empty, so they really aren't there, but I also did correct the permissions. What is the answer to my path question?

      2) I'll try implementing the fix for #2.

      3) Ok

      4) Screen shot attached. By necessity I have obscured the content and the post details as this is a private board.

      Click image for larger version

Name:	imported-post.jpg
Views:	1
Size:	41.4 KB
ID:	3686992

      Comment

      • mgaretz
        New Member
        • Apr 2012
        • 9
        • 4.1.x

        #4
        Is there an easy way to wipe the database for a clean import if I have already removed the import ids?

        Comment

        • Jake Bunce
          Senior Member
          • Dec 2000
          • 46598
          • 3.6.x

          #5
          1) In looking at the code, it pulls the user's avatar location from users.user_avatar in the wowbb database. Then prefixes it with the path you enter to get the full server path to each user's avatar. So you need to look at the users.user_avatar values in your wowbb database to see if it includes the directory or not. Then you know if you need to include that in the path you enter.

          4) I found it in the code:

          impex/systems/wowBB/007.php

          Remove the red code:

          Code:
          			// Mandatory
          			$try->set_value('mandatory', 'threadid',			$thread_ids_array["$post_details[topic_id]"]);
          			$try->set_value('mandatory', 'userid',				$user_ids_array["$post_details[user_id]"]);
          			$try->set_value('mandatory', 'importthreadid',		$post_details['topic_id']);
          
          			// Non Mandatory
          			$try->set_value('nonmandatory', 'parentid',			'0');
          			$try->set_value('nonmandatory', 'username',			$user_name_array["$post_details[user_id]"]);
          			[color=red]$try->set_value('nonmandatory', 'title',			'imported post');[/color]
          			$try->set_value('nonmandatory', 'dateline',			strtotime($post_details['post_date_time']));
          			$try->set_value('nonmandatory', 'pagetext',			$this->wowBB_html($this->html_2_bb($post_details['pagetext'])));
          			$try->set_value('nonmandatory', 'allowsmilie',		'1');
          			$try->set_value('nonmandatory', 'showsignature',	'1');
          			$try->set_value('nonmandatory', 'ipaddress',		$post_details['post_ip']);
          			$try->set_value('nonmandatory', 'iconid',			'1');
          			$try->set_value('nonmandatory', 'visible',			'1');
          			$try->set_value('nonmandatory', 'attach',			$post_details['attach']);
          			$try->set_value('nonmandatory', 'importpostid',		$post_id);
          Originally posted by mgaretz
          Is there an easy way to wipe the database for a clean import if I have already removed the import ids?
          I would do a reinstall. Clear the database, restore the install/install.php file, run the install.php file in your browser.

          Comment

          • mgaretz
            New Member
            • Apr 2012
            • 9
            • 4.1.x

            #6
            Thanks!

            Comment

            • mgaretz
              New Member
              • Apr 2012
              • 9
              • 4.1.x

              #7
              Well no matter what, avatars aren't importing. I'm giving up on that.

              BUT, I added the mod for thread descriptions (because Wowbb has them and we don't want to lose them). The mod is working fine for new posts. The mods a coulmn to the threads table called threaddesc. I have modded the 006.php impex file to add:

              Code:
              $try->set_value('nonmandatory', 'threaddesc',  $thread_details['topic_description']);
              And I've added this line to the vbfields.php file:

              Code:
              $queries[] = "INSERT INTO {$tableprefix}vbfields VALUES ('title', 'thread', 'Y', 'threaddesc', 'return true;', 'vbulletin')";
              But the topic descriptions won't import. What am I missing?

              Comment

              • Jake Bunce
                Senior Member
                • Dec 2000
                • 46598
                • 3.6.x

                #8
                You would also have to update the import_thread() function in the impex/ImpExDatabaseCore.php file. The function starts with:

                Code:
                	function import_thread($Db_object, $databasetype, $tableprefix)
                	{

                Comment

                • mgaretz
                  New Member
                  • Apr 2012
                  • 9
                  • 4.1.x

                  #9
                  Originally posted by Jake Bunce
                  You would also have to update the import_thread() function in the impex/ImpExDatabaseCore.php file. The function starts with:

                  Code:
                      function import_thread($Db_object, $databasetype, $tableprefix)
                      {
                  I added threaddesc to the list and the line at the bottom:

                  Code:
                  $Db_object->query("
                       INSERT INTO " . $tableprefix . "thread
                       (
                        forumid, title, importforumid,
                        importthreadid, firstpostid, lastpost,
                        pollid, open, replycount,
                        postusername, postuserid, lastposter,
                        dateline, views, iconid,
                        notes, visible, sticky,
                        votenum, votetotal, attach, similar,
                        hiddencount, deletedcount, threaddesc
                       )
                       VALUES
                       (
                        '" . $this->get_value('mandatory', 'forumid') . "',
                        '" . addslashes($this->get_value('mandatory', 'title')) . "',
                        '" . $this->get_value('mandatory', 'importforumid') . "',
                        '" . $this->get_value('mandatory', 'importthreadid') . "',
                        '" . $this->get_value('nonmandatory', 'firstpostid') . "',
                        '" . addslashes($this->get_value('nonmandatory', 'lastpost')) . "',
                        '" . $this->get_value('nonmandatory', 'pollid') . "',
                        '" . $this->get_value('nonmandatory', 'open')  . "',
                        '" . $this->get_value('nonmandatory', 'replycount') . "',
                        '" . addslashes($this->get_value('nonmandatory', 'postusername')) . "',
                        '" . $this->get_value('nonmandatory', 'postuserid') . "',
                        '" . addslashes($this->get_value('nonmandatory', 'lastposter')) . "',
                        '" . $this->get_value('nonmandatory', 'dateline') . "',
                        '" . $this->get_value('nonmandatory', 'views') . "',
                        '" . $this->get_value('nonmandatory', 'iconid') . "',
                        '" . addslashes($this->get_value('nonmandatory', 'notes')) . "',
                        '" . $this->get_value('nonmandatory', 'visible') . "',
                        '" . $this->get_value('nonmandatory', 'sticky') . "',
                        '" . $this->get_value('nonmandatory', 'votenum') . "',
                        '" . $this->get_value('nonmandatory', 'votetotal') . "',
                        '" . addslashes($this->get_value('nonmandatory', 'attach')) . "',
                        '" . addslashes($this->get_value('nonmandatory', 'similar')) . "',
                        '" . $this->get_value('nonmandatory', 'hiddencount') . "',
                        '" . $this->get_value('deletedcount', 'hiddencount') . "',
                        '" . addslashes($this->get_value('mandatory', 'threaddesc')) . "'
                       )
                  But that didn't bring over the thread description and all the post data was lost. Tried rebuilding the threads, forum info and post cache, no help. Tried deleting the import for a fresh start and now the board is compeletly trashed. Going to have to re-install and re-import. I assume I will also have to reinstall the mods.

                  Comment

                  • Jake Bunce
                    Senior Member
                    • Dec 2000
                    • 46598
                    • 3.6.x

                    #10
                    You specified "nonmandatory" before. You need to be consistent about "mandatory" versus "nonmandatory".

                    And stuff can get messy if you run an import multiple times on the same database. I usually reinstall the forum between test imports. If you have custom development you wish to preserve then you should backup the forum in that state so you can revert if you need to run the import again.

                    Comment

                    • mgaretz
                      New Member
                      • Apr 2012
                      • 9
                      • 4.1.x

                      #11
                      Originally posted by Jake Bunce
                      You specified "nonmandatory" before. You need to be consistent about "mandatory" versus "nonmandatory".

                      And stuff can get messy if you run an import multiple times on the same database. I usually reinstall the forum between test imports. If you have custom development you wish to preserve then you should backup the forum in that state so you can revert if you need to run the import again.
                      That was a recreation of the code. I'm pretty sure I was consistent in the real code. Other than that, was everything else correct?

                      Comment

                      • Jake Bunce
                        Senior Member
                        • Dec 2000
                        • 46598
                        • 3.6.x

                        #12
                        It looks correct, yes.

                        Comment

                        • mgaretz
                          New Member
                          • Apr 2012
                          • 9
                          • 4.1.x

                          #13
                          What does mandatory vs nonmandatory do?

                          Comment

                          • Jake Bunce
                            Senior Member
                            • Dec 2000
                            • 46598
                            • 3.6.x

                            #14
                            That simply defines what is required and what is not. It won't import a thread if mandatory fields are misssing.

                            Comment

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