Nazwa : Mod's notice
Autor: quba <
[email protected] > (Jakub Bomba) http://m-forum.pl
Opis modyfikacji: Jest to system dopiskow do postow, ktore udostepnione sa tylko adminom oraz modom. Glowna zaleta to brak możliwości edycji dopisku admina przez usera. Kolory i rozmiary dopisków oczywiscie mozna konfigurowac w PA. Dodatkowo możliwość całkowitego wyłaczenia moda oraz automatycznego dodawania nicku usera po notatce.
Screen:
Download: w załączniku są pliki do wgrania, a tutaj daje instrukcje.
#
#--[ SQL ]-------------------
#
ALTER TABLE `phpbb_posts_text` ADD `mods_notice` text;
ALTER TABLE `phpbb_posts` ADD `notice` INT( 1 ) UNSIGNED DEFAULT '0';
INSERT INTO `phpbb_config` VALUES ('mn_on', '1');
INSERT INTO `phpbb_config` VALUES ('mn_admin_color', 'red');
INSERT INTO `phpbb_config` VALUES ('mn_mod_color', 'green');
INSERT INTO `phpbb_config` VALUES ('mn_admin_size', '9');
INSERT INTO `phpbb_config` VALUES ('mn_mod_size', '9');
INSERT INTO `phpbb_config` VALUES ('mn_add_nick', '1');
#
#-----[ COPY ]-------------------------------------------
#
copy mods_notice.php to /mods_notice.php
copy mods_notice_body.tpl to templates/NAZWA STYLU/mods_notice_body.tpl
copy mods_notice_delete.gif to templates/NAZWA STYLU/images/mods_notice_delete.gif
copy mods_notice_edit.gif to templates/NAZWA STYLU/images/mods_notice_edit.gif
copy mods_notice_add.gif to templates/NAZWA STYLU/images/mods_notice_add.gif
#
#--[ OPEN ]------------------
#
viewtopic.php
#
#--[ FIND ]----------
#
pt.bbcode_uid
#
#--[ IN LINE AFTER, ADD ]----
#
, pt.mods_notice
#
#--[ FIND ]-----------
#
$show_post = (!$postrow[$i]['post_approve'] && $forum_view_moderate ) ? false : true;
#
#--[ AFTER, ADD ]------------------
#
if( $is_auth['auth_mod'] && $board_config['mn_on'] || ($userdata['user_jr'] == 1) )
{
$mods_notice_img = '';
if ($postrow[$i]['mods_notice'] )
{
$mods_notice_img = '';
$temp_url = append_sid("mods_notice.$phpEx?mode=delete&post_mods_notice=".$postrow[$i]['post_id']);
}
if ($postrow[$i]['mods_notice'] )
{
$mods_notice_del_img = '';
}
else
$mods_notice_del_img = '';
}
else
{
$mods_notice_img = '';
$mods_notice_del_img = '';
}
#
#--[ FIND ]------------------
#
$message = $postrow[$i]['post_text'];
#
#--[ AFTER, ADD ]------------------
#
$mods_notice = stripslashes($postrow[$i]['mods_notice']);
#
#--[ FIND ]------------------
#
$message = ($board_config['allow_bbcode']) ? bbencode_second_pass($message, $bbcode_uid, $userdata['username']) : preg_replace("/\:$bbcode_uid/si", '', $message);
#
#--[ AFTER, ADD ]------------------
#
$mods_notice = bbencode_second_pass($mods_notice, $bbcode_uid);
#
#--[ FIND ]------------------
#
$message = smilies_pass($message);
#
#--[ AFTER, ADD ]------------------
#
$mods_notice = smilies_pass($mods_notice);
#
#--[ FIND ]------------------
#
'DELETE' => $delpost,
#
#--[ AFTER, ADD ]------------------
#
'MODS_NOTICE_ADD' => $mods_notice_img,
'MODS_NOTICE_DEL' => $mods_notice_del_img,
'MODS_NOTICE' => $mods_notice,
#
#--[ OPEN ]------------------
#
templates/NAZWA STYLU/viewtopic_body.tpl
#
#--[ FIND ]------------------
#
{postrow.IP_IMG}
#
#--[ IN-LINE AFTER, ADD ]----
#
{postrow.MODS_NOTICE_ADD} {postrow.MODS_NOTICE_DEL}
#
#--[ FIND ]------------------
#
{postrow.MESSAGE}
#
#--[ IN-LINE AFTER, ADD ]----
#
{postrow.MODS_NOTICE}
#
#--[ OPEN ]------------------
#
templates/NAZWA STYLU/NAZWA STYLU.cfg
#
#--[ FIND ]------------------
#
$images['topic_mod_delete'] =
#
#--[ AFTER, ADD ]------------------
#
$images['mods_notice_add'] = "$current_template_images/mods_notice_add.gif";
$images['mods_notice_edit'] = "$current_template_images/mods_notice_edit.gif";
$images['mods_notice_delete'] = "$current_template_images/mods_notice_delete.gif";
#
#--[ OPEN ]------------------
#
language/lang_polish/lang_main.php
#
#--[ FIND ]------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#--[ BEFORE, ADD ]------------------
#
//Mod's notice
$lang['add_notice'] = 'Dopisz się do tego posta';
$lang['mods_notice'] = 'Notatka moderatora';
$lang['no_parameters'] = 'Brak parametrów';
$lang['notice_text'] = 'Tekst notatki:';
$lang['empty_notice_text'] = 'Treć notaki nie została podana. Kliknij %sTutaj%s aby powrócić.';
$lang['notice_added'] = 'Notatka została dodana. Kliknij %sTutaj%s aby powrócić do tematu.';
$lang['edit_notice'] = 'Edytuj notatkę';
$lang['not_authorised'] = 'Nie jeste autoryzowany do dodawania notatek';
$lang['delete_notice'] = 'Usuń notatkę';
$lang['notice_deleted'] = 'Notatka została usunięta. Kliknij %sTutaj%s aby powrócić do tematu.';
#
#--[ OPEN ]------------------
#
language/lang_polish/lang_admin.php
#
#--[ FIND ]------------------
#
//
// That's all Folks!
// -------------------------------------------------
#
#--[ BEFORE, ADD ]------------------
#
//Mod's notice
$lang['mn_on'] = 'Wł±cz notatki na forum';
$lang['mn_admin_color'] = 'Kolor notatek admina';
$lang['mn_mod_color'] = 'Kolor notatek moderatora';
$lang['mn_admin_size'] = 'Rozmiar notatek admina';
$lang['mn_mod_size'] = 'Rozmiar notatek moderatora';
$lang['mn_admin_size_explain'] = 'Możesz wpisać wartoci od 1 do 24';
$lang['mn_mod_size_explain'] = 'Możesz wpisać wartoci od 1 do 24';
$lang['mn_add_nick'] = 'Dodawaj nick przy notatce';
#
#--[ OPEN ]------------------
#
includes/functions_post.php
#
#--[ FIND ]------------------
#
if ( $mode != 'editpost' )
{
$post_id = $db->sql_nextid();
update_config('lastpost', CR_TIME);
}
#
#--[ AFTER, ADD ]------------------
#
$sql = "SELECT pt.mods_notice, pt.bbcode_uid
FROM " . POSTS_TEXT_TABLE . " pt
WHERE pt.post_id = $post_id";
if ( !($result = $db->sql_query($sql)) )
{
message_die(GENERAL_ERROR, 'Could not obtain post information', '', __LINE__, __FILE__, $sql);
}
$mods_notice = $db->sql_fetchrow($result);
$mods_notice_text = $mods_notice['mods_notice'];
$mn_bbcode_uid = $mods_notice['bbcode_uid'];
$mods_notice_text = str_replace($mn_bbcode_uid , $bbcode_uid, $mods_notice_text);
#
#--[ FIND ]------------------
#
$sql = ($mode != 'editpost') ? "INSERT INTO " . POSTS_TEXT_TABLE . " (post_id, post_subject, bbcode_uid, post_text
#
#--[ IN-LINE FIND ]----------
#
, post_subject = '$post_subject'
#
#--[ IN-LINE AFTER, ADD ]----------
#
, mods_notice = '$mods_notice_text'
#
#-----[ OPEN ]------------------------------------------------
#
admin/admin_board.php
#
#-----[ FIND ]------------------------------------------------
#
'L_PUBLIC_DIRECTORY' => $lang['Public_category'],
#
#-----[ AFTER, ADD ]------------------------------------------
#
'MN_ADMIN_COLOR' => $new['mn_admin_color'],
'MN_MOD_COLOR' => $new['mn_mod_color'],
'MN_ADMIN_SIZE' => $new['mn_admin_size'],
'MN_MOD_SIZE' => $new['mn_mod_size'],
#
#-----[ FIND ]------------------------------------------------
#
'AA_CHECK_3' => ($new['allow_autologin'] == 3) ? ' selected="selected"' : '',
#
#-----[ AFTER, ADD ]------------------------------------------
#
'MN_ON_YES' => ( $new['mn_on'] ) ? "checked=\"checked\"" : "",
'MN_ON_NO' => ( !$new['mn_on'] ) ? "checked=\"checked\"" : "",
'MN_ADD_NICK_YES' => ( $new['mn_add_nick'] ) ? "checked=\"checked\"" : "",
'MN_ADD_NICK_NO' => ( !$new['mn_add_nick'] ) ? "checked=\"checked\"" : "",
#
#-----[ OPEN ]------------------------------------------------
#
templates/NAZWA STYLU/admin/board_config_body.tpl
#
#-----[ FIND ]------------------------------------------------
#
{L_OVERRIDE_STYLE}
{L_OVERRIDE_STYLE_EXPLAIN}
{L_YES} {L_NO}
#
#-----[ AFTER, ADD ]------------------------------------------
#
{L_MN_ON}
{L_YES} {L_NO}
{L_MN_ADD_NICK}
{L_YES} {L_NO}
{L_MN_ADMIN_COLOR}
{L_MN_MOD_COLOR}
{L_MN_ADMIN_SIZE}
{L_MN_ADMIN_SIZE_EXPLAIN}
{L_MN_MOD_SIZE}
{L_MN_MOD_SIZE_EXPLAIN}
#
#--[ SAVE/CLOSE ALL FILES ]--[/code] Pliki.rar