if you need to replace only links try something like this.

$pattern = "/(<link ([^>]*)>)(.*?)(<\/link>)/si";
preg_match_all($pattern,$message,$regs);
for ($i = 0; $i < count($regs[0]); $i++)
{
    if (is_numeric($regs[2][$i]))
    {
        // Internal link
$message = str_replace($regs[1][$i],'<a href="http://your_host_name/index.php?id='.$regs[2][$i].'">',$message);
    }
    else if (ereg('@',$regs[2][$i]))
    {
        // Email address
$message = str_replace($regs[1][$i],'<a href="mailto:'.$regs[2][$i].'">',$message);
    }
    else
    {
        // External links
$message = str_replace($regs[1][$i],'<a href="'.$regs[2][$i].'">',$message);
    }
}

On 3/29/2013 6:09 AM, Dawid Pacholczyk wrote:
Hello,
  TYPO3 keeps hyperlinks as <link http://target.loc - some more
data>Label</link>

I'm writing exporter of my content to the external system that isn't based
on TYPO3 so I need to convert this link to normal <a
href="target.loc">Label</a>

How can I do this while exporting thata from BE module to xml or text file ?

Best regards,
Dawid Pacholczyk


_______________________________________________
TYPO3-english mailing list
[email protected]
http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english

Reply via email to