What is the recommended line break character for vanilla discussion/comment bodies?
\r, \n, \r\n or what?
I am migrating a custom forum system to Vanilla and line breaks are not converted to "<br/>", despite the fact that I see line breaks in HTML source and PHPMyAdmin edit field.
Answers
Well depends, for example if you are using markup it is two spaces at the end of a line or more
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •For some reason Vanilla is not picking up linebreaks from my old forum and not converting them to <br/>s.
They are simple linebreaks, straight from a HTML form with only filter being "mysql_real_escape_string()".
And I can see those linebreaks if i open gdn_discussion table in phpmyadmin. They're there, but not being picked up by Vanilla. If i create new posts in vanilla itself, then I get "correct" linebreaks.
I tried converting breaks to \r \n \r\n or \n\r, with or without mysql_real_escape_string. Also tried utf8_encode. Nothing works.
If I replace \n \r \r\n etc. with <br/> before insering then, of course, I get normal linebreaks. But storing HTML break tags in DB is a no-go.
Could it be some dreadful encoding issue? Old table used latin1_swedish_ci. Vanilla is utf8_unicode_ci.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@x00
You just solved my problem!
I left "Format" column NULL when I wrote my migration script. Now that I set Format to "BBCode" all newlines are picked up as they should!
So advice for anyone else who is migrating custom forum/commenting system to Vanilla: don't forget "Format" column for gdn_discussion and gdn_comment!!!
Also, it would be helpful if there was a guide on how to do custom migration (users, password hashing, discussions, comments, user avatars) - otherwise, like me, you have to do it the hard way - by trial and error.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •start one on the wiki - its sounds like you already know a few things.
factoid: Most questions have been previously answered, try the search box first, please provide your Vanilla version Number!
Peregrine's Addons - donations gladly accepted for "successful solutions" and addons - kind of like tipping a waiter at a restaurant
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •wiki = http://vanillawiki.homebrewforums.net
all documentation welcome.
Vanilla Wiki, Tastes Great! 31,000 viewers can't be wrong.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •I think the format we use in our DB tables is 'Html' and not 'BBcode'
Do you mean migration from other systems than the one mentioned on the VanillaPorter Addon page? (the one that Vanilla Porter supports)
What to do if I get a Bonk Error?
Vanilla Wiki : Join and help edit our Wiki! | View all Vanilla issues on GitHub | Report a new Vanilla issue on GitHub
Deploying a new Forum and adding a Theme | Give thanks to the Vanilla Developers!
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •@peregrine
When I am finished with migration and rebuilding of my site, I think I will write something to contribute to community.
@UnderDog
I set it to BBCode because the old system used a subset of BBCode and I hae enabled it on Vanilla configuration as well.
Regarding migration manual:
Yes, that is exactly what I mean. Manual on how to populate Garden DB with basic forum data that any custom forum system would have - users, categories, discussions/threads, comments/posts, avatars and password hash issues.
It wasn't very difficult and I managed to do it just by looking at how vanilla itself populates the tables. But it wasn't without several stumbling blocks - as one can tell by discussions/questions I have posted here.
- Spam
- Abuse
- Troll
0 • Off Topic Insightful Awesome LOL •