Uutiset:

Wondering if this will always be free?  See why free is better.

Main Menu
Advertisement:

Adding a new quote BBC

Aloittaja diablo3x.dk, toukokuu 13, 2014, 11:53:23 AP

« edellinen - seuraava »

diablo3x.dk

Hello there,

I'm trying to add a new BB code so that I can have two different looks for quotes. I want the standard quote design to stay and then a new quote design with different background styling. I know how to add a new button to the WYSIWYG editor in subs-editor.php and how to style it all in CSS. I simply copied the original quote part in subs-editor.php and edited it so that my new button for quotes generates this BBC:

[blizzquote][/blizzquote]

Code looks like this:

array(
'image' => 'quote',
'code' => 'blizzquote',
'before' => '[blizzquote]',
'after' => '[/blizzquote]',
'description' => $txt['bbc_quote']
)


What I do not know is how to make this code work so that it actually does something different than being exactly the same as the original quote. So my question is what do I do in order to make the blizzquote fetch the new css I will make for it?

NanoSector

I copied this from my FancyPosts mod (it contains a whole splat of other examples you can use):

        // [catbar]Test[/catbar]
        $codes[] = array(
                        'tag' => 'catbar',
                        'before' => '<div class="cat_bar"><h3 class="catbg">',
                        'after' => '</h3></div>',
                        'trim' => 'outside',
                );


I hope that'll give you a bit of an idea :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

This is also not helped by the fact that there are something like 5 different types of quote bbc depending on whether it's just a simple quote, quoting a message, quoting a PM, quoting just an author... and the various combinations of parameters therein.
Holder of controversial views, all of which my own.


diablo3x.dk

Lainaus käyttäjältä: Yoshi - toukokuu 13, 2014, 12:06:16 IP
I copied this from my FancyPosts mod (it contains a whole splat of other examples you can use):

        // [catbar]Test[/catbar]
        $codes[] = array(
                        'tag' => 'catbar',
                        'before' => '<div class="cat_bar"><h3 class="catbg">',
                        'after' => '</h3></div>',
                        'trim' => 'outside',
                );


I hope that'll give you a bit of an idea :)

Thanks, Yoshi. Will give it a try soon :)

Lainaus käyttäjältä: Arantor - toukokuu 13, 2014, 12:09:04 IP
This is also not helped by the fact that there are something like 5 different types of quote bbc depending on whether it's just a simple quote, quoting a message, quoting a PM, quoting just an author... and the various combinations of parameters therein.

Yes, I agree. For this particular quote design I only want it to apply to simple quotes - no quotes in quotes, quoting messages/pm or something like that.

Arantor

Preventing quotes in quotes is something else entirely. The code Yoshi has is, largely, correct with one omission; the block_level value isn't set and it should be set to true.
Holder of controversial views, all of which my own.


NanoSector

Lainaus käyttäjältä: Arantor - toukokuu 13, 2014, 01:22:35 IP
Preventing quotes in quotes is something else entirely. The code Yoshi has is, largely, correct with one omission; the block_level value isn't set and it should be set to true.
Thanks, will implement that in my mod as well - does it need to be set to anything with <div>s and crap?
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Yes, because they're block tags ;) Basically, any tag that functions in the context of being a block tag in HTML should be declared a block_level tag which ensures that nesting is maintained; you won't be able to use it inside, say, a font tag because the parser will prevent using a block level tag inside an inline level one.

It's less of an issue these days where display can be set on any element to vary its displayed behaviour but from a semantic point of view, tags that aren't semantically block tags shouldn't nest block tags.
Holder of controversial views, all of which my own.


NanoSector

Thanks :)
There should really be documentation about this kind of stuff.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Arantor

Holder of controversial views, all of which my own.


Illori

Lainaus käyttäjältä: Yoshi - toukokuu 13, 2014, 03:28:33 IP
Thanks :)
There should really be documentation about this kind of stuff.

we have asked the coding people to help document stuff like this... very few have helped.

NanoSector

Fair point, though when I used it to write FancyPosts I found it rather confusing. I guess it gets the job done but I wouldn't call it friendly for beginners.

@Illori: If I could, I would write more documentation. Though I don't even fully understand it myself :\
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Illori

Lainaus käyttäjältä: Yoshi - toukokuu 13, 2014, 03:35:54 IP
@Illori: If I could, I would write more documentation. Though I don't even fully understand it myself :\

you understand more then a lot of people. even simple tutorials on how to remove parts in the templates may be useful to many.

NanoSector

Can you send me a PM, or a topic link later, that has a list of all "commonly asked" code snippets or code changes? I might start writing up those then if I have free time.
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

Illori

Lainaus käyttäjältä: Yoshi - toukokuu 13, 2014, 03:44:24 IP
Can you send me a PM, or a topic link later, that has a list of all "commonly asked" code snippets or code changes? I might start writing up those then if I have free time.

i dont think there are really common ones, but things like how to remove the info center and things along those lines would not be a bad start. maybe removing the new posts/no new posts icons above the info center.

NanoSector

Bookmarked, I'll get to it once I have more free time :)
My Mods / Mod Builder - A tool to easily create mods / Blog
"I've heard from a reliable source that the Answer is 42. But, still no word on what the question is."

diablo3x.dk

It worked. Thanks, Yoshi and Arantor. Now I will be able to add some BBC useful to my forum specifically.

Advertisement: