|
#1
|
|||
|
|||
Color pallette
I want to ad this option in forum (this option is from phpbb3.0.4)
PHP Code:
PHP Code:
Last edited by joeroberts; 14th June 2009 at 22:52. |
#2
|
||||
|
||||
first you need to specify what tracker source you use !
|
#3
|
||||
|
||||
we first off are you adding this to phpBB forum or to a tracker source?
if your adding this to a tracker source you need to define the java parts Code:
bbfontstyle helpline bbfontstyle like this Code:
bbfontstyle('[color'=#40FFFF]', '[/color']');
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#4
|
|||
|
|||
Quote:
I use installer surce.(last version) Please help me with this line of cod: PHP Code:
Last edited by LANDSER; 15th June 2009 at 19:36. |
#5
|
||||
|
||||
Im not realy sure what your trouble with the code is?
I went threw phpBB and got all the code needed to make colour pallet to work and it did its not the same colors yours is + I was also able to get the tab to show and Hide it. can you please tell Me where your trouble is in detail? Or would you like for me to post and explane what I came up with?
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#6
|
|||
|
|||
this one is work
Quote:
javascript: PHP Code:
PHP Code:
Thx. |
#7
|
||||
|
||||
First you need to create a new java page name to what ever you want
add this code to it Code:
// Startup variables var onload_functions = new Array(); var imageTag = false; var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); var baseHeight; window.onload = function() { for (var i = 0; i < onload_functions.length; i++) { eval(onload_functions[i]); } } onload_functions.push('initInsertions()'); function insert_text(text, spaces, popup) { var textarea; if (!popup) { textarea = document.forms[form_name].elements[text_name]; } else { textarea = opener.document.forms[form_name].elements[text_name]; } if (spaces) { text = ' ' + text + ' '; } if (!isNaN(textarea.selectionStart)) { var sel_start = textarea.selectionStart; var sel_end = textarea.selectionEnd; mozWrap(textarea, text, '') textarea.selectionStart = sel_start + text.length; textarea.selectionEnd = sel_end + text.length; } else if (textarea.createTextRange && textarea.caretPos) { if (baseHeight != textarea.caretPos.boundingHeight) { textarea.focus(); storeCaret(textarea); } var caret_pos = textarea.caretPos; caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; } else { textarea.value = textarea.value + text; } if (!popup) { textarea.focus(); } } function dE(n, s) { var e = document.getElementById(n); if (!s) { s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1; } e.style.display = (s == 1) ? 'block' : 'none'; } function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; var scrollTop = txtarea.scrollTop; if (selEnd == 1 || selEnd == 2) { selEnd = selLength; } var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; txtarea.selectionStart = selEnd + open.length + close.length; txtarea.selectionEnd = txtarea.selectionStart; txtarea.focus(); txtarea.scrollTop = scrollTop; return; } function caretPosition() { var start = null; var end = null; } function getCaretPosition(txtarea) { var caretPos = new caretPosition(); // simple Gecko/Opera way if(txtarea.selectionStart || txtarea.selectionStart == 0) { caretPos.start = txtarea.selectionStart; caretPos.end = txtarea.selectionEnd; } // dirty and slow IE way else if(document.selection) { // get current selection var range = document.selection.createRange(); // a new selection of the whole textarea var range_all = document.body.createTextRange(); range_all.moveToElementText(txtarea); // calculate selection start point by moving beginning of range_all to beginning of range var sel_start; for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) { range_all.moveStart('character', 1); } txtarea.sel_start = sel_start; // we ignore the end value for IE, this is already dirty enough and we don't need it caretPos.start = txtarea.sel_start; caretPos.end = txtarea.sel_start; } return caretPos; } function bbfontstyle(bbopen, bbclose) { theSelection = false; var textarea = document.forms[form_name].elements[text_name]; textarea.focus(); if ((clientVer >= 4) && is_ie && is_win) { // Get text selection theSelection = document.selection.createRange().text; if (theSelection) { // Add tags around selection document.selection.createRange().text = bbopen + theSelection + bbclose; document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } } else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) { mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose); document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } //The new position for the cursor after adding the bbcode var caret_pos = getCaretPosition(textarea).start; var new_pos = caret_pos + bbopen.length; // Open tag insert_text(bbopen + bbclose); // Center the cursor when we don't have a selection // Gecko and proper browsers if (!isNaN(textarea.selectionStart)) { textarea.selectionStart = new_pos; textarea.selectionEnd = new_pos; } // IE else if (document.selection) { var range = textarea.createTextRange(); range.move("character", new_pos); range.select(); storeCaret(textarea); } textarea.focus(); return; } function colorPalette(dir, width, height) { var r = 0, g = 0, b = 0; var numberList = new Array(6); var color = ''; numberList[0] = '00'; numberList[1] = '40'; numberList[2] = '80'; numberList[3] = 'BF'; numberList[4] = 'FF'; document.writeln('<table cellspacing="1" cellpadding="0" border="0">'); for (r = 0; r < 5; r++) { if (dir == 'h') { document.writeln('<tr>'); } for (g = 0; g < 5; g++) { if (dir == 'v') { document.writeln('<tr>'); } for (b = 0; b < 5; b++) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write('<td bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">'); document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img src="http://bvlist.com/images/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.writeln('</td>'); } if (dir == 'v') { document.writeln('</tr>'); } } if (dir == 'h') { document.writeln('</tr>'); } } document.writeln('</table>'); } HTML Code:
<script type="text/javascript" src="http://yoursite/javacode.js"></script> <script type="text/javascript"> // <![CDATA[ var form_name = 'formdata'; var text_name = 'descr'; 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]','<<<@!1!@>>>','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'); var imageTag = false; // Helpline messages var help_line = { b: 'Bold text: [b]text[/b]', i: 'Italic text: [i]text[/i]', u: 'Underline text: [u]text[/u]', q: 'Quote text: <<<@!2!@>>>', c: 'Code display: [code]code[/code]', l: 'List: [list]text[/list]', o: 'Ordered list: [list=]text[/list]', p: 'Insert image: [img]http://image_url[/img]', w: 'Insert URL: [url=http://url]Lost redirect[/url] or [url=http://url]URL text[/url]', a: 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]', s: 'Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000', f: 'Font size: [size=85]small text[/size]', e: 'List: Add list element', d: 'Flash: [flash=width,height]http://url[/flash]' } var panels = new Array('options-panel', 'attach-panel', 'poll-panel'); var show_panel = 'options-panel'; // ]]> </script> Code:
var form_name = 'formdata'; var text_name = 'descr'; now where you want to add the pallet (with in the form) put this code HTML Code:
<div id="colour_palette" style="display: none;"> <dl style="clear: left;"> <dt><label>Font colour:</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 = 'Hide font colour'; } else { document.getElementById('bbpalette').value = 'Font colour'; } } colorPalette('h', 15, 10); // ]]> </script> </dd> </dl> </div> <input type="button" class="button2" name="bbpalette" id="bbpalette" value="Font colour" onclick="change_palette();" title="Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000" /> phpMyBitTorrentV2.0.3
__________________
Do not ask me to help you work on your site that is not phpMyBitTorrent Do not ask me to make a mod for any other source Do not Ask me to setup your site. I will no longer help you setup your site, there is a setup script if you have trouble with it post in the forum here or in BT.Manager™ forum My Current Demo is here http://demo.btmanager.org/ |
#8
|
||||
|
||||
updated for TBDEV and TorrentStrike
javacode.js Code:
// Startup variables var onload_functions = new Array(); var imageTag = false; var theSelection = false; // Check for Browser & Platform for PC & IE specific bits // More details from: http://www.mozilla.org/docs/web-developer/sniffer/browser_type.html var clientPC = navigator.userAgent.toLowerCase(); // Get client info var clientVer = parseInt(navigator.appVersion); // Get browser version var is_ie = ((clientPC.indexOf('msie') != -1) && (clientPC.indexOf('opera') == -1)); var is_win = ((clientPC.indexOf('win') != -1) || (clientPC.indexOf('16bit') != -1)); var baseHeight; window.onload = function() { for (var i = 0; i < onload_functions.length; i++) { eval(onload_functions[i]); } } onload_functions.push('initInsertions()'); function insert_text(text, spaces, popup) { var textarea; if (!popup) { textarea = document.forms[form_name].elements[text_name]; } else { textarea = opener.document.forms[form_name].elements[text_name]; } if (spaces) { text = ' ' + text + ' '; } if (!isNaN(textarea.selectionStart)) { var sel_start = textarea.selectionStart; var sel_end = textarea.selectionEnd; mozWrap(textarea, text, '') textarea.selectionStart = sel_start + text.length; textarea.selectionEnd = sel_end + text.length; } else if (textarea.createTextRange && textarea.caretPos) { if (baseHeight != textarea.caretPos.boundingHeight) { textarea.focus(); storeCaret(textarea); } var caret_pos = textarea.caretPos; caret_pos.text = caret_pos.text.charAt(caret_pos.text.length - 1) == ' ' ? caret_pos.text + text + ' ' : caret_pos.text + text; } else { textarea.value = textarea.value + text; } if (!popup) { textarea.focus(); } } function dE(n, s) { var e = document.getElementById(n); if (!s) { s = (e.style.display == '' || e.style.display == 'block') ? -1 : 1; } e.style.display = (s == 1) ? 'block' : 'none'; } function mozWrap(txtarea, open, close) { var selLength = txtarea.textLength; var selStart = txtarea.selectionStart; var selEnd = txtarea.selectionEnd; var scrollTop = txtarea.scrollTop; if (selEnd == 1 || selEnd == 2) { selEnd = selLength; } var s1 = (txtarea.value).substring(0,selStart); var s2 = (txtarea.value).substring(selStart, selEnd) var s3 = (txtarea.value).substring(selEnd, selLength); txtarea.value = s1 + open + s2 + close + s3; txtarea.selectionStart = selEnd + open.length + close.length; txtarea.selectionEnd = txtarea.selectionStart; txtarea.focus(); txtarea.scrollTop = scrollTop; return; } function caretPosition() { var start = null; var end = null; } function getCaretPosition(txtarea) { var caretPos = new caretPosition(); // simple Gecko/Opera way if(txtarea.selectionStart || txtarea.selectionStart == 0) { caretPos.start = txtarea.selectionStart; caretPos.end = txtarea.selectionEnd; } // dirty and slow IE way else if(document.selection) { // get current selection var range = document.selection.createRange(); // a new selection of the whole textarea var range_all = document.body.createTextRange(); range_all.moveToElementText(txtarea); // calculate selection start point by moving beginning of range_all to beginning of range var sel_start; for (sel_start = 0; range_all.compareEndPoints('StartToStart', range) < 0; sel_start++) { range_all.moveStart('character', 1); } txtarea.sel_start = sel_start; // we ignore the end value for IE, this is already dirty enough and we don't need it caretPos.start = txtarea.sel_start; caretPos.end = txtarea.sel_start; } return caretPos; } function bbfontstyle(bbopen, bbclose) { theSelection = false; var textarea = document.forms[form_name].elements[text_name]; textarea.focus(); if ((clientVer >= 4) && is_ie && is_win) { // Get text selection theSelection = document.selection.createRange().text; if (theSelection) { // Add tags around selection document.selection.createRange().text = bbopen + theSelection + bbclose; document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } } else if (document.forms[form_name].elements[text_name].selectionEnd && (document.forms[form_name].elements[text_name].selectionEnd - document.forms[form_name].elements[text_name].selectionStart > 0)) { mozWrap(document.forms[form_name].elements[text_name], bbopen, bbclose); document.forms[form_name].elements[text_name].focus(); theSelection = ''; return; } //The new position for the cursor after adding the bbcode var caret_pos = getCaretPosition(textarea).start; var new_pos = caret_pos + bbopen.length; // Open tag insert_text(bbopen + bbclose); // Center the cursor when we don't have a selection // Gecko and proper browsers if (!isNaN(textarea.selectionStart)) { textarea.selectionStart = new_pos; textarea.selectionEnd = new_pos; } // IE else if (document.selection) { var range = textarea.createTextRange(); range.move("character", new_pos); range.select(); storeCaret(textarea); } textarea.focus(); return; } function colorPalette(dir, width, height) { var r = 0, g = 0, b = 0; var numberList = new Array(6); var color = ''; numberList[0] = '00'; numberList[1] = '40'; numberList[2] = '80'; numberList[3] = 'BF'; numberList[4] = 'FF'; document.writeln('<table class="colorpiker" align="left" cellspacing="0" cellpadding="0" border="0">'); for (r = 0; r < 5; r++) { if (dir == 'h') { document.writeln('<tr>'); } for (g = 0; g < 5; g++) { if (dir == 'v') { document.writeln('<tr>'); } for (b = 0; b < 5; b++) { color = String(numberList[r]) + String(numberList[g]) + String(numberList[b]); document.write('<td class="colorpiker" bgcolor="#' + color + '" style="width: ' + width + 'px; height: ' + height + 'px;">'); document.write('<a href="#" onclick="bbfontstyle(\'[color=#' + color + ']\', \'[/color]\'); return false;"><img border="0" src="pic/spacer.gif" width="' + width + '" height="' + height + '" alt="#' + color + '" title="#' + color + '" /></a>'); document.writeln('</td>'); } if (dir == 'v') { document.writeln('</tr>'); } } if (dir == 'h') { document.writeln('</tr>'); } } document.writeln('</table>'); } Code:
var r = document.body.createTextRange(); r.moveToElementText(e); r.select(); } } </script> HTML Code:
<script type="text/javascript" src="javacode.js"></script> <script type="text/javascript"> // <![CDATA[ var form_name = '<?=$form?>'; var text_name = '<?=$text?>'; 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]','<<<@!1!@>>>','[code]','[/code]','[list]','[/list]','[list=]','[/list]','[img]','[/img]','[url]','[/url]','[flash=]', '[/flash]','[size=]','[/size]'); var imageTag = false; // Helpline messages var help_line = { b: 'Bold text: [b]text[/b]', i: 'Italic text: [i]text[/i]', u: 'Underline text: [u]text[/u]', q: 'Quote text: [code] var r = document.body.createTextRange(); r.moveToElementText(e); r.select(); } } </script>[/code]', c: 'Code display: [code]code[/code]', l: 'List:[list]text[/list]', o: 'Ordered list:[list=]text[/list]', p: 'Insert image: [img]http://image_url[/img]', w: 'Insert URL: [url=http://url]Lost redirect[/url] or [url=http://url]URL text[/url]', a: 'Inline uploaded attachment: [attachment=]filename.ext[/attachment]', s: 'Font colour: [color=red]text[/color] Tip: you can also use color=#FF0000', f: 'Font size: [size=85]small text[/size]', e: 'List: Add list element', d: 'Flash: [flash=width,height]http://url[/flash]' } var panels = new Array('options-panel', 'attach-panel', 'poll-panel'); var show_panel = 'options-panel'; // ]]> </script> Code:
<!--<select name='color' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'color')"> <option value='0'>------ Color -------</option> <option style="BACKGROUND-COLOR: black" value="Black">Black </option> <option style="BACKGROUND-COLOR: sienna" value="Sienna"> Sienna</option> <option style="BACKGROUND-COLOR: darkolivegreen" value="DarkOliveGreen"> Dark Olive Green</option> <option style="BACKGROUND-COLOR: darkgreen" value="DarkGreen"> Dark Green</option> <option style="BACKGROUND-COLOR: darkslateblue" value="DarkSlateBlue"> Dark Slate Blue</option> <option style="BACKGROUND-COLOR: navy" value="Navy">Navy </option> <option style="BACKGROUND-COLOR: indigo" value="Indigo"> Indigo</option> <option style="BACKGROUND-COLOR: darkslategray" value="DarkSlateGray"> Dark Slate Gray</option> <option style="BACKGROUND-COLOR: darkred" value="DarkRed"> Dark Red</option> <option style="BACKGROUND-COLOR: darkorange" value="DarkOrange"> Dark Orange</option> <option style="BACKGROUND-COLOR: olive" value="Olive">Olive </option> <option style="BACKGROUND-COLOR: green" value="Green">Green </option> <option style="BACKGROUND-COLOR: teal" value="Teal">Teal </option> <option style="BACKGROUND-COLOR: blue" value="Blue">Blue </option> <option style="BACKGROUND-COLOR: slategray" value="SlateGray"> Slate Gray</option> <option style="BACKGROUND-COLOR: dimgray" value="DimGray"> Dim Gray</option> <option style="BACKGROUND-COLOR: red" value="Red">Red </option> <option style="BACKGROUND-COLOR: sandybrown" value="SandyBrown"> Sandy Brown</option> <option style="BACKGROUND-COLOR: yellowgreen" value="YellowGreen"> Yellow Green</option> <option style="BACKGROUND-COLOR: seagreen" value="SeaGreen"> Sea Green</option> <option style="BACKGROUND-COLOR: mediumturquoise" value="MediumTurquoise"> Medium Turquoise</option> <option style="BACKGROUND-COLOR: royalblue" value="RoyalBlue"> Royal Blue</option> <option style="BACKGROUND-COLOR: purple" value="Purple"> Purple</option> <option style="BACKGROUND-COLOR: gray" value="Gray">Gray </option> <option style="BACKGROUND-COLOR: magenta" value="Magenta"> Magenta</option> <option style="BACKGROUND-COLOR: orange" value="Orange"> Orange</option> <option style="BACKGROUND-COLOR: yellow" value="Yellow"> Yellow</option> <option style="BACKGROUND-COLOR: lime" value="Lime">Lime </option> <option style="BACKGROUND-COLOR: cyan" value="Cyan">Cyan </option> <option style="BACKGROUND-COLOR: deepskyblue" value="DeepSkyBlue"> Deep Sky Blue</option> <option style="BACKGROUND-COLOR: darkorchid" value="DarkOrchid"> Dark Orchid</option> <option style="BACKGROUND-COLOR: silver" value="Silver"> Silver</option> <option style="BACKGROUND-COLOR: pink" value="Pink">Pink </option> <option style="BACKGROUND-COLOR: wheat" value="Wheat">Wheat </option> <option style="BACKGROUND-COLOR: lemonchiffon" value="LemonChiffon"> Lemon Chiffon</option> <option style="BACKGROUND-COLOR: palegreen" value="PaleGreen"> Pale Green</option> <option style="BACKGROUND-COLOR: paleturquoise" value="PaleTurquoise"> Pale Turquoise</option> <option style="BACKGROUND-COLOR: lightblue" value="LightBlue"> Light Blue</option> <option style="BACKGROUND-COLOR: plum" value="Plum">Plum </option> <option style="BACKGROUND-COLOR: white" value="White">White </option> </select> Code:
<input type="button" class="codebuttons" name="bbpalette" id="bbpalette" value="Font colour" onclick="change_palette();" title="Font colour: text Tip: you can also use color=#FF0000" /> Code:
<td class=embedded> <select name='size' class='codebuttons' onchange="alterfont(this.options[this.selectedIndex].value, 'size')"> <option value='0'>- Size -</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> </select> </select> </table> Code:
<div class="colorpiker" id="colour_palette" style="display: none;"> <dl style="clear: left;border: none;"> <dt><label></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 = 'Hide font colour'; } else { document.getElementById('bbpalette').value = 'Font colour'; } } colorPalette('h', 15, 10); // ]]> </script> </dd> </dl> </div> Code:
.colorpiker { border: solid #FFFFFF 2px; } Last edited by Dehas; 8th July 2009 at 12:41. |
Tags |
color , pallette |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
change black text in shout box to a diff color | smudger | xBTiT | 1 | 25th June 2010 03:39 |
Text color | zyberwax | Template Shares | 1 | 26th November 2009 01:06 |
shoutbox background color | sharpe | Torrent Strike | 4 | 3rd October 2008 21:58 |
Username color | BacKUP | TBDev | 1 | 23rd September 2008 23:44 |