Code Duplication    Length = 21-21 lines in 2 locations

modules/leaders.php 1 location

@@ 101-121 (lines=21) @@
98
			$legends = array();
99
			$groups = array();
100
101
			if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
102
			{
103
				$sql = 'SELECT group_id, group_name, group_colour, group_type, group_legend
104
					FROM ' . GROUPS_TABLE . '
105
					WHERE group_legend >= 1
106
					ORDER BY ' . $order_legend . ' ASC';
107
			}
108
			else
109
			{
110
				$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type, g.group_legend
111
					FROM ' . GROUPS_TABLE . ' g
112
					LEFT JOIN ' . USER_GROUP_TABLE . ' ug
113
						ON (
114
							g.group_id = ug.group_id
115
							AND ug.user_id = ' . $this->user->data['user_id'] . '
116
							AND ug.user_pending = 0
117
						)
118
					WHERE g.group_legend >= 1
119
						AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . $this->user->data['user_id'] . ')
120
					ORDER BY g.' . $order_legend . ' ASC';
121
			}
122
			$result = $this->db->sql_query($sql, 600);
123
124
			while ($row = $this->db->sql_fetchrow($result))

modules/whois_online.php 1 location

@@ 101-121 (lines=21) @@
98
		$order_legend = ($this->config['legend_sort_groupname']) ? 'group_name' : 'group_legend';
99
100
		// Grab group details for legend display
101
		if ($this->auth->acl_gets('a_group', 'a_groupadd', 'a_groupdel'))
102
		{
103
			$sql = 'SELECT group_id, group_name, group_colour, group_type
104
				FROM ' . GROUPS_TABLE . '
105
				WHERE group_legend > 0
106
				ORDER BY ' . $order_legend . ' ASC';
107
		}
108
		else
109
		{
110
			$sql = 'SELECT g.group_id, g.group_name, g.group_colour, g.group_type
111
				FROM ' . GROUPS_TABLE . ' g
112
				LEFT JOIN ' . USER_GROUP_TABLE . ' ug
113
					ON (
114
						g.group_id = ug.group_id
115
						AND ug.user_id = ' . (int) $this->user->data['user_id'] . '
116
						AND ug.user_pending = 0
117
					)
118
				WHERE g.group_legend > 0
119
					AND (g.group_type <> ' . GROUP_HIDDEN . ' OR ug.user_id = ' . (int) $this->user->data['user_id'] . ')
120
				ORDER BY g.' . $order_legend . ' ASC';
121
		}
122
		$result = $this->db->sql_query($sql);
123
124
		$legend = array();