anpera.net
https://anpera.dyndns.org/phpbb3/

[b]-code
https://anpera.dyndns.org/phpbb3/viewtopic.php?f=34&t=3671
Seite 1 von 1

Autor:  MySql [ Mo 28 Mai, 2007 05:42 ]
Betreff des Beitrags:  [b]-code

Guten Morgen liebe Anperalaner,

ich hab da so ein Problemm, :pein: :pein:
ich sitze seit ca. 3 Stunden vor meinem Pc und
versuche BBcode's in meine common zu bekommen,
die ich hinterher beim scripten verwendne kan. Es
will aber partou nicht klappen. Könnte mir dort vllt.
jemand weiter helfen? :pein: :pein:

Lg

Autor:  Harthas [ Mo 28 Mai, 2007 13:05 ]
Betreff des Beitrags: 

Versuchs mal mit preg_replace ;-)

Autor:  MySql [ Mo 28 Mai, 2007 13:29 ]
Betreff des Beitrags: 

Hab ich ja -lach-
Ich weis aber nicht was ich dann im script selber eingeben muss.



[php]function bbcode ($text) {
$ergebnis = htmlentities($text);
$ergebnis = str_replace("[ b ]","<b>",$ergebnis);
$ergebnis = str_replace("[ / b ]","</b>",$ergebnis);
$ergebnis = str_replace("[ i ]","<i>",$ergebnis);
$ergebnis = str_replace("[ / i ]","</i>",$ergebnis);
$ergebnis = str_replace("[ u ]","<u>",$ergebnis);
$ergebnis = str_replace("[ / u ]","</u>",$ergebnis);
return $ergebnis;
}
[/php]

Hab ich halt im script mal Text eingegeben und siehe da es war nicht dick :pein:

Autor:  Harthas [ Mo 28 Mai, 2007 13:39 ]
Betreff des Beitrags: 

Hast du die Funktion bbcode in die Funktion output integriert? Und falls ja, wie genau?

Und versuchs mal so
[php]function bbcode ($text) {
$ergebnis = htmlentities($text);
$ergebnis = str_replace("","<b>",$ergebnis);
$ergebnis = str_replace("
","</b>",$ergebnis);
$ergebnis = str_replace("","<i>",$ergebnis);
$ergebnis = str_replace("
","</i>",$ergebnis);
$ergebnis = str_replace("","<u>",$ergebnis);
$ergebnis = str_replace("
","</u>",$ergebnis);
return $ergebnis;
} [/php]

Autor:  MySql [ Mo 28 Mai, 2007 13:45 ]
Betreff des Beitrags: 

hab ich doch so drinn, habe die leerzeichen extra gemacht weil die zeichen dann nicht angezeigt werden. -schmunzel-

Autor:  Harthas [ Mo 28 Mai, 2007 13:51 ]
Betreff des Beitrags: 

Mist, stimmt *g*

Aber die erste Frage wurde noch nicht beantwortet :-P
Wie verwendest du die Funktion?

Autor:  MySql [ Mo 28 Mai, 2007 13:59 ]
Betreff des Beitrags: 

Ich verwende die so: :lol:

[php]output('Du hast heute einen [ b ]großen[ / b ] Fisch gefangen'); [/php]

ging nicht also hab ich es so gemacht:

[php]output('Du hast heute einen [ b ]großen[ / b ] Fisch gefangen',true); [/php]
ging aber auch nicht :D

Autor:  Harthas [ Mo 28 Mai, 2007 14:04 ]
Betreff des Beitrags: 

Und wie hast du die Funktion bbcode eingebunden?

Autor:  MySql [ Mo 28 Mai, 2007 14:11 ]
Betreff des Beitrags: 

in der common.php

Autor:  Harthas [ Mo 28 Mai, 2007 14:15 ]
Betreff des Beitrags: 

Ach wirklich. Erstauuuuunlich.

Du weisst aber schon, dass du die Funktion bbcode in die Funktion output integrieren musst. Ansonsten funktioniert das nicht.


[php]function output($indata,$priv=false){
global $output;

$indata = bbcode($indata);
$output.=appoencode($indata,$priv);
$output.="\n";
return 0;
}[/php]

Nur musst du dann immer HTML erlaubt haben. ;-)

Autor:  MySql [ Mo 28 Mai, 2007 14:19 ]
Betreff des Beitrags: 

Huch bin ich plöd :lol:

Ich danke dir :D

Autor:  MySql [ So 22 Jul, 2007 17:56 ]
Betreff des Beitrags: 

:nene: :nene: :nene: :pein: :pein: :pein: :pein: :o :o :o :???: :???: :???: :???: :???:

-.- -.- -.-

Ich hab das Zauberwerk den dan mal heute eingebaut.....

[php]
function output($indata,$priv=false){
global $nestedtags,$output;
$data = translate($indata);
$indata = bbcode($indata);
$output.=appoencode($indata,$priv);
$output.="\n";
return 0;
}
[/php]

nichts wildes^^

ABER:

$this->bbcode_second_pass_code('', 'Dorfplatz
—Am Stadtrand—
Das Stadttor
Die Stadtmauer
Der See
Das Wohnviertel
Der Friedhof
—Klingengasse—
Gildenstrasse
Trainingslager
Spieler töten
Die Arena
Die Ruhmeshalle
Der Tempel
—Marktplatz—
Das Zigeunerzelt
Der Waffenladen
Der Rüstungsladen
Die Bäckerei
—Tavernenstraße—
Schencke zu Arvalezia
Die alte Bank
Die Kapelle
Das Gericht
—Anderes Stadtende—
Mericksställe
Die Jägerhütte
Die Gärten
—Sonstiges—
(?) F.A.Q. (für neue Spieler)
Tägliche News
Liste der Kämpfer
Dein Profil
In die Felder (Logout)
Das Forum
—Göttliche Straße—
(X) Admin Grotte
Neuer Tag
Der Palast
Tesr Server
Freudenhaus
Die Kapelle


MoTD
Ye Olde Mail: 0 neu, 0 alt
Hilfe anfordern
Forum
Chat
Edit

<!--CheckNewDay()-->
Dorfplatz
Die Einwohner rennen gesch&auml;ftig umher. Keiner bemerkt wirklich, dass Du dort stehst. Du siehst verschiedene Gesch&auml;fte und L&auml;den entlang der Strasse. Es gibt einen merkw&uuml;rdig aussehenden Felsen auf einer Seite. Auf diesem kannst du die neueste Meldung lesen:


Der Wanderh&auml;ndler ist heute im Dorf!

Auf jeder Seite wird das Dorf von tiefem dunklem Wald umgeben.
Wir schreiben den 15.6.0000 im Zeitalter des Drachen.
Die Uhr an der Kneipe zeigt 10:33 am. Das heutige Wetter: Regnerisch

.

In der N&auml;he reden einige Dorfbewohner:
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('11.06.2007 um 20:43 Uhr.')"> amp;Bäuerin Kira</a> amp; sagt freundlich hallo
<a href='bio.php?char=Segen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('11.06.2007 um 20:45 Uhr.')"> amp;Gamp;ötamp;tlamp;icamp;heamp;r Samp;egamp;en</a> amp; meint zu Kira Eurem Bruder wird es nun gelingen....
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('11.06.2007 um 20:46 Uhr.')"> amp;Bäuerin Kira</a> amp; sch&uuml;ttelt traurig den kopf
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('11.06.2007 um 22:24 Uhr.')">amp;Bäuerin Kira</a> sagt: ": schaut hoch zum himmel und sagt zu sich selbst &acute;9 oh, schon so sp&auml;t &acute;&und sie verschwindet in den feldern"
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 8:46 Uhr.')"> amp;Bäuerin Kira</a> amp; betritt den dp und schaut sich um
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 8:54 Uhr.')"> amp;Bäuerin Kira</a> amp; regt sich lautstark auf dieses bl&ouml;de kopfgeld! ich hab doch nichts gemacht... amp; setzt sich unter einen baum und weint
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 10:02 Uhr.')"> amp;Bäuerin Kira</a> amp; amp; steht auf und geht stampfend in den wald... nuschelt noch etwas von den werde ich es zeigen amp; und schon ist sie weg
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 10:05 Uhr.')"> amp;Holzkopf Betzen</a> amp; nuschelt etwas von, amp;Ich habe gerade ebend gehoert, das man wider Briefe schreiben kan...
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 10:06 Uhr.')"> amp;Bäuerin Kira</a> amp; amp; kommt wieder aus dem wald.. immer noch genauso schlecht gelaunt wie vorher bl&ouml;d bl&ouml;d bl&ouml;d
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('12.06.2007 um 10:55 Uhr.')">amp;Bäuerin Kira</a> sagt: ":amp; begr&uuml;&szlig;t den neuen dorfbewohner recht herzlich hallo"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('14.06.2007 um 13:37 Uhr.')"> amp;Holzkopf Betzen</a> amp; schlendert gem&uuml;tlich &uuml;ber den Dorfplatz von Arvalenzias.
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.06.2007 um 21:42 Uhr.')"> amp;Holzkopf Betzen</a> amp; wundert sich das es hier so ruhig ist.
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.06.2007 um 21:54 Uhr.')"> amp;Bäuerin Kira</a> amp; amp; sieht Betzen und winkt
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('18.06.2007 um 20:09 Uhr.')"> amp;Holzkopf Betzen</a> amp; freut sich ueber Kira's anwesenheit und winkt zurueck.
<a href='bio.php?char=Raffael&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('20.06.2007 um 8:48 Uhr.')"> amp;Bauernjunge Raffael</a> amp; kommt aus Richtung H&uuml;gel gerannt und verschwindet, laut nach Mama rufend im Wohnviertel...
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('20.06.2007 um 14:03 Uhr.')"> amp;Bäuerin Kira</a> amp; amp; l&auml;chelt
<a href='bio.php?char=Kira&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('09.07.2007 um 20:26 Uhr.')"> amp;Bäuerin Kira</a> amp; amp; w&uuml;rde gerne ihr haus weiter bauen.. doch sind ihr 50000 gems zu viel
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:02 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/kiss xD"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:04 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/kiss yaya ,amm"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:17 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/kiss Mhm"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:19 Uhr.')">amp;Holzkopf Betzen</a> sagt: "^^"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:20 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/kiss kay kay"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('16.07.2007 um 18:21 Uhr.')">amp;Holzkopf Betzen</a> sagt: "^^"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('17.07.2007 um 13:04 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/afk"
<a href='bio.php?char=Betzen&ret=%2Fvillage.php%3Fc%3D18-185241' style='text-decoration: none' onmouseover="this.T_WIDTH=225;this.T_TEXTALIGN='center';this.T_BGCOLOR='#000000';this.T_FONTCOLOR='#999999';this.T_BORDERWIDTH=1;this.T_BORDERCOLOR='#999999'; return escape('17.07.2007 um 13:17 Uhr.')">amp;Holzkopf Betzen</a> sagt: "/afk xDDDDD"
<form action="village.php?c=18-185241" method='POST'>Hinzufügen
<input name='insertcommentary[village]' size='40' maxlength='185'><input type='hidden' name='talkline' value='sagt'><input type='hidden' name='section' value='village'><input type='submit' class='button' value='Hinzufügen'>

</form> <a href="village.php?comscroll=3">&lt;&lt;&lt; Letzte </a> <a href="village.php?comscroll=1">&lt;&lt; Vorherige</a> &nbsp;<a href="village.php?comscroll=0">Aktualisieren</a>&nbsp; Anfragen*: 0 Ungelesen, 16 Gelesen, 0 Geschlossen.


')

Was in drei teufels namen ist DAS?

und wenn ich das

[php]$indata = bbcode($indata);[/php]

rausnehme, ist wieder alles okay-.-

Autor:  Eliwood [ So 22 Jul, 2007 18:21 ]
Betreff des Beitrags: 

Ist ja auch logisch:
$this->bbcode_second_pass_code('', '$ergebnis = htmlentities($text); ')

Lösch die Zeile aus deiner Funktion raus, bzw ersetz sie mit:

$this->bbcode_second_pass_code('', '$ergebnis = $text; ')

Und gut ist.

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/