includes/template.php
changeset 165 199599eca89e
parent 163 ad00dc1f8706
child 166 d53cc29308f4
child 174 4c5c2b66a34d
equal deleted inserted replaced
164:54c79adfb694 165:199599eca89e
  1343     
  1343     
  1344     // External links
  1344     // External links
  1345     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1345     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1346     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
  1346     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
  1347     
  1347     
  1348     preg_match_all('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\ ([^\]]+)]#', $message, $ext_link);
  1348     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);
  1349     
  1349     
  1350     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1350     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1351     {
  1351     {
  1352       $text_parser->assign_vars(Array(  
  1352       $text_parser->assign_vars(Array(  
  1353           'HREF'  => "{$ext_link[1][$i]}://{$ext_link[2][$i]}",
  1353           'HREF'  => $ext_link[1][$i],
  1354           'FLAGS' => '',
  1354           'FLAGS' => '',
  1355           'TEXT'  => $ext_link[3][$i]
  1355           'TEXT'  => $ext_link[16][$i]
  1356         ));
  1356         ));
  1357       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1357       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1358     }
  1358     }
  1359     
  1359     
  1360     preg_match_all('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', $message, $ext_link);
  1360     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);
  1361     
  1361     
  1362     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1362     for ( $i = 0; $i < count($ext_link[0]); $i++ )
  1363     {
  1363     {
  1364       $text_parser->assign_vars(Array(  
  1364       $text_parser->assign_vars(Array(  
  1365           'HREF'  => "{$ext_link[1][$i]}://{$ext_link[2][$i]}",
  1365           'HREF'  => $ext_link[1][$i],
  1366           'FLAGS' => '',
  1366           'FLAGS' => '',
  1367           'TEXT'  => htmlspecialchars("{$ext_link[1][$i]}://{$ext_link[2][$i]}")
  1367           'TEXT'  => htmlspecialchars($ext_link[1][$i])
  1368         ));
  1368         ));
  1369       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1369       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
  1370     }
  1370     }
  1371     
  1371     
  1372     $parser1 = $this->makeParserText($tplvars['sidebar_section']);
  1372     $parser1 = $this->makeParserText($tplvars['sidebar_section']);