includes/template.php
changeset 59 7c4a851fb5c5
parent 57 b354deeaa4c4
child 60 71b50f8c8f85
equal deleted inserted replaced
58:8f532d8ab5f5 59:7c4a851fb5c5
  1123     
  1123     
  1124     preg_match_all('#\[\[([a-zA-Z0-9 -_]*?)\]\]#is', $message, $il);
  1124     preg_match_all('#\[\[([a-zA-Z0-9 -_]*?)\]\]#is', $message, $il);
  1125     for($i=0;$i<sizeof($il[1]);$i++)
  1125     for($i=0;$i<sizeof($il[1]);$i++)
  1126     {
  1126     {
  1127       $href = makeUrl(str_replace(' ', '_', $il[1][$i]), null, true);
  1127       $href = makeUrl(str_replace(' ', '_', $il[1][$i]), null, true);
  1128       $text_parser->assign_vars(Array(
  1128       $text_parser->assign_vars(Array(  
  1129           'HREF'  => $href,
  1129           'HREF'  => $href,
  1130           'FLAGS' => '',
  1130           'FLAGS' => '',
  1131           'TEXT'  => $il[1][$i]
  1131           'TEXT'  => $il[1][$i]
  1132         ));
  1132         ));
  1133       $message = str_replace("[[{$il[1][$i]}]]", $text_parser->run(), $message);
  1133       $message = str_replace("[[{$il[1][$i]}]]", $text_parser->run(), $message);
  1144         ));
  1144         ));
  1145       $message = str_replace("[[{$il[1][$i]}|{$il[2][$i]}]]", $text_parser->run(), $message);
  1145       $message = str_replace("[[{$il[1][$i]}|{$il[2][$i]}]]", $text_parser->run(), $message);
  1146     }
  1146     }
  1147     
  1147     
  1148     // External links
  1148     // External links
  1149     $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\ ([^\]]+)]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1149     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?) ([^\]]+)\\]#', '<a href="\\1://\\2">\\3</a><br style="display: none;" />', $message);
  1150     $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
  1150     // $message = preg_replace('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', '<a href="\\1://\\2">\\1://\\2</a><br style="display: none;" />', $message);
       
  1151     
       
  1152     preg_match_all('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\ ([^\]]+)]#', $message, $ext_link);
       
  1153     
       
  1154     for ( $i = 0; $i < count($ext_link[0]); $i++ )
       
  1155     {
       
  1156       $text_parser->assign_vars(Array(  
       
  1157           'HREF'  => "{$ext_link[1][$i]}://{$ext_link[2][$i]}",
       
  1158           'FLAGS' => '',
       
  1159           'TEXT'  => $ext_link[3][$i]
       
  1160         ));
       
  1161       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
       
  1162     }
       
  1163     
       
  1164     preg_match_all('#\[(http|ftp|irc):\/\/([a-z0-9\/:_\.\?&%\#@_\\\\-]+?)\\]#', $message, $ext_link);
       
  1165     
       
  1166     for ( $i = 0; $i < count($ext_link[0]); $i++ )
       
  1167     {
       
  1168       $text_parser->assign_vars(Array(  
       
  1169           'HREF'  => "{$ext_link[1][$i]}://{$ext_link[2][$i]}",
       
  1170           'FLAGS' => '',
       
  1171           'TEXT'  => htmlspecialchars("{$ext_link[1][$i]}://{$ext_link[2][$i]}")
       
  1172         ));
       
  1173       $message = str_replace($ext_link[0][$i], $text_parser->run(), $message);
       
  1174     }
  1151     
  1175     
  1152     $parser1 = $this->makeParserText($tplvars['sidebar_section']);
  1176     $parser1 = $this->makeParserText($tplvars['sidebar_section']);
  1153     $parser2 = $this->makeParserText($tplvars['sidebar_section_raw']);
  1177     $parser2 = $this->makeParserText($tplvars['sidebar_section_raw']);
  1154                             
  1178                             
  1155     preg_match_all('#\{slider(2|)=(.*?)\}(.*?)\{\/slider(2|)\}#is',  $message, $sb);
  1179     preg_match_all('#\{slider(2|)=(.*?)\}(.*?)\{\/slider(2|)\}#is',  $message, $sb);