This site is READ ONLY!! No support will be given! Everything in here is just for archiving purposes!

Re: Custom BBCodes in a select box

Support for all Snippets will go here!
Forum rules
PLEASE USE THE [HSIMG][/HSIMG] TAGS WHEN POSTING LARGE IMAGES!
IF YOU DO NOT PROVIDE A LINK TO YOUR FORUM, YOUR TOPIC COULD BE IGNORED!
CANNOT REALLY HELP YOU OUT IF WE CANNOT SEE THE PROBLEM!
Simon
Stars
Stars
Posts: 5
Joined: Thu Sep 23 2010 8:58 am
Country Flag: France

Re: Custom BBCodes in a select box

Post by Simon »

Custom BBCodes in a select box

Author: Simon
Description: Puts all custom bbcodes in a select box. This makes the posting page look nicer and save some space.
Demo: This site.

Open styles/{YOURTHEME}/template/posting_buttons.html
Find:

Code: Select all

    <!-- 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 -->
Replace with:

Code: Select all

    <select name="addbbcode_custom" onchange="bbstyle(this.form.addbbcode_custom.options[this.form.addbbcode_custom.selectedIndex].value*1);this.form.addbbcode_custom.selectedIndex = 0;">
          <option value="#" selected="selected">Custom BBCodes</option>
          <!-- BEGIN custom_tags -->
          <option value="{custom_tags.BBCODE_ID}" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
          <!-- END custom_tags -->   
         </select>


Save, upload and refresh template.
Last edited by Steve on Sun Oct 31 2010 2:00 pm, edited 1 time in total.
Reason: will cahnge topic author to simon later!
Flogging My Log

Re: Custom BBCodes in a select box

Post by Flogging My Log »

i have this error on prosilver when i tryin to install bbcodes in s select box

Code: Select all

Parse error: syntax error, unexpected $end in /home/content/44/6144844/html/sajtovi/comm/planetmo/cache/tpl_prosilver_posting_buttons.html.php on line 120
Last edited by Flogging My Log on Fri Oct 08 2010 8:14 am, edited 1 time in total.
User avatar
Steve
X-Steve
X-Steve
Posts: 1920
Joined: Thu Sep 16 2010 3:19 pm
Real name: Steve© MX
Country Flag: Great Britain
Location: Up north!
Contact:

Re: Custom BBCodes in a select box

Post by Steve »

post up your posting_buttons html between the

Code: Select all

 tags.
Hello! and Do NOT contact me via private message for support!!
Flogging My Log

Re: Custom BBCodes in a select box

Post by Flogging My Log »

Parse error: syntax error, unexpected $end in /home/content/44/6144844/html/sajtovi/comm/planetmo/cache/tpl_prosilver_posting_buttons.html.php on line 118

Code: Select all

<script type="text/javascript">
// <![CDATA[
	var form_name = 'postform';
	var text_name = <!-- IF $SIG_EDIT -->'signature'<!-- ELSE -->'message'<!-- ENDIF -->;
	var load_draft = false;
	var upload = false;

	// Define the bbCode tags
	var bbcode = new Array();
	var bbtags = new Array('[b]','[/b]','[i]','[/i]','[u]','[/u]','[quote]','[/quote]','[code]','
','
  • ','
','
  • ','
','[img]','[/img]','','','[flash=]', '[/flash]','[size=]','[/size]'<!-- BEGIN custom_tags -->, {custom_tags.BBCODE_NAME}<!-- END custom_tags -->);
var imageTag = false;

// Helpline messages
var help_line = {
b: '{LA_BBCODE_B_HELP}',
i: '{LA_BBCODE_I_HELP}',
u: '{LA_BBCODE_U_HELP}',
q: '{LA_BBCODE_Q_HELP}',
c: '{LA_BBCODE_C_HELP}',
l: '{LA_BBCODE_L_HELP}',
o: '{LA_BBCODE_O_HELP}',
p: '{LA_BBCODE_P_HELP}',
w: '{LA_BBCODE_W_HELP}',
a: '{LA_BBCODE_A_HELP}',
s: '{LA_BBCODE_S_HELP}',
f: '{LA_BBCODE_F_HELP}',
e: '{LA_BBCODE_E_HELP}',
d: '{LA_BBCODE_D_HELP}'
<!-- BEGIN custom_tags -->
,cb_{custom_tags.BBCODE_ID}: '{custom_tags.A_BBCODE_HELPLINE}'
<!-- END custom_tags -->
}

var panels = new Array('options-panel', 'attach-panel', 'poll-panel');
var show_panel = 'options-panel';


// ]]>
</script>
<script type="text/javascript" src="{T_TEMPLATE_PATH}/editor.js"></script>

<!-- IF S_BBCODE_ALLOWED -->
<div id="colour_palette" style="display: none;">
<dl style="clear: left;">
<dt><label>{L_FONT_COLOR}:</label></dt>
<dd>
<script type="text/javascript">
// <![CDATA[
function change_palette()
{
dE('colour_palette');
e = document.getElementById('colour_palette');

if (e.style.display == 'block')
{
document.getElementById('bbpalette').value = '{LA_FONT_COLOR_HIDE}';
}
else
{
document.getElementById('bbpalette').value = '{LA_FONT_COLOR}';
}
}

colorPalette('h', 15, 10);
// ]]>
</script>
</dd>
</dl>
</div>

<div id="format-buttons">
<input type="button" class="button2" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" title="{L_BBCODE_B_HELP}" />
<input type="button" class="button2" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" title="{L_BBCODE_I_HELP}" />
<input type="button" class="button2" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" title="{L_BBCODE_U_HELP}" />
<!-- IF S_BBCODE_QUOTE -->
<input type="button" class="button2" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" title="{L_BBCODE_Q_HELP}" />
<!-- ENDIF -->
<input type="button" class="button2" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" title="{L_BBCODE_C_HELP}" />
<input type="button" class="button2" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" title="{L_BBCODE_L_HELP}" />
<input type="button" class="button2" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" title="{L_BBCODE_O_HELP}" />
<input type="button" class="button2" accesskey="t" name="addlitsitem" value="[*]" style="width: 40px" onclick="bbstyle(-1)" title="{L_BBCODE_LISTITEM_HELP}" />
<!-- IF S_BBCODE_IMG -->
<input type="button" class="button2" accesskey="p" name="addbbcode14" value="Img" style="width: 40px" onclick="bbstyle(14)" title="{L_BBCODE_P_HELP}" />
<!-- ENDIF -->
<!-- IF S_LINKS_ALLOWED -->
<input type="button" class="button2" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" title="{L_BBCODE_W_HELP}" />
<!-- ENDIF -->
<!-- IF S_BBCODE_FLASH -->
<input type="button" class="button2" accesskey="d" name="addbbcode18" value="Flash" onclick="bbstyle(18)" title="{L_BBCODE_D_HELP}" />
<!-- ENDIF -->
<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>
<input type="button" class="button2" name="bbpalette" id="bbpalette" value="{L_FONT_COLOR}" onclick="change_palette();" title="{L_BBCODE_S_HELP}" />
<select name="addbbcode_custom" onchange="bbstyle(this.form.addbbcode_custom.options[this.form.addbbcode_custom.selectedIndex].value*1);this.form.addbbcode_custom.selectedIndex = 0;">
<option value="#" selected="selected">Custom BBCodes</option>
<!-- BEGIN custom_tags -->
<option value="{custom_tags.BBCODE_ID}" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
<!-- END custom_tags -->
</select>[/code]
User avatar
Steve
X-Steve
X-Steve
Posts: 1920
Joined: Thu Sep 16 2010 3:19 pm
Real name: Steve© MX
Country Flag: Great Britain
Location: Up north!
Contact:

Re: Custom BBCodes in a select box

Post by Steve »

find:

Code: Select all

    <!-- BEGIN custom_tags -->
              <option value="{custom_tags.BBCODE_ID}" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
              <!-- END custom_tags -->   
             </select>
add after what you took out:

Code: Select all

<!-- ENDIF -->
Hello! and Do NOT contact me via private message for support!!
Flogging My Log

Re: Custom BBCodes in a select box

Post by Flogging My Log »

thank you man.
Mess
Donators
Donators
Posts: 97
Joined: Fri Sep 17 2010 5:28 pm
Real name: Kim
Country Flag: Denmark

Re: Custom BBCodes in a select box

Post by Mess »

Can anyone please share these edits again?
User avatar
cisco007
Ciscox
Ciscox
Posts: 2843
Joined: Thu Sep 16 2010 3:25 pm
Country Flag: Mexico

Re: Custom BBCodes in a select box

Post by cisco007 »

Custom BBCodes in a select box

Author: Simon
Description: Puts all custom bbcodes in a select box. This makes the posting page look nicer and save some space.
Demo: This site.

Open styles/{YOURTHEME}/template/posting_buttons.html
Find:

Code: Select all

    <!-- 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 -->
Replace with:

Code: Select all

    <select name="addbbcode_custom" onchange="bbstyle(this.form.addbbcode_custom.options[this.form.addbbcode_custom.selectedIndex].value*1);this.form.addbbcode_custom.selectedIndex = 0;">
          <option value="#" selected="selected">Custom BBCodes</option>
          <!-- BEGIN custom_tags -->
          <option value="{custom_tags.BBCODE_ID}" title="{custom_tags.BBCODE_HELPLINE}">{custom_tags.BBCODE_TAG}</option>
          <!-- END custom_tags -->   
         </select>


Save, upload and refresh template.
Image
Mess
Donators
Donators
Posts: 97
Joined: Fri Sep 17 2010 5:28 pm
Real name: Kim
Country Flag: Denmark

Re: Custom BBCodes in a select box

Post by Mess »

Thanks Cisco. :)
User avatar
cisco007
Ciscox
Ciscox
Posts: 2843
Joined: Thu Sep 16 2010 3:25 pm
Country Flag: Mexico

Re: Custom BBCodes in a select box

Post by cisco007 »

no problem mess!
Image
Ephemeraboy

Re: Re: Custom BBCodes in a select box

Post by Ephemeraboy »

want to ask
i have hide bbcode button
and want to make custom hide bbcode in a select box
the problem is
i want to arrange them (into one selectbox) like e.g

Code: Select all

[hide]/[/hide]
[hide=][/hide]
[hide=10][/hide]
[hide=100][/hide]
[ghide=5][/ghide]
nad each value is different so i am confused how to list them on a selectbox
thanks
User avatar
cisco007
Ciscox
Ciscox
Posts: 2843
Joined: Thu Sep 16 2010 3:25 pm
Country Flag: Mexico

Re: Re: Custom BBCodes in a select box

Post by cisco007 »

try something like these!

Code: Select all

<select name="addbbcodehide" onchange="bbfontstyle('[' + this.form.addbbcodehide.options[this.form.addbbcodehide.selectedIndex].value + ']', '[/' + this.form.addbbcodehide.options[this.form.addbbcodehide.selectedIndex].value + ']');this.form.addbbcodehide.selectedIndex = 0;" onmouseout="helpline('tip')";>
<option value="" selected="selected">HIDE</option>	
<option value="hide" title="[hide]Your text[/hide]">Hide</option>
<option value="hide=" title="[hide=]Your text[/hide]">Hide=</option>

</select>
you get the idea of how to add the rest, I think!
Image
Post Reply