Temos pavadinimas: WordPress, Shopify ir PHPFusion programuotojų bendruomenė :: Jaunelio Klausimai :)

Parašė K-braun· 2010 Bal. 2 02:04:28
#173

function make_clickable($text){
   $ret = ' ' . $text;
   $ret = preg_replace("#(^|[\n ])\[(url|URL)=http://(.*?)\](.*?)\[\/(url|URL)\]#ise", "'\\1[<a href=\"http://\\3\" target=\"_blank\">\\4</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])\[(url|URL)=(.*?)\](.*?)\[\/(url|URL)\]#ise", "'\\1[<a href=\"http://\\3\" target=\"_blank\">\\4</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])\[(url|URL)\]http://(.*?)\[\/(url|URL)\]#ise", "'\\1[<a href=\"http://\\3\" target=\"_blank\">Click Here</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])\[(url|URL)\](.*?)\[\/(url|URL)\]#ise", "'\\1[<a href=\"http://\\3\" target=\"_blank\">Click Here</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])([\w]+?://[\w]+[^ \"\n\r\t<]*)#ise", "'\\1[<a href=\"\\2\" target=\"_blank\">Click Here</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])((www|ftp)\.[^ \"\t\n\r<]*)#ise", "'\\1[<a href=\"http://\\2\" target=\"_blank\">Click Here</a> ]'", $ret);
   $ret = preg_replace("#(^|[\n ])([a-z0-9&\-_\.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1[<a href=\"mailto:\\2@\\3\">Mail to \\2</a> ]", $ret);
   $ret = substr($ret, 1);
   return($ret);
}




http://failai.in/show/F/AED40C65...01.13g.zip - AJAX šaukykla [v7] -- \infusions\xSBox_panel\includes\functions.php faile - 38-49 eilutės šitas kodas.