Url mit Klammern

Probleme bei der regulären Arbeiten mit phpBB, Fragen zu Vorgehensweisen oder Funktionsweise sowie sonstige Fragen zu phpBB im Allgemeinen.
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.
I-Jack
Mitglied
Beiträge: 16
Registriert: 01.09.2006 09:49

Url mit Klammern

Beitrag von I-Jack »

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.
Michael Zacher
Mitglied
Beiträge: 1620
Registriert: 03.01.2004 23:12
Wohnort: Aken (Elbe)

Beitrag von Michael Zacher »

Wenn man die URL mit dem Tag

Code: Alles auswählen

[url=http://lalala.de/muh(haha).php]Beschreibung[/url]
einfügt sollte es eigentlich gehen.
Mit freundlichen Grüßen / Best regards / Met vriendelijke groeten

Michael Zacher
SoLo1905

Beitrag von SoLo1905 »

wie wird denn z.B. welche adresse dargestellt also

ein beispiel:
diese adresse
www.ichbindieseite.de

wird so angezeigt
www.ich)bin0dieseite.de
I-Jack
Mitglied
Beiträge: 16
Registriert: 01.09.2006 09:49

Beitrag von I-Jack »

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

Beitrag von SoLo1905 »

Öffne
./includes/bbcode

Suche

Code: Alles auswählen

   // Remove our padding..
   $ret = substr($ret, 1);
und kopiere mal die davor liegenden 5 zeilen und die davor kommende 5 zeilen
I-Jack
Mitglied
Beiträge: 16
Registriert: 01.09.2006 09:49

Beitrag von I-Jack »

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

Beitrag von 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;

}
I-Jack
Mitglied
Beiträge: 16
Registriert: 01.09.2006 09:49

Beitrag von I-Jack »

Funktioniert leider nicht, aber schonmal vielen Dank.
SoLo1905

Beitrag von SoLo1905 »

pff verlink mal die bbCode als .txt datei
I-Jack
Mitglied
Beiträge: 16
Registriert: 01.09.2006 09:49

Beitrag von I-Jack »

Hab sie dir hier hochgeladen: http://www.pixelrain.de/phpbb.txt
Antworten

Zurück zu „phpBB 2.0: Administration, Benutzung und Betrieb“