Subject:*
<
Name/Email:*
<
Message Icon:*
<
Select*
<
Message:*
<



Click the Preview to see the content in action.
Options:*
<
Confirmation Code*
<
2 + 8 = ?  
Input the result from the expression
Maximum attempts you can try: 10
*
<
     

Re: Assign bb code [img] to a class
by incama on 2005/3/12 12:58:36

Thank you very much Mithrandir,.I'll play with this and will post my results.

Dave
Re: Assign bb code [img] to a class
by Mithrandir on 2005/3/12 12:48:29

not a bad idea - look at the xoopsCodeDecode() method of the textsanitizer in class/module.textsanitizer.php

le="color: #000000"><?php $patterns[] = "/[img align=(['"]?)(left|center|right)\1]([^"()?&'<>]*)[/img]/sU"; $patterns[] = "/[img]([^"()?&'<>]*)[/img]/sU"; $patterns[] = "/[img align=(['"]?)(left|center|right)\1 id=(['"]?)([0-9]*)\3]([^"()?&'<>]*)[/img]/sU"; $patterns[] = "/[img id=(['"]?)([0-9]*)\1]([^"()?&'<>]*)[/img]/sU"; if ($allowimage != 1) { $replacements[] = '<a href="\3" target="_blank">\3</a>'; $replacements[] = '<a href="\1" target="_blank">\1</a>'; $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\4" target="_blank">\4</a>'; $replacements[] = '<a href="'.XOOPS_URL.'/image.php?id=\2" target="_blank">\3</a>'; } else { $replacements[] = '<img src="\3" align="\2" alt="" />'; $replacements[] = '<img src="\1" alt="" />'; $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\4" align="\2" alt="\4" />'; $replacements[] = '<img src="'.XOOPS_URL.'/image.php?id=\2" alt="\3" />'; }

Add the CSS class to the replacements and it should work.
Assign bb code [img] to a class
by incama on 2005/3/12 12:37:48

Is there a way to assing the bbcode [img] to a class or id, so I can control it in my stylesheet.

The problem I have is that when people post a large image on my forums it wrecks apart my site. I can handle the the post itself, telling when a certain width is crossed it has to overflow, but the overflow needs a width parameter so it knows when to overflow.
Doing this makes pics [img] indeed fit into the page, but, if a post has a smilie in it, the smilie grows until the max width.

So, what I want to do is assing the bbcode [img] to a class so I can control it.

Any one?

Who's Online

215 user(s) are online (149 user(s) are browsing Support Forums)


Members: 0


Guests: 215


more...

Donat-O-Meter

Stats
Goal: $15.00
Due Date: Jul 31
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $15.00
Make donations with PayPal!

Latest GitHub Commits