The following code can insert code at the cursor. If there is a selection area, the selection area will be used to take effect.
1. In the vbcode.js file
replace the function vbcode with the following content
if(caretPos.text.length > 0)
caretPos.text = "[" vbcode "]" caretPos.text "[/" vbcode "]";
else
caretPos.text = "[" vbcode "]" "[/" vbcode "]"; Content
Copy code
The code is as follows:
function fontformat(theform,thevalue,thetype) {
if (theform.message.createTextRange && theform.message.caretPos) {
function smilie(thesmilie) {
// inserts smilie text
if (document.vbform.message.createTextRange && document.vbform.message.caretPos) {
var caretPos = document.vbform.message.caretPos;
caretPos.text = thesmilie;
}
document.vbform.message.focus();
}
Add below Code
Copy code
The code is as follows:
2. color.js file
Find function insertTag and replace it with The following content
Copy code
The code is as follows:
function insertTag(MyString)
caretPos .text = text;
} else {
MM_findObj('message').value = bbopen bbclose;
}
MM_findObj('message').focus();
return;
}
3. Modify editpost, newthread and newreply templates
Find
Statement:The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn