MyBB Community Forums

Full Version: CSS Columns MyCode
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
This will arrange a paragraph into columns. It uses CSS3. This means that only certain browsers will see the columns. However, browsers that don't support CSS3, such as IE, will just see it as normal text; it won't break or anything, they'll just miss out on the effects.

Regular expression:

\[column=([0-9]+?)\](.*?)\[/column\]

Replacement:

<div style="-moz-column-count: $1; -webkit-column-count: $1;">$2</div>

And obviously have it activated/enabled.

Then you would do this:

[column=3]Text here[/column]

for three columns, or

[column=5]Text here[/column]

for five columns, or

[column=1000000]Text here[/column]

for a million columns... you get the idea. Don't really need to see a screenshot, it's basically like a newspaper Toungue

Also, I'm not totally sure about the (.*?) stuff and whether that's secure, if it isn't, please, tell me Smile
If that's supposed to be a number always, you could use column=([0-9]+?) instead of .*?
Thank you, updated Smile That's one thing I've never really got round to learning about so I just use the example it gives in the ACP.
BTW (.*?) is secure but aome times it enables the use of HTML withing the tags,

Very good job Smile
(2009-06-04, 11:27 AM)ghazal Wrote: [ -> ]BTW (.*?) is secure but aome times it enables the use of HTML withing the tags,

...which would make it: not secure Rolleyes
so whats the othe way to make it secure ?
amazing idea, thanks MattRogowski
great code men, very useful in the signs Toungue
This is awesome, thanks Matt.
Great work Matt but out of curiosity, is there a way to add a little more white space between columns?

Off-topic, love one of your avatars, a Peel P50, the world's smallest production car... Smile

Cheers,
Gene
Pages: 1 2