./templates/default/post_bbinsert.htm
找到
- </span></td><td bgcolor="{ALTBG2}">
复制代码
下面添加
- <table border=0 ><tr ><td>
复制代码
再找到最后面的
前面加上
- <td> <td>
- <td bgcolor="#eeeeee"><center>添加文字底框
- <script language="JavaScript">
- var string = '<table cellpadding="0" cellspacing="1" class="cp_table">';
- var colours = new Array('FF', 'CC', '99', '66', '33', '00', '00');
- var maincol = new Array('FF', 'FF', 'FF', 'CC', '99', '66', '66');
- var rgb = new Array();
- for (x = 0; x < 6; x++){
- rgb.push(colours[x+1] + maincol[x] + maincol[x]);;
- rgb.push(colours[x+1] + colours[x+1] + maincol[x]);
- rgb.push(maincol[x] + colours[x+1] + maincol[x]);
- rgb.push(maincol[x] + colours[x+1] + colours[x+1]);
- rgb.push(maincol[x] + colours[x] + colours[x+1]);
- rgb.push(maincol[x] + maincol[x] + colours[x+1]);
- rgb.push(colours[x+1] + maincol[x] + colours[x+1]);
- rgb.push(colours[x] + colours[x] + colours[x]);
- string += '<tr>';
- for (y = 0; y < rgb.length; y++){
- if (rgb[y].length == 4)
- rgb[y] == '00' + rgb[y];
- string += '<td style="background-color: #' + rgb[y] + '"><a href="javascript:addbox(\'#' + rgb[y] + '\');" ><img src="images/common/transparent.gif" height="8" width="8" alt="#' + rgb[y] + '" border="0" /></a></td>';
-
- }
- string += '</tr>';
- rgb = new Array();
- }
- string += '</table>';
- document.write(string);
- </script>
- </center>
- </td>
- </tr></table></td>
复制代码
./include/bbcode.js
最后添加
- function addbox(color) {
- if (helpmode) {
- alert(box_help);
- } else if (document.selection && document.selection.type == "Text") {
- var range = document.selection.createRange();
- range.text = "[box=" + color + "]" + range.text + "[/box]";
- } else if (advmode) {
- AddTxt="[box="+color+"] [/box]";
- AddText(AddTxt);
- } else {
- txt=prompt(color_normal,text_input);
- if(txt!=null) {
- AddTxt="[box="+color+"]"+txt;
- AddText(AddTxt);
- AddText("[/box]");
- }
- }
- }
复制代码
演示:
http://www.51happy365.com/bbs
[ 本帖最后由 freddy 于 2005-7-7 15:46 编辑 ] |