Url mit Klammern
Forumsregeln
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
phpBB 2.0 hat das Ende seiner Lebenszeit überschritten
phpBB 2.0 wird nicht mehr aktiv unterstützt. Insbesondere werden - auch bei Sicherheitslücken - keine Patches mehr bereitgestellt. Der Einsatz von phpBB 2.0 erfolgt daher auf eigene Gefahr. Wir empfehlen einen Umstieg auf phpBB 3.1, welches aktiv weiterentwickelt wird und für welches regelmäßig Updates zur Verfügung gestellt werden.
Url mit Klammern
Hallo Leute,
habe folgendes Problem, wenn jemand eine URL bei mir im Forum postet und diese URL eine Klammer enthält, dann wird diese nicht richtig dargestellt. Wo müsste ich was ändern damit es funktionieren würde?
Vielen Dank.
habe folgendes Problem, wenn jemand eine URL bei mir im Forum postet und diese URL eine Klammer enthält, dann wird diese nicht richtig dargestellt. Wo müsste ich was ändern damit es funktionieren würde?
Vielen Dank.
-
Michael Zacher
- Mitglied
- Beiträge: 1620
- Registriert: 03.01.2004 23:12
- Wohnort: Aken (Elbe)
Wenn man die URL mit dem Tag einfügt sollte es eigentlich gehen.
Code: Alles auswählen
[url=http://lalala.de/muh(haha).php]Beschreibung[/url]Mit freundlichen Grüßen / Best regards / Met vriendelijke groeten
Michael Zacher
Michael Zacher
-
SoLo1905
wie wird denn z.B. welche adresse dargestellt also
ein beispiel:
diese adresse
www.ichbindieseite.de
wird so angezeigt
www.ich)bin0dieseite.de
ein beispiel:
diese adresse
www.ichbindieseite.de
wird so angezeigt
www.ich)bin0dieseite.de
SoLo1905 hat geschrieben:wie wird denn z.B. welche adresse dargestellt also
ein beispiel:
diese adresse
www.ichbindieseite.de
wird so angezeigt
www.ich)bin0dieseite.de
wie dein letztes Beispiel
-
SoLo1905
Öffne
./includes/bbcode
Suche
und kopiere mal die davor liegenden 5 zeilen und die davor kommende 5 zeilen
./includes/bbcode
Suche
Code: Alles auswählen
// Remove our padding..
$ret = substr($ret, 1);Hab mal beide Funkionen kopiert
Code: Alles auswählen
function make_clickable($text)
{
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
// 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);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
}
/**
* Nathan Codding - Feb 6, 2001
* Reverses the effects of make_clickable(), for use in editpost.
* - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs.
*
*/
function undo_make_clickable($text)
{
$text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text);
$text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text);
return $text;
}
-
SoLo1905
ersetze mal die von dir geschriebene code durch
Code: Alles auswählen
function make_clickable($text)
{
$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
// pad it with a space so we can match things at the start of the 1st line.
$ret = ' ' . $text;
// 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);
// matches an email@domain type address at the start of a line, or after a space.
// Note: Only the followed chars are valid; alphanums, "-", "_" and or ".".
$ret = preg_replace("#(^|[\n ])([a-z0-9&\-_.]+?)@([\w\-]+\.([\w\-\.]+\.)*[\w]+)#i", "\\1<a href=\"mailto:\\2@\\3\">\\2@\\3</a>", $ret);
$ret = preg_replace("/<a href=(.*?)>((http:\/\/|https:\/\/|ftp:\/\/|www.).*?)<\/a>/ie", "(strlen(\"\\2\") > 65 && !eregi(\"<\", \"\\2\") ) ? '<a href='.stripslashes(\"\\1\").'>'.substr(\"\\2\", 0, 35) . ' [...] ' . substr(\"\\2\", -25).'</a>' : '<a href='.stripslashes(\"\\1\").'>'.\"\\2\".'</a>'", $ret);
// Remove our padding..
$ret = substr($ret, 1);
return($ret);
}
/**
* Nathan Codding - Feb 6, 2001
* Reverses the effects of make_clickable(), for use in editpost.
* - Does not distinguish between "www.xxxx.yyyy" and "http://aaaa.bbbb" type URLs.
*
*/
function undo_make_clickable($text)
{
$text = preg_replace("#<!-- BBCode auto-link start --><a href=\"(.*?)\" target=\"_blank\">.*?</a><!-- BBCode auto-link end -->#i", "\\1", $text);
$text = preg_replace("#<!-- BBcode auto-mailto start --><a href=\"mailto:(.*?)\">.*?</a><!-- BBCode auto-mailto end -->#i", "\\1", $text);
return $text;
}Hab sie dir hier hochgeladen: http://www.pixelrain.de/phpbb.txt