Julius Posted March 17, 2012 Share Posted March 17, 2012 Hello, I made myself a simple blog system, but in my case "simple" becomes difficult when it comes to writing an article. Have you ever seen that movie about how facebook was created (I think it's called "Social network" or something like that)? As a newbie web developer I noticed how "Mark" was writting his blog post. I think it was an textarea, and when he was writing article, he wrote it with html tags, like <p>. So, I have now the same problem: when I'm writing article, I have to write it with all div's and p's and a's and img's and so on. I want to avoid that. Few ideas did pop to my head: use preg_replace for some elements, and set up some javascript WYSIWYG editor (but i really don't want it, and can't explain why, I just don't like it). I have a couple of css classes for images, both of them resizes images, one resizes it a lot, other not so much, both make them smaller. One class is for image to be on the left, so the text would wap that image from the right. After paragraph I must clear floats with css class. Other image class just takes full width available and if image is bigger that that available width - it resizes image. So no need to clear floats. How can I make my life easier when I'm writing article to my blog? Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/ Share on other sites More sharing options...
scootstah Posted March 17, 2012 Share Posted March 17, 2012 If you need HTML, you need HTML. The only option is to either use a WYSIWYG or to possibly shorten syntax with something like BBCode, Wiki markup, or markdown. Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/#findComment-1328386 Share on other sites More sharing options...
QuickOldCar Posted March 17, 2012 Share Posted March 17, 2012 I'm sure others will say something similar to me. Unless you want to make an entire editor, the easiest is to use one that already exists. http://www.tinymce.com/ Can also look into bbcode. http://www.bbcode.org/ Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/#findComment-1328388 Share on other sites More sharing options...
Julius Posted March 17, 2012 Author Share Posted March 17, 2012 Yeah, I was thinking about bbcode. Any other suggestions are welcome Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/#findComment-1328394 Share on other sites More sharing options...
Julius Posted March 17, 2012 Author Share Posted March 17, 2012 One more question: when writing html code, it contains quotes. What to do, when my text contains quotes? It's okay when I write articles alone, but if I let someone else write articles, there might be some trouble, I think Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/#findComment-1328449 Share on other sites More sharing options...
scootstah Posted March 17, 2012 Share Posted March 17, 2012 One more question: when writing html code, it contains quotes. What to do, when my text contains quotes? It's okay when I write articles alone, but if I let someone else write articles, there might be some trouble, I think Why do quotes matter? As long as you escape it before interacting with the database you're fine. Quote Link to comment https://forums.phpfreaks.com/topic/259120-blog-post-and-database/#findComment-1328538 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.