We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 21191
    • 236 Posts
    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/
      ~Shawn Himmelberger
      Check out my MODx Development and MODx Design Company - Himmelberger Design
      • 21191
      • 236 Posts
      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;​
        ~Shawn Himmelberger
        Check out my MODx Development and MODx Design Company - Himmelberger Design