diff options
| author | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-06-06 15:23:50 +0000 |
|---|---|---|
| committer | Paul S. Owen <psotfx@users.sourceforge.net> | 2003-06-06 15:23:50 +0000 |
| commit | d1dd262f831db070ad5c1e6e179d2e3099556383 (patch) | |
| tree | f457a8b8498f9c31fd5c9e9dd589c443178425dd /phpBB/adm | |
| parent | 8a09c0d75f1da62d40b71cb67f74de9ac005d5a7 (diff) | |
| download | forums-d1dd262f831db070ad5c1e6e179d2e3099556383.tar forums-d1dd262f831db070ad5c1e6e179d2e3099556383.tar.gz forums-d1dd262f831db070ad5c1e6e179d2e3099556383.tar.bz2 forums-d1dd262f831db070ad5c1e6e179d2e3099556383.tar.xz forums-d1dd262f831db070ad5c1e6e179d2e3099556383.zip | |
Various updates and fixes ... no doubt there are new bugs but where would the fun be without them?
git-svn-id: file:///svn/phpbb/trunk@4090 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/adm')
| -rw-r--r-- | phpBB/adm/admin_board.php | 8 | ||||
| -rw-r--r-- | phpBB/adm/admin_email.php | 177 | ||||
| -rw-r--r-- | phpBB/adm/admin_forums.php | 36 | ||||
| -rw-r--r-- | phpBB/adm/admin_icons.php | 33 | ||||
| -rw-r--r-- | phpBB/adm/admin_prune.php | 2 | ||||
| -rw-r--r-- | phpBB/adm/admin_ranks.php | 35 | ||||
| -rw-r--r-- | phpBB/adm/subSilver.css | 1 |
7 files changed, 134 insertions, 158 deletions
diff --git a/phpBB/adm/admin_board.php b/phpBB/adm/admin_board.php index 694d3a8b1a..1d7b8a70e9 100644 --- a/phpBB/adm/admin_board.php +++ b/phpBB/adm/admin_board.php @@ -182,6 +182,10 @@ switch ($mode) <td class="row2"><input class="post" type="text" size="4" maxlength="10" name="avatar_filesize" value="<?php echo $new['avatar_filesize']; ?>" /> Bytes</td> </tr> <tr> + <td class="row1"><?php echo $user->lang['MIN_AVATAR_SIZE']; ?>: <br /><span class="gensmall"><?php echo $user->lang['MIN_AVATAR_SIZE_EXPLAIN']; ?></span></td> + <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="avatar_min_height" value="<?php echo $new['avatar_min_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="avatar_min_width" value="<?php echo $new['avatar_min_width']; ?>"></td> + </tr> + <tr> <td class="row1"><?php echo $user->lang['MAX_AVATAR_SIZE']; ?>: <br /><span class="gensmall"><?php echo $user->lang['MAX_AVATAR_SIZE_EXPLAIN']; ?></span></td> <td class="row2"><input class="post" type="text" size="3" maxlength="4" name="avatar_max_height" value="<?php echo $new['avatar_max_height']; ?>" /> x <input class="post" type="text" size="3" maxlength="4" name="avatar_max_width" value="<?php echo $new['avatar_max_width']; ?>"></td> </tr> @@ -309,6 +313,10 @@ switch ($mode) <td class="row2"><input class="post" type="text" size="3" maxlength="3" name="min_pass_chars" value="<?php echo $new['min_pass_chars']; ?>" /> <?php echo $user->lang['MIN_CHARS']; ?> <input class="post" type="text" size="3" maxlength="3" name="max_pass_chars" value="<?php echo $new['max_pass_chars']; ?>" /> <?php echo $user->lang['MAX_CHARS']; ?></td> </tr> <tr> + <td class="row1"><?php echo $user->lang['MIN_RATINGS']; ?>: <br /><span class="gensmall"><?php echo $user->lang['MIN_RATINGS_EXPLAIN']; ?></span</td> + <td class="row2"><input class="post" type="text" size="3" maxlength="5" name="min_ratings" value="<?php echo $new['min_ratings']; ?>" /></td> + </tr> + <tr> <td class="row1"><?php echo $user->lang['ALLOW_EMAIL_REUSE']; ?>: <br /><span class="gensmall"><?php echo $user->lang['ALLOW_EMAIL_REUSE_EXPLAIN']; ?></span></td> <td class="row2"><input type="radio" name="allow_emailreuse" value="1" <?php echo $emailreuse_yes; ?> /> <?php echo $user->lang['YES']; ?> <input type="radio" name="allow_emailreuse" value="0" <?php echo $emailreuse_no; ?> /> <?php echo $user->lang['NO']; ?></td> </tr> diff --git a/phpBB/adm/admin_email.php b/phpBB/adm/admin_email.php index 2a1d0b38ca..00353ee399 100644 --- a/phpBB/adm/admin_email.php +++ b/phpBB/adm/admin_email.php @@ -39,60 +39,66 @@ if (!$auth->acl_get('a_email')) } // Set some vars -$message = ''; -$subject = ''; +$message = $subject = $group_id = ''; // Do the job ... if (isset($_POST['submit'])) { - // Increase maximum execution time in case of a lot of users, but don't complain about it if it isn't - // allowed. + // Increase maximum execution time in case of a lot of users, but don't complain + // about it if it isn't allowed. @set_time_limit(1200); - $group_id = intval($_POST['g']); + // Error checking needs to go here ... if no subject and/or no message then skip + // over the send and return to the form + $group_id = (isset($_POST['g'])) ? intval($_POST['g']) : 0; + $subject = (!empty($_POST['subject'])) ? stripslashes(trim($_POST['subject'])) : ''; + $message = (!empty($_POST['message'])) ? stripslashes(trim($_POST['message'])) : ''; - if ($group_id > 0) + $error = array(); + if ($subject == '') { - $sql = 'SELECT u.user_email, u.username, u.user_lang - FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug - WHERE ug.group_id = $group_id - AND g.user_pending <> " . TRUE . " - AND u.user_id = ug.user_id"; + $error[] = $user->lang['NO_EMAIL_SUBJECT']; } - else + + if ($message == '') { - $sql = 'SELECT user_email FROM ' . USERS_TABLE; + $error[] = $user->lang['NO_EMAIL_MESSAGE']; } - $result = $db->sql_query($sql); - $subject = stripslashes(trim($_POST['subject'])); - $message = stripslashes(trim($_POST['message'])); - - if (!($row = $db->sql_fetchrow($result))) + if (!sizeof($error)) { - // Output a relevant GENERAL_MESSAGE about users/group - // not existing - trigger_error($user->lang['GROUP_DOES_NOT_EXIST']); - } + $sql = ($group_id) ? 'SELECT u.user_email, u.username, u.user_lang FROM ' . USERS_TABLE . ' u, ' . USER_GROUP_TABLE . " ug WHERE ug.group_id = $group_id AND ug.user_pending <> 1 AND u.user_id = ug.user_id AND u.user_allow_massemail = 1" : 'SELECT user_email FROM ' . USERS_TABLE . ' WHERE user_allow_massemail = 1'; + $result = $db->sql_query($sql); + if (!($row = $db->sql_fetchrow($result))) + { + trigger_error($user->lang['NO_USER']); + } + $db->sql_freeresult($result); - // Error checking needs to go here ... if no subject and/or - // no message then skip over the send and return to the form - + $i = 0; + $email_list = array(); + do + { + $email_list[$row['user_lang']][$i]['email'] = $row['user_email']; + $email_list[$row['user_lang']][$i]['name'] = $row['username']; + $i++; + } + while ($row = $db->sql_fetchrow($result)); + $db->sql_freeresult($result); - if ($subject != '' && $message != '') - { - include($phpbb_root_path . 'includes/emailer.'.$phpEx); - // Let's do some checking to make sure that mass mail functions - // are working in win32 versions of php. - if (preg_match('/[c-z]:\\\.*/i', getenv('PATH')) && !$config['smtp_delivery']) + // Let's do some checking to make sure that mass mail functions are working in win32 versions of php. + if (preg_match('#^[c-z]:\\\#i', getenv('PATH')) && !$config['smtp_delivery'] && phpversion() < '4.3') { - // We are running on windows, force delivery to use - // our smtp functions since php's are broken by default + // We are running on windows, force delivery to use our smtp functions since + // php's are broken by default $config['smtp_delivery'] = 1; - $config['smtp_host'] = get_cfg_var('SMTP'); + $config['smtp_host'] = @ini_get('SMTP'); } + + + include($phpbb_root_path . 'includes/emailer.'.$phpEx); $emailer = new emailer(true); $extra_headers = 'X-AntiAbuse: Board servername - ' . $config['server_name'] . "\r\n"; @@ -100,62 +106,72 @@ if (isset($_POST['submit'])) $extra_headers .= 'X-AntiAbuse: Username - ' . $user->data['username'] . "\r\n"; $extra_headers .= 'X-AntiAbuse: User IP - ' . $user->ip . "\r\n"; - $email_list = array(); - $count = 0; - do + foreach ($email_list as $lang => $to_ary) { - $email_list[$count]['email'] = $row['user_email']; - $email_list[$count]['name'] = $row['username']; - $email_list[$count]['lang'] = $row['user_lang']; - $count++; - } - while ($row = $db->sql_fetchrow($result)); - $db->sql_freeresult($result); + foreach ($to_ary as $to) + { + $emailer->template('admin_send_email', $lang); - foreach ($email_list as $addr) - { - $emailer->template('admin_send_email', $addr['lang']); + $emailer->subject($subject); + $emailer->headers($extra_headers); - $emailer->subject($subject); - $emailer->headers($extra_headers); + $emailer->replyto($config['board_email']); + $emailer->to($to['email'], $to['name']); - $emailer->replyto($config['board_email']); - $emailer->to($addr['email'], $addr['name']); + $emailer->assign_vars(array( + 'SITENAME' => $config['sitename'], + 'CONTACT_EMAIL' => $config['board_contact'], + 'MESSAGE' => $message) + ); - - $emailer->assign_vars(array( - 'SITENAME' => $config['sitename'], - 'CONTACT_EMAIL' => $config['board_contact'], - 'MESSAGE' => $message) - ); - - $emailer->send(); - $emailer->reset(); + $emailer->send(); + $emailer->reset(); + } } - + $emailer->queue->save(); unset($email_list); - - add_log('admin', 'LOG_MASS_EMAIL'); - trigger_error($user->lang['EMAIL_SENT'], E_USER_NOTICE); + + if ($group_id) + { + $sql = 'SELECT group_name + FROM ' . GROUPS_TABLE . " + WHERE group_id = $group_id"; + $result = $db->sql_query($sql); + + $row = $db->sql_fetchrow($result); + $db->sql_freeresult($result); + extract($row); + } + else + { + // Not great but the logging routine doesn't cope well with localising + // on the fly + $group_name = $user->lang['ALL_USERS']; + } + + add_log('admin', 'LOG_MASS_EMAIL', $group_name); + trigger_error($user->lang['EMAIL_SENT']); } } // Initial selection -$sql = 'SELECT group_id, group_name - FROM ' . GROUPS_TABLE; +$sql = 'SELECT group_id, group_type, group_name + FROM ' . GROUPS_TABLE . ' + ORDER BY group_type DESC, group_name ASC'; $result = $db->sql_query($sql); -$select_list = '<select name="g"><option value="-1">' . $user->lang['ALL_USERS'] . '</option>'; +$select_list = '<option value="0"' . ((!$group_id) ? ' selected="selected"' : '') . '>' . $user->lang['ALL_USERS'] . '</option>'; if ($row = $db->sql_fetchrow($result)) { do { - $select_list .= '<option value = "' . $row['group_id'] . '">' . $row['group_name'] . '</option>'; + $selected = ($group_id == $row['group_id']) ? ' selected="selected"' : ''; + $select_list .= '<option value = "' . $row['group_id'] . '"' . (($row['group_type'] == GROUP_SPECIAL) ? ' class="blue"' : '') . $selected . '>' . (($row['group_type'] == GROUP_SPECIAL) ? $user->lang['G_' . $row['group_name']] : $row['group_name']) . '</option>'; } while ($row = $db->sql_fetchrow($result)); } -$select_list .= '</select>'; +$db->sql_freeresult($result); adm_page_header($user->lang['MASS_EMAIL']); @@ -165,22 +181,35 @@ adm_page_header($user->lang['MASS_EMAIL']); <p><?php echo $user->lang['MASS_EMAIL_EXPLAIN']; ?></p> -<form method="post" action="admin_email.<?php echo $phpEx.$SID; ?>"> -<table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> +<form method="post" action="admin_email.<?php echo $phpEx.$SID; ?>"><table class="bg" cellspacing="1" cellpadding="4" border="0" align="center"> <tr> <th colspan="2"><?php echo $user->lang['COMPOSE']; ?></th> </tr> +<?php + + if (sizeof($error)) + { + +?> + <tr> + <td class="row3" colspan="2" align="center"><span class="error"><?php echo implode('<br />', $error); ?></span></td> + </tr> +<?php + + } + +?> <tr> <td class="row1" align="right"><b><?php echo $user->lang['RECIPIENTS']; ?></b></td> - <td class="row2" align="left"><?php echo $select_list; ?></td> + <td class="row2" align="left"><select name="g"><?php echo $select_list; ?></select></td> </tr> <tr> <td class="row1" align="right"><b><?php echo $user->lang['SUBJECT']; ?></b></td> - <td class="row2"><span class="gen"><input type="text" name="subject" size="45" maxlength="100" tabindex="2" class="post" value="<?php echo $subject; ?>" /></span></td> + <td class="row2"><input class="post" type="text" name="subject" size="45" maxlength="100" tabindex="2" value="<?php echo $subject; ?>" /></td> </tr> <tr> <td class="row1" align="right" valign="top"><span class="gen"><b><?php echo $user->lang['MESSAGE']; ?></b></span> - <td class="row2"><textarea class="post" name="message" rows="15" cols="35" wrap="virtual" style="width:450px" tabindex="3"><?php echo $message; ?></textarea></td> + <td class="row2"><textarea class="post" name="message" rows="10" cols="76" wrap="virtual" tabindex="3"><?php echo $message; ?></textarea></td> </tr> <tr> <td class="cat" colspan="2" align="center"><input type="submit" value="<?php echo $user->lang['EMAIL']; ?>" name="submit" class="mainoption" /></td> diff --git a/phpBB/adm/admin_forums.php b/phpBB/adm/admin_forums.php index b43ef2437b..37a74153f5 100644 --- a/phpBB/adm/admin_forums.php +++ b/phpBB/adm/admin_forums.php @@ -515,15 +515,15 @@ switch ($mode) </tr> <tr> <td class="row1"><?php echo $user->lang['FORUM_TOPICS_PAGE'] ?>: <br /><span class="gensmall"><?php echo $user->lang['FORUM_TOPICS_PAGE_EXPLAIN']; ?></span></td> - <td class="row2"><input type="text" name="topics_per_page" value="<?php echo $forum_topics_per_page; ?>" size="3" maxlength="3" /></td> + <td class="row2"><input class="post" type="text" name="topics_per_page" value="<?php echo $forum_topics_per_page; ?>" size="3" maxlength="3" /></td> </tr> <tr> <td class="row1"><?php echo $user->lang['FORUM_PASSWORD'] ?>: <br /><span class="gensmall"><?php echo $user->lang['FORUM_PASSWORD_EXPLAIN']; ?></span></td> - <td class="row2"><input type="password" name="forum_password" value="<?php echo $forum_password; ?>" size="25" maxlength="25" /></td> + <td class="row2"><input class="post" type="password" name="forum_password" value="<?php echo $forum_password; ?>" size="25" maxlength="25" /></td> </tr> <tr> <td class="row1"><?php echo $user->lang['FORUM_PASSWORD_CONFIRM'] ?>: <br /><span class="gensmall"><?php echo $user->lang['FORUM_PASSWORD_CONFIRM_EXPLAIN']; ?></span></td> - <td class="row2"><input type="password" name="forum_password_confirm" value="<?php echo $forum_password_confirm; ?>" size="25" maxlength="25" /></td> + <td class="row2"><input class="post" type="password" name="forum_password_confirm" value="<?php echo $forum_password_confirm; ?>" size="25" maxlength="25" /></td> </tr> <?php @@ -992,25 +992,31 @@ while ($row = $db->sql_fetchrow($result)) <tr> <td class="row1" width="5%"><?php echo $folder_image; ?></td> <td class="row1" width="50%"><table width="100%" cellspacing="0" cellpadding="0" border="0"> - <tr> - <td><span class="forumlink"><?php echo $forum_title ?></span></td><?php + <tr> + <td><span class="forumlink"><?php echo $forum_title ?></span></td> + </tr> + </table> + <table cellspacing="5" cellpadding="0" border="0"> + <tr> + <td class="gensmall"><?php echo $row['forum_desc'] ?></td> + </tr> + </table> +<?php if ($forum_type == FORUM_POST) { ?> - <td class="gensmall" align="right"> <?php echo $user->lang['TOPICS']; ?>: <b><?php echo $row['forum_topics'] ?></b> / <?php echo $user->lang['POSTS']; ?>: <b><?php echo $row['forum_posts'] ?></b></td><?php + <table width="100%" cellspacing="0" cellpadding="0" border="0"> + <tr> + <td class="gensmall"> <?php echo $user->lang['TOPICS']; ?>: <b><?php echo $row['forum_topics'] ?></b> / <?php echo $user->lang['POSTS']; ?>: <b><?php echo $row['forum_posts'] ?></b></td> + </tr> + </table> +<?php } -?> - </tr> - </table> - <table cellspacing="5" cellpadding="0" border="0"> - <tr> - <td class="gensmall"><?php echo $row['forum_desc'] ?></td> - </tr> - </table></td> +?></td> <td class="row2" width="15%" align="center" valign="middle" nowrap="nowrap"><a href="admin_forums.<?php echo $url ?>&mode=move_up"><?php echo $user->lang['MOVE_UP'] ?></a><br /><a href="admin_forums.<?php echo $url ?>&mode=move_down"><?php echo $user->lang['MOVE_DOWN'] ?></a></td> <td class="row2" width="20%" align="center" valign="middle" nowrap="nowrap"> <a href="admin_forums.<?php echo $url ?>&mode=edit"><?php echo $user->lang['EDIT'] ?></a> | <a href="admin_forums.<?php echo $url ?>&mode=delete"><?php echo $user->lang['DELETE'] ?></a><?php @@ -1030,7 +1036,7 @@ while ($row = $db->sql_fetchrow($result)) ?> <tr> - <td width="100%" colspan="6" class="cat"><input type="hidden" name="mode" value="add" /><input type="hidden" name="parent_id" value="<? echo $forum_id ?>" /><input type="text" name="forum_name" /> <input class="liteoption" type="submit" value="<?php echo $user->lang['CREATE_FORUM'] ?>" /></td> + <td width="100%" colspan="6" class="cat"><input type="hidden" name="mode" value="add" /><input type="hidden" name="parent_id" value="<? echo $forum_id ?>" /><input class="post" type="text" name="forum_name" /> <input class="liteoption" type="submit" value="<?php echo $user->lang['CREATE_FORUM'] ?>" /></td> </tr> </table></form> diff --git a/phpBB/adm/admin_icons.php b/phpBB/adm/admin_icons.php index 1555910972..09912ccb54 100644 --- a/phpBB/adm/admin_icons.php +++ b/phpBB/adm/admin_icons.php @@ -721,37 +721,4 @@ function update_image_dimensions() break; } -// --------- -// FUNCTIONS -// -function filelist($rootdir, $dir = '', $type = 'gif|jpg|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/adm/admin_prune.php b/phpBB/adm/admin_prune.php index 6318f04785..dc8c27b580 100644 --- a/phpBB/adm/admin_prune.php +++ b/phpBB/adm/admin_prune.php @@ -220,7 +220,7 @@ else <td class="row2"><input type="radio" name="prune_sticky" value="1" /> <?php echo $user->lang['YES']; ?> <input type="radio" name="prune_sticky" value="0" checked="checked" /> <?php echo $user->lang['NO']; ?></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"></td> + <td class="cat" colspan="2" align="center"><input type="submit" name="submit" value="<?php echo $user->lang['SUBMIT']; ?>" class="mainoption"></td> </tr> </table></form> diff --git a/phpBB/adm/admin_ranks.php b/phpBB/adm/admin_ranks.php index 48b7bcb45f..7899e3bd27 100644 --- a/phpBB/adm/admin_ranks.php +++ b/phpBB/adm/admin_ranks.php @@ -277,9 +277,7 @@ function update_image_dimensions() </tr> <?php - // // Show the default page - // $sql = "SELECT * FROM " . RANKS_TABLE . " ORDER BY rank_min ASC, rank_special ASC"; $result = $db->sql_query($sql); @@ -329,37 +327,4 @@ function update_image_dimensions() 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/adm/subSilver.css b/phpBB/adm/subSilver.css index 6892d07784..f32f26ddeb 100644 --- a/phpBB/adm/subSilver.css +++ b/phpBB/adm/subSilver.css @@ -100,6 +100,7 @@ a.nav:hover { font: 8pt Verdana, Arial, Helvetica, sans-serif; letter-spacing: -1px; } +.error { color: #FF0000 } /* Tables |
