Merge pull request #44 from GameServerPanel/copilot/fix-cart-loading-and-consolidate-docs

Fix cart loading, consolidate duplicate game docs, add navigation
This commit is contained in:
Frank Harris 2025-11-07 14:12:13 -05:00 committed by GitHub
commit edf5e07670
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
735 changed files with 82 additions and 6821 deletions

View file

@ -188,7 +188,6 @@ mysqli_close($db);
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Shopping Cart - Game Server Panel</title>
<link rel="stylesheet" href="/includes/style.css">
<style>
body {
font-family: Arial, sans-serif;

View file

@ -96,7 +96,7 @@ foreach ($categories as $cat) {
$grouped[$category][] = $cat;
}
// Category labels
// Category labels - can be extended via JSON
$categoryLabels = [
'game' => 'Game Servers',
'panel' => 'Panel Documentation',
@ -104,6 +104,16 @@ $categoryLabels = [
'troubleshooting' => 'Troubleshooting',
'other' => 'Other'
];
// Sort categories by number of items (fewest to most)
uksort($grouped, function($a, $b) use ($grouped) {
$countA = count($grouped[$a]);
$countB = count($grouped[$b]);
if ($countA !== $countB) {
return $countA - $countB; // ascending order (fewest first)
}
return strcmp($a, $b);
});
?>
<!DOCTYPE html>
<html lang="en">
@ -274,6 +284,59 @@ $categoryLabels = [
background: none;
padding: 0;
}
.nav-links {
background: var(--card);
border: 1px solid var(--border);
border-radius: 8px;
padding: 20px;
margin-bottom: 30px;
}
.nav-links h3 {
margin: 0 0 15px;
color: var(--accent);
font-size: 18px;
}
.nav-links a {
display: inline-block;
padding: 8px 15px;
margin: 5px 10px 5px 0;
background: #1f2937;
border: 1px solid var(--border);
border-radius: 5px;
color: var(--accent);
text-decoration: none;
transition: all 0.2s;
}
.nav-links a:hover {
background: var(--accent);
color: var(--bg);
border-color: var(--accent);
}
.return-to-top {
text-align: center;
margin: 30px 0;
}
.return-to-top a {
display: inline-block;
padding: 10px 20px;
background: var(--card);
border: 1px solid var(--border);
border-radius: 8px;
color: var(--accent);
text-decoration: none;
transition: all 0.2s;
}
.return-to-top a:hover {
background: #1f2937;
border-color: var(--accent);
}
</style>
</head>
<body>
@ -301,7 +364,7 @@ $categoryLabels = [
<?php else: ?>
<!-- List all documentation categories -->
<div class="header">
<h1>Documentation</h1>
<h1 id="top">Documentation</h1>
<p>Browse our comprehensive documentation for game servers, panel features, and troubleshooting guides.</p>
</div>
@ -315,8 +378,19 @@ $categoryLabels = [
</ul>
</div>
<?php else: ?>
<!-- Navigation Links -->
<div class="nav-links">
<h3>Jump to Section:</h3>
<?php foreach ($grouped as $category => $docs): ?>
<a href="#<?php echo htmlspecialchars($category); ?>">
<?php echo htmlspecialchars($categoryLabels[$category] ?? ucfirst($category)); ?>
(<?php echo count($docs); ?>)
</a>
<?php endforeach; ?>
</div>
<?php foreach ($grouped as $category => $docs): ?>
<div class="category-section">
<div class="category-section" id="<?php echo htmlspecialchars($category); ?>">
<h2 class="category-title"><?php echo htmlspecialchars($categoryLabels[$category] ?? ucfirst($category)); ?></h2>
<div class="docs-grid">
@ -337,6 +411,10 @@ $categoryLabels = [
</a>
<?php endforeach; ?>
</div>
<div class="return-to-top">
<a href="#top"> Return to Top</a>
</div>
</div>
<?php endforeach; ?>
<?php endif; ?>

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.8 KiB

After

Width:  |  Height:  |  Size: 2.8 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.5 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 130 KiB

After

Width:  |  Height:  |  Size: 130 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.9 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 40 KiB

After

Width:  |  Height:  |  Size: 40 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 2.4 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 32 KiB

After

Width:  |  Height:  |  Size: 32 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 70 KiB

After

Width:  |  Height:  |  Size: 70 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.6 KiB

After

Width:  |  Height:  |  Size: 2.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 171 KiB

After

Width:  |  Height:  |  Size: 171 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.3 KiB

After

Width:  |  Height:  |  Size: 3.3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.2 KiB

After

Width:  |  Height:  |  Size: 3.2 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.6 KiB

After

Width:  |  Height:  |  Size: 3.6 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 36 KiB

After

Width:  |  Height:  |  Size: 36 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.7 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3.1 KiB

After

Width:  |  Height:  |  Size: 3.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 3 KiB

After

Width:  |  Height:  |  Size: 3 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

View file

Before

Width:  |  Height:  |  Size: 28 KiB

After

Width:  |  Height:  |  Size: 28 KiB

Before After
Before After

Some files were not shown because too many files have changed in this diff Show more