Coastal Web
06-09-2005, 06:09 AM
Hello, here is a snip from my phpBB and this is for the BBCode function that replaces [ img]url_here[ /img] with the users image..
I was trying to change this so it would allow URLS with ?'s in them...
for instance, as it stands now if l posted:
[ img]http://www.example.com/img.jpg?size=full[/ img]
The ? breaks the [ img] and it doesn't show up.
So basically l'm trying to make it so that the board will allow ?'s to be posted in [ img] URL's...
What would l need to change in the code bellow to make this happen?
// image_url_here code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
I just dont understand the preg_replace mess ^that thing is...
thanks for the help :D
I was trying to change this so it would allow URLS with ?'s in them...
for instance, as it stands now if l posted:
[ img]http://www.example.com/img.jpg?size=full[/ img]
The ? breaks the [ img] and it doesn't show up.
So basically l'm trying to make it so that the board will allow ?'s to be posted in [ img] URL's...
What would l need to change in the code bellow to make this happen?
// image_url_here code..
$text = preg_replace("#\[img\]((http|ftp|https|ftps)://)([^ \?&=\#\"\n\r\t<]*?(\.(jpg|jpeg|gif|png)))\[/img\]#sie", "'[img:$uid]\\1' . str_replace(' ', '%20', '\\3') . '[/img:$uid]'", $text);
I just dont understand the preg_replace mess ^that thing is...
thanks for the help :D