# HG changeset patch # User IBBoard # Date 1244398852 0 # Node ID 6077ff381bf8d217e03ab21272bf84ca9b41ccb9 # Parent e3c4cd9d49382acd2c2c7f6af2f48a6c1791e387 Re #1: Create "root" directory to meet new packaging requirements diff -r e3c4cd9d4938 -r 6077ff381bf8 Install.xml --- a/Install.xml Sun Jun 07 18:14:27 2009 +0000 +++ b/Install.xml Sun Jun 07 18:20:52 2009 +0000 @@ -13,7 +13,9 @@ Multi-race rank themes This MOD will allow you to add, modify and remove rank themes. -Rank themes are selectable collections of ranks that users can choose to use, allowing RPG forums to have different 'races' or allowing 'normal' forums to provide an set of alternative icon images for their users. +Rank themes are selectable collections of ranks that normal users can choose to use, allowing RPG forums to have different 'races' or allowing 'normal' forums to provide an set of alternative icon images for their users. + +Note that users with "special ranks" (normally Administrators etc.) will not get a theme selection in the UCP as the special rank is their rank theme. If users with special ranks want a themed rank image then you need to also install my "Special and Normal Rank Images" MOD. subsilver2 - 1.2.3 + 1.2.4 intermediate @@ -49,6 +51,19 @@ + 2009-05-31 + 1.2.4 + + Fix: Use some extra constants instead of magic numbers to pass validation + Fix: Move some files in package because MOD packaging instructions keep changing + Fix: Don't hard-code link in rank themes text + Fix: Update finds of get_user_rank in memberlist.php to newer v3.0.4 parameters + Change: Make it clear that people with special ranks won't get a rank selection option in the description + Change: Make it clearer that deleting a theme deletes the ranks in it (since we can't guess where to put them and we need a standard confirm page so we can't ask the user) + Change: Make the default and special rank theme IDs slightly more flexible + + + 2009-05-10 1.2.3 @@ -228,8 +243,8 @@ INSERT INTO phpbb_rank_themes VALUES (-1, 'Special', 0); INSERT INTO phpbb_rank_themes VALUES (1, 'Default', 1);]]> - - + + @@ -350,9 +365,9 @@ //$special_rank = request_var('special_rank', 0); $rank_theme = request_var('rank_theme', DEFAULT_RANK_THEME_ID); - if ($rank_theme < DEFAULT_RANK_THEME_ID) + if ($rank_theme <= 0) { - $special_rank = 1; + $special_rank = 1; //Stick with the phpBB convention and use magic numbers for the "special rank" value $rank_theme = SPECIAL_RANK_THEME_ID; } else @@ -406,14 +421,14 @@ case 'save_theme': $theme_title = utf8_normalize_nfc(request_var('title', '', true)); - $theme_public = request_var('theme_public', 1); + $theme_public = request_var('theme_public', RANK_THEME_PUBLIC); if (!$theme_title) { trigger_error($user->lang['NO_RANK_THEME_TITLE'] . adm_back_link($this->u_action), E_USER_WARNING); } - if ($rank_id <= DEFAULT_RANK_THEME_ID && $rank_id != 0) + if ($rank_id == DEFAULT_RANK_THEME_ID || $rank_id == SPECIAL_RANK_THEME_ID || $rank_id <= 0) { trigger_error($user->lang['MUST_SELECT_RANK_THEME'] . adm_back_link($this->u_action), E_USER_WARNING); } @@ -548,8 +563,8 @@ $template->assign_block_vars('themes', array( 'RANK_THEME_TITLE' => $theme['rtheme_title'], 'S_THEME_PUBLIC' => $theme['rtheme_public'], - 'U_EDIT_THEME' => ($theme['rtheme_id'] > 1 ? $this->u_action . '&action=edit_theme&id=' . $theme['rtheme_id'] : ''), - 'U_DELETE_THEME' => ($theme['rtheme_id'] > 1 ? $this->u_action . '&action=delete_theme&id=' . $theme['rtheme_id'] : ''))); + 'U_EDIT_THEME' => (($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID) ? $this->u_action . '&action=edit_theme&id=' . $theme['rtheme_id'] : ''), + 'U_DELETE_THEME' => (($theme['rtheme_id'] != DEFAULT_RANK_THEME_ID && $theme['rtheme_id'] != SPECIAL_RANK_THEME_ID) ? $this->u_action . '&action=delete_theme&id=' . $theme['rtheme_id'] : ''))); if (sizeof($ranks[$theme['rtheme_id']]) > 0) { @@ -578,11 +593,11 @@ global $db, $user; - $sql = 'SELECT * FROM ' . RANK_THEMES_TABLE. " WHERE rtheme_id > ".DEFAULT_RANK_THEME_ID." ORDER BY rtheme_title"; + $sql = 'SELECT * FROM ' . RANK_THEMES_TABLE. ' WHERE rtheme_id <> ' . DEFAULT_RANK_THEME_ID . ' AND rtheme_id <> ' . SPECIAL_RANK_THEME_ID . ' ORDER BY rtheme_title'; $result = $db->sql_query($sql); - $this->rank_themes = array(SPECIAL_RANK_THEME_ID => array('rtheme_id' => SPECIAL_RANK_THEME_ID, 'rtheme_title' => $user->lang['SPECIAL_RANK_THEME'], 'rtheme_public' => false), - DEFAULT_RANK_THEME_ID => array('rtheme_id' => DEFAULT_RANK_THEME_ID, 'rtheme_title' => $user->lang['DEFAULT_RANK_THEME'], 'rtheme_public' => true)); + $this->rank_themes = array(SPECIAL_RANK_THEME_ID => array('rtheme_id' => SPECIAL_RANK_THEME_ID, 'rtheme_title' => $user->lang['SPECIAL_RANK_THEME'], 'rtheme_public' => RANK_THEME_PRIVATE), + DEFAULT_RANK_THEME_ID => array('rtheme_id' => DEFAULT_RANK_THEME_ID, 'rtheme_title' => $user->lang['DEFAULT_RANK_THEME'], 'rtheme_public' => RANK_THEME_PUBLIC)); while ($row = $db->sql_fetchrow($result)) { @@ -594,7 +609,7 @@ - 't.rtheme_public OR t.rtheme_id = ' . SPECIAL_RANK_THEME_ID, + 'WHERE' => 't.rtheme_public = ' . RANK_THEME_PUBLIC . ' OR t.rtheme_id = ' . SPECIAL_RANK_THEME_ID, 'ORDER_BY' => 'r.rank_min DESC' ));]]> @@ -626,10 +641,12 @@ +define('DEFAULT_RANK_THEME_ID', 1); +define('RANK_THEME_PRIVATE', 0); +define('RANK_THEME_PUBLIC', 1);]]> - + @@ -652,7 +669,9 @@ - + - - - - + if (!empty($theme)) + { + foreach ($theme as $rank)]]> @@ -708,7 +725,7 @@ RANK_THEMES_TABLE => 'r' ), - 'WHERE' => 'rtheme_public = 1 AND rtheme_id > ' . DEFAULT_RANK_THEME_ID, + 'WHERE' => 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID, 'ORDER_BY' => 'rtheme_title ASC', )); @@ -773,7 +790,7 @@ RANK_THEMES_TABLE => 'r' ), - 'WHERE' => 'rtheme_public = 1 AND rtheme_id > '.DEFAULT_RANK_THEME_ID, + 'WHERE' => 'rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id <> '.DEFAULT_RANK_THEME_ID, 'ORDER_BY' => 'rtheme_title ASC', )); @@ -827,7 +844,7 @@ 'The rank was successfully updated.',]]> 'Add new rank theme', - 'ACP_RANK_THEMES_EXPLAIN' => 'Using this form you can add, edit, view and delete rank themes. Rank themes can be made private so that they are not selectable by users.', + 'ACP_RANK_THEMES_EXPLAIN' => 'Using this page you can add, edit, view and delete rank themes. Rank themes can be made private so that they are not selectable by users. Deleting a rank theme will delete all ranks within it.', 'RANK_THEME_TITLE' => 'Rank theme title', 'RANK_THEME_PUBLIC' => 'Set as public rank theme', 'RANK_THEME' => 'Rank theme', @@ -840,8 +857,8 @@ - 'No new private messages are waiting for you.',]]> - array(]]> + 'Default theme', 'SPECIAL_RANK_THEME' => 'Special theme', @@ -857,7 +874,7 @@ ?>]]> 'Rank Themes', - 'RANKTHEME_TEXT' => 'Rank themes allow you to customise the name and image of the rank that is displayed beside your post. For a full list of the ranks within a scheme click on the scheme name. For more detail on ranks please see the FAQ.', + 'RANKTHEME_TEXT' => 'Rank themes allow you to customise the name and image of the rank that is displayed beside your post. For a full list of the ranks within a scheme click on the scheme name. For more detail on ranks please see the FAQ.', 'RANK_NAME' => 'Rank', 'RANK_IMG' => 'Rank image', 'RANK_POSTS' => 'Required post count', @@ -888,7 +905,7 @@ - + $rank_img_src @@ -908,11 +925,15 @@ // Get list of rank themes $sql = 'SELECT rtheme_id, rtheme_title FROM ' . RANK_THEMES_TABLE . ' - WHERE rtheme_public = 1 - AND rtheme_id > ' . DEFAULT_RANK_THEME_ID . ' + WHERE rtheme_public = ' . RANK_THEME_PUBLIC . ' + AND rtheme_id <> ' . DEFAULT_RANK_THEME_ID . ' ORDER BY rtheme_title ASC'; $result = $db->sql_query($sql); + $template->assign_vars(array( + 'L_RANKSET_TEXT' => sprintf($user->lang['RANKSET_TEXT'], append_sid("{$phpbb_root_path}faq.{$phpExt}#f15")) + )); + $template->assign_block_vars('rankset', array( 'RANKSET_URL' => append_sid("{$phpbb_root_path}memberlist.$phpEx", 'mode=ranks&r=' . DEFAULT_RANK_THEME_ID), 'RANKSET_NAME' => $user->lang['DEFAULT_RANK_THEME'] @@ -932,7 +953,7 @@ { $sql = 'SELECT rtheme_title FROM ' . RANK_THEMES_TABLE . ' - WHERE rtheme_public = 1 + WHERE rtheme_public = ' . RANK_THEME_PUBLIC . ' AND rtheme_id = ' . $rank_theme; $result = $db->sql_query($sql); $row = $db->sql_fetchrow($result); @@ -972,7 +993,7 @@ break;]]> - + $rank_img_src