[外掛] Enable Hoteditor In Blog (網誌編輯介面改採所見即所得模式)

MODs Released by Other phpbb Sites
非官方認證通過之 MOD ,或許有安全性之疑慮,所有問題由原發表者回覆!

版主: 版主管理群

主題已鎖定
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8437
註冊時間: 2004-04-30 01:54
來自: Taiwan

[外掛] Enable Hoteditor In Blog (網誌編輯介面改採所見即所得模式)

文章 心靈捕手 »

代碼: 選擇全部

##############################################################
## 外掛名稱: Enable Hoteditor In Blog (網誌編輯介面改採所見即所得模式)
## 外掛作者: wang5555 < wang55.wang55@msa.hinet.net > (心靈捕手) http://220.134.232.37/
## 外掛描述: 這個外掛, 讓您論壇裡的網誌編輯介面, 改採所見即所得模式
##
## 外掛版本: 1.0.0
##
## 安裝難度: Easy
## 安裝時間: < 3 Minutes
## 需要編輯的檔案: 1
##               weblogs/templates/YOUR_THEME/weblog_posting_body.htm
##
## 附加檔案: 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. 修改前提: 您的論壇已經安裝好下面兩個外掛, 且運作正常
##       Blog Mod 0.24b
##       http://phpbb-tw.net/phpbb/viewtopic.php?t=35352
##       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 ]-----
#
weblogs/templates/YOUR_THEME/weblog_posting_body.htm

#
#-----[ FIND ]-----
#
function checkForm() {

#
#-----[ AFTER, ADD ]-----
#
//EDITOR
get_hoteditor_data();

#
#-----[ FIND ]-----
#
			<form action="{S_POST_ACTION}" method="post" name="post" enctype="multipart/form-data">

#
#-----[ REPLACE WITH ]-----
#
			<form action="{S_POST_ACTION}" method="post" name="post" onsubmit="return checkForm(this)" enctype="multipart/form-data">

#
#-----[ FIND ]-----
#
				  <tr>
					<td colspan="2"><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
				  </tr>
				  <tr>
					<td valign="center" align="center"> <br /><br /><br /><br />
					  <table width="100" border="0" cellspacing="0" cellpadding="5">
						<tr align="center">
						  <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
						</tr>
						<!-- BEGIN smilies_row -->
						<tr align="center" valign="middle">
						  <!-- BEGIN smilies_col -->
						  <td><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" onmouseover="this.style.cursor='hand';" onclick="emoticon('{smilies_row.smilies_col.SMILEY_CODE}');" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></td>
						  <!-- END smilies_col -->
						</tr>
						<!-- END smilies_row -->
						<!-- BEGIN switch_smilies_extra -->
						<tr align="center">
						  <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
						</tr>
						<!-- END switch_smilies_extra -->
					  </table>
					</td>
				  </tr>
				</table>
			  </td>
			  <td class="entry" valign="top">
				<table border="0" cellspacing="0" cellpadding="2">
				  <tr align="center" valign="middle">
					<!-- BEGIN switch_is_popup -->
					<td>
					  <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onclick="bbstyle(0)" onmouseover="helpline('b')" />
					  <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onclick="bbstyle(2)" onmouseover="helpline('i')" />
					  <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onclick="bbstyle(4)" onmouseover="helpline('u')" />
					  <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onclick="bbstyle(6)" onmouseover="helpline('q')" />
					  <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onclick="bbstyle(8)" onmouseover="helpline('c')" />
					  <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onclick="bbstyle(10)" onmouseover="helpline('l')" />
					  <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onclick="bbstyle(12)" onmouseover="helpline('o')" />
					  <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onclick="bbstyle(14)" onmouseover="helpline('p')" />
					  <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onclick="bbstyle(16)" onmouseover="helpline('w')" />
					</td>
					<!-- END switch_is_popup -->
					<!-- BEGIN switch_not_popup -->
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="b" name="addbbcode0" value=" B " style="font-weight:bold; width: 30px" onClick="bbstyle(0)" onMouseOver="helpline('b')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="i" name="addbbcode2" value=" i " style="font-style:italic; width: 30px" onClick="bbstyle(2)" onMouseOver="helpline('i')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="q" name="addbbcode6" value="Quote" style="width: 50px" onClick="bbstyle(6)" onMouseOver="helpline('q')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="c" name="addbbcode8" value="Code" style="width: 40px" onClick="bbstyle(8)" onMouseOver="helpline('c')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="l" name="addbbcode10" value="List" style="width: 40px" onClick="bbstyle(10)" onMouseOver="helpline('l')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="o" name="addbbcode12" value="List=" style="width: 40px" onClick="bbstyle(12)" onMouseOver="helpline('o')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="p" name="addbbcode14" value="Img" style="width: 40px"  onClick="bbstyle(14)" onMouseOver="helpline('p')" />
					  </span></td>
					<td><span class="genmed">
					  <input type="button" class="button" accesskey="w" name="addbbcode16" value="URL" style="text-decoration: underline; width: 40px" onClick="bbstyle(16)" onMouseOver="helpline('w')" />
					  </span></td>
		<!-- END switch_not_popup -->
				  </tr>
				  <tr>
					<td colspan="9">
					  <table width="100%" border="0" cellspacing="0" cellpadding="0">
						<tr>
						  <td><span class="genmed"> &nbsp;{L_FONT_COLOR}:
							<select name="addbbcode18" onchange="bbfontstyle('[color=' + this.form.addbbcode18.options[this.form.addbbcode18.selectedIndex].value + ']', '[/color]');this.selectedIndex=0;" onmouseover="helpline('s')">
							  <option style="color:black; background-color: {T_TD_COLOR1}" value="{T_FONTCOLOR1}" class="genmed">{L_COLOR_DEFAULT}</option>
							  <option style="color:darkred; background-color: {T_TD_COLOR1}" value="darkred" class="genmed">{L_COLOR_DARK_RED}</option>
							  <option style="color:red; background-color: {T_TD_COLOR1}" value="red" class="genmed">{L_COLOR_RED}</option>
							  <option style="color:orange; background-color: {T_TD_COLOR1}" value="orange" class="genmed">{L_COLOR_ORANGE}</option>
							  <option style="color:brown; background-color: {T_TD_COLOR1}" value="brown" class="genmed">{L_COLOR_BROWN}</option>
							  <option style="color:yellow; background-color: {T_TD_COLOR1}" value="yellow" class="genmed">{L_COLOR_YELLOW}</option>
							  <option style="color:green; background-color: {T_TD_COLOR1}" value="green" class="genmed">{L_COLOR_GREEN}</option>
							  <option style="color:olive; background-color: {T_TD_COLOR1}" value="olive" class="genmed">{L_COLOR_OLIVE}</option>
							  <option style="color:cyan; background-color: {T_TD_COLOR1}" value="cyan" class="genmed">{L_COLOR_CYAN}</option>
							  <option style="color:blue; background-color: {T_TD_COLOR1}" value="blue" class="genmed">{L_COLOR_BLUE}</option>
							  <option style="color:darkblue; background-color: {T_TD_COLOR1}" value="darkblue" class="genmed">{L_COLOR_DARK_BLUE}</option>
							  <option style="color:indigo; background-color: {T_TD_COLOR1}" value="indigo" class="genmed">{L_COLOR_INDIGO}</option>
							  <option style="color:violet; background-color: {T_TD_COLOR1}" value="violet" class="genmed">{L_COLOR_VIOLET}</option>
							  <option style="color:white; background-color: {T_TD_COLOR1}" value="white" class="genmed">{L_COLOR_WHITE}</option>
							  <option style="color:black; background-color: {T_TD_COLOR1}" value="black" class="genmed">{L_COLOR_BLACK}</option>
							</select> &nbsp;{L_FONT_SIZE}:<select name="addbbcode20" onchange="bbfontstyle('[size=' + this.form.addbbcode20.options[this.form.addbbcode20.selectedIndex].value + ']', '[/size]')" onmouseover="helpline('f')">
							  <option value="7" class="genmed">{L_FONT_TINY}</option>
							  <option value="9" class="genmed">{L_FONT_SMALL}</option>
							  <option value="12" selected="selected" class="genmed">{L_FONT_NORMAL}</option>
							  <option value="18" class="genmed">{L_FONT_LARGE}</option>
							  <option  value="24" class="genmed">{L_FONT_HUGE}</option>
							</select>
							</span></td>
						  <td nowrap="nowrap" align="right"><span class="gensmall"><a href="javascript:bbstyle(-1)" class="genmed" onmouseover="helpline('a')">{L_BBCODE_CLOSE_TAGS}</a></span></td>
						</tr>
					  </table>
					</td>
				  </tr>
		<!-- BEGIN switch_is_popup -->
				  <tr>
					<td colspan="9"> <span class="gensmall">
					  <input type="text" name="helpbox" size="45" maxlength="100" style="font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
					  </span></td>
				  </tr>
				  <tr>
					<td colspan="9"><span class="gen">
					  <textarea name="message" rows="15" cols="35" tabindex="6" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
					  </span></td>
				  </tr>
		<!-- END switch_is_popup -->
		<!-- BEGIN switch_not_popup -->
				  <tr>
					<td colspan="9"> <span class="gensmall">
					  <input type="text" name="helpbox" size="45" maxlength="100" style="width: 450px; font-size:10px" class="helpline" value="{L_STYLES_TIP}" />
					  </span></td>
				  </tr>
				  <tr>
					<td colspan="9"><span class="gen">
					  <textarea name="message" rows="15" cols="45" tabindex="6" style="width: 450px" class="post" onselect="storeCaret(this);" onclick="storeCaret(this);" onkeyup="storeCaret(this);">{MESSAGE}</textarea>
					  </span></td>
				  </tr>
		<!-- END switch_not_popup -->
				</table>
				</td>
			</tr>

#
#-----[ REPLACE WITH ]-----
#
				  <tr> 
				    <td><span class="gen"><b>{L_MESSAGE_BODY}</b></span> </td>
				  </tr>
				  <tr>
					<td valign="center" align="center"> <br /><br /><br /><br />
					  <table width="100" border="0" cellspacing="0" cellpadding="5">
						<tr align="center">
						  <td colspan="{S_SMILIES_COLSPAN}" class="gensmall"><b>{L_EMOTICONS}</b></td>
						</tr>
						<!-- BEGIN smilies_row -->
						<tr align="center" valign="middle">
						  <!-- BEGIN smilies_col -->
						  <td><span style="CURSOR:hand;CURSOR:Pointer;" onmousedown="if(editor_type=='1'){WriteHTML('<img src={smilies_row.smilies_col.SMILEY_IMG}>','editor');}else{WriteTEXT('[IMG]{smilies_row.smilies_col.SMILEY_IMG}[/IMG]','editor');}"><img src="{smilies_row.smilies_col.SMILEY_IMG}" border="0" alt="{smilies_row.smilies_col.SMILEY_DESC}" title="{smilies_row.smilies_col.SMILEY_DESC}" /></span></td>
						  <!-- END smilies_col -->
						</tr>
						<!-- END smilies_row -->
						<!-- BEGIN switch_smilies_extra -->
						<tr align="center">
						  <td colspan="{S_SMILIES_COLSPAN}"><span  class="nav"><a href="{U_MORE_SMILIES}" onclick="window.open('{U_MORE_SMILIES}', '_phpbbsmilies', 'HEIGHT=300,resizable=yes,scrollbars=yes,WIDTH=250');return false;" target="_phpbbsmilies" class="nav">{L_MORE_SMILIES}</a></span></td>
						</tr>
						<!-- END switch_smilies_extra -->
					  </table>
					</td>
				  </tr>
				</table>
			  </td>
			  <td class="row2" valign="top"> 
			    <table border="0" cellspacing="0" cellpadding="2">
			    <!-- //EDITOR - REMOVE ORIGINAL BBCODE BUTTONS -->
				  <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 ]-----
#
DEMO:
http://218.161.28.134/phpbb2/weblog_entry.php?e=165

圖檔

圖檔
施比受有福,歡迎來信賜教,謝謝 & 再見!
祝福您 好運 ^_^
歡迎加入★★心靈捕手★★ :: 討論區!!
http://wang5555.hopto.org/phpBB3/
p.s. 奉老婆之命:在晚上十一點前,得關機睡覺!!!

主題已鎖定

回到「非官方認證外掛」