CSS Columns MyCode
#1
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
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#2
This user has been denied support. This user has been denied support.
If that's supposed to be a number always, you could use column=([0-9]+?) instead of .*?
Reply
#3
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.
MyReactions - All Plugins

Can you still feel the butterflies?

Free never tasted like pudding.
Reply
#4
BTW (.*?) is secure but aome times it enables the use of HTML withing the tags,

Very good job Smile
Reply
#5
This user has been denied support. This user has been denied support.
(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
Reply
#6
so whats the othe way to make it secure ?
Reply
#7
amazing idea, thanks MattRogowski
Reply
#8
great code men, very useful in the signs Toungue
Reply
#9
This is awesome, thanks Matt.
Reply
#10
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
“The road to positivity is strewn with the abandoned vehicles of the faint-hearted.” Peter McWilliams
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)