function editDbTrollAnatomique($id_troll_anat, $pv_anat, $att_anat, $esq_anat, $deg_anat, $reg_anat, $vue_anat, $arm_anat, $source_anat, $date_anat) { global $db_vue_rm; if ($source_anat == "") { $lesTrolls = selectDbTrolls($_SESSION[AuthTroll]); $troll = $lesTrolls[1]; $source_anat = htmlentities($troll[nom_troll]); } // on regarde si le troll existe dans la table des trolls $sql = " SELECT count(id_troll)"; $sql .= " FROM trolls"; $sql .= " WHERE id_troll = {$id_troll_anat}"; $result = mysql_query($sql, $db_vue_rm); echo mysql_error(); list($nb) = mysql_fetch_array($result); if ($nb == 0) { $info = " Le troll {$id_troll_anat} n'existe pas dans la tables des trolls"; $info .= ", l'ananlyse n'est donc pas prise en compte.<br>"; return $info; } // On regarde si le troll n'existe pas déjà dans la table anatomiques $sql = " SELECT id_troll_anatomique"; $sql .= " FROM anatomiques"; $sql .= " WHERE id_troll_anatomique = {$id_troll_anat}"; $result = mysql_query($sql, $db_vue_rm); echo mysql_error(); if (mysql_affected_rows() == 0) { $new = true; } else { $new = false; } if ($new == "new") { // On l'ajoute dans la base de données mysql_query("INSERT into anatomiques (id_troll_anatomique) VALUES ({$id_troll_anat})"); echo mysql_error(); } $sql = " UPDATE anatomiques SET"; $sql .= " pv_anatomique = '" . addslashes($pv_anat) . "',"; $sql .= " att_anatomique = '" . addslashes($att_anat) . "',"; $sql .= " esq_anatomique = '" . addslashes($esq_anat) . "',"; $sql .= " deg_anatomique = '" . addslashes($deg_anat) . "',"; $sql .= " reg_anatomique = '" . addslashes($reg_anat) . "',"; $sql .= " vue_anatomique = '" . addslashes($vue_anat) . "',"; $sql .= " arm_anatomique = '" . addslashes($arm_anat) . "',"; $sql .= " source_anatomique = '" . addslashes($source_anat) . "',"; $sql .= " date_anatomique = '{$date_anat}'"; $sql .= " WHERE id_troll_anatomique={$id_troll_anat}"; if (!($result = mysql_query($sql, $db_vue_rm))) { echo mysql_error(); echo "<br>chaine sql = {$sql}<br>"; echo "Erreur dans la mise à jour de la baronnie. Copiez / Collez ce que vous voyez et postez"; echo " cela dans le forum outils. Merci (ou contactez Bodéga 49145)."; die('Erreur'); } else { $info_retour = "L'analyse du troll {$id_troll_anat} est enregistrée<br>"; } return $info_retour; }
function deleteDbDistinction() { global $db_vue_rm; $page = "engine_view.php"; // Récupération des variables du formulaire $id_distinction = $_REQUEST[id_distinction]; // On regarde si la distinction est utilisée $lesTrolls = selectDbTrolls("", "", "", $id_distinction); $nbTrolls = count($lesTrolls); if ($nbTrolls > 0) { $msg = "<br><font color=red><b>Suppression Impossible, "; $msg .= "la distinction est utilisée par un troll </font></br>"; die($msg); } $sql = " DELETE FROM distinctions"; $sql .= " WHERE id_distinction={$id_distinction}"; echo "{$sql}<br>"; if (!($result = mysql_query($sql, $db_vue_rm))) { echo mysql_error(); echo "<br>chaine sql = {$sql}<br>"; echo "Erreur dans la suppression de la distinction. Copiez / Collez ce que vous voyez et postez"; echo " cela dans le forum outils. Merci (ou contactez Bodéga 49145)."; } else { echo "<h1>La distinction {$id_distinction} est supprimée</h1>"; echo "<a href='{$page}?distinction=liste>Retour à la liste des distinctions</a> "; } }
function view_all() { $type = $_REQUEST["type"]; if (!empty($type)) { $path = "images/avatars/cache"; } else { $path = "http://www.pipeshow.net/RM"; } $lesTrolls = selectDbTrolls("", "trombinoscope"); $nbTrolls = count($lesTrolls); $flag = false; $flag_pnj = false; for ($i = 1; $i <= $nbTrolls; $i++) { $res = $lesTrolls[$i]; if ($j == 6) { echo "<br>"; $j = 0; } if (!$flag) { if ($num_rang_troll != $res[num_rang_troll]) { $num_rang_troll = $res[num_rang_troll]; $nom_rang_troll = $res[nom_rang_troll]; $nom_image_titre_distinction = $res[nom_image_titre_distinction]; if ($i != 1) { echo "</td></tr></table>"; } if ($num_rang_troll == 14) { echo '<br><img src="http://www.pipeshow.net/RM/avatars/Trombinoscope_rangs1.gif"><br>'; } elseif ($num_rang_troll == 7) { echo '<br><img src="http://www.pipeshow.net/RM/avatars/Trombinoscope_niveaux1.gif"><br>'; } echo "<br><br><h2>" . $nom_rang_troll . "</h2>"; //<img src='$nom_image_titre_distinction'>"; echo "<table>"; echo "<tr><td align=center>"; $j = 0; } } $j++; echo "<img alt=\"[" . addslashes($res[nom_troll]) . "]\""; echo " src='{$path}/avatars/bleus/{$res['nom_image_troll']}_avatar_bleu.gif' " . afficheInfosTroll($res) . ">"; /* PNJ ayant perdu les trolls */ if ($num_rang_troll == 10 && !$flag_pnj) { $res[nom_troll] = "Tackianosaurus"; $res[nom_image_troll] = "Tackianosaurus"; $res[nom_rang_troll] = "Monument de la Guilde (PNJ)"; $res[race_troll] = "Skrim"; echo "<img alt=\"[" . addslashes($res[nom_troll]) . "]\""; echo " src='{$path}/avatars/{$res['nom_image_troll']}_avatar_bleu.gif' " . afficheInfosTroll($res) . ">"; $res[nom_troll] = "Kkwet"; $res[nom_image_troll] = "Kkwet"; $res[nom_rang_troll] = "Monument de la Guilde (PNJ)"; $res[race_troll] = "Durakuir"; echo "<img alt=\"[" . addslashes($res[nom_troll]) . "]\""; echo " src='{$path}/avatars/{$res['nom_image_troll']}_avatar_bleu.gif' " . afficheInfosTroll($res) . ">"; $res[nom_troll] = "Bollocks Le Transplanté"; $res[nom_image_troll] = "Bollocks"; $res[nom_rang_troll] = "Monument de la Guilde (PNJ)"; $res[race_troll] = "Kastar"; echo "<img alt=\"[" . addslashes($res[nom_troll]) . "]\""; echo " src='{$path}/avatars/{$res['nom_image_troll']}_avatar_bleu.gif' " . afficheInfosTroll($res) . ">"; $flag_pnj = true; } } echo "<br><hr>"; echo "<br><br><h2>Anciens Blasons</h2>"; affiche_ancien_blasons(); }
function generateAvatar($id_avatar) { echo "<h2> Génération </h2>"; $lesTrolls = selectDbTrolls($id_avatar); $nbTrolls = count($lesTrolls); $res = $lesTrolls[1]; echo "<div style='background-color: #a9b1d3;'><img src='generate_avatar.php?id={$id_avatar}'></div>"; echo " il faut sauvegarder cette image en " . $res[nom_image_troll] . "_avatar.gif"; }
function engine_list_passe_error($isAdmin) { isControlAdministrateur("yes"); // Control strict de l'administrateur afficher_titre_tableau("Erreur mot de passe"); if (file_exists("vues/list_mdp_error.txt")) { $tmpfile = fopen("vues/list_mdp_error.txt", "r"); while ($line = fgets($tmpfile, 1024)) { $i++; echo $line; preg_match("/(.*) (\\d+)/", $line, $parts); $lesTrolls = selectDbTrolls($parts[2], ""); $res = $lesTrolls[1]; echo " " . $res['nom_troll'] . "<br>"; } fclose($tmpfile); } else { echo "Erreur, le fichier vues/list_mdp_error.txt n'existe pas"; } }
function afficheInfosWanted($id_troll, $nom_troll, $race_troll, $niveau_troll, $x_troll, $y_troll, $z_troll, $date_troll) { $lesGriefs = selectDbGriefs($id_troll); $nbGriefs = count($lesGriefs); $text .= "<center><h3><font color=red>{$nom_troll} N° {$id_troll}</font><font color=white> {$race_troll} ({$niveau_troll})</font></h3>"; $text .= "<font color=white>Position : X={$x_troll}, Y={$y_troll}, Z={$z_troll} ({$date_troll})</font><br>"; $text .= afficherLien("troll", "fiche", $id_troll, $x_troll, $y_troll, $z_troll, "[RG]", false); $text .= afficherLien("troll", "mh_evenements", $id_troll, $x_troll, $y_troll, $z_troll, "[MH]", false); $text .= afficherLien("troll", "vue2d", $id_troll, $x_troll, $y_troll, $z_troll, "[Vue2d]", false); $text .= afficherLien("troll", "gps", $id_troll, $x_troll, $y_troll, $z_troll, "[GPS]", false); $text .= "</center><br>"; $text .= "<center><b><font color=red>Liste des Griefs</font></b></center><font color=white>"; for ($i = 1; $i <= $nbGriefs; $i++) { $res = $lesGriefs[$i]; $lesTrolls = selectDbTrolls($res[troll_impacte]); $troll_impacte = $lesTrolls[1]; $text .= "{$res['type']} : le {$res['date_grief']}"; $text .= " sur " . htmlentities($troll_impacte[nom_troll]) . " ({$troll_impacte['id_troll']}) : <br>"; $text .= htmlentities(trim($res[description])) . "<br>"; } $lesVengeances = selectDbVengeances($id_troll); $nbVengeances = count($lesVengeances); $text .= "</font><center><b><font color=green>Liste des Châtiements</font></b></center><font color=white>"; for ($i = 1; $i <= $nbVengeances; $i++) { $res = $lesVengeances[$i]; $lesTrolls = selectDbTrolls($res[troll_vengeur]); $troll_vengeur = $lesTrolls[1]; $text .= "Le {$res['date_vengeance']}"; $text .= " par {$troll_vengeur['nom_troll']} ({$troll_vengeur['id_troll']}) : <br>"; $text .= htmlentities(trim($res[description])) . "<br>"; } $text .= "</font>"; $text = str_replace("\r\n", "<br>", $text); $text = addslashes($text); echo " onmouseover=\"return overlib('<font color=red> <b>Cliquez là où vous êtes !</b></font> <br>{$text}');\" "; echo " onclick=\"return overlib('{$text}', STICKY, CAPTION, 'Informations',CLOSECLICK, EXCLUSIVE);\" "; echo " onmouseout=\"return nd();\""; }
function selectDbMicheline($id_objet_depart, $id_objet_arrivee, $type_objet_depart, $type_objet_arrivee) { global $db_vue_rm; $id_objet = $id_objet_depart; $type_objet = $type_objet_depart; for ($i = 0; $i <= 1; $i++) { if ($i == 1) { $id_objet = $id_objet_arrivee; $type_objet = $type_objet_arrivee; $x1 = $x; $y1 = $y; $z1 = $z; $nom1 = $nom; } switch ($type_objet) { case "troll": $res = selectDbTrolls($id_objet); $res = $res[1]; if (!userIsGroupSpec() && $res[maj_groupe_spec_troll] == 'oui') { $res[x_troll] = 0; $res[y_troll] = 0; $res[z_troll] = 0; } $x = $res[x_troll]; $y = $res[y_troll]; $z = $res[z_troll]; $nom = $res[nom_troll]; break; case "monstre": $res = selectDbRechercheMonstres($id_objet); $x = $res[x_monstre]; $y = $res[y_monstre]; $z = $res[z_monstre]; $nom = $res[nom_monstre]; break; case "lieux": $res = selectDbLieux($id_objet); $x = $res[x_lieu]; $y = $res[y_lieu]; $z = $res[z_lieu]; $nom = $res[nom_lieu]; break; case "champignons": $res = selectDbRechercheChampignons($id_objet); $x = $res[x_champi]; $y = $res[y_champi]; $z = $res[z_champi]; $nom = $res[nom_champi]; break; } } $tab[0]['x'] = $x1; $tab[0]['y'] = $y1; $tab[0]['z'] = $z1; $tab[0]['nom'] = $nom1; $tab[1]['x'] = $x; $tab[1]['y'] = $y; $tab[1]['z'] = $z; $tab[1]['nom'] = $nom; return $tab; }
function view_all($sombre = false) { $lesTrolls = selectDbTrolls("", "avatar_to_bollock"); $nbTrolls = count($lesTrolls); for ($i = 1; $i <= $nbTrolls; $i++) { $res = $lesTrolls[$i]; //echo "<img src='images/avatars/cache/$res[nom_image_troll]_avatar.png'>"; if ($res[id_troll] != 11466 && $res[id_troll] != 18610) { if ($sombre != false) { echo "<img src='images/avatars/cache/{$res['nom_image_troll']}_avatar_bleu.gif'>"; } else { //if ( ( $rang != 19 && $rang != 18 && $sombre == "" ) || // ( $sombre != "" ) ) { echo "<img src='images/avatars/cache/{$res['nom_image_troll']}_avatar.gif'>"; } } } }
function afficher_ligne_anatomique($res) { $lesTrolls = selectDbTrolls($res[id_troll_anatomique]); $troll = $lesTrolls[1]; $lien = "href='/engine_view.php?troll={$res['id_troll_anatomique']}'"; echo "<tr class='mh_tdpage'>"; echo "<td nowrap>{$troll['id_troll']}</td>"; echo "<td nowrap>{$troll['nom_troll']}<br>{$troll['race_troll']} ({$troll['niveau_troll']})</td>"; echo "<td nowrap>" . anaChaine($res[pv_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[att_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[esq_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[deg_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[reg_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[vue_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[arm_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[date_anatomique]) . "</td>"; echo "<td nowrap>" . anaChaine($res[source_anatomique]) . "</td>"; echo "<td nowrap><a {$lien}>[Fiche RG]</a></td>"; echo "</tr>"; }
$trollDists = $_REQUEST['trollDists']; $trollEtages = $_REQUEST['trollEtages']; $begin = $_REQUEST['begin']; $arrayVtt = getVttTrolls($trollsid, $db_vue_rm); $arrayAna = getAnaTrolls($trollsid, $db_vue_rm); $vttTroll = getVttTroll($idTroll, $db_vue_rm); $degbm = 0; if (is_file("../pimpmytroll/trolls/" . $idTroll . ".xml")) { $c_Troll = new c_Troll($idTroll); $c_Troll->getTroll(); $c_Troll->applyEquipement(); $degbm = $c_Troll->getVar("DégâtsBMM"); } for ($i = 0; $i < count($trollsid); $i++) { $dist = $trollDists[$i]; $lesTrolls = selectDbTrolls($trollsid[$i], ""); $troll = $lesTrolls[1]; $nom_troll = htmlentities($troll["nom_troll"], ENT_QUOTES); $rang = $i * 2 + $begin; $colorTroll = ""; // ajoute une couleur si le troll est au même niveau if ($trollEtages[$i] == $etageTroll) { echo "\n\t\t\t\t\ttableTrolls[{$rang}].setAttribute ( 'class', '' );\n\t\t\t\t\ttableTrolls[{$rang}].setAttribute ( 'style', 'background-color:' + colorSearch );\n\t\t\t\t"; $colorTroll = "colorSearch"; } // ajoute une couleur si le troll est sur la case if ($dist == 0) { echo "\n\t\t\t\t\ttableTrolls[{$rang}].setAttribute ( 'class', '' );\n\t\t\t\t\ttableTrolls[{$rang}].setAttribute ( 'style', 'background-color:' + colorUrg );\n\t\t\t\t"; $colorTroll = "colorUrg"; } // ajoute une couleur en fonction de la diplomatie