已經安裝使用 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