isAdmin( $user_id ); $query_groups = ""; if($isAdmin) $home_info = $db->getGameHome($home_id); else { $home_info = $db->getUserGameHome($user_id,$home_id); $groups = $db->getUsersGroups($_SESSION['user_id']); if (!is_array($groups)) { $groups = []; } $query_groups .= " AND ("; foreach ((array)$groups as $group) $query_groups .= "group_id=".$group['group_id']." OR "; $query_groups .= "group_id=0 OR group_id IS NULL)"; } if ($home_info) { scm_ensure_workshop_schema($db); $home_cfg_id = $home_info['home_cfg_id']; echo "

Server Content: ".htmlentities($home_info['home_name'])."

\n". "\n". "\n"; // Iterate all registered content types. Each type that has at least // one item for this game generates a link to the installer page. // New types added to server_content_categories.php automatically // appear here without any further code changes. $categories = get_server_content_categories(); // key => label $printed_any_cell = false; foreach ((array)$categories as $type_key => $type_label) { $items = $db->resultQuery( "SELECT DISTINCT addon_id, name, game_name " . "FROM OGP_DB_PREFIXaddons " . "NATURAL JOIN OGP_DB_PREFIXconfig_homes " . "WHERE addon_type='" . $db->realEscapeSingle($type_key) . "' " . "AND home_cfg_id=" . (int)$home_cfg_id . $query_groups ); $items_qty = is_array($items) ? count((array)$items) : 0; if ($items && $items_qty >= 1) { if ($printed_any_cell) echo "\n"; echo "\n". "
\n"; else echo "\n"; $printed_any_cell = true; // Workshop items route to the workshop_content page where users // enter their own Workshop IDs. All other types use the installer. if ($type_key === 'workshop_item') { $first_addon_id = isset($items[0]['addon_id']) ? (int)$items[0]['addon_id'] : 0; echo "" . htmlspecialchars($type_label) . " (" . $items_qty . ")" . "\n"; } else { echo "" . htmlspecialchars($type_label) . " (" . $items_qty . ")" . "\n"; } } } if ($printed_any_cell) echo "
\n". "
\n". "\n". "
\n". "
\n"; } else print_failure(get_lang('no_games_servers_available')); } ?>