Vanilla 1 is no longer supported or maintained. If you need a copy, you can get it here.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Line and paragraph breaks from phpBB imported comments won't show

edited October 2006 in Vanilla 1.0 Help
I converted my Invision Powerboard to phpBB and then to Vanilla which worked out quite all-right. Only the line and paragraph breaks in old comments won't show. But when I edit an old comment the line and paragraph breaks are being displayed, and saving them solves the problem... Unfortunately there are 20.000 of old comments. Is there an easier (and faster) way to show line and paragraph breaks from old imported comments?

Comments

  • Anyone?
  • I looked at this, but I don't really see why it is happening. Neither phpBB, nor Vanilla saves comment text line breaks as tags or anything like that. If I was you I'd go into my database, and compare the text of a post you've edited with one that you haven't and see if you can see any clear difference in them.
  • When I look in the 'Body' field of the 'Comment' table there's no difference between old (phpbb) and vanilla posts, the white space of the paragraphs in both of them look the same. If I open the body field in phpMyAdmin and just add a character or something and save it, Vanilla does show the paragraphs. An automation that would open all the (20.000) body fields and saves them again should work. But is that possible? I tried it with a replace query, but that only replaces and is'nt saving (parsing) the entire body field.
  • I believe this could be because the text formatter in Vanilla only replaces Windows newlines (\r\n) with line breaks, so if you only have *nix or mac style newlines then it won't convert them. Try opening up library/Framework/Framework.Class.StringManipulator.php and change line 44 from this:$sReturn = str_replace("\r\n", '<br />', $sReturn);to this$sReturn = str_replace(array("\r\n", "\r", "\n"), '<br />', $sReturn);
  • Posted By: SirNotI believe this could be because the text formatter in Vanilla only replaces Windows newlines (\r\n) with line breaks, so if you only have *nix or mac style newlines then it won't convert them.
    Yes, I use a Mac (and unix for webhosting), so that would be the reason.

    I found the solution: By replacing all line-breaks with html breaks in the body, changing the formattype from bbcode to html and using the html formatter extension my 20.000 old posts now show line breaks!

    I used the following queries:
    UPDATE `LUM_Comment` SET FormatType ="Html"; UPDATE `LUM_Comment` SET Body = replace(Body, " ", "<br />");
This discussion has been closed.