只是無法回覆加上只好另開一篇
版本:1.4.9
檔案大小:21 Kb
適用phpBB版本:2.0.6 - 2.0.22
載點:(發現與Personal Notes 1.4.8 日記本載點一樣,只是裡面版本更新了)
http://www.phpbbhacks.com/download/1524
文件檔我稍做了點繁化僅供參考....(小弟的第一次0.0)
代碼: 選擇全部
##############################################################
## MOD Title: Personal Notes
## MOD Author: OXPUS < webmaster@oxpus.de > (Karsten Ude) http://www.oxpus.de
## MOD Description: Want personal notes? Here it is...
## HTML is disabled, Smilies, BBCodes and Acronyms are possible ;-)
## Users can decide between popup or normal page for notes.
## On ACP can be set how many notes every user can have.
## Default notes per user are set to 20.
## MOD Version: 1.4.9
##
## Installation Level: Intermediate
## Installation Time: 10 分鐘
## Files To Edit: 12
## admin/admin_board.php
## admin/admin_users.php
## includes/constants.php
## includes/page_header.php
## includes/usercp_avatar.php
## includes/usercp_register.php
## language/lang_english/lang_main.php
## language/lang_english/lang_admin.php
## templates/subSilver/admin/board_config_body.tpl
## templates/subSilver/admin/user_edit_body.tpl
## templates/subSilver/overall_header.tpl
## templates/subSilver/profile_add_body.tpl
##
## Included Files: 4
## root/notes.php
## root/posting_notes.php
## root/templates/subSilver/notes_body.tpl
## root/templates/subSilver/posting_notes_body.tpl
##
## 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:
##
## If you uses an other language as english, too, look into the folder translations!
##
##############################################################
## MOD History:
##
## 2007-01-08 Version 1.4.9
## - 修正 一些 HTML 的錯誤
## - 修正 MOD package structur
## - 修正 Replace Popup URL with phpBB like placeholder
## - SPLIT German language to extra instructions
## For update look into the folder updates.
##
## 2006-05-08 Version 1.4.8
## - 新增 關閉 "沒有記事本" 訊息
## For update replace notes.php and notes_body.tpl and update lang_main.php.
##
## 2005-04-09 Version 1.4.7
## - 修正 安全性問題
## For update replace posting_notes.php.
##
## 2004-06-18 Version 1.4.6
## - 修正 解析 html 連接
## For update replace notes.php and posting_notes.php.
##
## 2004-04-03 Version 1.4.5
## - 新增 input popup for entering url's. For update replace templates/subSilver/posting_notes_body.tpl
##
## 2004-03-31 Version 1.4.4
## - 修正 SQL
##
## 2004-03-26 Version 1.4.3
## - 修正 在posting的小臭蟲. 更新至 1.4.3 替換 posting_notes.php
##
## 2004-03-08 Version 1.4.2
## (For updating from 1.4.1 to 1.4.2 replace posting_notes.php, notes_body.tpl, posting_notes_body.tpl)
## - Replace "Close Window" and "Cancel" with buttons
##
## 2004-02-12 Version 1.4.1
## (For updating from 1.4.0 to 1.4.1 just replace posting_notes.php and posting_notes_body.tpl)
## - 修正 typo on posting notes
## - Hide BBCode buttons when BBCodes are disabled
##
## 2004-02-12 Version 1.4.0
## (For updating from 1.3.x to 1.4.0 just replace all files provided in this mod)
## - Replace HTML with BBCodes
## - User can disable bbcodes, smilies and acronyms for each note
## - 新增 筆記排序
## - Add searching in notes and highlighting the search keywords
##
## 2004-02-08 Version 1.3.4
## - 修正 一個錯字在 HowTo
##
## 2004-01-28 Version 1.3.3
## - 修正 URL Spoofing. 更新替換 posting_notes.php.
##
## 2004-01-25 Version 1.3.2
## - Passed through phpBB.com Mod Validator
##
## 2004-01-22 Version 1.3.1
## - 沒有代碼變動. Only a fix for the layout on notes.php and notes_body.tpl.
## Just replace this files.
##
## 2004-01-08 Version 1.3.0
## - Add predefined HTML-Tags to insert by mouseklick in the note
## - For update just replace posting_notes.php and templates/subSilver/posting_notes_body.tpl
##
## 2003-12-30 - Version 1.2.1
## - 重寫 HowTo
##
## 2003-12-19 - Version 1.2.0
## - User can switch between popup or normal page for notes
##
## 2003-??-?? - Version 1.1.0
## - 可以使用 Smilies, Acronyms and URLs
##
## 2003-??-?? - Version 1.0.3
## - 修正 一個安全臭蟲 (THX @EGO2000)
##
## 2003-??-?? - Version 1.0.2
## - Missing 2 functions for posting notes (older phpBB)
##
## 2003-??-?? - Version 1.0.1
## - Block anonymous users and redirect to login
##
## 2003-??-?? - Version 1.0.0
## - 初始版本
##
##############################################################
## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD
##############################################################
#
#-----[ 執行以下SQL碼 ]------------------------------------------
#
CREATE TABLE phpbb_notes (
post_id mediumint(8) unsigned NOT NULL auto_increment,
poster_id mediumint(8) NOT NULL DEFAULT '0',
post_subject varchar(60) DEFAULT NULL,
post_text text,
post_time int(11) NOT NULL DEFAULT '0',
bbcode_uid varchar(10) DEFAULT NULL,
bbcode TINYINT(1) DEFAULT '1' NOT NULL,
smilies TINYINT(1) DEFAULT '1' NOT NULL,
acronym TINYINT(1) DEFAULT '1' NOT NULL,
PRIMARY KEY (post_id),
KEY poster_id (poster_id),
KEY post_time (post_time)
) TYPE=MyISAM;
INSERT INTO phpbb_config ( config_name , config_value ) VALUES ('notes', '20');
ALTER TABLE phpbb_users ADD user_popup_notes TINYINT(1) DEFAULT '0';
#
#-----[ 複製檔案 ]------------------------------------------
#
複製 root/notes.php 到 notes.php
複製 root/posting_notes.php 到 posting_notes.php
複製 root/templates/subSilver/notes_body.tpl 到 templates/subSilver/notes_body.tpl
複製 root/templates/subSilver/posting_notes_body.tpl 到 templates/subSilver/posting_notes_body.tpl
#
#-----[ 開啟 ]------------------------------------------
#
includes/constants.php
#
#-----[ 搜尋 ]------------------------------------------
#
define('POSTS_TABLE', $table_prefix.'posts');
#
#-----[ 之後增加 ]------------------------------------------
#
define('NOTES_TABLE', $table_prefix.'notes');
#
#-----[ 開啟 ]------------------------------------------
#
includes/page_header.php
#
#-----[ 搜尋 ]------------------------------------------
#
//
// Generate HTML required for Mozilla Navigation bar
//
#
#-----[ 之前增加 ]------------------------------------------
#
if ( $userdata['user_popup_notes'] == TRUE )
{
$u_notes = "javascript:notes()";
$u_notes_popup = append_sid('notes.'.$phpEx);
}
else
{
$u_notes = append_sid('notes.'.$phpEx);
$u_notes_popup = '';
}
#
#-----[ 搜尋 ]------------------------------------------
#
'L_USERNAME' => $lang['Username'],
'L_PASSWORD' => $lang['Password'],
#
#-----[ 之後增加 ]------------------------------------------
#
'L_NOTES' => $lang['Notes'],
'U_NOTES' => $u_notes,
'U_NOTES_POPUP' => $u_notes_popup,
#
#-----[ 開啟 ]------------------------------------------
#
includes/usercp_avatar.php
#
#-----[ 搜尋 ]------------------------------------------
#
function display_avatar_gallery($mode, &$category, &$user_id, &$email, &$current_email, &$coppa, &$username, &$email, &$new_password, &$cur_password, &$password_confirm, &$icq, &$aim, &$msn, &$yim, &$website, &$location, &$occupation, &$interests, &$signature, &$viewemail, &$notifypm, &$popuppm, &$notifyreply, &$attachsig, &$allowhtml, &$allowbbcode, &$allowsmilies, &$hideonline, &$style, &$language, &$timezone, &$dateformat, &$session_id)
#
#-----[ 在內容搜尋 ]------------------------------------------
#
&$dateformat
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, &$popup_notes
#
#-----[ 搜尋 ]------------------------------------------
#
$params = array('coppa', 'user_id', 'username', 'email', 'current_email', 'cur_password', 'new_password', 'password_confirm', 'icq', 'aim', 'msn', 'yim', 'website', 'location', 'occupation', 'interests', 'signature', 'viewemail', 'notifypm', 'popuppm', 'notifyreply', 'attachsig', 'allowhtml', 'allowbbcode', 'allowsmilies', 'hideonline', 'style', 'language', 'timezone', 'dateformat');
#
#-----[ 在內容搜尋 ]------------------------------------------
#
'dateformat'
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, 'popup_notes'
#
#-----[ 開啟 ]------------------------------------------
#
includes/usercp_register.php
#
#-----[ 搜尋 ]------------------------------------------
#
$viewemail = ( isset($HTTP_POST_VARS['viewemail']) ) ? ( ($HTTP_POST_VARS['viewemail']) ? TRUE : 0 ) : 0;
#
#-----[ 之後增加 ]------------------------------------------
#
$popup_notes = ( isset($HTTP_POST_VARS['popup_notes']) ) ? ( ($HTTP_POST_VARS['popup_notes']) ? TRUE : 0 ) : 0;
#
#-----[ 搜尋 ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) ."', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_sig_bbcode_uid = '$signature_bbcode_uid', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_active = $user_active, user_actkey = '" . str_replace("\'", "''", $user_actkey) . "'" . $avatar_sql . "
#
#-----[ 在內容搜尋 ]------------------------------------------
#
$interests) . "'
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, user_popup_notes = $popup_notes
#
#-----[ 搜尋 ]------------------------------------------
#
$sql = "INSERT INTO " . USERS_TABLE . " (user_id, username, user_regdate, user_password, user_email, user_icq, user_website, user_occ, user_from, user_interests, user_sig, user_sig_bbcode_uid, user_avatar, user_avatar_type, user_viewemail, user_aim, user_yim, user_msnm, user_attachsig, user_allowsmile, user_allowhtml, user_allowbbcode, user_allow_viewonline, user_notify, user_notify_pm, user_popup_pm, user_timezone, user_dateformat, user_lang, user_style, user_level, user_allow_pm, user_active, user_actkey)
VALUES ($user_id, '" . str_replace("\'", "''", $username) . "', " . time() . ", '" . str_replace("\'", "''", $password) . "', '" . str_replace("\'", "''", $email) . "', '" . str_replace("\'", "''", $icq) . "', '" . str_replace("\'", "''", $website) . "', '" . str_replace("\'", "''", $occupation) . "', '" . str_replace("\'", "''", $location) . "', '" . str_replace("\'", "''", $interests) . "', '" . str_replace("\'", "''", $signature) . "', '$signature_bbcode_uid', $avatar_sql, $viewemail, '" . str_replace("\'", "''", str_replace(' ', '+', $aim)) . "', '" . str_replace("\'", "''", $yim) . "', '" . str_replace("\'", "''", $msn) . "', $attachsig, $allowsmilies, $allowhtml, $allowbbcode, $allowviewonline, $notifyreply, $notifypm, $popuppm, $user_timezone, '" . str_replace("\'", "''", $user_dateformat) . "', '" . str_replace("\'", "''", $user_lang) . "', $user_style, 0, 1, ";
#
#-----[ 在內容搜尋 ]------------------------------------------
#
user_interests
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, user_popup_notes
#
#-----[ 在內容搜尋 ]------------------------------------------
#
$interests) . "'
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, $popup_notes
#
#-----[ 搜尋 ]------------------------------------------
#
$viewemail = $userdata['user_viewemail'];
#
#-----[ 之後增加 ]------------------------------------------
#
$popup_notes = $userdata['user_popup_notes'];
#
#-----[ 搜尋 ]------------------------------------------
#
display_avatar_gallery($mode, $avatar_category, $user_id, $email, $current_email, $coppa, $username, $email, &$new_password, &$cur_password, $password_confirm, $icq, $aim, $msn, $yim, $website, $location, $occupation, $interests, $signature, $viewemail, $notifypm, $popuppm, $notifyreply, $attachsig, $allowhtml, $allowbbcode, $allowsmilies, $allowviewonline, $user_style, $user_lang, $user_timezone, $user_dateformat, $userdata['session_id']);
#
#-----[ 在內容搜尋 ]------------------------------------------
#
$user_dateformat
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, $popup_notes
#
#-----[ 搜尋 ]------------------------------------------
#
'INTERESTS' => $interests,
#
#-----[ 之後增加 ]------------------------------------------
#
'POPUP_NOTES_YES' => ( $popup_notes ) ? 'checked="checked"' : '',
'POPUP_NOTES_NO' => ( !$popup_notes ) ? 'checked="checked"' : '',
'L_POPUP_NOTES' => $lang['popup_notes'],
#
#-----[ 開啟 ]------------------------------------------
#
admin/admin_board.php
#
#-----[ 搜尋 ]------------------------------------------
#
"L_POSTS_PER_PAGE" => $lang['Posts_per_page'],
#
#-----[ 之後增加 ]------------------------------------------
#
"L_NOTES" => $lang['Notes_per_user'],
#
#-----[ 搜尋 ]------------------------------------------
#
"POSTS_PER_PAGE" => $new['posts_per_page'],
#
#-----[ 之後增加 ]------------------------------------------
#
"NOTES" => $new['notes'],
#
#-----[ 開啟 ]------------------------------------------
#
admin/admin_users.php
#
#-----[ 搜尋 ]------------------------------------------
#
$viewemail = ( isset( $HTTP_POST_VARS['viewemail']) ) ? ( ( $HTTP_POST_VARS['viewemail'] ) ? TRUE : 0 ) : 0;
#
#-----[ 之後增加 ]------------------------------------------
#
$popup_notes = ( isset( $HTTP_POST_VARS['popup_notes']) ) ? ( ( $HTTP_POST_VARS['popup_notes'] ) ? TRUE : 0 ) : 0;
#
#-----[ 搜尋 ]------------------------------------------
#
$sql = "UPDATE " . USERS_TABLE . "
SET " . $username_sql . $passwd_sql . "user_email = '" . str_replace("\'", "''", $email) . "', user_icq = '" . str_replace("\'", "''", $icq) . "', user_website = '" . str_replace("\'", "''", $website) . "', user_occ = '" . str_replace("\'", "''", $occupation) . "', user_from = '" . str_replace("\'", "''", $location) . "', user_interests = '" . str_replace("\'", "''", $interests) . "', user_sig = '" . str_replace("\'", "''", $signature) . "', user_viewemail = $viewemail, user_aim = '" . str_replace("\'", "''", $aim) . "', user_yim = '" . str_replace("\'", "''", $yim) . "', user_msnm = '" . str_replace("\'", "''", $msn) . "', user_attachsig = $attachsig, user_sig_bbcode_uid = '$signature_bbcode_uid', user_allowsmile = $allowsmilies, user_allowhtml = $allowhtml, user_allowavatar = $user_allowavatar, user_allowbbcode = $allowbbcode, user_allow_viewonline = $allowviewonline, user_notify = $notifyreply, user_allow_pm = $user_allowpm, user_notify_pm = $notifypm, user_popup_pm = $popuppm, user_lang = '" . str_replace("\'", "''", $user_lang) . "', user_style = $user_style, user_timezone = $user_timezone, user_dateformat = '" . str_replace("\'", "''", $user_dateformat) . "', user_active = $user_status, user_rank = $user_rank" . $avatar_sql . "
#
#-----[ 在內容搜尋 ]------------------------------------------
#
$interests) . "'
#
#-----[ 在搜尋到之後加入 ]------------------------------------------
#
, user_popup_notes = $popup_notes
#
#-----[ 搜尋 ]------------------------------------------
#
$viewemail = $this_userdata['user_viewemail'];
#
#-----[ 之後增加 ]------------------------------------------
#
$popup_notes = $this_userdata['user_popup_notes'];
#
#-----[ 搜尋 ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="viewemail" value="' . $viewemail . '" />';
#
#-----[ 之後增加 ]------------------------------------------
#
$s_hidden_fields .= '<input type="hidden" name="popup_notes" value="' . $popup_notes . '" />';
#
#-----[ 搜尋 ]------------------------------------------
#
'INTERESTS' => $interests,
#
#-----[ 之後增加 ]------------------------------------------
#
'POPUP_NOTES_YES' => ($popup_notes) ? 'checked="checked"' : '',
'POPUP_NOTES_NO' => (!$popup_notes) ? 'checked="checked"' : '',
'L_POPUP_NOTES' => $lang['popup_notes'],
#
#-----[ 開啟 ]------------------------------------------
#
language/lang_english/lang_main.php
#
#-----[ 搜尋 ]------------------------------------------
#
//
// That's all, Folks!
// -------------------------------------------------
#
#-----[ 之前增加 ]------------------------------------------
#
$lang['Notes'] = '記事本';
$lang['popup_notes'] = '在新視窗開啟記事本';
$lang['Acronym_on'] = '使用匿稱 <u>開啟</u>;
$lang['Disable_Acronym_post'] = '關閉在這文章匿稱';
$lang['Filter_notes'] = '記事本搜尋完畢. 再次按下搜尋鈕, 可顯示所有的筆記';
$lang['No_notes'] = '目前您沒有筆記';
#
#-----[ 開啟 ]------------------------------------------
#
language/lang_english/lang_admin.php
#
#-----[ 搜尋 ]------------------------------------------
#
?>
#
#-----[ 之前增加 ]------------------------------------------
#
$lang['Notes_per_user'] = '設置每位會員最大記事數量'';
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/overall_header.tpl
#
#-----[ 搜尋 ]------------------------------------------
#
</head>
#
#-----[ 之前增加 ]------------------------------------------
#
<script language="JavaScript" type="text/javascript">
<!--
function notes() {
window.open("{U_NOTES_POPUP}", "_blank", "width=800,height=600,scrollbars=yes,resizable=no");
}
//-->
</script>
#
#-----[ 搜尋 ]------------------------------------------
#
<td align="center" valign="top" nowrap="nowrap"><span class="mainmenu"> <a href="{U_FAQ}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_faq.gif" width="12" height="13" border="0" alt="{L_FAQ}" hspace="3" />{L_FAQ}</a></span><span class="mainmenu"> <a href="{U_SEARCH}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_search.gif" width="12" height="13" border="0" alt="{L_SEARCH}" hspace="3" />{L_SEARCH}</a> <a href="{U_MEMBERLIST}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_members.gif" width="12" height="13" border="0" alt="{L_MEMBERLIST}" hspace="3" />{L_MEMBERLIST}</a> <a href="{U_GROUP_CP}" class="mainmenu"><img src="templates/subSilver/images/icon_mini_groups.gif" width="12" height="13" border="0" alt="{L_USERGROUPS}" hspace="3" />{L_USERGROUPS}</a>
#
#-----[ 之後增加 ]------------------------------------------
#
<!-- BEGIN switch_user_logged_in -->
<a href="{U_NOTES}" class="mainmenu">{L_NOTES}</a>
<!-- END switch_user_logged_in -->
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/profile_add_body.tpl
#
#-----[ 搜尋 ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_INTERESTS}:</span></td>
<td class="row2">
<input type="text" class="post"style="width: 200px" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>
#
#-----[ 之後增加 ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_POPUP_NOTES}:</span></td>
<td class="row2">
<input type="radio" name="popup_notes" value="1" {POPUP_NOTES_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="popup_notes" value="0" {POPUP_NOTES_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/admin/board_config_body.tpl
#
#-----[ 搜尋 ]------------------------------------------
#
<tr>
<td class="row1">{L_POSTS_PER_PAGE}</td>
<td class="row2"><input class="post" type="text" name="posts_per_page" size="3" maxlength="4" value="{POSTS_PER_PAGE}" /></td>
</tr>
#
#-----[ 之後增加 ]------------------------------------------
#
<tr>
<td class="row1">{L_NOTES}</td>
<td class="row2"><input class="post" type="text" name="notes" size="3" maxlength="4" value="{NOTES}" /></td>
</tr>
#
#-----[ 開啟 ]------------------------------------------
#
templates/subSilver/admin/user_edit_body.tpl
#
#-----[ 搜尋 ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_INTERESTS}</span></td>
<td class="row2">
<input type="text" name="interests" size="35" maxlength="150" value="{INTERESTS}" />
</td>
</tr>
#
#-----[ 之後增加 ]------------------------------------------
#
<tr>
<td class="row1"><span class="gen">{L_POPUP_NOTES}</span></td>
<td class="row2">
<input type="radio" name="popup_notes" value="1" {POPUP_NOTES_YES} />
<span class="gen">{L_YES}</span>
<input type="radio" name="popup_notes" value="0" {POPUP_NOTES_NO} />
<span class="gen">{L_NO}</span></td>
</tr>
#
#-----[ SAVE/CLOSE ALL FILES ]------------------------------------------
#
# EoM

