Hello, I'm opening a Minecraft server (java game) and I came across the following need:
For each minecraft server it is necessary to build an informative website. When building the site, I created a simple page with only the list of the server team. The team consists of "Helpers", "Moderators" and "Administrators". To assign one of these roles to a player, you need to enter a command within the game, which will then be validated in the server's config.yml file.
This is the config.yml file that defines the status of the players:
users:
JamesMarch:
group:
- Admin
TheCountess_:
group:
- Admin
mumiant_:
group:
- Moderador
Pequena20:
group:
- Ajudante
nana34piu:
group:
- Ajudante
What I was thinking was to create a "reader" in php, which read the yaml code and the positions of the players on my site as follows:
<html>
<head>
<title>Alderaan Minecraft Server</title>
</head>
<body>
<h1>Staff</h1>
<h2>Administradores</h2>
<p>JamesMarch</p>
<p>TheCountess_</p>
<h2>Moderador</h2>
<p>mumiant_</p>
<h2>Ajudantes</h2>
<p>Pequena20</p>
<p>nana34piu</p>
</body>
</html>
I would also like each staff member's name to appear in alphabetical order, for example:
Administrators
- JamesMarch
- TheCountess _
and not
Administrators
- TheCountess _
- JamesMarch
I would also like, for example, if there is only one Administrator, "Administrator" and not "Administrators", for example:
Home is an administrator:
Administrator
- JamesMarch
House have two or more administrators:
Administrator is
- JamesMarch
- TheCountess _
I also wanted to be able to appear only the three positions in the web site , since the site has more than three positions, I liked that only the positions of "Administrator" Moderator "and" Helper " appear on the page.
Finally, I wanted the hierarchy posts to appear, for example:
Right:
Administrators
JamesMarch
TheCountess _
Moderator
- mumiant _
Helpers
nana34piu
Small20
Wrong:
Helpers
nana34piu
Small20
Administrators
JamesMarch
TheCountess _
Moderator
- mumiant _