From fc0c9ce94451db5f85ac528c5a80567be07ddbdd Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:41:11 +0000 Subject: [PATCH 1/3] Initial plan From c55cc3eec1459525e478408b3fc493d5fa5518bf Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Mon, 8 Sep 2025 21:50:48 +0000 Subject: [PATCH 2/3] Implement HTML-based FAQ structure with comprehensive panel documentation Co-authored-by: iaretechnician <2749183+iaretechnician@users.noreply.github.com> --- faq_demo.html | 143 ++++++++++++++++ modules/faq/faq.php | 118 +++----------- modules/faq/faq_data.php | 341 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 502 insertions(+), 100 deletions(-) create mode 100644 faq_demo.html create mode 100644 modules/faq/faq_data.php diff --git a/faq_demo.html b/faq_demo.html new file mode 100644 index 00000000..f5c7a157 --- /dev/null +++ b/faq_demo.html @@ -0,0 +1,143 @@ + + + + Enhanced Open Game Panel FAQ + + + + +

F.A.Q.

+
+ 📋 Categories + +
+
+ + + +
+ +
📋 Panel Overview
+
What is the Open Game Panel?
+
+
The Open Game Panel (OGP) is a web-based control panel for managing game servers. It provides an easy-to-use interface for starting, stopping, configuring, and monitoring your game servers without needing command-line access.
+
+
How do I navigate the panel?
+
+
The panel is organized into several main sections accessible from the navigation menu:
+ • Dashboard - Overview of your servers and system status
+ • Game Servers - Manage your game server instances
+ • File Manager - Browse and edit server files
+ • User Management - Control user access and permissions
+ • Administration - System settings and configuration
+
+ +
🎮 Server Management
+
How do I start my game server?
+
+
Navigate to Game ManagerServer Monitor, then click the Start button. Wait for the status to change to "Online" before attempting to connect.
+
+
What if my server won't start?
+
+
Check the server logs for error messages by clicking View Log. Common issues include:
+ • Misconfigured settings
+ • Missing or corrupted files
+ • Port conflicts
+ • Insufficient system resources
+ If the problem persists, check the troubleshooting section or contact support.
+
+ +
📁 File Management
+
How do I access server files?
+
+
Use the File Manager (LiteFM) to browse, edit, upload, and download server files through your web browser. You can also use the FTP module for bulk file transfers.
+
+ +
🔧 Troubleshooting
+
My server won't start - "Failed to start remote server" error
+
+
This error usually means:
+ • The server crashed during startup
+ • Configuration files have syntax errors
+ • Required files are missing or corrupted
+ Solution: Check the server logs for specific error messages, verify your configuration files, and ensure all required game files are present.
+
+ +
+ + + + + \ No newline at end of file diff --git a/modules/faq/faq.php b/modules/faq/faq.php index 9fffda50..8f9af58b 100755 --- a/modules/faq/faq.php +++ b/modules/faq/faq.php @@ -34,116 +34,34 @@ function exec_ogp_module() echo '
Categories
'. '

'; - require 'modules/faq/rss_php.php'; - $url = 'https://opengamepanel.org/faq/rss.php'; - $local_copy = 'modules/faq/faq.rss'; ## Relative path - $save_as = realpath('modules' . DIRECTORY_SEPARATOR . 'faq') . DIRECTORY_SEPARATOR . 'faq.rss'; - ## Full path (adding the filename to realpath would fail if the file does not exists yet) - $online = false; - $local = true; - $updated = false; - $s = (isset($_SERVER['HTTPS'])) ? "s" : ""; - $p = (isset($_SERVER['SERVER_PORT']) and $_SERVER['SERVER_PORT'] != "80") ? ":".$_SERVER['SERVER_PORT'] : ""; - $localServerURL = $_SERVER['SERVER_NAME']; - if($localServerURL == "_"){ - $localServerURL = "localhost"; - } - $local_url = 'http'.$s.'://'.$localServerURL.$p.$_SERVER['SCRIPT_NAME']; - $local_url = str_replace('home.php', $local_copy, $local_url); - if(file_exists($save_as)) - { - $rss = new rss_php; - $rss->load($local_url); - $items = $rss->getItems(); #returns all rss items - $local = true; - } - /* - echo ""; - if( ($local AND ( strtotime("+1 day", filemtime($save_as)) <= strtotime("now") )) OR !$local) # Check the file is older than 1 day to avoid spamming the server - { - stream_context_set_default(array('ssl' => array( - 'verify_peer' => false, - 'verify_peer_name' => false - ) - )); - - $headers = get_headers( $url, 1 ); - touch( $save_as ); # Connection done, so we reset the file modification time even if the server is down (avoid server spamming) - echo ""; - if( $headers[0] == 'HTTP/1.1 200 OK') - { - $online = false; - $rss_online = new rss_php; - $rss_online->load($url); # SERVER USAGE WARNING : using 32kb of server bandwidth each time each person loads this function - $items_online = $rss_online->getItems(); - echo ""; - if(($local and $items_online != $items ) OR !$local) - { - $contents = file_get_contents($url); - if(preg_match('#^<\?xml version="1.0" encoding="utf-8" \?>#', $contents, $match)) - { - if( file_put_contents($save_as, $contents) === false ) - { - print_failure("Imposible write " . $save_as); - return; - } - touch( $save_as ); - echo ""; - $updated = true; - } - else - { - print_failure("Imposible fetch " . $url); - return; - } - } - else - { - echo ""; - } - } - } - + // Load FAQ data from new HTML structure + require_once 'modules/faq/faq_data.php'; + $entries = getFaqData(); - if($updated) - { - $rss = new rss_php; - $rss->load($local_url); - $items = $rss->getItems(); #returns all rss items - } - */ - - if(!file_exists($save_as)) - { - print_failure('Unable to load entries.'); - return; # Stop loading page - } - - - $entries = array(); - foreach($items as $index => $item) - { - $category = $item['category'][0]; - $entries[$category][$index]['title'] = $item['title'][0]; - $entries[$category][$index]['content'] = $item['content:encoded'][0]; - } $categories = ""; $accordion_entries = "
\n"; + foreach($entries as $category_name => $category_entries) { - $categories .= "
  • $category_name
  • "; - $accordion_entries .= "
    $category_name
    "; - foreach($category_entries as $index => $item) + // Create category navigation link with clean ID + $category_id = preg_replace('/[^a-z0-9_]/', '_', strtolower($category_name)); + $categories .= "
  • $category_name
  • "; + + // Create category section + $accordion_entries .= "
    $category_name
    "; + + // Add items for this category + foreach($category_entries as $item) { - $accordion_entries .= "\t
    ". - "$item[title]
    \n". - "\t
    \n\t\t
    $item[content]
    \n\t
    \n"; + $accordion_entries .= "\t
    ". + htmlspecialchars($item['title']) . "
    \n". + "\t
    \n\t\t
    " . $item['content'] . "
    \n\t
    \n"; } } $categories .= ""; $accordion_entries .= "
    "; - echo $categories.$accordion_entries; + echo $categories . $accordion_entries; echo "