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.
Three formatting/quotations problems
Apreche
✭
So I've been running a Vanilla forum for quite sometime now. There are plenty of users and posts, and everything is going nicely. There are however, three related issues I would like to resolve. They are related issues, and I'm hoping they can be solved with one stone rather than three. I'm a programmer by trade, and I've thought of many solutions, but I've done relatively little work with Vanilla itself, so I'm wondering what you guys think. I'm going to be updating all the services and web applications on my hosting sometime in the near future, and I'd like to take that opportunity to fix things like this.
The first problem is the radio buttons below the comment box. My users are not all very quick. They often post comments without selecting the proper radio button. They will make an HTML link and not click the Html radio button. This creates extra work for moderators who have to edit these posts to properly set the formatting. I would like to either have only one formatting option which will properly format posts no matter if users use BBCode, Html or text. I know that's difficult, so second best would be to have Vanilla somehow automatically detect and select the correct formatting option.
The second problem is that our database is full of unformatted posts. It would be quite the pain to go through every thread to find posts written in HTML that are rendered as text to change them all. So I need some way to go through the database and detect what format a posts should have, and set it properly.
The final problem is the quotations extension. The quotations extension can be easily configured to use BBCode or Html. However, many users click the quote button and do not set the radio button. This problem has created most of the posts in our database that need fixing. Is there a way to automatically select the Html radio button when a users presses the quote button? Maybe we should have two quote buttons, one for BBCode and one for Html?
Generally I want to make sure that every comment already in the database is formatted properly. I also want to make things easier on the users as well as the moderators in the future. What is the best way to go about this?
0
This discussion has been closed.
Comments
You just have to figure out the order... i.e. BBCode might strip HTML tags that would be put in place by the extended text formatter.
So maybe try unformatted text parsed with BBCode -> html code formatted with extended text formatter -> HTML formatter strips nasty code -> Done!
Of course, the simplest solution would be to just remove either bbcode or html.
Or (and this would ignore any code blocks in the comments and such) you just do straight replacing with SQL statements, so you'd have a bunch of
UPDATE LUM_Comment SET Body=(REPLACE (Body, '[b]', '<b>')); UPDATE LUM_Comment SET Body=(REPLACE (Body, '[/b]', '</b>'));
etc.I wouldn't replace all '[' with '<', because you might have comments where square brackets have been used for other things besides bbcode, and replacing might screw those comments up.