Blackboy0 Posted March 13, 2009 Share Posted March 13, 2009 Alright, I am starting on a PHP, CSS and HTML project today, and I need some help with some PHP things. I will post them all in this Thread!! Yes, some of this stuff is simple, but I'm learning PHP through looking at different scripts, and none of them have had this yet. So, 1st question: How do I, using PHP, convert BBCode Tags into HTML Tags? Example: I have a Forum using BBCode tags, and I have a PHP Script that grabs the posts from the forums, and displays them on the homepage. How do I convert the BBCode into HTML? I have a SMF Forum' date=' and they have an... awkward DB Structure for PHPers (me, atleast). I want to make it so that there is a list of all Topics created in the Forum with the ID of "1", but [b']ONLY[/b] topics, not messages, which have the same ID. Example: Right now, I have the list and it shows: Re: News 4 Re: News 4 Re: News 4 News 4 What I want it to be is: News 4 News 3 News 2 News 1 Please only answer if you know PHP, thanks. Quote Link to comment https://forums.phpfreaks.com/topic/149190-blackboy0s-php-questions/ Share on other sites More sharing options...
blueman378 Posted March 13, 2009 Share Posted March 13, 2009 well youll have to use regex to read through the post and convert it to html, its your choice if you do this before you put it into the database or after, but regex is the way to go, with regards to the SMF database structure, it may seem akward, its not. its simply practical. once you get some more experience with database go look over the structure again and youll see what i mean. Quote Link to comment https://forums.phpfreaks.com/topic/149190-blackboy0s-php-questions/#findComment-783433 Share on other sites More sharing options...
Michdd Posted March 13, 2009 Share Posted March 13, 2009 http://corz.org/blog/inc/cbparser.php Quote Link to comment https://forums.phpfreaks.com/topic/149190-blackboy0s-php-questions/#findComment-783434 Share on other sites More sharing options...
Blackboy0 Posted March 13, 2009 Author Share Posted March 13, 2009 THank you, Michdd Alright... now the second question, anybody? Quote Link to comment https://forums.phpfreaks.com/topic/149190-blackboy0s-php-questions/#findComment-783438 Share on other sites More sharing options...
.josh Posted March 13, 2009 Share Posted March 13, 2009 I suggest you post your 2nd question on the smf board. At the very least, you'll probably get a faster answer on where to look, as far as them telling you to do it yourself. But if you're lucky, there might already be a mod for that, or someone willing to make one, since that's what they focus on, there. Quote Link to comment https://forums.phpfreaks.com/topic/149190-blackboy0s-php-questions/#findComment-783450 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.