diff options
author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-06-03 21:40:02 +0000 |
---|---|---|
committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-06-03 21:40:02 +0000 |
commit | 67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8 (patch) | |
tree | b29f9c5c3b0cd34f2cc085a692336f5f2817415b | |
parent | 7dc2a615ee25b78d8ea3edc329183bd1c19c9950 (diff) | |
download | forums-67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8.tar forums-67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8.tar.gz forums-67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8.tar.bz2 forums-67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8.tar.xz forums-67bbcf5c49ba73f05477bc5bb5864e3fa40b5fd8.zip |
Default rank images directory
git-svn-id: file:///svn/phpbb/trunk@4076 89ea8834-ac86-4346-8a33-228a782c2dd0
-rw-r--r-- | phpBB/adm/admin_board.php | 8 | ||||
-rw-r--r-- | phpBB/adm/admin_icons.php | 16 | ||||
-rw-r--r-- | phpBB/adm/admin_ranks.php | 236 | ||||
-rw-r--r-- | phpBB/install/schemas/mysql_basic.sql | 48 | ||||
-rw-r--r-- | phpBB/language/en/lang_admin.php | 5 | ||||
-rw-r--r-- | phpBB/language/en/lang_main.php | 8 | ||||
-rw-r--r-- | phpBB/memberlist.php | 17 | ||||
-rw-r--r-- | phpBB/viewtopic.php | 6 |
8 files changed, 217 insertions, 127 deletions
diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index 9ff1bb82e7..694d3a8b1a 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -388,7 +388,7 @@ switch ($mode) </tr> <tr> <td class="row1"><?php echo $user->lang['ACC_ACTIVATION']; ?>: <br /><span class="gensmall"><?php echo $user->lang['ACC_ACTIVATION_EXPLAIN']; ?></span></td> - <td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /> <?php echo $user->lang['ACC_NONE']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /> <?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /> <?php echo $user->lang['ACC_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF_ADMIN; ?>" <?php echo $activation_user_admin; ?> /> <?php echo $user->lang['ACC_USER_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /> <?php echo $user->lang['ACC_DISABLE']; ?></td> + <td class="row2"><input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_NONE; ?>" <?php echo $activation_none; ?> /> <?php echo $user->lang['ACC_NONE']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_SELF; ?>" <?php echo $activation_user; ?> /> <?php echo $user->lang['ACC_USER']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_ADMIN; ?>" <?php echo $activation_admin; ?> /> <?php echo $user->lang['ACC_ADMIN']; ?> <input type="radio" name="require_activation" value="<?php echo USER_ACTIVATION_DISABLE; ?>" <?php echo $activation_disable; ?> /> <?php echo $user->lang['ACC_DISABLE']; ?></td> </tr> <tr> <td class="row1"><?php echo $user->lang['VISUAL_CONFIRM']; ?>: <br /><span class="gensmall"><?php echo $user->lang['VISUAL_CONFIRM_EXPLAIN']; ?></span></td> @@ -564,8 +564,14 @@ switch ($mode) <td class="row1"><?php echo $user->lang['ICONS_PATH']; ?>: <br /><span class="gensmall"><?php echo $user->lang['ICONS_PATH_EXPLAIN']; ?></span></td> <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="icons_path" value="<?php echo $new['icons_path']; ?>" /></td> </tr> + <tr> + <td class="row1"><?php echo $user->lang['RANKS_PATH']; ?>: <br /><span class="gensmall"><?php echo $user->lang['RANKS_PATH_EXPLAIN']; ?></span></td> + <td class="row2"><input class="post" type="text" size="20" maxlength="255" name="ranks_path" value="<?php echo $new['ranks_path']; ?>" /></td> + </tr> <?php + break; + case 'load': $load_db_track_yes = ($new['load_db_track']) ? 'checked="checked"' : ''; diff --git a/phpBB/adm/admin_icons.php b/phpBB/adm/admin_icons.php index 4376f6c640..1555910972 100644 --- a/phpBB/adm/admin_icons.php +++ b/phpBB/adm/admin_icons.php @@ -218,11 +218,11 @@ function update_image_dimensions() <form method="post" action="admin_icons.<?php echo $phpEx . $SID . "&mode=$mode&action=" . (($action == 'add') ? 'create' : 'modify'); ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> - <th class="th" colspan="2"><?php echo $user->lang[$lang . '_CONFIG'] ?></th> + <th colspan="2"><?php echo $user->lang[$lang . '_CONFIG'] ?></th> </tr> <tr> <td class="row1"><?php echo $user->lang[$lang . '_URL'] ?></td> - <td class="row1"><select name="img" onChange="update_image(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> <img src="<?php echo $phpbb_root_path . $img_path . '/' . $edit_img ?>" name="image" border="0" alt="" title="" onload="update_image_dimensions()" /> </td> + <td class="row2"><select name="img" onchange="update_image(this.options[selectedIndex].value);"><?php echo $filename_list ?></select> <img src="<?php echo $phpbb_root_path . $img_path . '/' . $edit_img ?>" name="image" border="0" alt="" title="" onload="update_image_dimensions()" /> </td> </tr> <?php @@ -231,11 +231,11 @@ function update_image_dimensions() ?> <tr> - <td class="row2"><?php echo $user->lang[$lang . '_CODE'] ?></td> + <td class="row1"><?php echo $user->lang[$lang . '_CODE'] ?></td> <td class="row2"><input class="post" type="text" name="code" value="<?php echo (!empty($data['code'])) ? $data['code'] : '' ?>" /></td> </tr> <tr> - <td class="row2"><?php echo $user->lang[$lang . '_EMOTION'] ?></td> + <td class="row1"><?php echo $user->lang[$lang . '_EMOTION'] ?></td> <td class="row2"><input class="post" type="text" name="emotion" value="<?php echo (!empty($data['emoticon'])) ? $data['emoticon'] : '' ?>" /></td> </tr> <?php @@ -245,18 +245,18 @@ function update_image_dimensions() ?> <tr> <td class="row1"><?php echo $user->lang[$lang . '_WIDTH'] ?></td> - <td class="row1"><input class="post" type="text" size="3" name="width" value="<?php echo (!empty($data[$fields .'_width'])) ? $data[$fields .'_width'] : '' ?>" /></td> + <td class="row2"><input class="post" type="text" size="3" name="width" value="<?php echo (!empty($data[$fields .'_width'])) ? $data[$fields .'_width'] : '' ?>" /></td> </tr> <tr> - <td class="row2"><?php echo $user->lang[$lang . '_HEIGHT'] ?></td> + <td class="row1"><?php echo $user->lang[$lang . '_HEIGHT'] ?></td> <td class="row2"><input class="post" type="text" size="3" name="height" value="<?php echo (!empty($data[$fields .'_height'])) ? $data[$fields .'_height'] : '' ?>" /></td> </tr> <tr> <td class="row1"><?php echo $user->lang['DISPLAY_ON_POSTING'] ?></td> - <td class="row1"><input type="checkbox" name="display_on_posting" <?php echo (!empty($data['display_on_posting']) || !isset($data)) ? ' checked="checked"' : '' ?>/></td> + <td class="row2"><input type="checkbox" name="display_on_posting" <?php echo (!empty($data['display_on_posting']) || !isset($data)) ? ' checked="checked"' : '' ?>/></td> </tr> <tr> - <td class="row2"><?php echo $user->lang[$lang . '_ORDER'] ?></td> + <td class="row1"><?php echo $user->lang[$lang . '_ORDER'] ?></td> <td class="row2"><select name="order"><?php echo $order_list ?></select></td> </tr> <tr> diff --git a/phpBB/adm/admin_ranks.php b/phpBB/adm/admin_ranks.php index b4ff6e9b9f..48b7bcb45f 100644 --- a/phpBB/adm/admin_ranks.php +++ b/phpBB/adm/admin_ranks.php @@ -64,67 +64,115 @@ else } } -// Process mode -if ($mode != '') -{ - if ($mode == 'edit' || $mode == 'add') - { - // - // They want to add a new rank, show the form. - // - $rank_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0; +$rank_id = (isset($_GET['id'])) ? intval($_GET['id']) : 0; - $s_hidden_fields = '<input type="hidden" name="mode" value="save" />'; - if ($mode == 'edit') +// +switch ($mode) +{ + case 'edit': + case 'add': + + $data = $ranks = $existing_imgs = array(); + $result = $db->sql_query('SELECT * + FROM ' . RANKS_TABLE . ' + ORDER BY rank_special DESC, rank_min DESC'); + if ($row = $db->sql_fetchrow($result)) { - if (empty($rank_id)) + do { - trigger_error($user->lang['Must_select_rank']); + $existing_imgs[] = $row['rank_image']; + if ($mode == 'edit' && $rank_id == $row['rank_id']) + { + $ranks = $row; + } } + while ($row = $db->sql_fetchrow($result)); + } + $db->sql_freeresult($result); - $sql = "SELECT * FROM " . RANKS_TABLE . " - WHERE rank_id = $rank_id"; - $result = $db->sql_query($sql); - - $rank_info = $db->sql_fetchrow($result); - $db->sql_freeresult($result); - - $s_hidden_fields .= '<input type="hidden" name="id" value="' . $rank_id . '" />'; + $imglist = filelist($phpbb_root_path . $config['ranks_path'], ''); - } - else + $edit_img = $filename_list = ''; + foreach ($imglist as $img) { - $rank_info['rank_special'] = 0; + $img = substr($img['path'], 1) . (($img['path'] != '') ? '/' : '') . $img['file']; + + if (!in_array($img, $existing_imgs) || $mode == 'edit') + { + if ($ranks && $img == $ranks['rank_image']) + { + $selected = ' selected="selected"'; + $edit_img = $img; + } + else + { + $selected = ''; + } + + $filename_list .= '<option value="' . htmlspecialchars($img) . '"' . $selected . '>' . $img . '</option>'; + } } + $filename_list = '<option value=""' . (($edit_img == '') ? ' selected="selected"' : '') . '>----------</option>' . $filename_list; + unset($existing_imgs); + unset($imglist); + + // They want to add a new rank, show the form. + $s_hidden_fields = '<input type="hidden" name="mode" value="save" />'; adm_page_header($user->lang['RANKS']); ?> +<script language="javascript" type="text/javascript" defer="defer"> +<!-- + +function update_image(newimage) +{ + document.image.src = (newimage) ? "<?php echo $phpbb_root_path . $config['ranks_path']; ?>/" + newimage : "../images/spacer.gif"; +} + +function update_image_dimensions() +{ + if (document.image.height && document.forms[0].height) + { + document.forms[0].height.value = document.image.height; + document.forms[0].width.value = document.image.width; + } +} + +//--> +</script> + <h1><?php echo $user->lang['RANKS']; ?></h1> <p><?php echo $user->lang['RANKS_EXPLAIN']; ?></p> -<form method="post" action="<?php echo "admin_ranks.$phpEx$SID"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> +<form method="post" action="<?php echo "admin_ranks.$phpEx$SID&id=$rank_id"; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th colspan="2"><?php echo $user->lang['RANKS']; ?></th> </tr> <tr> - <td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_TITLE']; ?>: </td> - <td class="row2"><input type="text" name="title" size="35" maxlength="40" value="<?php echo $rank_info['rank_title']; ?>" /></td> + <td class="row1" width="40%"><?php echo $user->lang['RANK_TITLE']; ?>: </td> + <td class="row2"><input class="post" type="text" name="title" size="25" maxlength="40" value="<?php echo $ranks['rank_title']; ?>" /></td> </tr> <tr> - <td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_SPECIAL']; ?>: </td> - <td class="row2"><input type="radio" name="special_rank" value="1"<?php echo ($rank_info['rank_special']) ? ' checked="checked"' : ''; ?> /><?php echo $user->lang['YES']; ?> <input type="radio" name="special_rank" value="0"<?php echo (!$rank_info['rank_special']) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['NO']; ?></td> + <td class="row1" width="40%"><?php echo $user->lang['RANK_IMAGE']; ?>:</td> + <td class="row2"><table width="100%" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td valign="middle"><select name="rank_image" onchange="update_image(this.options[selectedIndex].value);"><?php echo $filename_list ?></select></td> + <td> </td> + <td valign="middle"><img src="<?php echo ($edit_img) ? $phpbb_root_path . $config['ranks_path'] . '/' . $edit_img : '../images/spacer.gif' ?>" name="image" border="0" alt="" title="" onload="update_image_dimensions()" /></td> + </tr> + </table></td> </tr> <tr> - <td class="row1" width="40%" nowrap="nowrap"><?php echo $user->lang['RANK_MINIMUM']; ?>: </td> - <td class="row2"><input type="text" name="min_posts" size="5" maxlength="10" value="<?php echo ($rank_info['rank_special']) ? '' : $rank_info['rank_min']; ?>" /></td> + <td class="row1"><?php echo $user->lang['RANK_SPECIAL']; ?>: </td> + <td class="row2"><input type="radio" name="special_rank" value="1"<?php echo ($ranks['rank_special']) ? ' checked="checked"' : ''; ?> /><?php echo $user->lang['YES']; ?> <input type="radio" name="special_rank" value="0"<?php echo (!$ranks['rank_special']) ? ' checked="checked"' : ''; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> <tr> - <td class="row1" width="40%"><?php echo $user->lang['RANK_IMAGE']; ?>: <br /><span class="gensmall"><?php echo $user->lang['RANK_IMAGE_EXPLAIN']; ?></span></td> - <td class="row2" valign="middle"><input type="text" name="rank_image" size="40" maxlength="255" value="<?php echo ($rank_info['rank_image'] != '') ? $rank_info['rank_image'] : ''; ?>" /> <?php echo ($rank_info['rank_image'] != '') ? '<img src="../' . $rank_info['rank_image'] . '" />' : ''; ?></td> + <td class="row1"><?php echo $user->lang['RANK_MINIMUM']; ?>: </td> + <td class="row2"><input class="post" type="text" name="min_posts" size="5" maxlength="10" value="<?php echo ($ranks['rank_special']) ? '' : $ranks['rank_min']; ?>" /></td> </tr> <tr> <td class="cat" colspan="2" align="center"><?php echo $s_hidden_fields; ?><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption" /> <input type="reset" value="<?php echo $user->lang['RESET']; ?>" class="liteoption" /></td> @@ -135,38 +183,29 @@ if ($mode != '') adm_page_footer(); - } - else if ($mode == 'save') - { + break; + + case 'save': + // // Ok, they sent us our info, let's update it. // - $rank_id = (isset($_POST['id'])) ? intval($_POST['id']) : 0; + $rank_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0; $rank_title = (isset($_POST['title'])) ? trim($_POST['title']) : ''; $special_rank = (!empty($_POST['special_rank'])) ? 1 : 0; $min_posts = (isset($_POST['min_posts'])) ? intval($_POST['min_posts']) : -1; - $rank_image = (isset($_POST['rank_image'])) ? trim($_POST['rank_image']) : ''; - - if ($rank_title == '') - { - trigger_error($user->lang['MUST_SELECT_RANK']); - } + $rank_image = (isset($_POST['rank_image'])) ? trim(htmlspecialchars($_POST['rank_image'])) : ''; if ($special_rank == 1) { $min_posts = -1; } - // // The rank image has to be a jpg, gif or png - // - if ($rank_image != '') + if ($rank_image != '' && !preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#i', $rank_image)) { - if (!preg_match('#(\.gif|\.png|\.jpg|\.jpeg)$#is', $rank_image)) - { - $rank_image = ''; - } + $rank_image = ''; } if ($rank_id) @@ -190,9 +229,10 @@ if ($mode != '') trigger_error($message); - } - else if ($mode == 'delete') - { + break; + + case 'delete': + // Ok, they want to delete their rank $rank_id = (isset($_REQUEST['id'])) ? intval($_REQUEST['id']) : 0; @@ -215,10 +255,12 @@ if ($mode != '') { trigger_error($user->lang['MUST_SELECT_RANK']); } - } -} -adm_page_header($user->lang['RANKS']); + break; + + default: + + adm_page_header($user->lang['RANKS']); ?> @@ -235,30 +277,44 @@ adm_page_header($user->lang['RANKS']); </tr> <?php -// -// Show the default page -// -$sql = "SELECT * FROM " . RANKS_TABLE . " - ORDER BY rank_min ASC, rank_special ASC"; -$result = $db->sql_query($sql); + // + // Show the default page + // + $sql = "SELECT * FROM " . RANKS_TABLE . " + ORDER BY rank_min ASC, rank_special ASC"; + $result = $db->sql_query($sql); + + if ($row = $db->sql_fetchrow($result)) + { + do + { + $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; -if ($row = $db->sql_fetchrow($result)) -{ - do - { - $row_class = ($row_class != 'row1') ? 'row1' : 'row2'; ?> <tr> - <td class="<?php echo $row_class; ?>" align="center"><img src="../<?php echo $row['rank_image']; ?>"" border="0" alt="<?php echo $row['rank_title']; ?>" title="<?php echo $row['rank_title']; ?>" /></td> + <td class="<?php echo $row_class; ?>" align="center"><?php + + if ($row['rank_image']) + { + +?><img src="<?php echo $phpbb_root_path . $config['ranks_path'] . '/' . $row['rank_image']; ?>"" border="0" alt="<?php echo $row['rank_title']; ?>" title="<?php echo $row['rank_title']; ?>" /><?php + + } + else + { + echo '-'; + } + +?></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo $row['rank_title']; ?></td> <td class="<?php echo $row_class; ?>" align="center"><?php echo ($row['rank_special']) ? '-' : $row['rank_min']; ?></td> <td class="<?php echo $row_class; ?>" align="center"> <a href="<?php echo "admin_ranks.$phpEx$SID&mode=edit&id=" . $row['rank_id']; ?>"><?php echo $user->lang['EDIT']; ?></a> | <a href="<?php echo "admin_ranks.$phpEx$SID&mode=delete&id=" . $row['rank_id']; ?>"><?php echo $user->lang['DELETE']; ?></a> </td> </tr> <?php - } - while ($row = $db->sql_fetchrow($result)); -} + } + while ($row = $db->sql_fetchrow($result)); + } ?> <tr> @@ -268,6 +324,42 @@ if ($row = $db->sql_fetchrow($result)) <?php -adm_page_footer(); + adm_page_footer(); + + break; +} + +// --------- +// FUNCTIONS +// +function filelist($rootdir, $dir = '', $type = 'gif|jpg|jpeg|png') +{ + static $images = array(); + + $dh = opendir($rootdir . $dir); + + while ($fname = readdir($dh)) + { + if (is_file($rootdir . $dir . '/' . $fname) && + preg_match('#\.' . $type . '$#i', $fname) && + filesize($rootdir . $dir . '/' . $fname)) + { + $images[] = array('path' => $dir, 'file' => $fname); + } + else if ($fname != '.' && $fname != '..' && + !is_file($rootdir . $dir . '/' . $fname) && + !is_link($rootdir . $dir . '/' . $fname)) + { + filelist($rootdir, $dir . '/'. $fname, $type); + } + } + + closedir($dh); + + return $images; +} +// +// FUNCTIONS +// --------- ?>
\ No newline at end of file diff --git a/phpBB/install/schemas/mysql_basic.sql b/phpBB/install/schemas/mysql_basic.sql index 59152ebd62..4a2edd79f1 100644 --- a/phpBB/install/schemas/mysql_basic.sql +++ b/phpBB/install/schemas/mysql_basic.sql @@ -5,22 +5,14 @@ # # -- Config -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg',''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename','yourdomain.com'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc','A _little_ text to describe your forum'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name','phpbb22'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path','/'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain',''); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure','0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length','3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments','1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_html','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_html_tags','b,i,u,pre'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_bbcode','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_smilies','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_sig','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_namechange','0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_attachments','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_topic_notify','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_forum_notify','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_local','0'); @@ -28,24 +20,34 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_remot INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_avatar_upload','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_nocensors','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_emailreuse','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars','.*?'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_disable_msg',''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_name','phpbb22'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_path','/'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_domain',''); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('cookie_secure','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style','1'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_name_chars','3'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_name_chars','30'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('min_pass_chars','6'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('max_pass_chars','30'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('allow_name_chars','.*?'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_style','1'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('default_dateformat','D M d, Y g:i a'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_timezone','0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_dst','0'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('session_length','3600'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('sitename','yourdomain.com'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('site_desc','A _little_ text to describe your forum'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('override_user_style','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('posts_per_page','10'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('topics_per_page','25'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('hot_threshold','25'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('board_email_form','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_path','images/avatars/upload'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('avatar_gallery_path','images/avatars/gallery'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('smilies_path','images/smiles'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('icons_path','images/icons'); +INSERT INTO phpbb_config (config_name, config_value) VALUES ('ranks_path','images/ranks'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('email_enable','1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('privmsg_disable','0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('gzip_compress','0'); @@ -53,7 +55,6 @@ INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_name', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('server_port', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('script_path', ''); INSERT INTO phpbb_config (config_name, config_value) VALUES ('limit_load', '2.0'); -INSERT INTO phpbb_config (config_name, config_value) VALUES ('active_sessions', '0'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online_time', '5'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_online', '1'); INSERT INTO phpbb_config (config_name, config_value) VALUES ('load_birthdays', '1'); @@ -225,7 +226,6 @@ INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_readpm', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_sendpm', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_viewonline', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_viewprofile', 1); -INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_setavatar', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_chgavatar', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_chggrp', 1); INSERT INTO phpbb_auth_options (auth_option, is_global) VALUES ('u_chgemail', 1); @@ -308,14 +308,8 @@ INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 5, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option LIKE 'a_%'; -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 1, 0, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option IN ('u_%'); - -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 2, 0, auth_option_id, 0 FROM phpbb_auth_options WHERE auth_option IN ('u_%'); - -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('u_', 'u_sendemail', 'u_readpm', 'u_sendpm', 'u_viewprofile', 'u_chgavatar', 'u_chgemail', 'u_chgpasswd', 'u_search'); -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 2, auth_option_id, 2 FROM phpbb_auth_options WHERE auth_option IN ('u_viewonline', 'u_chgname'); - -INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 5, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('u_%'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 3, 0, auth_option_id, 1 FROM phpbb_auth_options WHERE auth_option IN ('u_%'); +INSERT INTO phpbb_auth_groups (group_id, forum_id, auth_option_id, auth_setting) SELECT 5, 0, auth_option_id, 2 FROM phpbb_auth_options WHERE auth_option IN ('u_%') AND auth_option NOT IN ('u_chgcensors', 'u_chggrp'); # -- Moderator cache diff --git a/phpBB/language/en/lang_admin.php b/phpBB/language/en/lang_admin.php index 61e7185f36..524429965b 100644 --- a/phpBB/language/en/lang_admin.php +++ b/phpBB/language/en/lang_admin.php @@ -383,13 +383,12 @@ $lang = array_merge($lang, array( 'acl_u_sendemail' => 'Can send emails', 'acl_u_sendpm' => 'Can send private messages', 'acl_u_readpm' => 'Can read private messages', - 'acl_u_setavatar' => 'Can display avatar', 'acl_u_chgavatar' => 'Can change avatar', - 'acl_u_chgcolor' => 'Can change default group', 'acl_u_chgemail' => 'Can change email address', 'acl_u_chgname' => 'Can change username', 'acl_u_chggrp' => 'Can change default usergroup', 'acl_u_chgpasswd' => 'Can change password', + 'acl_u_chgcensors' => 'Can disable word censors', 'acl_u_search' => 'Can search board', @@ -476,6 +475,8 @@ $lang = array_merge($lang, array( 'SMILIES_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/smilies', 'ICONS_PATH' => 'Post icons storage path', 'ICONS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/icons', + 'RANKS_PATH' => 'Rank image storage path', + 'RANKS_PATH_EXPLAIN' => 'Path under your phpBB root dir, e.g. images/ranks', 'LOAD_SETTINGS_EXPLAIN' => 'Here you can enable and disable certain board functions to reduce the amount of processing required. On most servers there is no need to disable any functions. However on certain systems or in shared hosting environments it may be beneficial to disable capabilities you do not really need. You can also specify limits for system load and active sessions beyond which the board will go offline.', diff --git a/phpBB/language/en/lang_main.php b/phpBB/language/en/lang_main.php index 8043c73be4..36dbd70d0e 100644 --- a/phpBB/language/en/lang_main.php +++ b/phpBB/language/en/lang_main.php @@ -246,9 +246,11 @@ $lang = array( 'G_SUPER_MODERATORS'=> 'SUPER MODERATORS', 'G_MODERATORS' => 'MODERATORS', 'G_REGISTERED' => 'REGISTERED USERS', + 'G_REGISTERED_COPPA'=> 'REGISTERED COPPA USERS', 'G_INACTIVE' => 'INACTIVE USERS', + 'G_INACTIVE_COPPA' => 'INACTIVE COPPA USERS', 'G_GUESTS' => 'GUESTS', - 'G_BANNED' => 'BANNED', + 'G_BANNED' => 'BANNED USERS', 'NO_NEW_POSTS' => 'No new posts', 'NEW_POSTS' => 'New posts', @@ -710,8 +712,8 @@ $lang = array( 'UPLOAD_AVATAR_URL_EXPLAIN' => 'Enter the URL of the location containing the image, it will be copied to this site.', 'LINK_REMOTE_AVATAR' => 'Link off-site', 'LINK_REMOTE_AVATAR_EXPLAIN'=> 'Enter the URL of the location containing the Avatar image you wish to link to.', - 'LINK_REMOTE_SIZE' => 'Size of off-site avatar', - 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the offsite avatar, leave blank to attempt automatic verification.', + 'LINK_REMOTE_SIZE' => 'Avatar dimensions', + 'LINK_REMOTE_SIZE_EXPLAIN' => 'Specify the width and height of the avatar, leave blank to attempt automatic verification.', 'BY' => 'by', // Width by Height 'AVATAR_GALLERY' => 'Select from gallery', 'AVATAR_CATEGORY' => 'Category', diff --git a/phpBB/memberlist.php b/phpBB/memberlist.php index be316d0b19..254cd88625 100644 --- a/phpBB/memberlist.php +++ b/phpBB/memberlist.php @@ -154,6 +154,8 @@ switch ($mode) unset($row); + + // TODO // Which forums does this user have an enabled post count? // Really auth should be handling this capability ... $post_count_sql = array(); @@ -172,6 +174,7 @@ switch ($mode) + // Grab all the relevant data $sql = "SELECT COUNT(p.post_id) AS num_posts FROM " . POSTS_TABLE . " p, " . FORUMS_TABLE . " f @@ -254,7 +257,7 @@ switch ($mode) } $poster_avatar .= $member['user_avatar']; - $poster_avatar = '<img src="' . $poster_avatar . '" width="' . $row['user_avatar_width'] . '" height="' . $row['user_avatar_height'] . '" border="0" alt="" />'; + $poster_avatar = '<img src="' . $poster_avatar . '" width="' . $member['user_avatar_width'] . '" height="' . $member['user_avatar_height'] . '" border="0" alt="" />'; } $template->assign_vars(show_profile($member)); @@ -713,17 +716,9 @@ function show_profile($data) $rank_title = $rank_img = ''; foreach ($ranksrow as $rank) { - if (empty($data['user_rank']) && $data['user_posts'] >= $rank['rank_min']) - { - $rank_title = $rank['rank_title']; - $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $rank['rank_image'] . '" border="0" alt="' . $rank_title . '" title="' . $rank_title . '" /><br />' : ''; - break; - } - - if (!empty($rank['rank_special']) && $data['user_rank'] == $rank['rank_id']) + if ((empty($rank['rank_special']) && empty($data['user_rank']) && $data['user_posts'] >= $rank['rank_min']) || (!empty($rank['rank_special']) && $data['user_rank'] == $rank['rank_id'])) { - $rank_title = $rank['rank_title']; - $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $rank['rank_image'] . '" border="0" alt="' . $rank_title . '" title="' . $rank_title . '" /><br />' : ''; + $rank_img = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" border="0" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : ''; break; } } diff --git a/phpBB/viewtopic.php b/phpBB/viewtopic.php index 6b5d77dd4a..326ccca9d6 100644 --- a/phpBB/viewtopic.php +++ b/phpBB/viewtopic.php @@ -771,7 +771,7 @@ do if (!empty($row['user_rank'])) { $user_cache[$poster_id]['rank_title'] = $ranks['special'][$row['user_rank']]['rank_title']; - $user_cache[$poster_id]['rank_image'] = (!empty($ranks['special'][$row['user_rank']]['rank_image'])) ? '<img src="' . $ranks['special'][$row['user_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" /><br />' : ''; + $user_cache[$poster_id]['rank_image'] = (!empty($ranks['special'][$row['user_rank']]['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $ranks['special'][$row['user_rank']]['rank_image'] . '" border="0" alt="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" title="' . $ranks['special'][$row['user_rank']]['rank_title'] . '" /><br />' : ''; } else { @@ -780,7 +780,7 @@ do if ($row['user_posts'] >= $rank['rank_min']) { $user_cache[$poster_id]['rank_title'] = $rank['rank_title']; - $user_cache[$poster_id]['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $rank['rank_image'] . '" border="0" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : ''; + $user_cache[$poster_id]['rank_image'] = (!empty($rank['rank_image'])) ? '<img src="' . $config['ranks_path'] . '/' . $rank['rank_image'] . '" border="0" alt="' . $rank['rank_title'] . '" title="' . $rank['rank_title'] . '" /><br />' : ''; break; } } @@ -1021,7 +1021,7 @@ foreach ($rowset as $key => $row) 'ICQ_STATUS_IMG' => $user_cache[$poster_id]['icq_status_img'], 'U_EDIT' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_edit', $forum_id) && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_edit', $forum_id)) ? "posting.$phpEx$SID&mode=edit&f=" . $row['forum_id'] . "&p=" . $row['post_id'] : '', - 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "posting.$phpEx$SID&mode=quote&p=" . $row['post_id'] : '', + 'U_QUOTE' => ($auth->acl_get('f_quote', $forum_id)) ? "posting.$phpEx$SID&mode=quote&f=$forum_id&p=" . $row['post_id'] : '', 'U_IP' => ($auth->acl_get('m_ip', $forum_id)) ? "mcp.$phpEx?sid=" . $user->session_id . "&mode=post_details&p=" . $row['post_id'] . "&t=$topic_id#ip" : '', 'U_DELETE' => (($user->data['user_id'] == $poster_id && $auth->acl_get('f_delete', $forum_id) && $topic_data['topic_last_post_id'] == $row['post_id'] && ($row['post_time'] > time() - $config['edit_time'] || !$config['edit_time'])) || $auth->acl_get('m_delete', $forum_id)) ? "posting.$phpEx$SID&mode=delete&p=" . $row['post_id'] : '', |