Seite 2 von 3

Verfasst: 31.12.2005 14:36
von BZebra
Sorry, war vielleicht etwas unverständlich.

equote ist ein zusätzlicher BBcode den ich installiert habe. http://www.phpbbhacks.com/download/1034
Der Unterschied zu quote ist der, daß bei der Variante

[equote="Entnommen aus Wikipedia:"]Test[/equote]

nicht über dem Zitat

Entnommen aus Wikipedia: hat folgendes geschrieben:

steht, sondern

Entnommen aus Wikipedia:

Dieser Teil hier den wir im 2.0.19er Update ändern müssen existiert aber nur für quote, nicht für equote.

Code: Alles auswählen

# 
#-----[ FIND ]--------------------------------------------- 
# Line 392 
            if( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) ) 
            { 
               // OK we are in a quote tag that probably contains a ] bracket. 
               // Grab a bit more of the string to hopefully get all of it.. 
               if ($close_pos = strpos($text, '"]', $curr_pos + 9)) 
               { 
                  if (strpos(substr($text, $curr_pos + 9, $close_pos - ($curr_pos + 9)), '[quote') === false) 
                  { 
                     $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 2); 

# 
#-----[ REPLACE WITH ]--------------------------------------------- 
# 
            if( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) ) 
            { 
               // OK we are in a quote tag that probably contains a ] bracket. 
               // Grab a bit more of the string to hopefully get all of it.. 
               if ($close_pos = strpos($text, '"]', $curr_pos + 14)) 
               { 
                  if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false) 
                  { 
                     $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);
Zumindest ist das jetzt die einzige Fehlerquelle die ich erkenne. Könnte jetzt in diesem Teil hier alle [quote-Ausdrücke mit [equote und noch ein zweites mal einfügen, nur keine Ahnung wo genau hin damit.

Also mit Deinen obigen Änderungen funktionieren jetzt die Tags

[ quote ]Test[ /quote ]
[ quote="Autor" ]Text[ /quote ]
[ equote ]Text[ equote ]

Es funktioniert nicht:

[ equote="Quelle" ]Text[/equote]

Verfasst: 31.12.2005 15:41
von Saint
versuch mal:

suche:

Code: Alles auswählen

$text = bbencode_first_pass_pda($text, $uid, '/\[equote=(\\\".*?\\\")\]/is', '[/equote]', '', false, '', "[equote:$uid=\\1]");
ersetze durch:

Code: Alles auswählen

$text = bbencode_first_pass_pda($text, $uid, '/\[equote=\\\\"(.*?)\\\\"\]/is', '[/equote]', '', false, '', "[equote:$uid=\\\"\\1\\\"]");
Gruß

Saint

Verfasst: 03.01.2006 17:17
von BZebra
Funktioniert.

Danke Saint! :grin:

Verfasst: 15.01.2006 17:16
von hagily
Hi.

Bei mir war nach einem update von .17 auf .19 das selbe problem beim posten von nachrichten. Dieses Problem habe ich aber erfolgreich gelöst.

Nun habe ich das problem dass

Code: Alles auswählen

[quote]
in Privaten Nachrichten nicht funktioniert.

Ne idee was an der bbcode nicht stimmt.
hier die bbcode.php www.zauberwald.ws/bbcode.txt

Verfasst: 15.01.2006 18:25
von Saint
Da sind ne ganze menge Macken drin.

suche:

Code: Alles auswählen

function bbencode_second_pass($text, $uid)
{
	global $lang, $bbcode_tpl;
füge danach ein:

Code: Alles auswählen

$text = preg_replace('#(script|about|applet|activex|chrome):#is', "\\1:", $text);
suche:

Code: Alles auswählen

	// [img]image_url_here[/img] code..
	// This one gets first-passed..
	$patterns[] = "#\[img:$uid\](.*?)\[/img:$uid\]#si";
	$replacements[] = $bbcode_tpl['img'];

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://[^ \"\n\r\t<]*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.[^ \"\n\r\t<]*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url2'];

	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
	$patterns[] = "#\[url=([\w]+?://[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url3'];

	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url=((www|ftp)\.[^ \"\n\r\t<]*?)\](.*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url4'];
ersetze durch:

Code: Alles auswählen

	// [img]image_url_here[/img] code..
	// This one gets first-passed..
	$patterns[] = "#\[img:$uid\]([^?].*?)\[/img:$uid\]#i";
	$replacements[] = $bbcode_tpl['img'];

	// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url2'];

	// [url=xxxx://www.phpbb.com]phpBB[/url] code..
	$patterns[] = "#\[url=([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url3'];

	// [url=www.phpbb.com]phpBB[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url=((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\]([^?\n\r\t].*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url4'];

suche (das ganze zweimal machen):

Code: Alles auswählen

$match = bbcode_array_pop($stack);
ersetze durch:

Code: Alles auswählen

$match = array_pop($stack);
suche:

Code: Alles auswählen

function make_clickable($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]+?://[^ \"\n\r\t<]*)#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)\.[^ \"\t\n\r<]*)#is", "\\1<a href=\"http://\\2\" target=\"_blank\">\\2</a>", $ret);
ersetze 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);
suche:

Code: Alles auswählen

$orig[] = "/(?<=.\W|\W.|^\W)" . phpbb_preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
ersetze durch:

Code: Alles auswählen

$orig[] = "/(?<=.\W|\W.|^\W)" . preg_quote($smilies[$i]['code'], "/") . "(?=.\W|\W.|\W$)/";
Gruß

Saint

Verfasst: 16.01.2006 20:42
von Ramona_FP
Saint hat geschrieben:@BZebra:

bbcode.php

suche:

Code: Alles auswählen

$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
				bbcode_array_push($stack, $match);
ersetze durch:

Code: Alles auswählen

$match = array("pos" => $curr_pos, "tag" => $which_start_tag, "index" => $start_tag_index);
				array_push($stack, $match);
functions_post.php

suche:

Code: Alles auswählen

$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[ ]*?=|on[\w]+[ ]*?=)#i', $hold_string)) ? false : true;
ersetze durch:

Code: Alles auswählen

$tagallowed = (preg_match('#^<\/?' . $match_tag . ' .*?(style[\t ]*?=|on[\w]+[\t ]*?=)#i', $hold_string)) ? false : true;
suche:

Code: Alles auswählen

if ($end_html != strlen($message) && $tmp_message != '')
ersetze durch:

Code: Alles auswählen

if (!$end_html || ($end_html != strlen($message) && $tmp_message != ''))
Gruß

Saint
Hat bei mir nicht geholfen...

bbcode.php
functions_post.php

Hab ich was übersehen?

Verfasst: 17.01.2006 19:25
von Saint
Hi Ramona,

die Fehler, die beim Update passieren, sind natürlich individuell. Je nachdem wer was verbaselt hat. :wink:
Hier sind deine :D

bbcode.php

suche:

Code: Alles auswählen

// matches a [url]xxxx://www.phpbb.com[/url] code..
        $patterns[] = "#\[url\]([\w]+?://[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
        $replacements[] = $bbcode_tpl['url1'];

        // [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
        $patterns[] = "#\[url\]((www|ftp)\.[\w\#$%&~/.\-;:=,?@\[\]+]*?)\[/url\]#is";
        $replacements[] = $bbcode_tpl['url2'];
ersetze durch:

Code: Alles auswählen

// matches a [url]xxxx://www.phpbb.com[/url] code..
	$patterns[] = "#\[url\]([\w]+?://([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url1'];

	// [url]www.phpbb.com[/url] code.. (no xxxx:// prefix).
	$patterns[] = "#\[url\]((www|ftp)\.([\w\#$%&~/.\-;:=,?@\]+]|\[(?!url=))*?)\[/url\]#is";
	$replacements[] = $bbcode_tpl['url2'];
suche:

Code: Alles auswählen

$text = bbencode_first_pass_pda($text, $uid, '/\[quote=(\\\".*?\\\")\]/is', '[/quote]', '', false, '', "[quote:$uid=\\1]");
ersetze durch:

Code: Alles auswählen

$text = bbencode_first_pass_pda($text, $uid, '/\[quote=\\\\"(.*?)\\\\"\]/is', '[/quote]', '', false, '', "[quote:$uid=\\\"\\1\\\"]");
suche:

Code: Alles auswählen

                                //
                                // We're going to try and catch usernames with "[' characters.
                                //
                                if( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) )
                                {
                                        // OK we are in a quote tag that probably contains a ] bracket.
                                        // Grab a bit more of the string to hopefully get all of it..
                                        if ($close_pos = strpos($text, '"]', $curr_pos + 9))
                                        {
                                                if (strpos(substr($text, $curr_pos + 9, $close_pos - ($curr_pos + 9)), '[quote') === false)
                                                {
                                                        $possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 2);
ersetze durch:

Code: Alles auswählen

                                //
				// We're going to try and catch usernames with "[' characters.
				//
				if( preg_match('#\[quote=\\\"#si', $possible_start, $match) && !preg_match('#\[quote=\\\"(.*?)\\\"\]#si', $possible_start) )
				{
					// OK we are in a quote tag that probably contains a ] bracket.
					// Grab a bit more of the string to hopefully get all of it..
					if ($close_pos = strpos($text, '"]', $curr_pos + 14))
					{
						if (strpos(substr($text, $curr_pos + 14, $close_pos - ($curr_pos + 14)), '[quote') === false)
						{
							$possible_start = substr($text, $curr_pos, $close_pos - $curr_pos + 7);
functions_post.php

suche:

Code: Alles auswählen

$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#');
$html_entities_replace = array('&', '<', '>');
ersetze durch:

Code: Alles auswählen

$html_entities_match = array('#&(?!(\#[0-9]+;))#', '#<#', '#>#', '#"#');
$html_entities_replace = array('&', '<', '>', '"');
Gruß

Saint

Verfasst: 17.01.2006 19:54
von hagily
Hi!

Vielen DAnk für deine Hilfe.
Aber ich habe es mir einfacher gemacht:
Über Windiff geschaut was zwischen meiner und der originaldatei nicht stimmt.
Da mir es zu viel war habe ich einfach die mods wieder in die neue datei gebaut und fertig!

Nochmal danke

Felix

Verfasst: 17.01.2006 19:58
von Saint
hagily hat geschrieben:Über Windiff geschaut was zwischen meiner und der originaldatei nicht stimmt.
Ehrlich gesagt komme ich mir hier gerade ein wenig verars... vor. :-?

Verfasst: 17.01.2006 20:01
von hagily
Hi

das soll keine verarsche sein. Ich habe mir deine änderungen angeschaut und habe mir gedacht: "mensch darauf hätt ich eigendlich auch kommen können".
Du hast ja den Stein in meinem Gehirn ersteinmal ins rollen gebracht.

Felix