Heyho,
ich hab zwei kleine Probleme mit den Farben und Anführungszeichen in den Kommentaren.
1. Der Farbcode wird für den Inhalt der "" nicht übernommen.
z.B.
Ich poste:
/X das ist ein Test: `&"Bla bla bla
Dann sind das Anführungszeichen und das Bla bla im Farbcode von `&
Wenn die Anführungszeichen allerdings geschlossen sind, erscheint eine andere Farbe.
Das hat wohl mit dieser Codestelle zu tun:
$this->bbcode_second_pass_code('', ' # Hinzufügen der Farben
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open'] = $quotationtype[COMMENTARY_QUOTATION_TYPE]['open'].$this->colorspeak;
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open-alt'] = $quotationtype[COMMENTARY_QUOTATION_TYPE]['open-alt'].$this->colorspeak;
if($this->emote == 2) {
# Wenn emote = 2 (/X), dann andere Farbe gebrauchen
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close'] = $this->color3person.$quotationtype[COMMENTARY_QUOTATION_TYPE]['close'];
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close-alt'] = $this->color3person.$quotationtype[COMMENTARY_QUOTATION_TYPE]['close-alt'];
}
else {
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close'] = $this->coloremote.$quotationtype[COMMENTARY_QUOTATION_TYPE]['close'];
$quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close-alt'] = $this->coloremote.$quotationtype[COMMENTARY_QUOTATION_TYPE]['close-alt'];
}
if(strpos($commentary, '[') OR strpos($commentary, '{')) {
# Verwendet die richtigen Platzhalter. Annahme: " und ' werden nicht gebraucht, ignorieren.
$commentary = str_replace('[', $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open'], $commentary);
$commentary = str_replace(']', $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close'], $commentary);
$commentary = str_replace('{', $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open-alt'], $commentary);
$commentary = str_replace('}', $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close-alt'], $commentary);
}
elseif(strpos($commentary, '"') OR strpos($commentary, ''')) {
# Kommentar bei " splitten
$commentary = explode('"', $commentary);
$pieces = count($commentary);
# Schauen, ob gerade Anzahl an " gebraucht wurde (Also eine ungerade Anzahl Teile), wenn nicht => nicht interpretierbar =/
if($pieces%2 == 1) {
$comments = ''; $nocolor = false;
foreach($commentary as $i => $comment) {
if($i > 0) {
if($i%2==1) {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open'];
}
else {
if($nocolor) {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['close'];
}
else {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close'];
}
}
}
if(substr($comment, -2, 1) == '`') {
$nocolor = true;
}
else {
$nocolor = false;
}
# Okay. Hier parsen wir ' innerhalb von ", damit beim ausserhalb-parsen kein Verschachtelungsfehler auftritt
$subcommentary = explode(''', $comment);
$subpieces = count($subcommentary);
# Wenn die Teilstücke mehr als eines sind und gerade, dann können wir das sicher interpretieren.
if($subpieces > 1 AND $subpieces%2==1) {
$subcomments = ''; $subnocolor = false;
foreach($subcommentary as $subi => $subcomment) {
if($subi > 0) {
if($subi%2==1) {
$subcomments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-open-alt'];
}
else {
if($subnocolor) {
$subcomments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['close-alt'];
}
else {
$subcomments .= $this->speakcolor.$quotationtype[COMMENTARY_QUOTATION_TYPE]['close-alt'];
}
}
}
if(substr($subcomment, -2, 1) == '`') {
$subnocolor = true;
}
else {
$subnocolor = false;
}
$subcomments .= $subcomment;
}
$comment = $subcomments;
}
$comments .= $comment;
}
$commentary = $comments;
}
else {
$commentary = implode('"', $commentary);
}
# Kommentar nun bei ' splitten
$commentary = explode(''', $commentary);
$pieces = count($commentary);
# Schauen, ob gerade Anzahl an " gebraucht wurde (Also eine ungerade Anzahl Teile), wenn nicht => nicht interpretierbar =/
if($pieces%2 == 1) {
$comments = ''; $nocolor = false;
foreach($commentary as $i => $comment) {
if($i > 0) {
if($i%2==1) {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['open-alt'];
}
else {
if($nocolor) {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['close-alt'];
}
else {
$comments .= $quotationtype[COMMENTARY_QUOTATION_TYPE]['colored-close-alt'];
}
}
}
if(substr($comment, -2, 1) == '`') {
$nocolor = true;
}
else {
$nocolor = false;
}
$comments .= $comment;
}
$commentary = $comments;
}
else {
$commentary = implode('"', $commentary);
}
}
return $commentary;
}
')
Leider komm ich nicht drauf was ich ändern muss damit die Farben vom Post übernommen werden
2. Die voreingestellten Farben für /X und /me funktionieren nicht
Im Profil des Users sind sie zwar festgelegt aber sie werden für den Kommentar nicht verwendet.
>.< Help pls?
source:
http://feeneden.com/source.php