代碼: 選擇全部
##############################################################
## 外掛名稱: Enable Hoteditor In Notes (筆記本編輯介面改採所見即所得模式)
## 外掛作者: wang5555 < wang55.wang55@msa.hinet.net > (心靈捕手) http://220.134.232.37/
## 外掛描述: 這個外掛, 讓您論壇裡的筆記本編輯介面, 改採所見即所得模式
##
## 外掛版本: 1.0.0
##
## 安裝難度: Easy
## 安裝時間: < 3 Minutes
## 需要編輯的檔案: 1
## templates/subSilver/posting_notes_body.tpl
##
## 附加檔案: 0
##
## 版權聲明: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## 由於安全上的考量, 請檢查: http://phpbb-tw.net/phpbb/index.php
## 是否有此外掛的最新版本.
################################################################
## 作者留言:
##
## 1. 此外掛於 phpBB 2.0.22 測試無誤.
##
## 2. 修改前提: 您的論壇已經安裝好下面兩個外掛, 且運作正常
## Personal Notes 1.4.9
## http://phpbb-tw.net/phpbb/viewtopic.php?t=47316
## WYSIWYG - Rich Text Editor for posting HTML message 4.2
## http://phpbb-tw.net/phpbb/viewtopic.php?t=42226
##
################################################################
## 外掛歷史:
##
## 2007-06-24 - Version 1.0.0
## - 首次發表
##
##############################################################
## 新增外掛前, 請先備份相關檔案.
##############################################################
#
#-----[ OPEN ]-----
#
templates/subSilver/posting_notes_body.tpl
#
#-----[ FIND ]-----
#
function checkForm() {
#
#-----[ AFTER, ADD ]-----
#
//EDITOR
get_hoteditor_data();
#
#-----[ FIND ]-----
<form action="{S_POST_ACTION}" method="post" name="post">
#
#-----[ REPLACE WITH ]-----
#
<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)">
#
#-----[ FIND ]-----
#
<tr>
<!-- BEGIN switch_bbcode_on -->
<td class="row1" width="20%" valign="top"><b>BBCode</b></td>
<td class="row2" width="80%">
<span class="genmed">
<input type="button" class="button" name="addbbcode0" value=" b " style="font-weight:bold" onClick="bbstyle(0)" />
<input type="button" class="button" name="addbbcode2" value=" i " style="font-style:italic" onClick="bbstyle(2)" />
<input type="button" class="button" name="addbbcode4" value=" u " style="text-decoration:underline" onClick="bbstyle(4)" />
<input type="button" class="button" name="addbbcode6" value="IMG" onClick="bbstyle(6)" />
<input type="button" class="button" name="addbbcode8" value="URL" onClick="BBCurl()" />
<input type="button" class="button" name="addbbcode10" value="center" onClick="bbstyle(10)" />
<input type="button" class="button" name="addbbcode12" value="Quote" onClick="bbstyle(12)" />
<input type="button" class="button" name="addbbcode14" value="Code" onClick="bbstyle(14)" />
<br />{L_FONT_COLOR}:
<select name="addbbcode16" onChange="bbfontstyle('[color=' + this.form.addbbcode16.options[this.form.addbbcode16.selectedIndex].value + ']', '[/color]')" >
<option style="color:darkred; background-color: darkred" value="darkred" class="genmed"> </option>
<option style="color:red; background-color: red" value="red" class="genmed"> </option>
<option style="color:orange; background-color: orange" value="orange" class="genmed"> </option>
<option style="color:brown; background-color: brown" value="brown" class="genmed"> </option>
<option style="color:yellow; background-color: yellow" value="yellow" class="genmed"> </option>
<option style="color:green; background-color: green" value="green" class="genmed"> </option>
<option style="color:olive; background-color: olive" value="olive" class="genmed"> </option>
<option style="color:cyan; background-color: cyan" value="cyan" class="genmed"> </option>
<option style="color:blue; background-color: blue" value="blue" class="genmed"> </option>
<option style="color:darkblue; background-color: darkblue" value="darkblue" class="genmed"> </option>
<option style="color:indigo; background-color: indigo" value="indigo" class="genmed"> </option>
<option style="color:violet; background-color: violet" value="violet" class="genmed"> </option>
<option style="color:white; background-color: white" value="white" class="genmed"> </option>
<option style="color:black; background-color: black" value="black" class="genmed"> </option>
</select>
{L_FONT_SIZE}:
<select name="addbbcode18" onChange="bbfontstyle('[size=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/size]')" >
<option value="1" class="genmed">size 1</option>
<option value="2" class="genmed">size 2</option>
<option value="3" selected class="genmed">size 3 (*)</option>
<option value="4" class="genmed">size 4</option>
<option value="5" class="genmed">size 5</option>
<option value="6" class="genmed">size 6</option>
<option value="7" class="genmed">size 7</option>
</select>
<a href="javascript:bbstyle(-1)" class="genmed">{L_BBCODE_CLOSE_TAGS}</a></span>
<!-- END switch_bbcode_on -->
</td>
</tr>
<tr>
<td class="row1" valign="top">
<table width="20%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><span class="gen">{L_MESSAGE_BODY}</span></td>
</tr>
<tr>
<td valign="middle" align="center"><span class="nav"><a href="{U_SMILIES}" onclick="window.open('{U_SMILIES}', '_blank', 'height=320,resizable=yes,scrollbars=yes,width=500');return false;" target="_blank" class="nav"><br />{L_SMILIES}</a></span></td>
</tr>
</table>
</td>
<td class="row2" valign="top"><textarea name="message" rows="15" cols="75" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);" onMouseOver="this.focus()" >{MESSAGE}</textarea></td>
</tr>
#
#-----[ REPLACE WITH ]-----
#
<tr>
<td class="row1" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="1">
<tr>
<td><span class="gen"><b>{L_MESSAGE_BODY}</b></span></td>
</tr>
<tr>
<td valign="middle" align="center"><span class="nav"><a href="{U_SMILIES}" onclick="window.open('{U_SMILIES}', '_blank', 'height=320,resizable=yes,scrollbars=yes,width=500');return false;" target="_blank" class="nav"><br />{L_SMILIES}</a></span></td>
</tr>
</table>
</td>
<td class="row2" valign="top">
<table border="0" cellspacing="0" cellpadding="2">
<tr>
<td colspan="9">
<!-- //EDITOR -->
<textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" id="message" name="message" rows="15" cols="35" wrap="virtual" tabindex="3" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
<style type='text/css'>@import url(richedit/styles/office2007/style.css);</style>
<script language="JavaScript" type="text/javascript" src="richedit/editor.js?version=4.2"></script>
<script language="JavaScript" type="text/javascript">
var getdata =document.getElementById("message").value;
Instantiate("max","editor", getdata , "100%", "300px");
function get_hoteditor_data(){
setCodeOutput();
var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
document.getElementById("message").value = bbcode_output;
}
</script>
<!-- //EDITOR -->
</td>
</tr>
</table>
</td>
</tr>
#
#-----[ SAVE & CLOSE ]-----
#
http://wang5555.dnsfor.me/phpbb2/notes.php

