diff options
author | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-08 19:04:49 +0000 |
---|---|---|
committer | Meik Sievertsen <acydburn@phpbb.com> | 2006-10-08 19:04:49 +0000 |
commit | 0b2aaae28bb341a38864eda320e135826a0568e4 (patch) | |
tree | 3eb7fb1c71612582f5dfa3bbeb062e6d26cb12aa | |
parent | f8be2a133bccc6860dd5531dbbfc068a5a3fa699 (diff) | |
download | forums-0b2aaae28bb341a38864eda320e135826a0568e4.tar forums-0b2aaae28bb341a38864eda320e135826a0568e4.tar.gz forums-0b2aaae28bb341a38864eda320e135826a0568e4.tar.bz2 forums-0b2aaae28bb341a38864eda320e135826a0568e4.tar.xz forums-0b2aaae28bb341a38864eda320e135826a0568e4.zip |
- forum image being an additional image instead of replacing forum indicators
- reasons fixes
git-svn-id: file:///svn/phpbb/trunk@6470 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/adm/style/acp_forums.html | 1 | ||||
-rw-r--r-- | phpBB/adm/style/acp_reasons.html | 24 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_forums.php | 2 | ||||
-rw-r--r-- | phpBB/includes/acp/acp_reasons.php | 26 | ||||
-rw-r--r-- | phpBB/includes/functions_display.php | 12 | ||||
-rw-r--r-- | phpBB/includes/mcp/mcp_queue.php | 4 | ||||
-rw-r--r-- | phpBB/includes/ucp/ucp_main.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/forums.php | 2 | ||||
-rw-r--r-- | phpBB/language/en/acp/posting.php | 28 | ||||
-rw-r--r-- | phpBB/report.php | 3 | ||||
-rw-r--r-- | phpBB/styles/subSilver/template/forumlist_body.html | 10 |
11 files changed, 79 insertions, 35 deletions
diff --git a/phpBB/adm/style/acp_forums.html b/phpBB/adm/style/acp_forums.html index adcc5d18ef..63ed7cb883 100644 --- a/phpBB/adm/style/acp_forums.html +++ b/phpBB/adm/style/acp_forums.html @@ -351,6 +351,7 @@ <tr> <td style="width: 5%;">{forums.FOLDER_IMAGE}</td> <td> + <!-- IF forums.FORUM_IMAGE --><div style="float: left;">{forums.FORUM_IMAGE}</div><!-- ENDIF --> <strong><!-- IF forums.S_FORUM_LINK -->{forums.FORUM_NAME}<!-- ELSE --><a href="{forums.U_FORUM}">{forums.FORUM_NAME}</a><!-- ENDIF --></strong> <!-- IF forums.FORUM_DESCRIPTION --><br /><span>{forums.FORUM_DESCRIPTION}</span><!-- ENDIF --> <!-- IF forums.S_FORUM_POST --><br /><br /><span>{L_TOPICS}: <b>{forums.FORUM_TOPICS}</b> / {L_POSTS}: <b>{forums.FORUM_POSTS}</b></span><!-- ENDIF --> diff --git a/phpBB/adm/style/acp_reasons.html b/phpBB/adm/style/acp_reasons.html index 8648fb18c5..be987dd294 100644 --- a/phpBB/adm/style/acp_reasons.html +++ b/phpBB/adm/style/acp_reasons.html @@ -17,19 +17,37 @@ </div> <!-- ENDIF --> + <!-- IF not S_TRANSLATED --> + <h3>{L_AVAILABLE_TITLES}</h3> + + <p>{S_AVAILABLE_TITLES}</p> + <!-- ENDIF --> + <form id="acp_reasons" method="post" action="{U_ACTION}"> <fieldset> <legend>{L_TITLE}</legend> - <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED}<!-- ELSE -->{L_IS_NOT_TRANSLATED}<!-- ENDIF --></p> + <p><!-- IF S_TRANSLATED -->{L_IS_TRANSLATED_EXPLAIN}<!-- ELSE -->{L_IS_NOT_TRANSLATED_EXPLAIN}<!-- ENDIF --></p> <dl> <dt><label for="reason_title">{L_REASON_TITLE}:</label></dt> <dd><input name="reason_title" type="text" id="reason_title" value="{REASON_TITLE}" /></dd> </dl> + <!-- IF S_TRANSLATED --> + <dl> + <dt>{L_REASON_TITLE_TRANSLATED}</dt> + <dd>{TRANSLATED_TITLE}</dd> + </dl> + <!-- ENDIF --> <dl> <dt><label for="reason_description">{L_REASON_DESCRIPTION}:</label></dt> <dd><textarea name="reason_description" id="reason_description" rows="8">{REASON_DESCRIPTION}</textarea></dd> </dl> + <!-- IF S_TRANSLATED --> + <dl> + <dt>{L_REASON_DESC_TRANSLATED}</dt> + <dd>{TRANSLATED_DESCRIPTION}</dd> + </dl> + <!-- ENDIF --> </fieldset> <fieldset class="submit-buttons"> @@ -67,11 +85,11 @@ <td style="width: 80px; text-align: right; white-space: nowrap;"> <!-- IF reasons.S_FIRST_ROW && not reasons.S_LAST_ROW --> {ICON_MOVE_UP_DISABLED} - <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> + <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> <!-- ELSEIF not reasons.S_FIRST_ROW && not reasons.S_LAST_ROW--> <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> <a href="{reasons.U_MOVE_DOWN}">{ICON_MOVE_DOWN}</a> - <!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW --> + <!-- ELSEIF reasons.S_LAST_ROW && not reasons.S_FIRST_ROW --> <a href="{reasons.U_MOVE_UP}">{ICON_MOVE_UP}</a> {ICON_MOVE_DOWN_DISABLED} <!-- ENDIF --> diff --git a/phpBB/includes/acp/acp_forums.php b/phpBB/includes/acp/acp_forums.php index b1a31dc37d..cd63f26a1b 100644 --- a/phpBB/includes/acp/acp_forums.php +++ b/phpBB/includes/acp/acp_forums.php @@ -751,6 +751,8 @@ class acp_forums $template->assign_block_vars('forums', array( 'FOLDER_IMAGE' => $folder_image, + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESCRIPTION' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'FORUM_TOPICS' => $row['forum_topics'], diff --git a/phpBB/includes/acp/acp_reasons.php b/phpBB/includes/acp/acp_reasons.php index a75dc64f5b..abf554d824 100644 --- a/phpBB/includes/acp/acp_reasons.php +++ b/phpBB/includes/acp/acp_reasons.php @@ -61,11 +61,11 @@ class acp_reasons $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row['reason_title'] == 'other') + if (strtolower($row['reason_title']) == 'other') { $reason_row['reason_title'] = 'other'; } - else if (utf8_strtolower($row['reason_title']) != utf8_strtolower($reason_row['reason_title'])) + else if ($row['reason_title'] != $reason_row['reason_title']) { $check_double = true; } @@ -76,12 +76,12 @@ class acp_reasons { $sql = 'SELECT reason_id FROM ' . REPORTS_REASONS_TABLE . " - WHERE LOWER(reason_title) = '" . $db->sql_escape(utf8_strtolower($reason_row['reason_title'])) . "'"; + WHERE reason_title = '" . $db->sql_escape($reason_row['reason_title']) . "'"; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if ($row) + if ($row || ($add && strtolower($reason_row['reason_title']) == 'other')) { $error[] = $user->lang['REASON_ALREADY_EXIST']; } @@ -159,10 +159,14 @@ class acp_reasons 'REASON_TITLE' => $reason_row['reason_title'], 'REASON_DESCRIPTION' => $reason_row['reason_description'], - - 'S_EDIT_REASON' => true, - 'S_TRANSLATED' => $translated, - 'S_ERROR' => (sizeof($error)) ? true : false, + + 'TRANSLATED_TITLE' => ($translated) ? $user->lang['report_reasons']['TITLE'][strtoupper($reason_row['reason_title'])] : '', + 'TRANSLATED_DESCRIPTION'=> ($translated) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($reason_row['reason_title'])] : '', + + 'S_AVAILABLE_TITLES' => implode(', ', array_map('htmlspecialchars', array_keys($user->lang['report_reasons']['TITLE']))), + 'S_EDIT_REASON' => true, + 'S_TRANSLATED' => $translated, + 'S_ERROR' => (sizeof($error)) ? true : false, ) ); @@ -183,7 +187,7 @@ class acp_reasons trigger_error($user->lang['NO_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($reason_row['reason_title'] == 'other') + if (strtolower($reason_row['reason_title']) == 'other') { trigger_error($user->lang['NO_REMOVE_DEFAULT_REASON'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -193,7 +197,7 @@ class acp_reasons { $sql = 'SELECT reason_id FROM ' . REPORTS_REASONS_TABLE . " - WHERE reason_title = 'other'"; + WHERE LOWER(reason_title) = 'other'"; $result = $db->sql_query($sql); $other_reason_id = (int) $db->sql_fetchfield('reason_id'); $db->sql_freeresult($result); @@ -327,7 +331,7 @@ class acp_reasons // If the reason is defined within the language file, we will use the localized version, else just use the database entry... if (isset($user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]) && isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) { - $row['reson_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; + $row['reason_description'] = $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])]; $row['reason_title'] = $user->lang['report_reasons']['TITLE'][strtoupper($row['reason_title'])]; $translated = true; diff --git a/phpBB/includes/functions_display.php b/phpBB/includes/functions_display.php index a1fdabd84f..ec5c87394e 100644 --- a/phpBB/includes/functions_display.php +++ b/phpBB/includes/functions_display.php @@ -237,8 +237,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_ID' => $row['forum_id'], 'FORUM_NAME' => $row['forum_name'], 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '', - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', + 'FORUM_FOLDER_IMG' => '', + 'FORUM_FOLDER_IMG_SRC' => '', + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang['FORUM_CAT'] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'U_VIEWFORUM' => append_sid("{$phpbb_root_path}viewforum.$phpEx", 'f=' . $row['forum_id'])) ); @@ -341,8 +343,10 @@ function display_forums($root_data = '', $display_moderators = true, $return_mod 'FORUM_DESC' => generate_text_for_display($row['forum_desc'], $row['forum_desc_uid'], $row['forum_desc_bitfield'], $row['forum_desc_options']), 'TOPICS' => $row['forum_topics'], $l_post_click_count => $post_click_count, - 'FORUM_FOLDER_IMG' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : $user->img($folder_image, $folder_alt), - 'FORUM_FOLDER_IMG_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), + 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'SUBFORUMS' => $subforums_list, 'LAST_POST_SUBJECT' => $last_post_subject, 'LAST_POST_TIME' => $last_post_time, diff --git a/phpBB/includes/mcp/mcp_queue.php b/phpBB/includes/mcp/mcp_queue.php index 69bebe9e06..7e23cf3219 100644 --- a/phpBB/includes/mcp/mcp_queue.php +++ b/phpBB/includes/mcp/mcp_queue.php @@ -644,7 +644,7 @@ function disapprove_post($post_id_list, $mode) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$row || (!$reason && $row['reason_title'] == 'other')) + if (!$row || (!$reason && strtolower($row['reason_title']) == 'other')) { $additional_msg = $user->lang['NO_REASON_DISAPPROVAL']; unset($_POST['confirm']); @@ -652,7 +652,7 @@ function disapprove_post($post_id_list, $mode) else { // If the reason is defined within the language file, we will use the localized version, else just use the database entry... - $disapprove_reason = ($row['reason_title'] != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; + $disapprove_reason = (strtolower($row['reason_title']) != 'other') ? ((isset($user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])])) ? $user->lang['report_reasons']['DESCRIPTION'][strtoupper($row['reason_title'])] : $row['reason_description']) : ''; $disapprove_reason .= ($reason) ? "\n\n" . $reason : ''; } } diff --git a/phpBB/includes/ucp/ucp_main.php b/phpBB/includes/ucp/ucp_main.php index 7e7def27fe..997f8884f5 100644 --- a/phpBB/includes/ucp/ucp_main.php +++ b/phpBB/includes/ucp/ucp_main.php @@ -306,6 +306,8 @@ class ucp_main 'FORUM_ID' => $forum_id, 'FORUM_FOLDER_IMG' => $user->img($folder_image, $folder_alt), 'FORUM_FOLDER_IMG_SRC' => $user->img($folder_image, $folder_alt, false, '', 'src'), + 'FORUM_IMAGE' => ($row['forum_image']) ? '<img src="' . $phpbb_root_path . $row['forum_image'] . '" alt="' . $user->lang[$folder_alt] . '" />' : '', + 'FORUM_IMAGE_SRC' => ($row['forum_image']) ? $phpbb_root_path . $row['forum_image'] : '', 'FORUM_NAME' => $row['forum_name'], 'LAST_POST_IMG' => $user->img('icon_topic_latest', 'VIEW_LATEST_POST'), 'LAST_POST_SUBJECT' => $row['forum_last_post_subject'], diff --git a/phpBB/language/en/acp/forums.php b/phpBB/language/en/acp/forums.php index 86ede116bd..21ddc34558 100644 --- a/phpBB/language/en/acp/forums.php +++ b/phpBB/language/en/acp/forums.php @@ -73,7 +73,7 @@ $lang = array_merge($lang, array( 'FORUM_DESC_EXPLAIN' => 'Any markup entered here will displayed as is.', 'FORUM_EDIT_EXPLAIN' => 'The form below will allow you to customise this forum. Please note that moderation and post count controls are set via forum permissions for each user or usergroup.', 'FORUM_IMAGE' => 'Forum Image', - 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an image to associate with this forum.', + 'FORUM_IMAGE_EXPLAIN' => 'Location, relative to the phpBB root directory, of an additional image to associate with this forum.', 'FORUM_LINK_EXPLAIN' => 'Full URL (including the protocol, for example <samp>http://</samp>) to location clicking this forum will take the user.', 'FORUM_LINK_TRACK' => 'Track link redirects', 'FORUM_LINK_TRACK_EXPLAIN' => 'Records the number of times a forum link was clicked.', diff --git a/phpBB/language/en/acp/posting.php b/phpBB/language/en/acp/posting.php index 6d23fd231d..a1feb2acac 100644 --- a/phpBB/language/en/acp/posting.php +++ b/phpBB/language/en/acp/posting.php @@ -212,25 +212,29 @@ $lang = array_merge($lang, array( // Reasons $lang = array_merge($lang, array( 'ACP_REASONS_EXPLAIN' => 'Here you can manage the reasons used in reports and denial messages when disapproving posts. There is one default reason (marked with a *) you are not able to remove, this reason is normally used for custom messages if no reason fits.', - 'ADD_NEW_REASON' => 'Add new reason', + 'AVAILABLE_TITLES' => 'Available localized reason titles', - 'IS_NOT_TRANSLATED' => 'Reason has not been localised', - 'IS_TRANSLATED' => 'Reason has been localised', + 'IS_NOT_TRANSLATED' => 'Reason has <samp>not</samp> been localised.', + 'IS_NOT_TRANSLATED_EXPLAIN' => 'Reason has <samp>not</samp> been localised. If you want to provide the localized form, specify the correct key from the language files report reasons section.', + 'IS_TRANSLATED' => 'Reason has been localised.', + 'IS_TRANSLATED_EXPLAIN' => 'Reason has been localised. If the title you enter here is specified within the language files report reasons section, the localized form of the title and description will be used.', 'NO_REASON' => 'Reason could not be found.', 'NO_REASON_INFO' => 'You have to specify a title and a description for this reason.', 'NO_REMOVE_DEFAULT_REASON' => 'You are not able to remove the default reason "Other".', - 'REASON_ADD' => 'Add report/denial reason', - 'REASON_ADDED' => 'Report/denial reason successfully added.', - 'REASON_ALREADY_EXIST' => 'A reason with this title already exist, please enter another title for this reason.', - 'REASON_DESCRIPTION' => 'Reason description', - 'REASON_EDIT' => 'Edit report/denial reason', - 'REASON_EDIT_EXPLAIN' => 'Here you are able to add or edit a reason. If the reason is translated the localized version is used instead of the description entered here.', - 'REASON_REMOVED' => 'Report/denial reason successfully removed.', - 'REASON_TITLE' => 'Reason Title', - 'REASON_UPDATED' => 'Report/denial reason successfully updated.', + 'REASON_ADD' => 'Add report/denial reason', + 'REASON_ADDED' => 'Report/denial reason successfully added.', + 'REASON_ALREADY_EXIST' => 'A reason with this title already exist, please enter another title for this reason.', + 'REASON_DESCRIPTION' => 'Reason description', + 'REASON_DESC_TRANSLATED' => 'Displayed reason description', + 'REASON_EDIT' => 'Edit report/denial reason', + 'REASON_EDIT_EXPLAIN' => 'Here you are able to add or edit a reason. If the reason is translated the localized version is used instead of the description entered here.', + 'REASON_REMOVED' => 'Report/denial reason successfully removed.', + 'REASON_TITLE' => 'Reason title', + 'REASON_TITLE_TRANSLATED' => 'Displayed reason title', + 'REASON_UPDATED' => 'Report/denial reason successfully updated.', 'USED_IN_REPORTS' => 'Used in reports', )); diff --git a/phpBB/report.php b/phpBB/report.php index 5e5a9870d8..6328540064 100644 --- a/phpBB/report.php +++ b/phpBB/report.php @@ -64,6 +64,7 @@ $sql = 'SELECT * WHERE forum_id = ' . $forum_id; $result = $db->sql_query($sql); $forum_data = $db->sql_fetchrow($result); +$db->sql_freeresult($result); if (!$forum_data) { @@ -99,7 +100,7 @@ if ($submit && $reason_id) $row = $db->sql_fetchrow($result); $db->sql_freeresult($result); - if (!$row || (!$report_text && $row['reason_title'] == 'other')) + if (!$row || (!$report_text && strtolower($row['reason_title']) == 'other')) { trigger_error('EMPTY_REPORT'); } diff --git a/phpBB/styles/subSilver/template/forumlist_body.html b/phpBB/styles/subSilver/template/forumlist_body.html index 22b3660f7e..5d0108d1f9 100644 --- a/phpBB/styles/subSilver/template/forumlist_body.html +++ b/phpBB/styles/subSilver/template/forumlist_body.html @@ -16,10 +16,14 @@ </tr> <!-- ELSEIF forumrow.S_IS_LINK --> <tr> - <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> + <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1"> + <!-- IF forumrow.FORUM_IMAGE --> + <div style="float: left;">{forumrow.FORUM_IMAGE}</div><div style="float: left;"> + <!-- ENDIF --> <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> <p class="forumdesc">{forumrow.FORUM_DESC}</p> + <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF --> </td> <!-- IF forumrow.CLICKS --> <td class="row2" colspan="3" align="center"><span class="genmed">{L_REDIRECTS}: {forumrow.CLICKS}</span></td> @@ -31,6 +35,9 @@ <tr> <td class="row1" width="50" align="center">{forumrow.FORUM_FOLDER_IMG}</td> <td class="row1" width="100%"> + <!-- IF forumrow.FORUM_IMAGE --> + <div style="float: left;">{forumrow.FORUM_IMAGE}</div><div style="float: left;"> + <!-- ENDIF --> <a class="forumlink" href="{forumrow.U_VIEWFORUM}">{forumrow.FORUM_NAME}</a> <p class="forumdesc">{forumrow.FORUM_DESC}</p> <!-- IF forumrow.MODERATORS --> @@ -39,6 +46,7 @@ <!-- IF forumrow.SUBFORUMS --> <p class="forumdesc"><strong>{forumrow.L_SUBFORUM_STR}</strong> {forumrow.SUBFORUMS}</p> <!-- ENDIF --> + <!-- IF forumrow.FORUM_IMAGE --></div><!-- ENDIF --> </td> <td class="row2" align="center"><p class="topicdetails">{forumrow.TOPICS}</p></td> <td class="row2" align="center"><p class="topicdetails">{forumrow.POSTS}</p></td> |