" . TRUE . " AND ug.user_pending <> ".TRUE . " AND ug.user_id = " . $userdata['user_id'] . " GROUP BY g.group_id"; if ($result = $db->sql_query($sql) ) { while( $row = $db->sql_fetchrow($result) ) { $group_access[] = $row; } } $db->sql_freeresult($result); if ( empty($group_access) ) { if ( $no_group_upi2db_on == 1 && $no_group_min_posts <= $user_min_posts && $no_group_min_regdays <= $user_min_regdays ) { return TRUE; } } else { for($i = 0; $i < count($group_access); $i++) { if($group_access[$i]['upi2db_on'] == '1' && $group_access[$i]['upi2db_min_posts'] <= $user_min_posts && $group_access[$i]['upi2db_min_regdays'] <= $user_min_regdays) { return TRUE; } } } return FALSE; } //################################### check_is_upi2db_on ########################################## function check_upi2db_on($userdata) { global $board_config; $user_upi2db_on = $userdata['user_upi2db_which_system']; $user_upi2db_disable = $userdata['user_upi2db_disable']; $admin_upi2db_on = $board_config['upi2db_on']; if($board_config['board_disable'] || $user_upi2db_disable || !$userdata['session_logged_in'] || !$admin_upi2db_on ) { return FALSE; } elseif( $admin_upi2db_on == 1 || ($admin_upi2db_on == 2 && $user_upi2db_on == 1)) { return check_group_auth($userdata); } return FALSE; } ?>