[1451] | 1 | <?php
|
---|
| 2 | include("config.php");
|
---|
| 3 |
|
---|
| 4 | $_GET['player'] = substr($_GET['player'],0,30);
|
---|
| 5 |
|
---|
| 6 | /* Determine if a Player was entered. If not, redirect. */
|
---|
| 7 | if ($_GET['player']=="") header('Location: http://'.$_SERVER['SERVER_NAME'].
|
---|
| 8 | ($_SERVER['SERVER_PORT']!=80?':'.$_SERVER['SERVER_PORT']:'').$BASEURL.
|
---|
| 9 | 'players.php');
|
---|
| 10 |
|
---|
| 11 | $irpg_page_title = "Joueur: " . htmlentities($_GET['player']);
|
---|
| 12 | $showmap = $_GET['showmap'];
|
---|
| 13 |
|
---|
| 14 | include("header.php");
|
---|
| 15 | include("commonfunctions.php");
|
---|
| 16 | echo "<h1>Fiche de personnage</h1>";
|
---|
| 17 | $file = fopen($irpg_db,"r");
|
---|
| 18 | fgets($file,1024); // skip top comment
|
---|
| 19 | $found=0;
|
---|
| 20 | while ($line=fgets($file,1024)) {
|
---|
| 21 | if (substr($line,0,strlen($_GET['player'])+1) == $_GET['player']."\t") {
|
---|
| 22 | list($user,,$isadmin,$level,$class,$secs,,$uhost,$online,$idled,
|
---|
| 23 | $x,$y,
|
---|
| 24 | $pen['mesg'],
|
---|
| 25 | $pen['nick'],
|
---|
| 26 | $pen['part'],
|
---|
| 27 | $pen['kick'],
|
---|
| 28 | $pen['quit'],
|
---|
| 29 | $pen['quest'],
|
---|
| 30 | $pen['logout'],
|
---|
| 31 | $created,
|
---|
| 32 | $lastlogin,
|
---|
| 33 | $item['amulet'],
|
---|
| 34 | $item['charm'],
|
---|
| 35 | $item['helm'],
|
---|
| 36 | $item['boots'],
|
---|
| 37 | $item['gloves'],
|
---|
| 38 | $item['ring'],
|
---|
| 39 | $item['leggings'],
|
---|
| 40 | $item['shield'],
|
---|
| 41 | $item['tunic'],
|
---|
| 42 | $item['weapon'],
|
---|
| 43 | $alignment,
|
---|
| 44 | ) = explode("\t",trim($line));
|
---|
| 45 | $found=1;
|
---|
| 46 | break;
|
---|
| 47 | }
|
---|
| 48 | }
|
---|
| 49 | if (!$found) echo "<h1>Erreur</h1><p><b>Utilisateur inconnu.</b></p>\n";
|
---|
| 50 | else {
|
---|
| 51 | $class=htmlentities($class);
|
---|
| 52 | /* if we htmlentities($user), then we cannot use links with it. */
|
---|
| 53 | echo " <p><b>Pseudo :</b> ".htmlentities($user)."<br />\n".
|
---|
| 54 | " <b>Profession :</b> $class<br />\n".
|
---|
| 55 | " <b>Admin ? :</b> ".($isadmin?"Oui":"Non")."<br />\n".
|
---|
| 56 | " <b>Niveau :</b> $level<br />\n".
|
---|
| 57 | " <b>Prochain niveau :</b> ".duration($secs)."<br />\n".
|
---|
| 58 | " <b>Statut :</b> ".($online?"C":"Déc")."onnecté<br />\n".
|
---|
| 59 | " <b>Host :</b> ".($uhost?$uhost:"Unknown")."<br />\n".
|
---|
[1563] | 60 | " <b>Date de création :</b> ".htmlentities(strftime($dateformat,$created))."<br />\n".
|
---|
| 61 | " <b>Dernière connexion :</b> ".htmlentities(strftime($dateformat,$lastlogin))."<br />\n".
|
---|
[1462] | 62 | " <b>Temps d'inactivité total:</b> ".duration($idled)."<br />\n".
|
---|
[1451] | 63 | " <b>Position :</b> [$x,$y]<br />\n".
|
---|
| 64 | " <b>Coté :</b> ".($alignment=='e'?"Sadique":($alignment=='n'?"Nain-déci":"Brave"))."<br />\n".
|
---|
[1456] | 65 | " <b>XML :</b> [<a href=\"xml.php?player=".urlencode($user)."\">link</a>]</p>\n".
|
---|
[1451] | 66 | " <h2>Carte</h2>\n".
|
---|
| 67 | " ".($showmap?"<div id=\"map\"><img src=\"makemap.php?player=".urlencode($user)."\"></div>\n\n":"<p><a href=\"?player=".urlencode($user)."&showmap=1\">Voir la carte</a></p>\n\n")."".
|
---|
| 68 | " <h2>Equipement</h2>\n<p>";
|
---|
| 69 | ksort($item);
|
---|
| 70 | $sum = 0;
|
---|
| 71 | foreach ($item_order as $key) {
|
---|
| 72 | $val = $item[$key];
|
---|
| 73 | $uniquecolor="#be9256";
|
---|
| 74 | if ($key == "helm" && substr($val,-1,1) == "a") {
|
---|
[1465] | 75 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Mattt's Omniscience Grand Crown")))."</font>]";
|
---|
[1451] | 76 | }
|
---|
| 77 | if ($key == "tunic" && substr($val,-1,1) == "b") {
|
---|
[1466] | 78 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Res0's Protectorate Plate Mail")))."</font>]";
|
---|
[1451] | 79 | }
|
---|
| 80 | if ($key == "amulet" && substr($val,-1,1) == "c") {
|
---|
[1466] | 81 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Dwyn's Storm Magic Amulet")))."</font>]";
|
---|
[1451] | 82 | }
|
---|
| 83 | if ($key == "weapon" && substr($val,-1,1) == "d") {
|
---|
[1466] | 84 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Jotun's Fury Colossal Sword")))."</font>]";
|
---|
[1451] | 85 | }
|
---|
| 86 | if ($key == "weapon" && substr($val,-1,1) == "e") {
|
---|
[1466] | 87 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Drdink's Cane of Blind Rage")))."</font>]";
|
---|
[1451] | 88 | }
|
---|
| 89 | if ($key == "boots" && substr($val,-1,1) == "f") {
|
---|
[1466] | 90 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Mrquick's Magical Boots of Swiftness")))."</font>]";
|
---|
[1451] | 91 | }
|
---|
| 92 | if ($key == "weapon" && substr($val,-1,1) == "g") {
|
---|
[1466] | 93 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Jeff's Cluehammer of Doom")))."</font>]";
|
---|
[1451] | 94 | }
|
---|
| 95 | if ($key == "ring" && substr($val,-1,1) == "h") {
|
---|
[1466] | 96 | $val = intval($val)." [<font color=\"$uniquecolor\">".htmlentities(ucfirst(gettext("Juliet's Glorious Ring of Sparkliness")))."</font>]";
|
---|
[1451] | 97 | }
|
---|
| 98 | echo " ".htmlentities(ucfirst(gettext($key)))." : $val<br />\n";
|
---|
| 99 | $sum += $val;
|
---|
| 100 | }
|
---|
[1456] | 101 | echo " <br />\n Somme : $sum<br />\n".
|
---|
[1451] | 102 | " </p>".
|
---|
| 103 | " <h2>Pénalités</h2>\n".
|
---|
| 104 | " <p>\n";
|
---|
| 105 |
|
---|
| 106 | ksort($pen);
|
---|
| 107 | $sum = 0;
|
---|
| 108 | foreach ($pen as $key => $val) {
|
---|
[1457] | 109 | echo " ".ucfirst($key)." : ".duration($val)."<br />\n";
|
---|
[1451] | 110 | $sum += $val;
|
---|
| 111 | }
|
---|
[1456] | 112 | echo " <br />\n Total : ".duration($sum)."</p>\n";
|
---|
[1451] | 113 |
|
---|
| 114 | $file = fopen($irpg_mod,"r");
|
---|
| 115 | $temp = array();
|
---|
| 116 | while ($line=fgets($file,1024)) {
|
---|
| 117 | if (strstr($line," ".$_GET['player']." ") ||
|
---|
| 118 | strstr($line," ".$_GET['player'].", ") ||
|
---|
| 119 | substr($line,0,strlen($_GET['player'])+1) ==
|
---|
| 120 | $_GET['player']." " ||
|
---|
| 121 | substr($line,0,strlen($_GET['player'])+3) ==
|
---|
| 122 | $_GET['player']."'s ") {
|
---|
| 123 | array_push($temp,$line);
|
---|
| 124 | }
|
---|
| 125 | }
|
---|
| 126 | fclose($file);
|
---|
| 127 | if (!is_null($temp) && count($temp)) {
|
---|
| 128 | echo('<h2>');
|
---|
| 129 | echo $_GET['allmods']!=1?"Dernières ":"";
|
---|
| 130 | echo('Modifications d\'Horlorge</h2><p>');
|
---|
| 131 | if ($_GET['allmods'] == 1 || count($temp) < 6) {
|
---|
| 132 | foreach ($temp as $line) {
|
---|
| 133 | $line=htmlentities(trim($line));
|
---|
| 134 | echo " $line<br />\n";
|
---|
| 135 | }
|
---|
| 136 | echo " <br />\n";
|
---|
| 137 | }
|
---|
| 138 | else {
|
---|
| 139 | end($temp);
|
---|
| 140 | for ($i=0;$i<4;++$i) prev($temp);
|
---|
| 141 | for ($line=trim(current($temp));$line;$line=trim(next($temp))) {
|
---|
| 142 | $line=htmlentities(trim($line));
|
---|
| 143 | echo " $line<br />\n";
|
---|
| 144 | }
|
---|
| 145 | }
|
---|
| 146 | }
|
---|
| 147 | if ($_GET['allmods'] != 1 && count($temp) > 5) {
|
---|
| 148 | ?>
|
---|
| 149 | <br />
|
---|
| 150 | [<a href="<?php echo $_SERVER['PHP_SELF']."?player=".urlencode($user);?>&allmods=1">Voir toutes les modifications</a> (<?=count($temp)?>)]
|
---|
| 151 | </p>
|
---|
| 152 | <?php
|
---|
| 153 | }
|
---|
| 154 | }
|
---|
| 155 | include("footer.php");
|
---|
| 156 | ?>
|
---|
| 157 |
|
---|