| :: |
| Author |
Message |
daddyo
Joined: 12 Sep 2007 Posts: 47
|
Posted: Thu Oct 25, 2007 1:21 pm Post subject: Links not recognized in [URL] tags |
|
|
I recently found where I needed to add the vertical bar "|" character to the search string in order to make links directly posted in my forum clickable.
However, I can't figure out where to add in the vertical bar "|" character so that when someone uses [URL] tags to make a URL, it also makes the URL clickable.
In other words, if I post a URL like this
-http://mysite.com/this|is|my|url
it actually knows it's a link in my forum and makes it clickable.
But if I put the [URL= tag around it, it doesn't recognize it anymore. |
|
|
| Back to top |
|
 |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
daddyo
Joined: 12 Sep 2007 Posts: 47
|
Posted: Sun Oct 28, 2007 2:12 pm Post subject: Re: Links not recognized in [URL] tags |
|
|
| I'm not sure what you mean. Can you please explain? |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
daddyo
Joined: 12 Sep 2007 Posts: 47
|
Posted: Sun Oct 28, 2007 2:44 pm Post subject: Re: Links not recognized in [URL] tags |
|
|
The problem I was having was related to users posting external links with vertical bars.
Here's a good example:
http://www.hallmark.com/webapp/wcs/stores/servlet/category2|10001|10051|149051|147551;149051|ecards|Photo%20Cards
phpBB wasn't parsing them correctly and making them clickable, so I found a place in the code where it makes links clickable and added "\|" in the criteria (since vertical bar represents OR in some occasions and migh cause other problems unless you escape it) and it now makes these links clickable.
But, if someone posts this same URL as
[url=http://www.hallmark.com/webapp/wcs/stores/servlet/category2|10001|10051|149051|147551;149051|ecards|Photo%20Cards]Click Here[/url]
The [URL] BBCode Tags don't know how to deal with vertical bars and thus don't make the link clickable. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
Posted: Sun Oct 28, 2007 2:51 pm Post subject: Re: Links not recognized in [URL] tags |
|
|
Ho I see now.
This deals with the bbcode regex in includes/bbcodes.php :
| Code: | // matches a [url]xxxx://www.phpbb.com[/url] code..
$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url1'];
// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]+|\[(?!url=))*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url2'];
// [url=xxxx://www.phpbb.com]phpBB[/url] code..
$patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url3'];
// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
$patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
$replacements[] = $bbcode_tpl['url4'] |
I guess you can find the proper place to add a nice \[ in these with a bit of testing
++ |
_________________ Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________
Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche |
|
| Back to top |
|
 |
daddyo
Joined: 12 Sep 2007 Posts: 47
|
Posted: Sun Oct 28, 2007 2:59 pm Post subject: Re: Links not recognized in [URL] tags |
|
|
Awesome.
includes/bbcodes.php is exactly what I needed.
The hardest part for me in making site mods on my own is simply knowing which files to look in. |
|
|
| Back to top |
|
 |
dcz Administrateur - Site Admin

Joined: 28 Apr 2006 Posts: 15242
|
|
| Back to top |
|
 |
daddyo
Joined: 12 Sep 2007 Posts: 47
|
Posted: Sun Oct 28, 2007 4:00 pm Post subject: Re: Links not recognized in [URL] tags |
|
|
| Thanks for your help. |
|
|
| Back to top |
|
 |
|
|