corz.org uses cookies to remember that you've seen this notice explaining that corz.org uses cookies, okay!
corzblog bbcode parser preview
Here it is! My [search engine fodder] bbcode to html parser, and html to bbcode parser [/search engine fodder]!
This is the actual very onsite parser that parses the bbcode of my blogs and site comments, which as well its usual tasks of, well, you know, the parsing stuff, also moonlights doing a cute wee background demo of itself, you're looking at it. it knew you wanted to do that. hit the "preview" button to see at least one half of the parser's bbcode to html/html to bbcode functionality.
The front-end (below) is built-in to the parser, you just call the
function and it creates the form. The cool, super-portable JavaScript bbcode buttons and functions come
in the package, too. Have fun. Oh, and by the way, output is 100% pure HTML5, or nice plain bbcode, which ever way you look at it, it's free.
Welcome to the comments facility!
one little question:
how can i use the htmltobb parser? entering html code to the textarea, and hitting "preview", but it gives html! one plz help. tried thousand times but it only gave in html form. and i also tried in my local apache server but i cant create the post file. im a noob in php, forgive.
We are back!
sebgymn, as a php n00b, there are some things you need to know. Firstly, trying something over and over a thousand times is not a good strategy. If something doesn't work, it's generally means you will have to do something to get it to work. It's not like a torch, or an old Television set; banging it will have no magical effect.
Next, you need to think about what you are doing. The comments mechanism here at the org utilizes the "bbcode to html" side of cbparser's functionality, so clearly, entering only bbcode is useful. If you were to read my previous comment to Michael, you will see I suggested making a comment here, and then editing it. At the editing phase, the comments mechanism utilizes the "html to bbcode" functionality, only once, to convert your old comment back to bbcode in your edit area.
Lastly, crucially, you must realise that these are features of the comment facility, something quite separate from cbparser. It utilizes cbparser's functions, but exactly how it does it is up to the author; in the case of the comment mechanism, that is me; in the case of whatever *you* are trying to do, that is YOU.
Fortunately, I think of everything*, and if you simply drop cbparser into a server and load it in a web browser, you'll see its built-in demo page, which not only demonstrates at least one half of cbparser's capabilities, but serves as a working example of the php code required to get it working.
As a coder, you must decide how you want to use cbparser, but at the very simplest level, switching the demo's function call from bb2html() to html2bb() would do what you want, sorta.
I've also stuffed the thing with notes and comments, and as you are new to things, perhaps you didn't realise that those are there for good reason; read and learn. Always walk through any code you are unfamiliar with, do the steps in your mind as you go along; things will quickly make sense. (it's not smart to implement code you don't understand)
And if, after all that, you have any troubles with your implementation, feel free to post questions with specific examples, copies of any error messages, example code (use [ccc] tags), etc., and I guarantee I'll do my best to help you with that.
Have fun!
;o)
(or
Very impressed by your work. I stumbled upon this while doing some quick research. There is a new Joomla forum component called Fireboard. It has a BBcode parser that is very lacking. I was wondering how would one go about replacing it with this one? I have NO knowledge of PHP coding but can manipulate things sometimes to get them to work. Can someone point me in the right direction on how to get this integrated?
I vagualy remember looking at Joomla for someone a long time back, and coming away thinking that it was an unintuitive pile of dog poo. Undeterred, I grabbed the latest copy and threw it into my local mirror, it seems not much has changed.
Still, I like it when folk use cbparser to replace built-in bbcode parsers, so I grabbed this Fireboard extension, and installed that. And that's about as far as I got. I couldn't see how to to activate Fireboard inside Joomla and make it available, and ran out of time.
If you want to provide some more information, I could have another look.
;o)
(or
ps. if you are just starting your site and don't code; there are lots of other CMS out there besides joomla (check out CMS Made Simple, for one).
When I saw this parser my jaw dropped. I had to have it. But my skills are non-existant so implementing it is beyond me.
As for making FB active you have to create a menu link like so
- Log in as admin
- Use the dropdown menu at the top of the page and choose the menu that I want to add the FireBoard Forum link into.
- Click on "New" from the toolbar.
- Click on "Components"
- Enter the Details:
--- name of your forum
--- the component you are linking to (in this case "Fireboard Forum")
--- where the link will be nested
--- who will be able to view your forum
--- publish it
- Click "Save" to finish.
I'm a mod on the Best OF Joomla Fireboard forum and if you think poorly of Joomla I can only IMAGINE what you would think of the coding of Fireboard. I think the file that holds interest is admin.fireboard.html.php.
I wish I could code. I would write my own forum or CMS.
Thanks for looking.
Also. Forget that file. It only LOOKED like something I could modify. Don't really know where to look past that. It's a mess in there.
Gotcha. Okay, I threw joom back in again, and got it up and running, and yes, you're right; it's a mess in there! For starters; they are still using tables for layout!
It would be no small task to incorporate cbparser, though I can certainly see the need for a more comprehensive bbcode facility. With php, everything is doable, but to be honest, if it were my task, I'd probably write a forum component from scratch, rather than base it on someone else's old code; a-la fireboard.
If you still want to play with it, you will probably also need to also look inside..
com_fireboard/template/default/smile.class.php
com_fireboard/template/default/post.php
com_fireboard/sources/fb_bb.js.php
and probably others. It's a bit scattered around.
I wish I could be more help, but even *with* loads of php experience, I wouldn't attempt it. TABLES!!!!
I thought I was slack in the XHTML upgrade department! Because joomla has grown so big and complex, it would be a mammoth task to get it xhtml compliant and accessible; there's all sorts of legacy html stylings embedded right inside the php. It wouldn't be a "fun" job to remove it, and I'd be surprised if they ever did.
It's more than simply a difference in tags, it's a complete mindset, and coding for or inside Joomla would be dangerous for me; my frustration levels would be at max the whole time, and I'd likely end up trashing it, and writing a CMS from scratch.
But I already did that; corz.org is 100% hand-built, and cbparser is just one small part of the whole show, available individually, like most of the other parts; modular, self-contained programs that work together and slot together as and how needed.
I guess what I'm saying is, if you want something *just so*, then you GOTTA learn to code. So learn to code! Start simple. Maybe add a few new tags into Fireboard, or better yet; head down to my /engine, and download some php, get it into a decent text editor; there's notes.
Writing php is easy; that's why everyone does it. Writing secure, even beautiful php is quite another thing. Getting there can be a lot of fun, though.
en-joy!
;o)
(or
I told you it was bad but they ARE doing a total rewrite of the code. They made the mistake of building on top of a project that was "flawed" in the first place! Every mod they made to the code just made things worse. But thanks for pointing me in the right direction. I appreciate it. I'll learn this one way or the other. No getting around it. I'll check back in and let you know how I'm progressing.
Marc said..
I told you it was bad but they ARE doing a total rewrite of the code. They made the mistake of building on top of a project that was "flawed" in the first place!
Yup, you can tell. It's always best to just rip out all that shit and start from scratch, I find. Props to the crew for taking on a rewrite; always a worthwhile endeavour; though in this case, probably a hellish one.
I look forward to the updates on your progress, here or elsewhere. It's always good to see someone getting into web coding; a powerfully enabling step to take.
All the best!
;o)
(or
Hi Cor,
First I want to say you parser is super! I love using it!
I have one problem with the code when I run it on my own desktop computer.
when I use special characters like: ë i get nothing back, the output is totally blank.
I use apache 2.2 and the newest php (also tried older versions).
Hope you can help!
Hi Hubble.
It's temtping to jump in with a few potential solutions, but less valuable than first asking.. Have you consulted your php error log?
It's clear that cbparser can handle these characters fine (you just used one), so before I rip it apart, even load it in my text editor, I'll need to know things like; what operating system you are using, what version of cbparser, any log output, errors, is it running alone or embedded in some other page, and so on.
Also, when you say the output is totally blank, do you mean the entire page (i.e. it desn't load at all) or just the area where you expected to see html output from cbparser?
It's not possible to give me too much information!
;o)
(or