Merge pull request #44 from GameServerPanel/copilot/fix-cart-loading-and-consolidate-docs
Fix cart loading, consolidate duplicate game docs, add navigation
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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; ?>
|
||||
|
|
|
|||
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 2.8 KiB |
|
Before Width: | Height: | Size: 3.5 KiB After Width: | Height: | Size: 3.5 KiB |
|
Before Width: | Height: | Size: 130 KiB After Width: | Height: | Size: 130 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 2.9 KiB After Width: | Height: | Size: 2.9 KiB |
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 2.4 KiB After Width: | Height: | Size: 2.4 KiB |
|
Before Width: | Height: | Size: 32 KiB After Width: | Height: | Size: 32 KiB |
|
Before Width: | Height: | Size: 70 KiB After Width: | Height: | Size: 70 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 2.6 KiB After Width: | Height: | Size: 2.6 KiB |
|
Before Width: | Height: | Size: 171 KiB After Width: | Height: | Size: 171 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.3 KiB After Width: | Height: | Size: 3.3 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3.2 KiB After Width: | Height: | Size: 3.2 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 3.6 KiB After Width: | Height: | Size: 3.6 KiB |
|
Before Width: | Height: | Size: 46 KiB After Width: | Height: | Size: 46 KiB |
|
Before Width: | Height: | Size: 36 KiB After Width: | Height: | Size: 36 KiB |
|
Before Width: | Height: | Size: 2.7 KiB After Width: | Height: | Size: 2.7 KiB |
|
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 3.1 KiB |
|
Before Width: | Height: | Size: 3 KiB After Width: | Height: | Size: 3 KiB |
|
Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB |
|
Before Width: | Height: | Size: 28 KiB After Width: | Height: | Size: 28 KiB |