1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.5 Visitor messages from vBulletin 3.8 converted to literal HTML

Discussion in 'Installation, Upgrade, and Import Support' started by Ralle, May 30, 2016.

  1. Ralle

    Ralle Active Member

    Have a look at the attached pictures. I have imported my vBulletin into XenForo and all the color tags are converted to literal HTML. What's up with that? Shouldn't we just strip the BB Code or keep it as is and not render it?
     

    Attached Files:

  2. Mike

    Mike XenForo Developer Staff Member

    Looks to me like your messages actually had HTML in them (allowed and rendered). That's what was actually in the message.

    XenForo doesn't support formatting in profile posts (HTML or BB code), so we just import them as is. I could really only recommend removing this code manually at this point.
     
  3. Ralle

    Ralle Active Member

    I think you're wrong. Take a look at this code from XenForo_Importer_vBulletin:
    PHP:
            $formatter XenForo_BbCode_Formatter_Base::create('XenForo_BbCode_Formatter_Text');
            
    $parser XenForo_BbCode_Parser::create($formatter);

            foreach (
    $vms AS $vm)
            {
                
    // [...]
                
    $import = array(
                    
    'profile_user_id' => $profileUserId,
                    
    'user_id' => $postUserId,
                    
    'username' => $this->_convertToUtf8($vm['postusername'], true),
                    
    'post_date' => $vm['dateline'],
                    
    'message' => $parser->render($this->_convertToUtf8($vm['pagetext'])),
                    
    'ip' => XenForo_Helper_Ip::convertIpBinaryToString($vm['ipaddress'])
                );
                
    // [...]
            
    }
    You actually use a BB Code parser and render the pagetext.
     
  4. Mike

    Mike XenForo Developer Staff Member

    I stand corrected on the importing as is part, but the rest is correct. We're rendering the BB code down to a plain text representation. It looks like yours was done in raw HTML.
     
  5. Ralle

    Ralle Active Member

    Nope. It's BB code alright.

    How does it work by making it plain text? I wrote my own [color] tag because XenForo does not support [color=ff00ff] (without the # mark) which vBulletin does. Perhaps mine is rendering when it shouldn't.
     

    Attached Files:

  6. Mike

    Mike XenForo Developer Staff Member

    That is very likely it. Have you defined a text replacement for your BB code? (In the advanced options.) It should just be removed out the box, but I'd have to test that if you've left it empty.
     
  7. Mike

    Mike XenForo Developer Staff Member

    Actually, just to confirm/clarify: if your custom BB code is using a callback, you need to choose what to do based on the type of BB code formatter in use (HTML, WYSIWYG, text, etc). The text replacement option I mentioned only applies if you're using a straight HTML replacmement.
     
  8. Ralle

    Ralle Active Member

    I see that now, thank you! Would I need to pay attention to any other Formatters too?
     
  9. Mike

    Mike XenForo Developer Staff Member

    In this instance, probably not.
     
  10. Ralle

    Ralle Active Member

    Okay. I am looking into the scope of all this. Oh boy what a mess. I am not sure I think the way [plain][code] and [php] is treated is optimal. Shouldn't they just evaluate to [CODE] and [PHP]? I will need to go through all my codes and make sure they are handled well in plain text mode. Is there a good way to test this?
     
  11. Mike

    Mike XenForo Developer Staff Member

    Removing the code entered? That doesn't really make sense to me. This is parsing to a plain text representation and the code itself would fit as that.

    Aside from creating a test script for your needs, the text parser is used to create textual versions of posts/conversation messages for emails (the text version rather than the HTML version). It is also used for the thread quick preview.
     
  12. Ralle

    Ralle Active Member

    Right. I am just thinking from the perspective of imported visitor messages from vBulletin. They display no line breaks so imported ones that contain code will look all mangled. This is why I think it would probably look better if it was just [CODE] instead of inline code with no line breaks. This is just 2786 out of the total 614222 imported VMs though of which 154 was made in the past 6 months.
     

Share This Page