Hi folks! What a beautiful day, isn't it? =)

I need some help trying to implement the editor from this tutorial:
- Part 1: http://www.phpfreaks.com/tutorials/107/0.php
- Part 2: http://www.phpfreaks.com/tutorials/123/0.php
I can't sort out what goes where. I have an idea, but apparently it's not the right one, because it's not working. I don't need the list parser, therefore, half of the code won't be needed.
Can anyone give me a brief explanation about the "architecture" of this editor? The tutorials don't have a .zip file with an organized version of the codes, and I'm really lost for a few days now.
Thanks!

-----

EDIT: Also, if anyone can tell me about another tutorial that has the same final product (the BBCode editor) and is easier to understand/implement, I'd appreciate.