[外掛] WYSIWYG - Rich Text Editor (所見即所得)(Update 4.2)

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

版主: 版主管理群

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

[外掛] WYSIWYG - Rich Text Editor (所見即所得)(Update 4.2)

文章 心靈捕手 »

  • 前言
  • 檔頭說明
  • 外掛下載
  • 補充說明
前言:
這個外掛, 可以讓您的論壇, 多一個所見即所得的編輯器, 方便使用者在發表文章或私人訊息時, 可以切換使用.


檔頭說明:

代碼: 選擇全部

################################################################################################
## 
## FOR phpBB VERSION 2.0.17 - 2.0.18
##
## MOD Title: WYSIWYG - Rich Text Editor 3.0 for Post and Private Message 
## MOD Author: Jimbo Hong http://www.HotEditor.com 
## MOD Description:	It's time to turn <textarea> into a powerful Rich Text HTML Editor. 
##			Don't force your users to learn another set of markup tags. 
##			With this MOD you can format your posts or Private message 
##			just like you would in MS. FrontPage! 
## 
## MOD Version: 3.0 
## 
## Installation Level: Intermediate 
## Installation Time: 20 minutes 
## 
## Files To Edit (7) : 
## viewtopic.php + posting.php + privmsg.php + search
## includes/topic_review.php 
## templates/subSilver/overall_header.tpl + posting_body.tpl 
## 
## Included Files (2) : + templates/subSilver/posting_body_ie.tpl 
##			+ get_vars.php
##
## Included new Folder (1) : richedit 
## 
################################################################################################
外掛下載:
http://www.ecardmax.com/index.php


補充說明:
1. 安裝後, 您的論壇會有兩個編輯介面,
一個是所見即所得編輯器, 另一個則是原來預設的編輯介面.

若您使用所見即所得編輯器, 則原來的 bbcode 語法仍可適用;
但是很少人會這麼做, 除非是比較特別的 bbcode 語法.

2. 我之前安裝時, 它的 editor.js 編碼, 可以適用 big-5, utf-8 編碼語系的論壇;
但是後來的更新版本裡頭, 它的 editor.js 編碼, 便不再適用 big-5, utf-8 編碼語系的論壇.

代碼: 選擇全部

// Meta tag for Editor 
var meta_tag="<meta http-equiv='Content-Type' content='text/html; charset=windows-1252'>"; 
我曾經試過升級, 但是在編輯文章的介面, 會出現 'ScriptError';
所以我的論壇( big-5 碼)跟測試論壇( utf-8 碼) 都無法使用最新版本.

3. 最新版的外掛安裝說明 + 舊版的
ichedit\ + 正體中文化 + 修正
等, 打包在一起, 丟在 Giga, 檔案大小: 1031K.

http://home.gigigaga.com/wang5555adsl/p ... or_3.0.rar
最後由 心靈捕手 於 2007-06-19 15:55 編輯,總共編輯了 1 次。
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[分享] 使用經驗談

文章 心靈捕手 »

用了此外掛, 將近半年, 終於在今天將它解除;
在此與大家分享使用經驗.

1. 優點:
轉貼文章容易, 所見即所得, 不用做過多的字型設定.

2. 缺點:
因為它的編輯, 主要是轉換為 html 語法, 所以容易造成論壇的危機.

我昨天測試 '許功蓋' 時, 意外發現一個狀況:
(ps. 此現象與 '許功蓋' 的修定無關)
當我直接複製底下這篇文章後,
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930
進入資料庫-> 資料表 phpbb_posts_text
找到該篇文章後, 編輯修改內容, 按 '執行' 後,
它便取代了所有的文章.
(如圖)
圖檔

我猜想:
是所見即所得的編輯方法, 因為該文末用了一些語法, 而造成這種現象.

因此, 在今天將這個外掛暫時移除, 以免後患.
最後由 心靈捕手 於 2006-02-15 15:41 編輯,總共編輯了 1 次。
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[分享]使用經驗談_2

文章 心靈捕手 »

前言:

由於回覆網友問題, 經過測試論壇的測試,
發現之前發生的錯誤, 問題應該是出在資料庫的操作失當.
因此, 論壇恢復使用此外掛.

難得的經驗是:
在修改資料庫的資料之前, 務必備份.


常見問題與解決方法:

A. 超連結無法顯示新視窗
如果您利用 '所見即所得編輯器' 裡的「插入超連結」鈕, 以及直接寫上 url 的話,
那麼結果是超連結不會另開新視窗.

由於無法破解 richedit/editor.js 原始碼, 暫時無解.

解決方法:
在 '所見即所得編輯器' 裡直接用 [url] bbcode.
參考連結:
http://wang5555.dnsfor.me/phpbb2/viewtopic. ... 4935#34935

B. 重新編輯或引言回覆 -> 出現 HTML 原始碼
  1. 使用者以 '所見即所得編輯器' 發文
    • 使用者以 '所見即所得編輯器' 重新編輯 -> OK
    • 使用者以 '一般正常編輯介面' 重新編輯 -> 出現 HTML 原始碼, 修改後 OK
    • 回覆者以 '所見即所得編輯器' 引言回覆 -> OK
    • 回覆者以 '一般正常編輯介面' 引言回覆 -> 出現 HTML 原始碼, 修改後 OK
    參考連結:
    http://wang5555.dnsfor.me/phpbb2/viewtopic.php?t=16118 (修改前)
    http://wang5555.dnsfor.me/phpbb2/viewtopic.php?t=16122 (修改後)
  2. 使用者以 '一般正常編輯介面' 發文
    • 使用者以 '所見即所得編輯器' 重新編輯 -> OK
    • 使用者以 '一般正常編輯介面' 重新編輯 -> 出現 HTML 原始碼, 修改後 OK
    • 回覆者以 '所見即所得編輯器' 引言回覆 -> OK
    • 回覆者以 '一般正常編輯介面' 引言回覆 -> 出現 HTML 原始碼, 修改後 OK
    參考連結:
    http://wang5555.dnsfor.me/phpbb2/viewtopic.php?t=16121 (修改前)
    http://wang5555.dnsfor.me/phpbb2/viewtopic.php?t=16123 (修改後)
解決方法:
控制台-> 一般管理-> 基本組態-> 調整 '允許使用的 HTML 標籤'

代碼: 選擇全部

b,i,u,pre,font,table,tr,td,tbody,p,br,br /,a,img,span,strong,div
ps. 這些是一般經常出現的標籤, 僅提供參考; 請自行調整之.

C. 許功蓋衝碼問題
若是語系編碼為 big-5 者, 則發文會有 '許功蓋' 衝碼問題.

解決方法:
1. 建議修正:
http://phpbb-tw.net/phpbb/viewtopic.php?p=226930#226930

2. 補充修正:
#
#-----[ OPEN ]-----
#
posting.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

$message = str_replace('\\\',"&bkfls;",$message);
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

//$message = str_replace('\\\',"&bkfls;",$message);// 許功蓋
#
#-----[ OPEN ]-----
#
privmsg.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

$privmsg_message = str_replace('\\\',"&bkfls;",$privmsg_message);
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

//$privmsg_message = str_replace('\\\',"&bkfls;",$privmsg_message);// 許功蓋
#
#-----[ SAVE & CLOSE ]-----
#
#EoM
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[建議] 升級 phpbb 2.0.20 後的安裝應變

文章 心靈捕手 »

相關問題參考連結:
http://phpbb-tw.net/phpbb/viewtopic.php?p=243129#243129

--
原外掛安裝說明 (privmsg.php) 部份擷取:

代碼: 選擇全部

# 
#-----[ FIND around line number 1785 ]------------------------------------------ 
# 

	privmsg_subject = preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject);
	$privmsg_subject = str_replace('"', '"', $privmsg_subject);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	//EDITOR START HERE 

	$privmsg_message = str_replace ("#ed_op#","<",$privmsg_message);
	$privmsg_message = str_replace ("#ed_cl#",">",$privmsg_message);
	$privmsg_message = str_replace ("&","&",$privmsg_message);
	$privmsg_message = str_replace('"',""",$privmsg_message);
	$privmsg_message = str_replace('\\',"&bkfls;",$privmsg_message);
	$privmsg_message = str_replace ("<br />","",$privmsg_message);

	$editor_off = get_global_var("editor_off");
	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	if ($richedit != "0") {
		$privmsg_message = str_replace("\r\n","<br />",$privmsg_message);
		$privmsg_message = str_replace("<br><br />","<br>",$privmsg_message);
	}
	if ($editor_off == "0" && strpos($ua,"Gecko") ){
		$privmsg_message = str_replace("<br />", "", $privmsg_message);
	}

	//EDITOR END HERE

# 
#-----[ NEXT 2 LINE FIND ]------------------------------------------ 
# 

	$template->assign_vars(array(

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	//EDITOR START HERE
	'DISPLAY_EDITOR_OPTION' => $display_editor_option,
	//EDITOR END HERE
privmsg.php 這一段原始碼, 已經在後來升級 phpbb 2.0.20 時移除.

代碼: 選擇全部

#
#-----[ FIND ]---------------------------------------------
# Line 1743

	//
	// Send smilies to template
	//
	generate_smilies('inline', PAGE_PRIVMSGS);

#
#-----[ FIND ]---------------------------------------------
# Line 1748

	$privmsg_subject = preg_replace($html_entities_match, $html_entities_replace, $privmsg_subject);
	$privmsg_subject = str_replace('"', '"', $privmsg_subject);

#
#-----[ REPLACE WITH ]---------------------------------------------
# Just remove/delete the lines (replacing with an empty line)
Source: phpbb-2.0.19_to_2.0.20.txt

關於 privmsg.php 以下的應變, 提供您參考:

代碼: 選擇全部

# 
#-----[ FIND ]------------------------------------------ 
# 
	//
	// Send smilies to template
	//
	generate_smilies('inline', PAGE_PRIVMSGS);

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	//EDITOR START HERE 

	$privmsg_message = str_replace ("#ed_op#","<",$privmsg_message);
	$privmsg_message = str_replace ("#ed_cl#",">",$privmsg_message);
	$privmsg_message = str_replace ("&","&",$privmsg_message);
	$privmsg_message = str_replace('"',""",$privmsg_message);
	$privmsg_message = str_replace('\\',"&bkfls;",$privmsg_message);
	$privmsg_message = str_replace ("<br />","",$privmsg_message);

	$editor_off = get_global_var("editor_off");
	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	if ($richedit != "0") {
		$privmsg_message = str_replace("\r\n","<br />",$privmsg_message);
		$privmsg_message = str_replace("<br><br />","<br>",$privmsg_message);
	}
	if ($editor_off == "0" && strpos($ua,"Gecko") ){
		$privmsg_message = str_replace("<br />", "", $privmsg_message);
	}

	//EDITOR END HERE

# 
#-----[ NEXT 2 LINE FIND ]------------------------------------------ 
# 

	$template->assign_vars(array(

# 
#-----[ AFTER, ADD ]------------------------------------------ 
# 

	//EDITOR START HERE
	'DISPLAY_EDITOR_OPTION' => $display_editor_option,
	//EDITOR END HERE
ps.
因為 phpbb 版本更新, 所以所有的 'number' 只能當做是 '參考' 而已.
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[建議] 安裝最新 4.2 版

文章 心靈捕手 »

檔頭說明:

代碼: 選擇全部

##############################################################
## MOD Title: WYSIWYG - Rich Text Editor for posting HTML message
## MOD Author: eCardMAX.com < webmaster@ecardmax.com > (Jimbo Hong) http://ecardmax.com
## MOD Description: It's time to turn <textarea> into a powerful Rich Text HTML Editor. Don't force your users to learn another set of markup tags. With this MOD you can format your posts or Private message just like you would in MS. FrontPage! Our Rich Text Editor will work on all popular browsers such as: IE - FireFox - Netscape - Opera 9x 
## MOD Version: 4.2
##
## Installation Level: (Easy)
## Installation Time: 3 ~ 5 Minutes
## Files To Edit: 
##	includes/bbcode.php,
##	templates/subSilver/overall_header.tpl,
##	templates/subSilver/posting_body.tpl,
##	templates/subSilver/posting_smilies.tpl,
##	templates/subSilver/profile_add_body.tpl
##
## Included Files: 0
##	
## Included Folders: [richedit]
## License: http://opensource.org/licenses/gpl-license.php GNU General Public License v2
##############################################################
## For security purposes, please check: http://www.phpbb.com/mods/
## for the latest version of this MOD. Although MODs are checked
## before being allowed in the MODs Database there is no guarantee
## that there are no security problems within the MOD. No support
## will be given for MODs not found within the MODs Database which
## can be found at http://www.phpbb.com/mods/
##############################################################
## Author Notes:
## Please DO NOT install this MOD if you already installed "Rich Text Editor MOD" Version 2.0 and 3.0 (Same Author) which can be found here
## http://www.phpbb.com/phpBB/viewtopic.php?t=250813 and here http://www.phpbb.com/phpBB/viewtopic.php?t=168054
##
## THIS MOD has been tested with easymod and phpbb version 2.0.22 (You can use easymod to install this MOD)
##
## Upload folder [richedit] to phpbb main (root) folder (same location with file posting.php)
## Upload file set_default_editor.php to phpbb main (root) folder (same location with file posting.php)
## Upload file posting_body_ie.tpl to folder phpbb/templates/subSilver/posting_body_ie.tpl 
##############################################################
## MOD History:
##
##   2007-05-23 - Version 4.2
##   2007-05-05 - Version 4.1
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
補充說明:
個人一直有在注意此外掛升級的情況,
只是在 (含) 4.0 版以前, 在測試論壇的使用, 都不是挺順利,
所以一直沒有升級的打算.

此外掛自從 4.1 版之後, 已經跳脫之前的架構,
將所見即所得編輯器, 直接取代了原來論壇的編輯介面,
也就是說, 不再有讓使用者切換編輯器的選項.

安裝注意事項:
1.若您之前有安裝 (含) 4.0 以前版本, 則建議移除舊版後, 再安裝新版.
2. 若您之前有安裝 (含) 4.0 以前版本, 且試著由 phpBB 2.x 轉換至 phpBB 3.x
則可參考 [Hoteditor V4.2 for phpBB 3 RC1 Update from V.3.0]
資料夾裡頭的安裝說明, 讓您之前的資料可以正常顯示.

而最新 4.2 版, 具有幾個特色:
1. 安裝更為迅速, 便利, 若是全新安裝, 則有已修正檔案可以直接取代
2. 若在 phpBB 2.x 安裝, 則將來轉 phpBB 3.x 將較不易出錯
3. 目前此外掛相容 phpBB 3.x (測試中)
4. 相容瀏覽器: IE 5.5+, Firefox 1.0+, Mozilla 1.3+, Netscape 7+, Opera 9+ and Safari 1.3+

下載位址:
// 官方網站:
(HotEditor V.4.2 MOD for phpBB 2.0.22 and phpBB 3 RC1)
http://www.ecardmax.com/ehelpmax/download.php
// FireFront (hoteditor_phpbb_mod_4.2.zip)(含中文化)
http://files.filefront.com/hoteditor+ph ... einfo.html
ps.
1. 若不易下載, 則請利用 proxy.
http://phpbb-tw.net/phpbb/viewtopic.php?p=258193#258193
2. 抱歉! 打包時, 漏掉原始 /richedit/*.*, 相關檔案請自原作者網站下載.

官方討論:
http://www.phpbb.com/community/viewtopic.php?t=546265

測試論壇:
http://ecardmax.com/hoteditor_forums/phpbb3x
最後由 心靈捕手 於 2007-07-07 05:37 編輯,總共編輯了 2 次。
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[分享] WYSIWYG - Rich Text Editor 3.0 升級 4.2 成功經驗

文章 心靈捕手 »

已經安裝使用 3.0 版者, 若要升級成 4.2 版的話, 則可參考此文.

ps.
1. 前面回文提到要移除舊版, 其實可以全部保留, 只要部分移除即可.
2. 必須先完成 WYSIWYG - Rich Text Editor 4.2 檔案的上傳 (覆蓋) 與修改,
再補做以下的修改:
#
#-----[ OPEN ]-----
#
posting.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

	//$template->set_filenames(array(
	//    'body' => 'posting_body.tpl', 
	//    'pollbody' => 'posting_poll_body.tpl', 
	//    'reviewbody' => 'posting_topic_review.tpl')
	//);
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	$template->set_filenames(array(
	    'body' => 'posting_body.tpl', 
	    'pollbody' => 'posting_poll_body.tpl', 
	    'reviewbody' => 'posting_topic_review.tpl')
	);
#
#-----[ FIND ]-----
#

代碼: 選擇全部

	//EDITOR START HERE

	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	$cookie_editor =get_global_var("cookie_editor");

	if ($richedit != "0" && strpos($ua,"Windows") && strpos($ua,"MSIE") && !strpos($ua,"Opera") && $cookie_editor !="off" || strpos($ua,"Gecko") && $richedit != "0" && !strpos($ua,"Safari") && $cookie_editor !="off") {

		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 checked name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body_ie.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}
	else{
		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 checked name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no')\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}

	if (strpos($ua,"Opera") || strpos($ua,"Safari")) {
		$display_editor_option="";
	}

	//EDITOR END HERE
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	/*
	//EDITOR START HERE

	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	$cookie_editor =get_global_var("cookie_editor");

	if ($richedit != "0" && strpos($ua,"Windows") && strpos($ua,"MSIE") && !strpos($ua,"Opera") && $cookie_editor !="off" || strpos($ua,"Gecko") && $richedit != "0" && !strpos($ua,"Safari") && $cookie_editor !="off") {

		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 checked name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body_ie.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}
	else{
		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 checked name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no')\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}

	if (strpos($ua,"Opera") || strpos($ua,"Safari")) {
		$display_editor_option="";
	}

	//EDITOR END HERE
	*/
#
#-----[ FIND ]-----
#

代碼: 選擇全部

	'DISPLAY_EDITOR_OPTION' => $display_editor_option,
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	//'DISPLAY_EDITOR_OPTION' => $display_editor_option,
#
#-----[ OPEN ]-----
#
privmsg.php

#
#-----[ FIND ]-----
#

代碼: 選擇全部

	//$template->set_filenames(array(
	//'body' => 'posting_body.tpl')
	//);
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	$template->set_filenames(array(
	'body' => 'posting_body.tpl')
	);
#
#-----[ FIND ]-----
#

代碼: 選擇全部

	//EDITOR START HERE

	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	$cookie_editor =get_global_var("cookie_editor");

	if ($richedit != "0" && strpos($ua,"Windows") && strpos($ua,"MSIE") && !strpos($ua,"Opera") && $cookie_editor !="off" || strpos($ua,"Gecko") && $richedit != "0" && !strpos($ua,"Safari") && $cookie_editor !="off") {

		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 checked name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body_ie.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}
	else{
		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 checked name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no')\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}

	if (strpos($ua,"Opera") || strpos($ua,"Safari")) {
		$display_editor_option="";
	}

	//EDITOR END HERE
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	/*
	//EDITOR START HERE

	$richedit = get_global_var("richedit");
	$ua = get_global_var("user_agent");
	$cookie_editor =get_global_var("cookie_editor");

	if ($richedit != "0" && strpos($ua,"Windows") && strpos($ua,"MSIE") && !strpos($ua,"Opera") && $cookie_editor !="off" || strpos($ua,"Gecko") && $richedit != "0" && !strpos($ua,"Safari") && $cookie_editor !="off") {

		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 checked name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no');\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body_ie.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}
	else{
		$display_editor_option = "<span class=gen>\n";
		$display_editor_option .= "<input type=radio value=1 name=richedit onClick='set_cookie(\"on\")'>Click here to set Rich Text Editor as your default<br>\n";
		$display_editor_option .= "<input type=radio value=0 checked name=richedit onClick='set_cookie(\"off\")'>Click here to set normal Text Area as your default\n";
		$display_editor_option .= "</span>\n";
		$display_editor_option .= "<script language=javascript>\n";
		$display_editor_option .= "function set_cookie(data){\n";
		$display_editor_option .= "popup=window.open('getvars.php?step=set_default&editor=' + data, 'hoteditor', 'height=300,width=300,status=no,toolbar=no,menubar=no,location=no,scrollbars=no')\n";
		$display_editor_option .= "popup.focus();\n";
		$display_editor_option .= "}\n";
		$display_editor_option .= "</script>\n";

		$template->set_filenames(array(
			'body' => 'posting_body.tpl', 
			'pollbody' => 'posting_poll_body.tpl', 
			'reviewbody' => 'posting_topic_review.tpl')
		);
	}

	if (strpos($ua,"Opera") || strpos($ua,"Safari")) {
		$display_editor_option="";
	}

	//EDITOR END HERE
	*/
#
#-----[ FIND ]-----
#

代碼: 選擇全部

	'DISPLAY_EDITOR_OPTION' => $display_editor_option,
#
#-----[ REPLACE WITH ]-----
#

代碼: 選擇全部

	//'DISPLAY_EDITOR_OPTION' => $display_editor_option,
#
#-----[ OPEN ]-----
#
templates/subSilver/overall_header.tpl

#
#-----[ FIND ]-----
#

代碼: 選擇全部

.postbody { font-size : {T_FONTSIZE3}px; line-height: 24px}
#
#-----[ REPLACE WITH ]------------------------------------------
#

代碼: 選擇全部

.postbody { font-size : {T_FONTSIZE3}px; line-height: 18px}
#
#-----[ SAVE & CLOSE ]-----
#
#EOM

DEMO:
http://wang5555.dnsfor.me/phpbb2/posting.ph ... topic&f=35
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

[建議] 安裝 4.2 版, 修改 profile_add_body.tpl 安裝步驟

文章 心靈捕手 »

最初安裝此外掛時, 是在測試論壇 (phpbb 2.0.22)
直接使用其已修改的檔案, 安裝, 測試; 並無發現此問題.

但是經網友提出分享, 使用 '個人資料' 編輯時, 發現有誤 - 資料無法寫入.
http://phpbb-tw.net/phpbb/viewtopic.php?t=49223

發現問題出在
安裝說明 (Hoteditor V4.2 for phpBB 2.0.22/Hoteditor_Mod.txt)
少了一個步驟; 而其中的語法, 則重複了一段.

以下為 Hoteditor_Mod.txt 部分內容

代碼: 選擇全部

#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
# ~ line number 128

<textarea name="signature" style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>

#
#-----[ REPLACE WITH ]------------------------------------------
#

<!-- //EDITOR JAVASCRIPT CODE -->
<textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" name="signature" id="signature" rows="6" cols="30" class="post">{SIGNATURE}</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("signature").value;
	Instantiate("min","editor", getdata , "100%", "200px");
	//For Vietnamese User. Edit file editor.js to enable vietnamese keyboard
	if(enable_vietnamese_keyboard==1){
		document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\"richedit/avim.js\"><\/script>");
		var hoteditor_avim_method = hot_readCookie("hoteditor_avim_method");var him_auto_checked="";var him_telex_checked="";var him_vni_checked="";var him_viqr_checked="";var him_viqr2_checked="";var him_off_checked="";if(hoteditor_avim_method=="0"){him_auto_checked="checked";}else if(hoteditor_avim_method=="1"){him_telex_checked="checked";}else if(hoteditor_avim_method=="2"){him_vni_checked="checked";}else if(hoteditor_avim_method=="3"){him_viqr_checked="checked";}else if(hoteditor_avim_method=="4"){him_viqr2_checked="checked";}else if(hoteditor_avim_method=="-1"){him_off_checked="checked";}
		document.write("<div style='width:100%;text-align:center;font-family:Verdana;font-size:11px;'><input "+him_auto_checked+" id=him_auto onclick=setMethod(0); type=radio name=viet_method> Auto :: <input "+him_telex_checked+" id=him_telex onclick=setMethod(1); type=radio name=viet_method> Telex :: <input "+him_vni_checked+" id=him_vni onclick=setMethod(2); type=radio name=viet_method> VNI :: <input "+him_viqr_checked+" id=him_viqr onclick=setMethod(3); type=radio name=viet_method> VIQR :: <input "+him_viqr2_checked+" id=him_viqr2 onclick=setMethod(4); type=radio name=viet_method> VIQR* :: <input "+him_off_checked+" id=him_off onclick=setMethod(-1); type=radio name=viet_method> Off<br><img src="+styles_folder_path+"/vietnamese_symbol.gif></div>");
	}
	//For Vietnamese User. Edit file editor.js to enable vietnamese keyboard
	if(enable_vietnamese_keyboard==1){
		document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\"richedit/avim.js\"><\/script>");
		var hoteditor_avim_method = hot_readCookie("hoteditor_avim_method");var him_auto_checked="";var him_telex_checked="";var him_vni_checked="";var him_viqr_checked="";var him_viqr2_checked="";var him_off_checked="";if(hoteditor_avim_method=="0"){him_auto_checked="checked";}else if(hoteditor_avim_method=="1"){him_telex_checked="checked";}else if(hoteditor_avim_method=="2"){him_vni_checked="checked";}else if(hoteditor_avim_method=="3"){him_viqr_checked="checked";}else if(hoteditor_avim_method=="4"){him_viqr2_checked="checked";}else if(hoteditor_avim_method=="-1"){him_off_checked="checked";}
		document.write("<div style='width:100%;text-align:center;font-family:Verdana;font-size:11px;'><input "+him_auto_checked+" id=him_auto onclick=setMethod(0); type=radio name=viet_method> Auto :: <input "+him_telex_checked+" id=him_telex onclick=setMethod(1); type=radio name=viet_method> Telex :: <input "+him_vni_checked+" id=him_vni onclick=setMethod(2); type=radio name=viet_method> VNI :: <input "+him_viqr_checked+" id=him_viqr onclick=setMethod(3); type=radio name=viet_method> VIQR :: <input "+him_viqr2_checked+" id=him_viqr2 onclick=setMethod(4); type=radio name=viet_method> VIQR* :: <input "+him_off_checked+" id=him_off onclick=setMethod(-1); type=radio name=viet_method> Off<br><img src="+styles_folder_path+"/vietnamese_symbol.gif></div>");
	}
	function get_hoteditor_data(){
		setCodeOutput();
		var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
		document.getElementById("signature").value = bbcode_output;
	}
</script>
<!-- //EDITOR -->
以下為比對 preset_files_phpbb_2.0.22/templates/subSilver/profile_add_body.tpl
修改的步驟:
#
#-----[ OPEN ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl

#
#-----[ FIND ]------------------------------------------
# ~ line number 128

代碼: 選擇全部

		<textarea name="signature" style="width: 300px" rows="6" cols="30" class="post">{SIGNATURE}</textarea>
#
#-----[ REPLACE WITH ]------------------------------------------
#

代碼: 選擇全部

		<!-- //EDITOR -->
		<textarea style="visibility:hidden;position:absolute;top:-20;left:-20;width:1px;height:1px" name="signature" id="signature" rows="6" cols="30" class="post">{SIGNATURE}</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("signature").value;
			Instantiate("min","editor", getdata , "100%", "200px");	
			//For Vietnamese User. Edit file editor.js to enable vietnamese keyboard
			if(enable_vietnamese_keyboard==1){
				document.write("<script language=\"JavaScript\" type=\"text/javascript\" src=\"richedit/avim.js\"><\/script>");
				var hoteditor_avim_method = hot_readCookie("hoteditor_avim_method");var him_auto_checked="";var him_telex_checked="";var him_vni_checked="";var him_viqr_checked="";var him_viqr2_checked="";var him_off_checked="";if(hoteditor_avim_method=="0"){him_auto_checked="checked";}else if(hoteditor_avim_method=="1"){him_telex_checked="checked";}else if(hoteditor_avim_method=="2"){him_vni_checked="checked";}else if(hoteditor_avim_method=="3"){him_viqr_checked="checked";}else if(hoteditor_avim_method=="4"){him_viqr2_checked="checked";}else if(hoteditor_avim_method=="-1"){him_off_checked="checked";}
				document.write("<div style='width:100%;text-align:center;font-family:Verdana;font-size:11px;'><input "+him_auto_checked+" id=him_auto onclick=setMethod(0); type=radio name=viet_method> Auto :: <input "+him_telex_checked+" id=him_telex onclick=setMethod(1); type=radio name=viet_method> Telex :: <input "+him_vni_checked+" id=him_vni onclick=setMethod(2); type=radio name=viet_method> VNI :: <input "+him_viqr_checked+" id=him_viqr onclick=setMethod(3); type=radio name=viet_method> VIQR :: <input "+him_viqr2_checked+" id=him_viqr2 onclick=setMethod(4); type=radio name=viet_method> VIQR* :: <input "+him_off_checked+" id=him_off onclick=setMethod(-1); type=radio name=viet_method> Off<br><img src="+styles_folder_path+"/vietnamese_symbol.gif></div>");
			}
			function get_hoteditor_data(){
				setCodeOutput();
				var bbcode_output=document.getElementById("hoteditor_bbcode_ouput_editor").value;//Output to BBCode
				document.getElementById("signature").value = bbcode_output;
			}
		</script>
		<!-- //EDITOR -->
#
#-----[ FIND ]------------------------------------------
#

代碼: 選擇全部

		<td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" name="submit" value="{L_SUBMIT}" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="liteoption" /></td>
#
#-----[ REPLACE WITH ]------------------------------------------
#

代碼: 選擇全部

		<!-- //EDITOR - Add onclick="get_hoteditor_data();" to button submit -->
		<td class="catBottom" colspan="2" align="center" height="28">{S_HIDDEN_FIELDS}<input type="submit" onclick="get_hoteditor_data();" name="submit" value="{L_SUBMIT}" class="mainoption" />&nbsp;&nbsp;<input type="reset" value="{L_RESET}" name="reset" class="liteoption" /></td>
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
頭像
心靈捕手
默默耕耘的老師
默默耕耘的老師
文章: 8510
註冊時間: 2004-04-30 01:54
來自: Taiwan

Re: [外掛] WYSIWYG - Rich Text Editor (所見即所得)(Update 4.2)

文章 心靈捕手 »

此外掛最新版, 仍是 4.2 (20080116);
只是 editor.js 有更新編譯, 其餘不變.


下載位址: HotEditor V.4.2 MOD for phpBB 2.0.22 and phpBB 3 Gold (Jan 16, 2008)
http://www.ecardmax.com/index.php?step=Hoteditor2phpbb
http://www.ecardmax.com/ehelpmax/index. ... wnload.php

中文化分享:
將此資料夾中的檔案, 覆蓋原來路徑下的檔案, 即可使用.
richedit/editor.js
richedit/show_it.php

此中文化採用 utf-8 (未含 BOM) 編碼;
存檔時, 請注意您論壇語系的編碼務必一致.

其餘, 詳見 readme.txt
附加檔案
hoteditor_tw.zip
editor.js 20080116
(28.74 KiB) 已下載 1052 次
施比受有福,祝福您好運! ^_^
歡迎光臨★★心靈捕手★★ :: 討論區
https://wang5555.dnsfor.me/phpBB3/
主題已鎖定

回到「非官方認證外掛」