Displaying page
of
pages;
Items to
Title |
Test
Details
Pattern Title
|
Expression |
(\[[Ii][Mm][Gg]\])(\S+?)(\[\/[Ii][Mm][Gg]\])
|
Description |
easy when you want to allow your users to post images, but in a controlled way. I used it like this (in php):
$text = preg_replace("/(\[IMG\])(\S+?)(\[\/IMG\])/is", "<a href=\"\\2\" target=\"_blank\"><IMG SRC=\"\\2\" align=\"center\" height=\"100\" border=\"0\"></a>",$text);
so whenever they use
[img]http://www.foo.com/bleh.jpg[/img]
it will be converted to
<a href="http://www.foo.com/bleh.jpg" target="_blank"><IMG SRC="http://www.foo.com/bleh.jpg" align="center" height="100" border="0"></a>
so you get a 100 pixels high picture, and when they click on it it opens in a new window...
(to prevent users from posting huge pictures and stuff)
|
Matches |
[IMG]http://bleh.jpg[/IMG] | [ImG]bleh[/imG] | [img]ftp://login: [email protected][/img]
|
Non-Matches |
<img src="bleh.jpg">
|
Author |
Rating:
marnik vander elst
|
Displaying page
of
pages;
Items to