一、在评论页comments.php添加如下JS代码:
- <script language=>
- to_reply(commentID,author) {
- nNd=\’@\’+author+\’:\’;
- myField;
- (document.getElementById(\’comment\’) && document.getElementById(\’comment\’).type == \’textarea\’) {
- myField = document.getElementById(\’comment\’);
- } {
- ;
- }
- (document.selection) {
- myField.focus();
- sel = document.selection.createRange();
- sel.text = nNd;
- myField.focus();
- }
- (myField.selectionStart || myField.selectionStart == \’0\’) {
- startPos = myField.selectionStart;
- endPos = myField.selectionEnd;
- cursorPos = endPos;
- myField.value = myField.value.substring(0, startPos)
- + nNd
- + myField.value.substring(endPos, myField.value.length);
- cursorPos += nNd.length;
- myField.focus();
- myField.selectionStart = cursorPos;
- myField.selectionEnd = cursorPos;
- }
- {
- myField.value += nNd;
- myField.focus();
- }
- }
- </script>
二、在functions.php中加入如下代码:
- to_reply() {
- ?>
- <a onclick=\’to_reply(, )\’ href= style=/>[@reply]</a>
- <?php
- }
三、在评论页后边添加”回复按钮”
- <?php to_reply(); ?>
暂无评论内容