<?php
# Copyright by Manuel Staechele
# Support www.ilch.de
defined (
'main'
)
or
die
(
'no direct access'
);
require_once
(
'include/includes/class/bbcode.php'
);
require_once
(
'include/includes/bbcode_config.php'
);
$ILCH_HEADER_ADDITIONS
.= "<link rel=\"stylesheet\" href=\"
include
/includes/css/bbcode.css\" type=\"text/css\">\n<script type=\"text/javascript\" src=\"
include
/includes/js/BBCodeGlobal.js\"></script>\n<script type=\"text/javascript\">\nvar bbcodemaximagewidth = {
$info
[
'ImgMaxBreite'
]};\nvar bbcodemaximageheight = {
$info
[
'ImgMaxHoehe'
]};\n</script>
<style type=\"text/css\">
#bbcodetooltip {
color: {
$info
[
'ToolTipColor'
]};
background: {
$info
[
'ToolTipBGColor'
]};
}
#bbcodetooltip:after {
border-top: 6px solid {
$info
[
'ToolTipBGColor'
]};
}
#bbcodetooltip.top:after {
border-bottom: 6px solid {
$info
[
'ToolTipBGColor'
]};
}
</style>";
function
colorliste (
$ar
) {
$l
=
''
;
foreach
(
$ar
as
$k
=>
$v
) {
$l
.=
'<td width="10" style="background-color: '
.
$k
.
';"><a href="javascript:bbcode_code_insert(\'color\',\''
.
$k
.
'\'); hide_color();"><img src="include/images/icons/bbcode/transparent.gif" border="0" height="10" width="10" alt="'
.
$v
.
'" title="'
.
$v
.
'"></td>'
;
}
return
(
$l
);
}
function
getBBCodeButtons(){
$ButtonSql
= db_query(
"SELECT * FROM prefix_bbcode_buttons WHERE fnButtonNr='1'"
);
$boolButton
= db_fetch_assoc(
$ButtonSql
);
$cfgBBCsql
= db_query(
"SELECT * FROM prefix_bbcode_config WHERE fnConfigNr='1'"
);
$cfgInfo
= db_fetch_assoc(
$cfgBBCsql
);
$BBCodeButtons
=
'<script type="text/javascript" src="include/includes/js/interface.js"></script>'
;
if
(
$boolButton
[
'fnFormatB'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('b','Gib hier den Text an der fett formatiert werden soll.')\"><img src=\"include/images/icons/bbcode/bbcode_bold.png\" alt=\"Fett formatieren\" title=\"Fett formatieren\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatI'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('i','Gib hier den Text an der kursiv formatiert werden soll.')\"><img src=\"include/images/icons/bbcode/bbcode_italic.png\" alt=\"Kursiv formatieren\" title=\"Kursiv formatieren\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatU'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('u','Gib hier den Text an der unterstrichen formatiert werden soll.')\"><img src=\"include/images/icons/bbcode/bbcode_underline.png\" alt=\"Unterstrichen formatieren\" title=\"Unterstrichen formatieren\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatS'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('s','Gib hier den Text an der durchgestrichen formatiert werden soll..')\"><img src=\"include/images/icons/bbcode/bbcode_strike.png\" alt=\"Durchgestrichen formatieren\" title=\"Durchgestrichen formatieren\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatSup'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('sup','Gib hier den Text an der hochgestellt werden soll..')\"><img src=\"include/images/icons/bbcode/bbcode_sup.png\" alt=\"Text hochstellen\" title=\"Text hochstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatSub'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('sub','Gib hier den Text an der tiefgestellt werden soll..')\"><img src=\"include/images/icons/bbcode/bbcode_sub.png\" alt=\"Text tiefstellen\" title=\"Text tiefstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatB'
] == 1 ||
$boolButton
[
'fnFormatI'
] == 1 ||
$boolButton
[
'fnFormatU'
] == 1 ||
$boolButton
[
'fnFormatS'
] == 1 ||
$boolButton
[
'fnFormatSup'
] == 1 ||
$boolButton
[
'fnFormatSub'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatLeft'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('left','0')\"><img src=\"include/images/icons/bbcode/bbcode_left.png\" alt=\"Links ausrichten\" title=\"Links ausrichten\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatCenter'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('center','0')\"><img src=\"include/images/icons/bbcode/bbcode_center.png\" alt=\"Mittig ausrichten\" title=\"Mittig ausrichten\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatRight'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('right','0')\"><img src=\"include/images/icons/bbcode/bbcode_right.png\" alt=\"Rechts ausrichten\" title=\"Rechts ausrichten\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatBlock'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('block','0')\"><img src=\"include/images/icons/bbcode/bbcode_block.png\" alt=\"Blocksatz ausrichten\" title=\"Blocksatz ausrichten\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatLeft'
] == 1 ||
$boolButton
[
'fnFormatCenter'
] == 1 ||
$boolButton
[
'fnFormatRight'
] == 1 ||
$boolButton
[
'fnFormatBlock'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatList'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('list','Gib hier den Text ein der aufgelistet werden soll.\\nUm die liste zu beenden einfach auf Abbrechen klicken.')\"><img src=\"include/images/icons/bbcode/bbcode_list.png\" alt=\"Liste erzeugen\" title=\"Liste erzeugen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatEmph'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('emph','0')\"><img src=\"include/images/icons/bbcode/bbcode_emph.png\" alt=\"Text hervorheben\" title=\"Text hervorheben\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatColor'
] == 1) {
}
if
(
$boolButton
[
'fnFormatColor'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:hide_color();\"><img id=\"bbcode_color_button\" src=\"include/images/icons/bbcode/bbcode_color.png\" alt=\"Text färben\" title=\"Text färben\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
$colorar
=
array
(
'#FF0000'
=>
'red'
,
'#FFFF00'
=>
'yellow'
,
'#008000'
=>
'green'
,
'#00FF00'
=>
'lime'
,
'#008080'
=>
'teal'
,
'#808000'
=>
'olive'
,
'#0000FF'
=>
'blue'
,
'#00FFFF'
=>
'aqua'
,
'#000080'
=>
'navy'
,
'#800080'
=>
'purple'
,
'#FF00FF'
=>
'fuchsia'
,
'#800000'
=>
'maroon'
,
'#C0C0C0'
=>
'grey'
,
'#808080'
=>
'silver'
,
'#000000'
=>
'black'
,
'#FFFFFF'
=>
'white'
,);
$BBCodeButtons
.= '<div style=
"position:absolute;"
><div style=
"display:none; position:relative; top:-30px; left:100px; width:200px; z-index:100;"
id=
"colorinput"
>
<table width=
"100%"
class
=
"border"
border=
"0"
cellspacing=
"1"
cellpadding=
"0"
>
<tr
class
=
"Chead"
onclick=
"javascript:hide_color();"
><td colspan=
"16"
><b>Farbe wählen</b></td></tr>
<tr
class
=
"Cmite"
height=
"15"
>
'.colorliste($colorar).'
</tr></table>
</div></div>';
}
if
(
$boolButton
[
'fnFormatSize'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('size','Enter here the text to be formatted in a different font size.','Please enter here the size of the text in pixels. \\n Pixellimit liegt bei "
.
$cfgInfo
['fnSizeMax
']."px !!!'
)\"><img src=\"
include
/images/icons/bbcode/bbcode_size.png\" alt=\"Textgröße verändern\" title=\"Textgröße verändern\" width=\"23\" height=\"22\" border=\"0\"></a> ";
}
if
(
$boolButton
[
'fnFormatBlink'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('blink','Gib hier den Text an der blinken soll..')\"><img src=\"include/images/icons/bbcode/bbcode_blink.gif\" alt=\"Blink Text\" title=\"Blink Text\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatList'
] == 1 ||
$boolButton
[
'fnFormatEmph'
] == 1 ||
$boolButton
[
'fnFormatColor'
] == 1 ||
$boolButton
[
'fnFormatSize'
] == 1 ||
$boolButton
[
'fnFormatBlink'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatUrl'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('url','Gib hier die Beschreibung für den Link an.','Gib hier die Adresse zu welcher verlinkt werden soll an.')\"><img src=\"include/images/icons/bbcode/bbcode_url.png\" alt=\"Hyperlink einfügen\" title=\"Hyperlink einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatEmail'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('mail','Gib hier den namen des links an.','Gib hier die eMail - Adresse an.')\"><img src=\"include/images/icons/bbcode/bbcode_email.png\" alt=\"eMail hinzufügen\" title=\"eMail hinzufügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatUrl'
] == 1 ||
$boolButton
[
'fnFormatEmail'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatImg'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('img','Gib hier die Adresse des Bildes an.\\nHinweise: Die Breite und Höhe des Bildes ist auf "
.
$cfgInfo
['fnImgMaxBreite
']."x".$cfgInfo['
fnImgMaxHoehe
']." eingeschränkt und würde verkleinert dargstellt werden.\\nEs ist möglich ein Bild rechts oder links von anderen Elementen darzustellen, indem man [img=left] oder [img=right] benutzt.'
)\"><img src=\"
include
/images/icons/bbcode/bbcode_image.png\" alt=\"Bild einfügen\" title=\"Bild einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> ";
}
global
$allgAr
;
if
(
$allgAr
[
'forum_usergallery'
] == 1 && loggedin() &&
$boolButton
[
'fnFormatImgUpl'
] == 1 ) {
$BBCodeButtons
.=
"<a href=\"javascript:usergalleryupl();\" title=\"Bild in Usergallery hochladen und einfügen\"><img src=\"include/images/icons/bbcode/bbcode_imageupl.png\" alt=\"Bild hochladen\" width=\"23\" height=\"22\" border=\"0\" /></a> "
;
}
if
(
$boolButton
[
'fnFormatScreen'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('shot','Gib hier die Adresse des Screens an.\\nDie Breite und Höhe des Bildes ist auf "
.
$cfgInfo
['fnScreenMaxBreite
']."x".$cfgInfo['
fnScreenMaxHoehe
']." eingeschränkt und wird verkleinert dargstellt.\\nEs ist möglich ein Screenshot rechts oder links von anderen Elementen darzustellen, indem man [shot=left] oder [shot=right] benutzt.'
)\"><img src=\"
include
/images/icons/bbcode/bbcode_screenshot.png\" alt=\"Bild einfügen\" title=\"Screen einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> ";
}
if
(
$boolButton
[
'fnFormatImg'
] == 1 ||
$boolButton
[
'fnFormatScreen'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatQuote'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_code_insert('quote','0')\"><img src=\"include/images/icons/bbcode/bbcode_quote.png\" alt=\"Zitat einfügen\" title=\"Zitat einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatKtext'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('ktext','Gib hier den zu verbergenden Text ein.','Gib hier einen Titel für den Klapptext an.')\"><img src=\"include/images/icons/bbcode/bbcode_ktext.png\" alt=\"Klappfunktion hinzufügen\" title=\"Klappfunktion hinzufügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatVideo'
] == 1) {
$message
=
"Bitte Anbieter auswählen.\\nAkzeptiert werden: YouTube, MyVideo und GameTrailers"
;
if
(ishttps()) {
$message
=
"Bitte Anbieter auswählen.\\nAkzeptiert wird: YouTube"
;
}
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value_2('video','Gib hier die Video ID vom Anbieter an.','"
.
$message
.
"')\"><img src=\"include/images/icons/bbcode/bbcode_video.png\" alt=\"Video einfügen\" title=\"Video einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatFlash'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_multiple_values('flash',{tag:['Gib hier den Link zur Flashdatei an',''],width:['Gib hier die Breite für die Flashdatei an','400'],height:['Gib hier die Höhe für die Flashdatei an','300']})\"><img src=\"include/images/icons/bbcode/bbcode_flash.png\" alt=\"Flash einfügen\" title=\"Flash einfügen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatCountdown'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('countdown','Gib hier das Datum an wann das Ereignis beginnt.\\n Format: TT.MM.JJJJ Bsp: 24.12."
.
date
(
"Y"
).
"','Gib hier eine Zeit an, wann das Ergeinis am Ereignis- Tag beginnt.\\nFormat: Std:Min:Sek Bsp: 20:15:00')\"><img src=\"include/images/icons/bbcode/bbcode_countdown.png\" alt=\"Countdown festlegen\" title=\"Countdown festlegen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatProgress'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('progress','Gibt hier den Text ein ,der in der Progressbar steht','Gib hier die Prozentzahl an, ohne Prozentzeichen')\"><img src=\"include/images/icons/bbcode/bbcode_progress.png\" alt=\"Progressbar\" title=\"Progressbar erstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatToolTip'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('tool','Gibt hier den Text ein den man sehen kann','Gib hier den ToolTip Text ein')\"><img src=\"include/images/icons/bbcode/bbcode_tooltip.png\" alt=\"ToolTip\" title=\"ToolTip erstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatLauftext'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value('marquee','Gibt hier den Text ein den man sehen kann','Hier die Breite angeben z.b 100 für 100px oder 100% für 100%')\"><img src=\"include/images/icons/bbcode/bbcode_lauftext.gif\" alt=\"LaufText\" title=\"Lauftext erstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatGoogle'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('google','Gib hier den Suchbegriff ein..')\"><img src=\"include/images/icons/bbcode/bbcode_google.png\" alt=\"Google Suche\" title=\"Google Suche\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatInfobox'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert_with_value_2('inbox','Gib hier den Text ein','Bitte Infobox Typ auswählen.\\nAkzeptiert werden: success, info, warning und danger')\"><img src=\"include/images/icons/bbcode/bbcode_infobox.png\" alt=\"Infobox\" title=\"Infobox erstellen\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatQuote'
] == 1||
$boolButton
[
'fnFormatKtext'
] == 1 ||
$boolButton
[
'fnFormatVideo'
] == 1 ||
$boolButton
[
'fnFormatFlash'
] == 1 ||
$boolButton
[
'fnFormatCountdown'
] == 1 ||
$boolButton
[
'fnFormatProgress'
] == 1 ||
$boolButton
[
'fnFormatToolTip'
] == 1 ||
$boolButton
[
'fnFormatLauftext'
] == 1 ||
$boolButton
[
'fnFormatGoogle'
] == 1 ||
$boolButton
[
'fnFormatInfobox'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatTwitch'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('twitch','Gib hier den Twitch-Channel Namen ein')\"><img src=\"include/images/icons/bbcode/bbcode_twitch.png\" alt=\"Twitch\" title=\"Twitch Channel Player\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatHitbox'
] == 1) {
$BBCodeButtons
.=
"<a href=\"javascript:bbcode_insert('hitbox','Gib hier den HitBox-Channel Namen ein')\"><img src=\"include/images/icons/bbcode/bbcode_hitbox.png\" alt=\"Hitbox\" title=\"Hitbox Channel Player\" width=\"23\" height=\"22\" border=\"0\"></a> "
;
}
if
(
$boolButton
[
'fnFormatTwitch'
] == 1 ||
$boolButton
[
'fnFormatHitbox'
] == 1) {
$BBCodeButtons
.=
" "
;
}
if
(
$boolButton
[
'fnFormatCode'
] == 1 ||
$boolButton
[
'fnFormatPhp'
] == 1 ||
$boolButton
[
'fnFormatHtml'
] == 1 ||
$boolButton
[
'fnFormatCss'
] == 1) {
$BBCodeButtons
.=
"<select onChange=\"javascript:bbcode_code_insert_codes(this.value); javascript:this.value='0';\" style=\"font-family:Verdana;font-size:10px; margin-bottom:6px; z-index:0;\" name=\"code\"><option value=\"0\">Code einfügen</option>"
;
}
if
(
$boolButton
[
'fnFormatPhp'
] == 1) {
$BBCodeButtons
.=
"<option value=\"php\">PHP</option>"
;
}
if
(
$boolButton
[
'fnFormatHtml'
] == 1) {
$BBCodeButtons
.=
"<option value=\"html\">HTML</option>"
;
}
if
(
$boolButton
[
'fnFormatCss'
] == 1) {
$BBCodeButtons
.=
"<option value=\"css\">CSS</option>"
;
}
if
(
$boolButton
[
'fnFormatCode'
] == 1) {
$BBCodeButtons
.=
"<option value=\"code\">Sonstiger Code</option>"
;
}
if
(
$boolButton
[
'fnFormatCode'
] == 1 ||
$boolButton
[
'fnFormatPhp'
] == 1 ||
$boolButton
[
'fnFormatHtml'
] == 1 ||
$boolButton
[
'fnFormatCss'
] == 1) {
$BBCodeButtons
.=
"</select>"
;
}
return
$BBCodeButtons
;
}
function
BBcode(
$s
,
$maxLength
=0,
$maxImgWidth
=0,
$maxImgHeight
=0) {
global
$permitted
,
$info
,
$global_smiles_array
;
if
(!isset(
$global_smiles_array
)) {
$erg
= db_query(
"SELECT ent, url, emo FROM `prefix_smilies`"
);
while
(
$row
= db_fetch_object(
$erg
) ) {
$global_smiles_array
[
$row
->ent] =
$row
->emo.
'#@#-_-_-#@#'
.
$row
->url;
}
}
$bbcode
=
new
bbcode();
$bbcode
->smileys =
$global_smiles_array
;
$bbcode
->permitted =
$permitted
;
$bbcode
->info =
$info
;
if
(
$maxLength
!= 0) {
$bbcode
->info[
'fnWortMaxLaenge'
] =
$maxLength
;
}
if
(
$maxImgWidth
!= 0) {
$bbcode
->info[
'fnImgMaxBreite'
] =
$maxImgWidth
;
}
if
(
$maxImgHeight
!= 0) {
$bbcode
->info[
'fnImgMaxBreite'
] =
$maxImgHeight
;
}
return
$bbcode
->parse(
$s
);
}
?>