[Typo3] Parsing links in a table
Jan Bednarik
info at bednarik.org
Wed Aug 10 14:38:33 CEST 2005
Hi,
I've got a table content like this:
Some Text|http://www.typo3.org|someone@typo3.org
I need it to be parsed and links to be created.
I'm using content (default) template and it's not working.
This is the conf (copied from the object browser)
[table]=COA
[10]=< lib.stdheader
[20]=CASE
[1]=TEXT
[current]=1
[if]
[trim]=1
[parseFunc]
[makelinks]=1
[http]
[keep]=path
[extTarget]=
[wrap]=
[mailto]
[keep]=path
[wrap]=
Right now I've solved it by creating an user function and sending
content to this function. The function is here:
function user_parse_links($c,$conf='') {
$c = preg_replace('/(http:\/\/[^< |>$%&*@#!]+)/','<a
href="\\1">\\1</a>',$c);
$c =
preg_replace('/([_a-zA-Z0-9\.\-]+@[_a-zA-Z0-9\.\-]+\.[a-zA-Z]{2,4})/','<a
href="mailto:\\1">\\1</a>',$c);
return $c;
}
Thanks
--
Jan Bednarik
More information about the TYPO3-english
mailing list