I’m trying to have getFeed’s output of a twitter feed have it’s links be links. I found the PHx custom modifier parseLinks
<?php
/*
* phx:parseLinks
*/
$t = $output;
$t = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "<a href=\"\\0\">\\0</a>", $t);
$t = ereg_replace("(^| |\n)(www([.]?[a-zA-Z0-9_/-])*)", "\\1<a href=\"http://\\2\">\\2</a>", $t);
return $t;
So I called this in MODx Revolution like so
[[+description:parseLinks]]
Working on the twitter feed on the side here
http://www.mbros.com.php5-20.websitetestlink.com/
Looks like I just ahd to change $output to $input , thanks to the fellas in the IRC
<?php
/*
* phx:parseLinks
*/
$t = $output;
$t = ereg_replace("[a-zA-Z]+://([.]?[a-zA-Z0-9_/-])*", "<a href=\"\\0\">\\0</a>", $t);
$t = ereg_replace("(^| |\n)(www([.]?[a-zA-Z0-9_/-])*)", "\\1<a href=\"http://\\2\">\\2</a>", $t);
return $t;