################################################################# ## Mod Title: Message Icons ## Mod Version: 1.0.2 ## Author: steveurkel - http://www.austauschforum.de ## Description: Adds a message icon right before the topic title in viewforum.php ## and viewtopic.php to give user the possibility to show his/her ## meaning of his/her post. ## ## Installation Level: moderate ## Installation Time: 20 Minutes ## Files To Edit: posting.php ## includes/functions_post.php ## viewforum.php ## viewtopic.php ## language/lang_xxx/lang_main.php ## templates/subSilver/posting_body.tpl ## templates/subSilver/viewforum_body.tpl ## templates/subSilver/viewtopic_body.tpl ## ## Included Files: [optional]14 GIF-Files ################################################################# ## Security Disclaimer: This MOD Cannot Be Posted To Or Added At Any Non-Official phpBB Sites ################################################################# ## ## Author Note: ## This Mod assumes that you add 14 message icons. If you want more you have to ## adjust the number at the appropriate spots. ## You have to get the icons. ## ## Place the icons in a new folder images/icon. ## Name the icons icon1.gif, icon2.gif ... You get the idea. ## ## Special thanks go to Exciter who wrote the hack for phpBB 1.4.x since I used ## some of his ideas for this mod. ## ################################################################# ## Before Adding This MOD To Your Forum, You Should Back Up All Files Related To This MOD ################################################################# ## ## Revision History: ## ## v1.0.2 ## - added additional option, that no icon is shown ## ## v1.0.1 ## - renamed some variables to obey the phpBB Coding Standards. ## ## v1.0.0 ## - First Release and Final. ## ################################################################# # #-----[ DATABASE CHANGES ]------------------------------------------ # ALTER TABLE phpbb_posts ADD COLUMN post_icon TINYINT (2) UNSIGNED DEFAULT '0' NOT NULL; ALTER TABLE phpbb_topics ADD COLUMN topic_icon TINYINT (2) UNSIGNED DEFAULT '0' NOT NULL; # #-----[ OPEN ]------------------------------------------ # phpBB2/posting.php # #-----[ FIND ]------------------------------------------ # $refresh = $preview || $poll_add || $poll_edit || $poll_delete; # #-----[ AFTER, ADD ]------------------------------------------ # if ($msg_icon) $msg_icon_checked = $msg_icon; else $msg_icon_checked = 0; # #-----[ FIND ]------------------------------------------ # $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig" : ''; # #-----[ REPLACE WITH ]------------------------------------------ # $select_sql = ( !$submit ) ? ", t.topic_title, p.enable_bbcode, p.enable_html, p.enable_smilies, p.enable_sig, p.post_username, pt.post_subject, pt.post_text, pt.bbcode_uid, u.username, u.user_id, u.user_sig, p.post_icon" : ''; # #-----[ FIND ]------------------------------------------ # submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length); # #-----[ REPLACE WITH ]------------------------------------------ # submit_post($mode, $post_data, $return_message, $return_meta, $forum_id, $topic_id, $post_id, $poll_id, $topic_type, $bbcode_on, $html_on, $smilies_on, $attach_sig, $bbcode_uid, str_replace("\'", "''", $username), str_replace("\'", "''", $subject), str_replace("\'", "''", $message), str_replace("\'", "''", $poll_title), $poll_options, $poll_length, $msg_icon); # #-----[ FIND ]------------------------------------------ # $smilies_on = ( $post_info['enable_smilies'] ) ? true : false; # #-----[ AFTER, ADD ]------------------------------------------ # switch ($post_info['post_icon']) { case 1 : $msg_icon_checked = 1; break; case 2 : $msg_icon_checked = 2; break; case 3 : $msg_icon_checked = 3; break; case 4 : $msg_icon_checked = 4; break; case 5 : $msg_icon_checked = 5; break; case 6 : $msg_icon_checked = 6; break; case 7 : $msg_icon_checked = 7; break; case 8 : $msg_icon_checked = 8; break; case 9 : $msg_icon_checked = 9; break; case 10 : $msg_icon_checked = 10; break; case 11 : $msg_icon_checked = 11; break; case 12 : $msg_icon_checked = 12; break; case 13 : $msg_icon_checked = 13; break; case 14 : $msg_icon_checked = 14; break; default : $msg_icon_checked = 0; break; } # #-----[ FIND ]------------------------------------------ # if( $user_sig != '' ) { $template->assign_block_vars('switch_signature_checkbox', array()); } # #-----[ AFTER, ADD ]------------------------------------------ # $template->assign_block_vars('switch_msgicon_checkbox', array()); # #-----[ FIND ]------------------------------------------ # 'U_REVIEW_TOPIC' => ( $mode == 'reply' ) ? append_sid("posting.$phpEx?mode=topicreview&" . POST_TOPIC_URL . "=$topic_id") : '', # #-----[ AFTER, ADD ]------------------------------------------ # 'L_MSG_ICON_NO_ICON' => $lang['Msg_Icon_No_Icon'], 'MSG_ICON_CHECKED0' => ( $msg_icon_checked==0) ? 'CHECKED' : '', 'MSG_ICON_CHECKED1' => ( $msg_icon_checked==1) ? 'CHECKED' : '', 'MSG_ICON_CHECKED2' => ( $msg_icon_checked==2) ? 'CHECKED' : '', 'MSG_ICON_CHECKED3' => ( $msg_icon_checked==3) ? 'CHECKED' : '', 'MSG_ICON_CHECKED4' => ( $msg_icon_checked==4) ? 'CHECKED' : '', 'MSG_ICON_CHECKED5' => ( $msg_icon_checked==5) ? 'CHECKED' : '', 'MSG_ICON_CHECKED6' => ( $msg_icon_checked==6) ? 'CHECKED' : '', 'MSG_ICON_CHECKED7' => ( $msg_icon_checked==7) ? 'CHECKED' : '', 'MSG_ICON_CHECKED8' => ( $msg_icon_checked==8) ? 'CHECKED' : '', 'MSG_ICON_CHECKED9' => ( $msg_icon_checked==9) ? 'CHECKED' : '', 'MSG_ICON_CHECKED10' => ( $msg_icon_checked==10) ? 'CHECKED' : '', 'MSG_ICON_CHECKED11' => ( $msg_icon_checked==11) ? 'CHECKED' : '', 'MSG_ICON_CHECKED12' => ( $msg_icon_checked==12) ? 'CHECKED' : '', 'MSG_ICON_CHECKED13' => ( $msg_icon_checked==13) ? 'CHECKED' : '', 'MSG_ICON_CHECKED14' => ( $msg_icon_checked==14) ? 'CHECKED' : '', # #-----[ OPEN ]------------------------------------------ # phpBB2/includes/functions_post.php # #-----[ FIND ]------------------------------------------ # function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length) # #-----[ REPLACE WITH ]------------------------------------------ # function submit_post($mode, &$post_data, &$message, &$meta, &$forum_id, &$topic_id, &$post_id, &$poll_id, &$topic_type, &$bbcode_on, &$html_on, &$smilies_on, &$attach_sig, &$bbcode_uid, &$post_username, &$post_subject, &$post_message, &$poll_title, &$poll_options, &$poll_length, &$msg_icon) # #-----[ FIND ]------------------------------------------ # include($phpbb_root_path . 'includes/functions_search.'.$phpEx); # #-----[ AFTER, ADD ]------------------------------------------ # //code to get rid of some quick-reply-mod problems if (!$msg_icon) $msg_icon=0; # #-----[ FIND ]------------------------------------------ # $sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote WHERE topic_id = $topic_id"; # #-----[ REPLACE WITH ]------------------------------------------ # $sql = ( $mode != "editpost" ) ? "INSERT INTO " . TOPICS_TABLE . " (topic_title, topic_poster, topic_time, forum_id, topic_status, topic_type, topic_vote, topic_icon) VALUES ('$post_subject', " . $userdata['user_id'] . ", $current_time, $forum_id, " . TOPIC_UNLOCKED . ", $topic_type, $topic_vote, $msg_icon)" : "UPDATE " . TOPICS_TABLE . " SET topic_title = '$post_subject', topic_type = $topic_type, topic_vote = $topic_vote, topic_icon = $msg_icon WHERE topic_id = $topic_id"; # #-----[ FIND ]------------------------------------------ # $sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . " WHERE post_id = $post_id"; # #-----[ REPLACE WITH ]------------------------------------------ # $sql = ( $mode != "editpost" ) ? "INSERT INTO " . POSTS_TABLE . " (topic_id, forum_id, poster_id, post_username, post_time, poster_ip, enable_bbcode, enable_html, enable_smilies, enable_sig, post_icon) VALUES ($topic_id, $forum_id, " . $userdata['user_id'] . ", '$post_username', $current_time, '$user_ip', $bbcode_on, $html_on, $smilies_on, $attach_sig, $msg_icon)" : "UPDATE " . POSTS_TABLE . " SET enable_bbcode = $bbcode_on, enable_html = $html_on, enable_smilies = $smilies_on, enable_sig = $attach_sig" . $edited_sql . ", post_icon = $msg_icon WHERE post_id = $post_id"; # #-----[ OPEN ]------------------------------------------ # phpBB2/viewforum.php # #-----[ FIND ]------------------------------------------ # $topic_type = $topic_rowset[$i]['topic_type']; # #-----[ AFTER, ADD ]------------------------------------------ # if ( $topic_rowset[$i]['topic_icon'] == 0 ) { $icon = " "; } else { $icon = "\"Messageicon\""; } # #-----[ FIND ]------------------------------------------ # $template->assign_block_vars('topicrow', array( 'ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'FORUM_ID' => $forum_id, # #-----[ REPLACE WITH ]------------------------------------------ # $template->assign_block_vars('topicrow', array( 'ICON' => $icon, 'ROW_COLOR' => $row_color, 'ROW_CLASS' => $row_class, 'FORUM_ID' => $forum_id, # #-----[ OPEN ]------------------------------------------ # phpBB2/viewtopic.php # #-----[ FIND ]------------------------------------------ # else { $l_edited_by = ''; } # #-----[ AFTER, ADD ]------------------------------------------ # if ( $postrow[$i]['post_icon'] == 0 ) { $icon = ""; } else { $icon = "\"Messageicon\""; } # #-----[ FIND ]------------------------------------------ # $template->assign_block_vars('postrow', array( 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'POSTER_NAME' => $poster, # #-----[ REPLACE WITH ]------------------------------------------ # $template->assign_block_vars('postrow', array( 'ICON' => $icon, 'ROW_COLOR' => '#' . $row_color, 'ROW_CLASS' => $row_class, 'POSTER_NAME' => $poster, # #-----[ OPEN ]------------------------------------------ # phpBB2/lang_english/lang_main.php # #-----[ FIND ]------------------------------------------ # // // That's all Folks! # #-----[ BEFORE, ADD ]------------------------------------ # //MsgIcon Mod $lang['Msg_Icon_No_Icon'] = 'No Icon'; ##### - Template alterations - #### # Directions are given for SubSilver, use as a guide for other templates # # #-----[ OPEN ]------------------------------------------ # phpBB2/templates/subSilver/posting_body.tpl # #-----[ FIND ]------------------------------------------ # {L_SUBJECT} # #-----[ AFTER, ADD ]------------------------------------------ # Messageicon
{L_MSG_ICON_NO_ICON}
 
# #-----[ OPEN ]------------------------------------------ # phpBB2/templates/subSilver/viewforum_body.tpl # #-----[ FIND ]------------------------------------------ #  {L_TOPICS}  # #-----[ REPLACE WITH ]------------------------------------------ #  {L_TOPICS}  # #-----[ FIND ]------------------------------------------ # {topicrow.L_TOPIC_FOLDER_ALT} # #-----[ AFTER, ADD ]------------------------------------------ # {topicrow.ICON} # #-----[ FIND ]------------------------------------------ # {L_NO_TOPICS} # #-----[ REPLACE WITH ]------------------------------------------ # {L_NO_TOPICS} # #-----[ FIND ]------------------------------------------ # {L_DISPLAY_TOPICS}: {S_SELECT_TOPIC_DAYS}  # #-----[ REPLACE WITH ]------------------------------------------ # {L_DISPLAY_TOPICS}: {S_SELECT_TOPIC_DAYS}  # #-----[ OPEN ]------------------------------------------ # phpBB2/templates/subSilver/viewtopic_body.tpl # #-----[ FIND ]------------------------------------------ # {postrow.L_MINI_POST_ALT}{L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT} # #-----[ REPLACE WITH ]------------------------------------------ # {postrow.L_MINI_POST_ALT} {postrow.ICON} {L_POSTED}: {postrow.POST_DATE}    {L_POST_SUBJECT}: {postrow.POST_SUBJECT} # #-----[ SAVE/CLOSE ALL FILES ]------------------------------------------ # # EoM