includes/template.php
changeset 226 0e6478521004
parent 215 94db56b8124f
child 227 0eca1498a77b
equal deleted inserted replaced
225:b9a8a993f4e7 226:0e6478521004
  1472     
  1472     
  1473     // External links
  1473     // External links
  1474     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1474     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1475     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
  1475     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
  1476     
  1476     
  1477     preg_match_all('/\[((https?|ftp|irc):\/\/([^@\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?) ([^\]]+)\]/is', $message, $ext_link);
  1477     preg_match_all('/\[((https?|ftp|irc):\/\/([^@\s\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?) ([^\]]+)\]/is', $message, $ext_link);
       
  1478     
       
  1479     // die('<pre>' . htmlspecialchars( print_r($ext_link, true) ) . '</pre>');
  1478     
  1480     
  1479     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1481     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1480     {
  1482     {
  1481       $text_parser->assign_vars(Array(  
  1483       $text_parser->assign_vars(Array(  
  1482           'HREF'  => $ext_link[1][$i],
  1484           'HREF'  => $ext_link[1][$i],
  1484           'TEXT'  => $ext_link[16][$i]
  1486           'TEXT'  => $ext_link[16][$i]
  1485         ));
  1487         ));
  1486       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1488       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1487     }
  1489     }
  1488     
  1490     
  1489     preg_match_all('/\[((https?|ftp|irc):\/\/([^@\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?)\]/is', $message, $ext_link);
  1491     preg_match_all('/\[((https?|ftp|irc):\/\/([^@\s\]"\':]+)?((([a-z0-9-]+\.)*)[a-z0-9-]+)(\/[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]*(\?(([a-z0-9_-]+)(=[A-z0-9_%\|~`\!@#\$\^&\*\(\):;\.,\/-\[\]]+)?((&([a-z0-9_-]+)(=[A-z0-9_%\|~`!\!@#\$\^&\*\(\):;\.,\/-]+)?)*))?)?)?)\]/is', $message, $ext_link);
  1490     
  1492     
  1491     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1493     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1492     {
  1494     {
  1493       $text_parser->assign_vars(Array(  
  1495       $text_parser->assign_vars(Array(  
  1494           'HREF'  => $ext_link[1][$i],
  1496           'HREF'  => $ext_link[1][$i],