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

XF 1.1 A lot of "code" is showing after conversion

Discussion in 'Installation, Upgrade, and Import Support' started by allthingsweezer, Dec 6, 2011.

  1. Hello,

    I've managed to convert 714K posts from SMF to xenForo but it has not been without issues. One of the issues I am currently experiencing is that a lot of posts are showing "code" instead of outputting the desired result. I have attached an annotated screenshot for reference (NOTE: There may be some foul language in the topic, in case anyone is sensitive to that)

    Is there a way to fix this or am I out of luck?

    Any help would be appreciated.
     

    Attached Files:

  2. steel_curtain

    steel_curtain Well-Known Member

  3. you need to download the actual image and then zoom in. i'm not sure why it doesn't show up right in the browser.
     
  4. steel_curtain

    steel_curtain Well-Known Member

    I tried that already, but when trying to zoom the picture quality degrades.
     
    ghundermark likes this.
  5. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Run this query to fix the <br /> tags:

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, '<br />', '\n');
    
    For the single quote entities:

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, '&#039;', '\'');
    
    For the double quote entities:

    Code:
    UPDATE xf_post
    SET message = REPLACE(message, '&quot;', '"');
    
    The quote and size tags require you to install this addon:

    http://xenforo.com/community/threads/post-content-find-replace.6548/

    For the size tags use this to simply remove the tag:

    Quick Find: [size

    Regular expression: #\[size=([\d]+)pt\]([^\[]+)\[/size\]#siU

    Replacement String: \2

    Screen shot 2011-12-05 at 6.34.14 PM.png

    For the quote tags use this:

    Quick Find: [quote

    Regular expression: #\[quote author=([a-z0-9_ \-]+) link=([^\]]+)\]([^\[]+)\[/quote\]#siU

    Replacement String: [quote="\1"]\3[/quote]

    Screen shot 2011-12-05 at 6.45.55 PM.png
     
    Duffer007 and allthingsweezer like this.
  6. Jake, first I want to thank you for posting those suggestions. Second, I'm really scratching my head over here. I followed each step of your post and I'm not seeing the results. When I run the queries, mySQL tells me that "0 rows affected." I also spent a ton of time running the Post Content Replacement Tool, but I don't see the results in any of my posts. Any idea what might be going on?
     
  7. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    I tested all of those queries and regexes by recreating your posts on my forum. It should work.

    But I see now that some of that stuff is in signatures. Here are queries for the signatures:

    Code:
    UPDATE xf_user_profile
    SET signature = REPLACE(signature, '<br />', '\n');
    
    UPDATE xf_user_profile
    SET signature = REPLACE(signature, '&#039;', '\'');
    
    UPDATE xf_user_profile
    SET signature = REPLACE(signature, '&quot;', '"');
    
    But Kier's addon only does posts, not signatures. The addon would have to be modified to get the BB codes in signatures.
     
    ghundermark likes this.
  8. Thank you! I applied those queries and saw the results in my original thread. It could be that I'm not seeing the Post Content Replace Tool changes because I wasn't looking at a thread where it would have been an issue?

    What about something like the image below?

    [​IMG]
     
  9. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Hmm, nested quotes...

    Try this:

    Quick Find: [quote

    Regular expression: #\[quote author=([a-z0-9_ \-]+) link=([^\]]+)\](.+)\[/quote\]#siU

    Replacement String: [quote="\1"]\3[/quote]

    This fudges the matching a bit but it should yield the correct result. You might find that you need to Save Changes on this replacement multiple times. It will keep matching additional levels of nested quotes each time you run it. Backup first to be safe.
     
    ghundermark likes this.
  10. 45, 929 results for nested quotes... should be a fun night :eek:
     
    Fuhrmann likes this.
  11. I was able to get this down to 36,058 posts, but now I keep getting "The connection was reset" in my browser. I took a shot in the dark and added

    Code:
    ini_set('memory_limit', '-1');
     
    ini_set('max_execution_time', 0);
    to my config.php but it has not helped at all. Any ideas?
     
  12. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Try using this to narrow it down:

    Quick Find: [quote author
     
  13. still scratching my head. now i can't even get my results to show up. a few seconds after clicking "Proceed" i get this:

    [​IMG]

    if i switch the Quick Find back to [quote then i get "Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 51 bytes) in C:\xampp\htdocs\ocommunity\library\Zend\Db\Statement\Mysqli.php on line 304"

    I changed my php.ini so that the memory_limit is 512M and the max_execution time is 180.

    Any idea what is going on?
     
  14. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    Check your phpinfo to make sure the new memory_limit is working:

    admin.php?tools/phpinfo

    There are also other ways to increase the memory_limit. See this post.

    You might also have to edit the library/XenForo/Application.php file (regarding this thread):

    Code:
    		@ini_set('memory_limit', 128 * 1024 * 1024);
    
     
  15. this is what i got when i went to admin.php?tools/phpinfo

    [​IMG]

    :eek:
     
  16. OK, i set the memory_limit to -1 and it took effect, and I also edited the Application.php so it said

    Code:
    @ini_set('memory_limit', 1024 * 1024 * 1024);
    and it still gives me the "Connection was reset" after a few seconds. Should I lose hope?
     
  17. so it turns out that my entire board is crapping out on me. if i try to post in a thread i'm getting

    [​IMG]

    i think i broke it!
     
  18. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

  19. not sure what you mean. when i search for "3E4" in xenforo.js, i get this:

    Code:
    (null,c.parseJSON(a.responseText),b)}catch(e){XenForo.handleServerError(a,b,d)}},headers:{"X-Ajax-Referer":h.URL},timeout:3E4},e);if(!e.data._xfResponseType)switch(e.dataType){case
    how do i know what 3E4 should be replaced with? my math is terrible.

    also, any idea why my board went to crap? how did it get so screwed up that i can't even post anymore?

    BTW, you should keep a big PayPal link in your signature. :notworthy: ;)
     

Share This Page