The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
'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. |
#2
|
|||
|
|||
Quote:
|
#3
|
||||
|
||||
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.
|
#4
|
|||
|
|||
|
#5
|
||||
|
||||
It's possible, but you'll need to know regular expressions (regex). Regex is complicated and is more suited to programmers who are confident.
|
Thread Tools | |
Display Modes | |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|