Seite 1 von 1

bbcode.php / .tpl -> mehrfache URL Generierung?

Verfasst: 19.09.2005 09:31
von mgutt
Es gibt in der bbcode.tpl folgende Zeile:

Code: Alles auswählen

<!-- BEGIN url --><a href="{URL}" target="_blank" class="postlink">{DESCRIPTION}</a><!-- END url -->
und in der bbcode.php folgende:

Code: Alles auswählen

	// matches an "xxxx://yyyy" URL at the start of a line, or after a space.
	// xxxx can only be alpha characters.
	// yyyy is anything up to the first space, newline, comma, double quote or <
	$ret = preg_replace("#(^|[\n ])([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"\\2\" target=\"_blank\">\\2</a>", $ret);

   // matches a "www|ftp.xxxx.yyyy[/zzzz]" kinda lazy URL thing
   // Must contain at least 2 dots. xxxx contains either alphanum, or "-"
   // zzzz is optional.. will contain everything up to the first space, newline, 
   // comma, double quote or <.
   $ret = preg_replace("#(^|[\n ])((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
Da ich externe Links umschreiben wollte und diese jetzt über eine outbound rausjage, damit Spammer keine Backlinks mehr erhalten viel mir auf, dass die tpl erstmal anscheinend nicht genutzt wird:
http://www.maxrev.de/cgi-bin/outbound.p ... w.phpbb.de

Wann schreibt die bbcode per .tpl eigentlich um? Für welche URLs ist das wichtig?

Verfasst: 19.09.2005 12:29
von itst
Dein Freund ist make_clickable()

Verfasst: 19.09.2005 12:45
von mgutt
is scho recht. das hat auch gepasst, die frage war eher wozu der link dann noch in der tpl?