Seite 1 von 2

bbcode DropDown einzeln?

Verfasst: 19.11.2011 14:15
von Shorty1968
Hallo ich suche ein bbcode DropDown auswahl , aber einzeln der den man über Google findet Packt alle bbcodes ind das DropDown.

Gruß

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 15:47
von Charlie_M
Ganz easy:
Öffne posting_button.html
Suche:

Code: Alles auswählen

	<!-- BEGIN custom_tags -->
		<input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
	<!-- END custom_tags -->
Füge DANACH ein:

Code: Alles auswählen

	<select onchange="if(this.selectedIndex > 0) { bbstyle(parseInt(this.options[this.selectedIndex].value, 10)); this.selectedIndex = 0; }">
       <option value=""></option>
       <option value="22">ID_TAG22</option>
       <option value="24">ID_TAG24</option>
       <option value="26">ID_TAG26</option>
    </select>	
Das Einzige was du selber herausfinden musst ist die BBCODE_ID:
Dazu schaust in der DB in der Tabelle phpbb_bbcode nach den gewünschten TAG und trägst die entsprechende ID bei Value ein, unter ID_TAG trägst den Titel des BBCodes ein.

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 16:05
von Shorty1968
Danke das ist das was ich gefunden hatte,da stand aber dabei das so alle bbcode betroffen sind?

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 16:40
von Charlie_M
[x] weder gelesen, ausprobiert noch verstanden

Das ist genau der Grund warum immer weniger Bock haben dir zu helfen :P

Damit allein ist es nicht getan: du willst ja dann die Custom BBCodes die im Dropdown sind nicht als Button haben, d.h. da muss man schon noch was tun.

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 18:38
von Shorty1968
Das ist ja wie einem Hund einen Knochen hinwerfen und ihn dann wider weg ziehen? :o :-?

Wenn ich deine anleitung mache gehen keine bbcodes mehr egal welcher , wenn ich jetzt wüsste was ich genau noch machen soll muss dann könnte ich mir ja selber einen programmieren oder?

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 18:57
von BNa
Die Sache ist ganz einfach und braucht nur in der posting_buttons.html bearbeitet zu werden

Finde diese Stelle in der Datei (Standard-Dropdown für die Schriftgröße)

Code: Alles auswählen

    <select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]');this.form.addbbcode20.selectedIndex = 2;" title="{L_BBCODE_F_HELP}">
        <option value="50">{L_FONT_TINY}</option>
        <option value="85">{L_FONT_SMALL}</option>
        <option value="100" selected="selected">{L_FONT_NORMAL}</option>
        <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 150 -->
            <option value="150">{L_FONT_LARGE}</option>
            <!-- IF not MAX_FONT_SIZE or MAX_FONT_SIZE >= 200 -->
                <option value="200">{L_FONT_HUGE}</option>
            <!-- ENDIF -->
        <!-- ENDIF -->
    </select> 
und füge danach diesen Code ein

Code: Alles auswählen

          <span class="genmed nowrap">
          <select class="select_class" name="addbbcode_custom" class="gensmall" onchange="bbstyle(this.form.addbbcode_custom.options[this.form.addbbcode_custom.selectedIndex].value*1);this.form.addbbcode_custom.selectedIndex = 0;">
          <option selected="selected" value="">BBCodes</option>
          <!-- BEGIN custom_tags -->
          <!-- IF custom_tags.BBCODE_TAG == 'youtube' or custom_tags.BBCODE_TAG == 'myvideo' or custom_tags.BBCODE_TAG == 'yahoovideo' -->
          <option value="{custom_tags.BBCODE_ID}" onmouseover="helpline('cb_{custom_tags.BBCODE_ID}')" onmouseout="helpline('tip')" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
          <!-- ENDIF -->
          <!-- END custom_tags -->   
          </select>
          </span> 
In diesem Faller sind nur die drei BBCodes

youtube
myvideo
yahoovideo

zu sehen und natürlich funktioniert alles wie gehabt parallel zu den normalen BBCodes.
Auf Deutsch: An dieser Stelle erweitern oder reduzieren

Code: Alles auswählen

<!-- IF custom_tags.BBCODE_TAG == 'youtube' or custom_tags.BBCODE_TAG == 'myvideo' or custom_tags.BBCODE_TAG == 'yahoovideo' --> 

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 19:01
von Charlie_M
Bei der Lösung werden ALLE Custom-BBCodes im Dropdown ausgegeben - das will der TS ja nicht.

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 19:02
von BNa
Probier mal den Code bzw, lese ihn richtig, es werden in dem Falle nur 3 BBCodes ausgegeben.
Dieser Code ist natürlich getestet :wink:

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 20:17
von BNa
Zusatz

Möchtest Du, das die im Dropdown befindlichen BBCodes nicht noch zusätzlich unter den normalen BBCode Buttons auftauchen, dann

finde

Code: Alles auswählen

    <!-- BEGIN custom_tags -->
        <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
    <!-- END custom_tags --> 
ersetze mit

Code: Alles auswählen

    <!-- BEGIN custom_tags -->
    <!-- IF custom_tags.BBCODE_TAG !== 'youtube' or custom_tags.BBCODE_TAG !== 'myvideo' or custom_tags.BBCODE_TAG !== 'yahoovideo' --> 
        <input type="button" class="button2" name="addbbcode{custom_tags.BBCODE_ID}" value="{custom_tags.BBCODE_TAG}" onclick="bbstyle({custom_tags.BBCODE_ID})" title="{custom_tags.BBCODE_HELPLINE}" />
    <!-- ENDIF -->
    <!-- END custom_tags --> 
Wiederum hier anpassen

Code: Alles auswählen

<!-- IF custom_tags.BBCODE_TAG !== 'youtube' or custom_tags.BBCODE_TAG !== 'myvideo' or custom_tags.BBCODE_TAG !== 'yahoovideo' --> 
Bevor Fragen kommen: Man beachte das ! vor dem ==

Re: bbcode DropDown einzeln?

Verfasst: 19.11.2011 23:44
von Shorty1968
Danke euch so geht es wie ich es möchte.