"Highlighting" Text in Posts - Posted (1186 Views)
Senior Member
MaGraham
Posts: 1297
1297

Just wondering if anyone has considered doing a mod that would allow members to highlight important text in their posts/replies? cool
"Do all the good you can, by all the means you can, in all the ways you can, at all the times you can, to all the people you can, as long as ever you can." - John Wesley
 Sort direction, for dates DESC means newest first  
 Page size 
Posted
Advanced Member
Carefree
Posts: 4224
4224
I will write it in a few minutes. This is untested, but it should do the job. I would highly suggest making this a DIFFERENT color than the search HiLite color above it. You can copy all this or download from SnitzBitz.
This mod adds text highlighting function to the editor.
1. Save the following in your forum folder, then run it from the admin console.
"dbs_highlight.asp"
Code:

Highlighter v1.0

[INSERT] CONFIG_NEW
(C_VARIABLE,C_VALUE)#('STRHIGHLIGHTER','yellow')
[END]

2. Save this in your images folder:

"icon_editor_highlight.png":


3. Make the following changes to forum files:

"admin_config_colors.asp"
Code:

Look for the following lines (appx 355-359):

" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>HighLight Font Color:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""strHiLiteFontColor"" size=""10"" maxLength=""20"" value=""" & chkExist(strHiLiteFontColor) & """>" & vbNewLine & _
" <a href=""JavaScript:openWindow3('pop_config_help.asp?mode=colors#colors')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _

Below those, insert these:

" <tr valign=""middle"">" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """ align=""right""><font face=""" & strDefaultFontFace & """ size=""" & strDefaultFontSize & """><b>HighLight Background Color:</b> </font></td>" & vbNewLine & _
" <td bgColor=""" & strPopUpTableColor & """><input type=""text"" name=""strHighlighter"" size=""10"" maxLength=""20"" value=""" & chkExist(strHighlighter) & """>" & vbNewLine & _
" <a href=""JavaScript:openWindow3('pop_config_help.asp?mode=colors#colors')"">" & getCurrentIcon(strIconSmileQuestion,"","") & "</a></td>" & vbNewLine & _
" </tr>" & vbNewLine & _

"config.asp"
Code:

Look for the following line (appx 477):

strShowQuickReply = Application(strCookieURL & "STRSHOWQUICKREPLY")

Below it, insert this:

strHighlighter = Application(strCookieURL & "STRHIGHLIGHTER")

Next, look for the following line (appx 163):

Dim SubCount, MySubCount

Below it, insert this:

Dim strHighlighter


"inc_code.js"
Code:

Look for the following lines (appx 177-196):

function left() {
var text = getText();
if (helpstat) {
alert("Left tag aligns the enclosed text to the left.\n\nUSE: This text is aligned left");
} else if (basic) {
AddTxt="" + text + "";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be aligned left",text);
} else {
txt=prompt("Text to be aligned left","Text");
}
if (txt!=null) {
AddTxt=""+txt+"";
AddText(AddTxt);
}
}
}

Below those, insert these:

function highlight() {
var text = getText();
if (helpstat) {
alert("Highlight tag changes the background color of text to emphasize it.\n\nUSE: This text is highlighted.");
} else if (basic) {
AddTxt="" + text + "";
AddText(AddTxt);
} else {
if (text) {
txt=prompt("Text to be highlighted",text);
} else {
txt=prompt("Text to be highlighted","Text");
}
if (txt!=null) {
AddTxt=""+txt+"";
AddText(AddTxt);
}
}
}


"inc_func_common.asp"

Code:

Look for the following line (appx 479):

fString = replace(fString, "
", "<br />", 1, -1, 1)

Above it, insert this:

fString = doCode(fString, "",
"
", "<mark style=""background-color: " & strHighlighter &
";"">", "</mark>")

"inc_func_posting.asp"

Code:

Look for the following lines (appx 313-314):

fString = replace(fString, "<div align=""right"">", "", 1, -1, 1)
fString = replace(fString, "</div id=""right"">", "
", 1, -1, 1)

Below those, insert these:

fString = replace(fString, "<mark
style=""background-color: " & strHighlighter & ";"">","", 1, -1, 1)
fString = replace(fString, "</mark>","
", 1, -1, 1)

"inc_iconfiles.asp"

Code:

Look for the following line (appx 48):

Const strIconEditorHR = "icon_editor_hr.gif|23|22"

Below it, insert this:

Const strIconEditorHighlight = "icon_editor_highlight.png|23|22"

"inc_post_buttons.asp"

Code:

Look for the following line (appx 58):

" <a href=""Javascript:hr();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorHR,"Horizontal Rule","align=""top""") & "</a>" & _

Above it, insert this:

" <a href=""Javascript:highlight();"" tabindex=""-1"">" & getCurrentIcon(strIconEditorHighlight,"Highlight","align=""top""") & "</a>" & vbNewLine & _

"pop_forum_code.asp"

Code:

Look for the following lines (appx 65-68):

" <p><b>Striking Text:</b><br />" & vbNewLine & _
" Enclose your text with and <br />" & vbNewLine & _
" <i>Example:</i> <b></b>mistake<b></b> = <s>mistake</s>" & vbNewLine & _
" </p>" & vbNewLine & _

Below those, insert these:

" <p><b>Highlighting Text:</b><br />" & vbNewLine & _
" Highlight text with [highlight]<br />" & vbNewLine & _
" <i>Example:</i> <b>[hightlight]</b> = <mark>highlighted text</mark>" & vbNewLine & _
" </p>" & vbNewLine & _
 
You Must enter a message