#TITLE Post Colors choice by gpa4 #INFO You are about to install "Post Colors choice" for tForum b0.94.2.2 written by gpa4 on 2005-08-03. This mod adds a font color picker for posts. Based on the "Text Formatting Mod" for tForum b0.92p6 written by MoJoe. #OPEN includes/functions.php #FIND $msgInfo['Message'] = preg_replace('#\[code\](.+)\[/code\]#Ueis', "code_replace('\\1')", $msgInfo['Message'] ); #ADDAFTER $msgInfo['Message'] = preg_replace('/(\[color=)(#?[a-z0-9]+)\]/is', '',$msgInfo['Message']); $msgInfo['Message'] = preg_replace('#\[/color\]#is', '',$msgInfo['Message']); #OPEN templates/tfcode.html #FIND #ADDAFTER #OPEN language/text.php #ADD $txt['Color'] = 'Colors'; $txt['Cyan'] = 'Cyan'; $txt['Blue'] = 'Blue'; $txt['Yellow'] = 'Yellow'; $txt['Purple'] = 'Purple'; $txt['Red'] = 'Red'; $txt['Green'] = 'Green'; #OPEN IEtFCode.js #FIND document.postform.list.selectedIndex = 0; } #ADDAFTER function tcolor(color) { strSelection = document.selection.createRange().text; if (strSelection == "") { document.postform.elements['post[Message]'].focus(); strSelection = prompt("Please enter the text that should be "+color,""); if (strSelection!=null) document.postform.elements['post[Message]'].value+="[color="+color+"]" +strSelection+ "[/color]"; } else { document.selection.createRange().text = "[color="+color+"]" + strSelection + "[/color]"; } } #OPEN NStFCode.js #FIND document.postform.elements['post[Message]'].value+= '[/list]\n'; } } #ADDAFTER function tcolor(color) { strSelection=prompt("Please enter the text that should be "+color,""); if (strSelection!=null) document.postform.elements['post[Message]'].value+="[color="+color+"]"+strSelection+"[/color]"; } #END