aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/groupcp.php
diff options
context:
space:
mode:
authorPaul S. Owen <psotfx@users.sourceforge.net>2002-03-03 23:32:36 +0000
committerPaul S. Owen <psotfx@users.sourceforge.net>2002-03-03 23:32:36 +0000
commit0eccf47be03199d63a7dec8436fa804124fbe66e (patch)
tree070cab23adc475eafec5f2f1a61529bc0711300f /phpBB/groupcp.php
parent0a01693cddf8aee54296d314de00d87815255212 (diff)
downloadforums-0eccf47be03199d63a7dec8436fa804124fbe66e.tar
forums-0eccf47be03199d63a7dec8436fa804124fbe66e.tar.gz
forums-0eccf47be03199d63a7dec8436fa804124fbe66e.tar.bz2
forums-0eccf47be03199d63a7dec8436fa804124fbe66e.tar.xz
forums-0eccf47be03199d63a7dec8436fa804124fbe66e.zip
Fix lack of display if no groups exist, bug #520902
git-svn-id: file:///svn/phpbb/trunk@2259 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/groupcp.php')
-rw-r--r--phpBB/groupcp.php38
1 files changed, 23 insertions, 15 deletions
diff --git a/phpBB/groupcp.php b/phpBB/groupcp.php
index ffa465b8eb..9207aca233 100644
--- a/phpBB/groupcp.php
+++ b/phpBB/groupcp.php
@@ -553,11 +553,10 @@ else if( $group_id )
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
}
- if( !$db->sql_numrows($result) )
+ if( !($group_info = $db->sql_fetchrow($result)) )
{
message_die(GENERAL_MESSAGE, $lang['Group_not_exist']);
}
- $group_info = $db->sql_fetchrow($result);
//
// Get moderator details for this group
@@ -1064,8 +1063,7 @@ else
//
$sql = "SELECT g.group_id, g.group_name, g.group_type, ug.user_pending
FROM " . GROUPS_TABLE . " g, " . USER_GROUP_TABLE . " ug
- WHERE
- ug.user_id = " . $userdata['user_id'] . "
+ WHERE ug.user_id = " . $userdata['user_id'] . "
AND ug.group_id = g.group_id
AND g.group_single_user <> " . TRUE . "
ORDER BY g.group_name, ug.user_id";
@@ -1074,21 +1072,31 @@ else
message_die(GENERAL_ERROR, "Error getting group information", "", __LINE__, __FILE__, $sql);
}
- $in_group = array();
- $s_member_groups_opt = "";
- $s_pending_groups_opt = "";
- while( $row = $db->sql_fetchrow($result) )
+ if ( $row = $db->sql_fetchrow($result) )
{
- $in_group[] = $row['group_id'];
- if ( $row['user_pending'] )
- {
- $s_pending_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
- }
- else
+ $in_group = array();
+ $s_member_groups_opt = "";
+ $s_pending_groups_opt = "";
+
+ do
{
- $s_member_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
+ $in_group[] = $row['group_id'];
+ if ( $row['user_pending'] )
+ {
+ $s_pending_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
+ }
+ else
+ {
+ $s_member_groups_opt .= '<option value="' . $row['group_id'] . '">' . $row['group_name'] . '</option>';
+ }
}
+ while( $row = $db->sql_fetchrow($result) );
}
+ else
+ {
+ message_die(GENERAL_MESSAGE, $lang['No_groups_exist']);
+ }
+
$s_pending_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_pending_groups_opt . "</select>";
$s_member_groups = '<select name="' . POST_GROUPS_URL . '">' . $s_member_groups_opt . "</select>";