Log in

View Full Version : pre-defined BB code


Phenomena
08-28-2007, 02:22 AM
I'm trying to make myself, what seems to be, a simple enough mod where members can set some BB code in their profile, and have all their posts automatically use that BB code.

So i managed to set up the profile fields through the ACP easy enough, but now I'm having troubles with this next part, I can't figure out how to get it so the BB code is automatically in the new message text area.

Any help would be appreciated.

Eikinskjaldi
08-28-2007, 02:27 AM
What is it exactly, that you are trying to do?

I am guessing bbcode is not the correct approach.

Phenomena
08-28-2007, 02:30 AM
ok so some of members like using there own font styles, colours, sizes and all that and one of them asked me this:

Y'know how you can pick a font,text size,and colours when you post a message right?
Well.
I think this would be rather awesome:

If we could some way pick all of those settings in our User CP and save it,so our posts already look pretty without us having to pick colours and stuff all the time.

And then we could change it in our CP whenever we wanted to match our sigs and stuff.

Making my posts look pretty only takes like 10 seconds,but it's annoying having to do it every time.
Which is why I don't.xD


So,is this possible?
I'd be a happyhappy panda.

so i thought meh, I'll just set up a couple of profile fields where you enter your opening and closing BB tags, and when you create a new post/topic the bb code is automatically there nad you just write your text in between. lol i suck at explaining things xD

Eikinskjaldi
08-28-2007, 06:02 AM
Make a plugin that hooks into bbcode_parse_start

it should include a test for is_numeric($forumid) to prevent the extra tags being entered in signatures and other non post locations.

it should finally set $text = opentags.$text.closetags

Note that class_bbcode has $vbulletin passed in as $this->registry for your db calls.