Skip to content

Commit

Permalink
Added hp change to pageinfo
Browse files Browse the repository at this point in the history
  • Loading branch information
Rackover committed Feb 7, 2020
1 parent 0abbc5d commit 080bd52
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion commands.php
Original file line number Diff line number Diff line change
Expand Up @@ -333,6 +333,7 @@ function command_get_author_of($db, $elements, $player){
page.id AS page_id,
page.is_dead_end,
page.is_hidden,
hp_event.hp_change,
prop.name as prop_name,
pp.count as prop_placement_count,
page_succession.command,
Expand All @@ -350,6 +351,7 @@ function command_get_author_of($db, $elements, $player){
LEFT JOIN player player ON player.id = page.author_id
LEFT JOIN client cli ON cli.id = player.client_id
LEFT JOIN page otherpage ON (page_succession.origin_id = otherpage.id OR page_succession.target_id = otherpage.id) AND otherpage.id != page.id
LEFT JOIN hp_event hp_event ON hp_event.page_id = page.id
WHERE
page.id = ?
");
Expand All @@ -361,6 +363,7 @@ function command_get_author_of($db, $elements, $player){
$author_id = "???";
$props = [];
$connections = [];
$hp_change = 0;
$page_content = "";

while ($row = $statement->fetch()){
Expand All @@ -375,6 +378,9 @@ function command_get_author_of($db, $elements, $player){
if ($row["prop_name"] != null){
$props[]= array("name"=>$row["prop_name"], "count"=>$row["prop_placement_count"]);
}
if ($row["hp_change"] != null){
$hp_change += $row["hp_change"];
}
if ($row["connected_page_id"] != null){
$connections []= array(
"name"=>explode("\n", $row["connected_page_content"])[0],
Expand Down Expand Up @@ -402,7 +408,9 @@ function command_get_author_of($db, $elements, $player){
return_200("status", '
<b class="emphasis">'.$title.'</b> [<b style="color:yellow;">'.$id.'</b>]<br><i>'.$content.'</i><br>Made by <span style="color:white;">PLAYER id:<b style="color:yellow;">'.substr($author_id, 0, 6).'...</b></span>
'.($is_client_banned ? "<span style='color:red;'>" : "").'('.($is_client_banned ? "BANNED " : "").'CLIENT id:<b style="color:yellow;">'.$client_id.'</b>)'.($is_client_banned ? "</span>" : "").'
<br><br><b>Props</b>: '.implode(", ", $strProps).'<br>
<br>
<br>Health change: '.$hp_change.'<br>
<br><b>Props</b>: '.implode(", ", $strProps).'<br>
<br><b>Connections</b>:
<ul>
'.$strConnections.'
Expand Down

0 comments on commit 080bd52

Please sign in to comment.