![]() |
'Allow Dynamic URL for [IMG] Tags': link replacement question
Hello.
Is this 'preg_replace()' statement coded to replace ALL instances of [img] tags in one shot? If so, what can I change in the 'preg_replace()' to only change ONE link at a time if I put it in a loop? I can do the other alterations necessary. I want to be able to evaluate each link separately to decide which image URLs to parse and which ones not. ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (ref: class_bbcode.php and class_bbcode_alt.php in "function handle_bbcode_img()") // do [img]xxx[/img] $bbcode = preg_replace('#\[img\]\s*(https?://([^<>*"' . iif(!$this->registry->options['allowdynimg'], '?&') . ']+|[a-z0-9/\\._\- !]+))\[/img\]#iUe', "\$this->handle_bbcode_img_match('\\1')", $bbcode); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Thanks in advance. |
Quote:
|
That PCRE function matches the URL inside the IMG tags, and allows/disallows query string depending on what is set. It then passes each result into handle_bbcode_img_match() to create the HTML.
|
What I really want is to get rid of spammers who use this type of links.
https://vborg.vbsupport.ru/external/2008/07/22.gif I want to keep the image and remove the url. can I strip the above linke to make it like this: https://vborg.vbsupport.ru/external/2008/07/22.gif I not a programmer but I can manage to do some modifications. |
It's possible, but you'll need to know regular expressions (regex). Regex is complicated and is more suited to programmers who are confident.
|
All times are GMT. The time now is 09:26 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|