Kommunauty
Connexion
Inscription

Tuto Hall Of Fame


arno Messages : 83

Bonjour,un petit tuto des H.O.F, dont les coordonnées ne paraissent pas au rapport de combat.

Deux fichiers a créer a la racine, quatre fichiers a créer dans templates/opengame, un fichier a créer dans language , leftmenu(.mo et tpl) a rédiger et des requêtes a effectuer

A la racine :

topkb.php

<?php

/* topkb.php
*
* version 1.1
*
* Historique:
* 1.0 - Version originelle (Eumele)
* 1.1 - Limite du nombre de rapport affiché modifiable (Kiwille)
*/

/********************************************************************************
*********************/
define('INSIDE'  , true);
define('INSTALL' , false);

$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);
/********************************************************************************
*********************/
// les constantes du HOF
$nbrapports = 100; //détermine le nombre limite de rapports dans le HOF


//Début des données du top 100
includeLang('topkb');
$BodyTPL = gettemplate('topkb');
$RowsTPL = gettemplate('topkb_rows');
$parse = $lang;

$top = doquery ("SELECT * FROM {{table}} ORDER BY (`gesamtunits` + `gesamttruemmer`) DESC;", 'topkb');

$a = 0 ;
while($data = mysql_fetch_assoc($top))
{

// On limite le classement à 100 joueurs
if ($a < $nbrapports)
{
$a++ ;

// calcul de la date du combat
$timedeut = date("r", $data['time']);

// colorisation des noms des joueurs (gagné, perdu ou match nul)
if ( $data['fleetresult'] == a ) $bloc['top_fighters'] = "
<a href="topkbuser.php?mode=". $data['rid'] ."" target="_new"><font color="green">" .$data['angreifer'] ."</font>
<b> VS </b>
<font color="red">". $data['defender'] ."</font></a>";
else if ( $data['fleetresult'] == w ) $bloc['top_fighters'] = "
<a href="topkbuser.php?mode=". $data['rid'] ."" target="_new"><font color="red">" .$data['angreifer'] ."</font>
<b> VS </b>
<font color="green">". $data['defender'] ."</font></a>";
else $bloc['top_fighters'] = "
<a href="topkbuser.php?mode=". $data['rid'] ."" target="_new"><font color="yellow">" .$data['angreifer'] ."</font>
<b> VS </b>
<font color="yellow">". $data['defender'] ."</font></a>";


// Allez on affiche tout ca sur la page!
$bloc['top_rank'] = $a;
$bloc['top_time'] = $timedeut;
$bloc['underrow'] = $lang['grata'] ."test";


// date("r", $data['time']);
$parse['top_list'] .= parsetemplate($RowsTPL, $bloc);


} // Fin du code pour la limitation du top 100
}
display(parsetemplate(gettemplate('topkb'), $parse), $lang['topkb'], false);
//Fin des données du Top 100

?>

topkbuser.php

<?php

/**
* topkbuser.php
*
* @version 1.0
* @copyright 2008 by Eumele www.x-nova.org
* Der Mod darf nur als download bei http://xnova-germany.de/
* oder www.x-nova.org angeboten werden, oder von den Teammitgliedern persönlich auf anderen Seiten.
*
*/

define('INSIDE'  , true);
define('INSTALL' , false);

$xnova_root_path = './';
include($xnova_root_path . 'extension.inc');
include($xnova_root_path . 'common.' . $phpEx);

if (!isset($mode)) {
if (isset($_GET['mode'])) {
$mode = $_GET['mode'];
} else {
$mode = 0;
}
}

//start der einzel anzeige ( Le départ unique montre )
$anzeige = doquery("SELECT * FROM {{table}} WHERE `rid` = '". $mode ."';", 'topkb');

includeLang('topkb');
$BodyTPL = gettemplate('topkbanzeige');
$RowsTPL = gettemplate('topkbanzeige_rows');
$parse = $lang;

while($tabelle = mysql_fetch_assoc($anzeige))
{

$user1 = doquery("SELECT * FROM {{table}} WHERE `id` = '". $tabelle['id_owner1'] ."';", 'users');
while($user1data = mysql_fetch_assoc($user1))
{
$bloc['useratter'] = "<th><img src="". $user1data['avatar'] ."" height=100 width=100></th>";
}
$user2 = doquery("SELECT * FROM {{table}} WHERE `id` = '". $tabelle['id_owner2'] ."';", 'users');
while($user2data = mysql_fetch_assoc($user2))
{
$bloc['userdeffer'] = "<th><img src="". $user2data['avatar'] ."" height=100 width=100></th>";;
}
$bloc['top_vs'] = "<th><b> VS </b></th>";
$bloc['top_titel'] = "<td><h2>". $tabelle['angreifer'] ."<b> VS </b>". $tabelle['defender'] ."</h2></td>";
$bloc['top_fighters'] = $tabelle['angreifer'] ."<b> VS </b>". $tabelle['defender'];
$bloc['top_id_owner1'] = "<b>". $tabelle['id_owner1'] ."</b>";
$bloc['top_angreifer'] = "<th>". $tabelle['angreifer'] ."</th>";
$bloc['top_id_owner2'] = $tabelle['id_owner2'];
$bloc['top_defender'] = "<th>". $tabelle['defender'] ."</th>";
$bloc['top_gesamtunits'] = pretty_number( $tabelle['gesamtunits'] );
$bloc['top_gesamttruemmer'] = $tabelle['gesamttruemmer'];
$bloc['top_rid'] = $tabelle['rid'];
$bloc['top_raport'] = $tabelle['raport'];
$bloc['top_time'] = date("r", $tabelle['time']);

$parse['top_list'] .= parsetemplate($RowsTPL, $bloc);

}
display(parsetemplate(gettemplate('topkbanzeige'), $parse), $lang['topkb'], false);

?>

dans les template :

topkb.TPL

<center>
<br><br>
<table width="569">
<tbody>
<tr>
<td colspan="3" class="c"><b>{top}</b></td>
</tr><tr>
<th colspan="3">
<font color="orange">{gratz}</font>
</th>
</tr><tr>
        <th><font color="lime">{Platz}</font></th>
<th><font color="lime">{Beteiligte}</font></th>
        <th><font color="lime">{Datum}</font></th>
</tr>
{top_list}

<tr><th colspan="3">{Legende}<font color="green">{Gewinner}</font>  <font color="red">{Verlierer}</font>{unentschieden}{Missing}</tr></th>
</tbody>
</table>
</center>

topkb_rows

<tr>
        <th>{top_rank}</th>
  <th>{top_fighters}</th>
        <th>{top_time}</th>
</tr>

topkbanzeige.TPL

<center>
<table width="569">
<br><br>
<tbody>
<tr><td>
{top_list}
</td></tr>
</tbody>
</table>
</center>

topkbanzeige_rows

<center><table width="569">
<tr>
{top_angreifer}<th> </th>{top_defender}
</tr>
<tr>
{useratter}{top_vs}{userdeffer}
</tr>
        </table>
{top_raport}</center>

includes/functions/MissionCaseAttack.php

remplacez tout le fichier par sa :

<?php

// Mission Case 1: -> Attaquer
function MissionCaseAttack ($FleetRow)
{
    global $user, $phpEx, $xnova_root_path, $pricelist, $lang, $resource, $CombatCaps;

    if ($FleetRow['fleet_start_time'] <= time()) {
        if ($FleetRow['fleet_mess'] == 0) {
            if (!isset($CombatCaps[202]['sd'])) {
                message("<font color="red">" . $lang['sys_no_vars'] . "</font>", $lang['sys_error'], "fleet." . $phpEx, 2);
            }
            $QryTargetPlanet = "SELECT * FROM {{table}} ";
            $QryTargetPlanet .= "WHERE ";
            $QryTargetPlanet .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryTargetPlanet .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryTargetPlanet .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryTargetPlanet .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "';";
            $TargetPlanet = doquery($QryTargetPlanet, 'planets', true);
            $TargetUserID = $TargetPlanet['id_owner'];

            $QryCurrentUser = "SELECT * FROM {{table}} ";
            $QryCurrentUser .= "WHERE ";
            $QryCurrentUser .= "`id` = '" . $FleetRow['fleet_owner'] . "';";
            $CurrentUser = doquery($QryCurrentUser , 'users', true);
            $CurrentUserID = $CurrentUser['id'];

            $QryTargetUser = "SELECT * FROM {{table}} ";
            $QryTargetUser .= "WHERE ";
            $QryTargetUser .= "`id` = '" . $TargetUserID . "';";
            $TargetUser = doquery($QryTargetUser, 'users', true);

            $QryTargetTech = "SELECT ";
            $QryTargetTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
            $QryTargetTech .= "FROM {{table}} ";
            $QryTargetTech .= "WHERE ";
            $QryTargetTech .= "`id` = '" . $TargetUserID . "';";

            $TargetTechno = doquery($QryTargetTech, 'users', true);

            $QryCurrentTech = "SELECT ";
            $QryCurrentTech .= "`military_tech`, `defence_tech`, `shield_tech` ";
            $QryCurrentTech .= "FROM {{table}} ";
            $QryCurrentTech .= "WHERE ";
            $QryCurrentTech .= "`id` = '" . $CurrentUserID . "';";
            $CurrentTechno = doquery($QryCurrentTech, 'users', true);

            for ($SetItem = 200; $SetItem < 500; $SetItem++) {
                if ($TargetPlanet[$resource[$SetItem]] > 0) {
                    $TargetSet[$SetItem]['count'] = $TargetPlanet[$resource[$SetItem]];
                }
            }

            $TheFleet = explode(";", $FleetRow['fleet_array']);
            foreach($TheFleet as $a => $b) {
                if ($b != '') {
                    $a = explode(",", $b);
                    $CurrentSet[$a[0]]['count'] = $a[1];
                }
            }

            include_once($xnova_root_path . 'includes/ataki.' . $phpEx);
            // Calcul de la duree de traitement (initialisation)
            $mtime = microtime();
            $mtime = explode(" ", $mtime);
            $mtime = $mtime[1] + $mtime[0];
            $starttime = $mtime;

            $walka = walka($CurrentSet, $TargetSet, $CurrentTechno, $TargetTechno);
            // Calcul de la duree de traitement (calcul)
            $mtime = microtime();
            $mtime = explode(" ", $mtime);
            $mtime = $mtime[1] + $mtime[0];
            $endtime = $mtime;
            $totaltime = ($endtime - $starttime);
            // Ce qu'il reste de l'attaquant
            $CurrentSet = $walka["atakujacy"];
            // Ce qu'il reste de l'attaqué
            $TargetSet = $walka["wrog"];
            // Le resultat de la bataille
            $FleetResult = $walka["wygrana"];
            // Rapport long (rapport de bataille detaillé)
            $dane_do_rw = $walka["dane_do_rw"];
            // Rapport court (cdr + unitées perdues)
            $zlom = $walka["zlom"];

            $FleetArray = "";
            $FleetAmount = 0;
            $FleetStorage = 0;
            foreach ($CurrentSet as $Ship => $Count) {
                $FleetStorage += $pricelist[$Ship]["capacity"] * $Count['count'];
                $FleetArray .= $Ship . "," . $Count['count'] . ";";
                $FleetAmount += $Count['count'];
            }
            // Au cas ou le p'tit rigolo qu'a envoyé la flotte y avait mis des ressources ...
            $FleetStorage -= $FleetRow["fleet_resource_metal"];
            $FleetStorage -= $FleetRow["fleet_resource_crystal"];
            $FleetStorage -= $FleetRow["fleet_resource_deuterium"];

            $TargetPlanetUpd = "";
            if (!is_null($TargetSet)) {
                foreach($TargetSet as $Ship => $Count) {
                    $TargetPlanetUpd .= "`" . $resource[$Ship] . "` = '" . $Count['count'] . "', ";
                }
            }
            // Determination des ressources pillées
            $Mining['metal'] = 0;
            $Mining['crystal'] = 0;
            $Mining['deuter'] = 0;
            if ($FleetResult == "a") {
                if ($FleetStorage > 0) {
                    $metal = $TargetPlanet['metal'] / 2;
                    $crystal = $TargetPlanet['crystal'] / 2;
                    $deuter = $TargetPlanet["deuterium"] / 2;
                    if (($metal) > $FleetStorage / 3) {
                        $Mining['metal'] = $FleetStorage / 3;
                        $FleetStorage = $FleetStorage - $Mining['metal'];
                    } else {
                        $Mining['metal'] = $metal;
                        $FleetStorage = $FleetStorage - $Mining['metal'];
                    }

                    if (($crystal) > $FleetStorage / 2) {
                        $Mining['crystal'] = $FleetStorage / 2;
                        $FleetStorage = $FleetStorage - $Mining['crystal'];
                    } else {
                        $Mining['crystal'] = $crystal;
                        $FleetStorage = $FleetStorage - $Mining['crystal'];
                    }

                    if (($deuter) > $FleetStorage) {
                        $Mining['deuter'] = $FleetStorage;
                        $FleetStorage = $FleetStorage - $Mining['deuter'];
                    } else {
                        $Mining['deuter'] = $deuter;
                        $FleetStorage = $FleetStorage - $Mining['deuter'];
                    }
                }
            }
            $Mining['metal'] = round($Mining['metal']);
            $Mining['crystal'] = round($Mining['crystal']);
            $Mining['deuter'] = round($Mining['deuter']);
            // Mise a jour de l'enregistrement de la planete attaquée
            $QryUpdateTarget = "UPDATE {{table}} SET ";
            $QryUpdateTarget .= $TargetPlanetUpd;
            $QryUpdateTarget .= "`metal` = `metal` - '" . $Mining['metal'] . "', ";
            $QryUpdateTarget .= "`crystal` = `crystal` - '" . $Mining['crystal'] . "', ";
            $QryUpdateTarget .= "`deuterium` = `deuterium` - '" . $Mining['deuter'] . "' ";
            $QryUpdateTarget .= "WHERE ";
            $QryUpdateTarget .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryUpdateTarget .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryUpdateTarget .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' AND ";
            $QryUpdateTarget .= "`planet_type` = '" . $FleetRow['fleet_end_type'] . "' ";
            $QryUpdateTarget .= "LIMIT 1;";
            doquery($QryUpdateTarget , 'planets');
            // Mise a jour du champ de ruine devant la planete attaquée
            $QryUpdateGalaxy = "UPDATE {{table}} SET ";
            $QryUpdateGalaxy .= "`metal` = `metal` + '" . $zlom['metal'] . "', ";
            $QryUpdateGalaxy .= "`crystal` = `crystal` + '" . $zlom['crystal'] . "' ";
            $QryUpdateGalaxy .= "WHERE ";
            $QryUpdateGalaxy .= "`galaxy` = '" . $FleetRow['fleet_end_galaxy'] . "' AND ";
            $QryUpdateGalaxy .= "`system` = '" . $FleetRow['fleet_end_system'] . "' AND ";
            $QryUpdateGalaxy .= "`planet` = '" . $FleetRow['fleet_end_planet'] . "' ";
            $QryUpdateGalaxy .= "LIMIT 1;";
            doquery($QryUpdateGalaxy , 'galaxy');
            // Là on va discuter le bout de gras pour voir s'il y a moyen d'avoir une Lune !
            $FleetDebris = $zlom['metal'] + $zlom['crystal'];
            $StrAttackerUnits = sprintf ($lang['sys_attacker_lostunits'], pretty_number ($zlom["atakujacy"]));
            $StrDefenderUnits = sprintf ($lang['sys_defender_lostunits'], pretty_number ($zlom["wrog"]));
            $StrRuins = sprintf ($lang['sys_gcdrunits'], pretty_number ($zlom["metal"]), $lang['Metal'], pretty_number ($zlom['crystal']), $lang['Crystal']);
           // mod TOP KB
        $strunitsgesamt      = $zlom["atakujacy"] + $zlom["wrog"];
        $user1lostunits      = $zlom["atakujacy"];
        $user1shotunits      = $zlom["wrog"];
        $user2lostunits      = $zlom["wrog"];
        $user2shotunits      = $zlom["atakujacy"];
        $strtruemmerfeld     = $zlom["metal"] + $zlom["crystal"];
        $strtruemmermetal    = $zlom["metal"];
        $strtruemmercrystal  = $zlom["crystal"];
// mod TOP KB
 $DebrisField = $StrAttackerUnits . "<br />" . $StrDefenderUnits . "<br />" . $StrRuins;
            $MoonChance = $FleetDebris / 100000;
            if ($FleetDebris > 2000000) {
                $MoonChance = 20;
            }
            if ($FleetDebris < 100000) {
                $UserChance = 0;
                $ChanceMoon = "";
            } elseif ($FleetDebris >= 100000) {
                $UserChance = mt_rand(1, 100);
                $ChanceMoon = sprintf ($lang['sys_moonproba'], $MoonChance);
            }

            if (($UserChance > 0) and ($UserChance <= $MoonChance) and $galenemyrow['id_luna'] == 0) {
                $TargetPlanetName = CreateOneMoonRecord ($FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet'], $TargetUserID, $FleetRow['fleet_start_time'], '', $MoonChance);
                $GottenMoon = sprintf ($lang['sys_moonbuilt'], $TargetPlanetName, $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
            } elseif ($UserChance = 0 or $UserChance > $MoonChance) {
                $GottenMoon = "";
            }

            $AttackDate = date("r", $FleetRow["fleet_start_time"]);
            $title = sprintf ($lang['sys_attack_title'], $AttackDate);
            $raport = "<center><table><tr><td>" . $title . "<br />";
             $raportX = "<center><table><tr><td>" . $title . "<br />";
            $zniszczony = false;
            $a_zestrzelona = 0;
            $AttackTechon['A'] = $CurrentTechno["military_tech"] * 10;
            $AttackTechon['B'] = $CurrentTechno["defence_tech"] * 10;
            $AttackTechon['C'] = $CurrentTechno["shield_tech"] * 10;
            $AttackerData = sprintf ($lang['sys_attack_attacker_pos'], $CurrentUser["username"], $FleetRow['fleet_start_galaxy'], $FleetRow['fleet_start_system'], $FleetRow['fleet_start_planet']);
            $AttackerDataX = sprintf ($lang['sys_attack_attacker_pos'], $CurrentUser["username"], "X","XXX","XX");
            $AttackerTech = sprintf ($lang['sys_attack_techologies'], $AttackTechon['A'], $AttackTechon['B'], $AttackTechon['C']);

            $DefendTechon['A'] = $TargetTechno["military_tech"] * 10;
            $DefendTechon['B'] = $TargetTechno["defence_tech"] * 10;
            $DefendTechon['C'] = $TargetTechno["shield_tech"] * 10;
            $DefenderData = sprintf ($lang['sys_attack_defender_pos'], $TargetUser["username"], $FleetRow['fleet_end_galaxy'], $FleetRow['fleet_end_system'], $FleetRow['fleet_end_planet']);
            $DefenderDataX = sprintf ($lang['sys_attack_defender_pos'], $TargetUser["username"], "X","XXX","XX");
            $DefenderTech = sprintf ($lang['sys_attack_techologies'], $DefendTechon['A'], $DefendTechon['B'], $DefendTechon['C']);
// mod TOP KB
        $angreifer     = $CurrentUser["username"];
        $defender      = $TargetUser["username"];
// mod TOP KB
            foreach ($dane_do_rw as $a => $b) {
                $raport .= "<table border=1 width=100%><tr><th><br /><center>" . $AttackerData . "<br />" . $AttackerTech . "<table border=1>";
                $raportX .= "<table border=1 width=100%><tr><th><br /><center>" . $AttackerDataX . "<br />" . $AttackerTechX . "<table border=1>";
                if ($b["atakujacy"]['count'] > 0) {
                    $raport1 = "<tr><th>" . $lang['sys_ship_type'] . "</th>";
                    $raport2 = "<tr><th>" . $lang['sys_ship_count'] . "</th>";
                    $raport3 = "<tr><th>" . $lang['sys_ship_weapon'] . "</th>";
                    $raport4 = "<tr><th>" . $lang['sys_ship_shield'] . "</th>";
                    $raport5 = "<tr><th>" . $lang['sys_ship_armour'] . "</th>";
                    foreach ($b["atakujacy"] as $Ship => $Data) {
                        if (is_numeric($Ship)) {
                            if ($Data['count'] > 0) {
                                $raport1 .= "<th>" . $lang["tech_rc"][$Ship] . "</th>";
                                $raport2 .= "<th>" . pretty_number ($Data['count']) . "</th>";
                                $raport3 .= "<th>" . pretty_number (round($Data["atak"] / $Data['count'])) . "</th>";
                                $raport4 .= "<th>" . pretty_number (round($Data["tarcza"] / $Data['count'])) . "</th>";
                                $raport5 .= "<th>" . pretty_number (round($Data["obrona"] / $Data['count'])) . "</th>";
                            }
                        }
                    }
                    $raport1 .= "</tr>";
                    $raport2 .= "</tr>";
                    $raport3 .= "</tr>";
                    $raport4 .= "</tr>";
                    $raport5 .= "</tr>";
                    $raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
                    $raportX .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
                } else {
                    if ($a == 2) {
                        $a_zestrzelona = 1;
                    }
                    $zniszczony = true;
                    $raport .= "<br />" . $lang['sys_destroyed'];
                    $raportX .= "<br />" . $lang['sys_destroyed'];
                }

                $raport .= "</table></center></th></tr></table>";
                $raport .= "<table border=1 width=100%><tr><th><br /><center>" . $DefenderData . "<br />" . $DefenderTech . "<table border=1>";
                $raportX .= "</table></center></th></tr></table>";
                $raportX .= "<table border=1 width=100%><tr><th><br /><center>" . $DefenderDataX . "<br />" . $DefenderTech . "<table border=1>";
                if ($b["wrog"]['count'] > 0) {
                    $raport1 = "<tr><th>" . $lang['sys_ship_type'] . "</th>";
                    $raport2 = "<tr><th>" . $lang['sys_ship_count'] . "</th>";
                    $raport3 = "<tr><th>" . $lang['sys_ship_weapon'] . "</th>";
                    $raport4 = "<tr><th>" . $lang['sys_ship_shield'] . "</th>";
                    $raport5 = "<tr><th>" . $lang['sys_ship_armour'] . "</th>";
                    foreach ($b["wrog"] as $Ship => $Data) {
                        if (is_numeric($Ship)) {
                            if ($Data['count'] > 0) {
                                $raport1 .= "<th>" . $lang["tech_rc"][$Ship] . "</th>";
                                $raport2 .= "<th>" . pretty_number ($Data['count']) . "</th>";
                                $raport3 .= "<th>" . pretty_number (round($Data["atak"] / $Data['count'])) . "</th>";
                                $raport4 .= "<th>" . pretty_number (round($Data["tarcza"] / $Data['count'])) . "</th>";
                                $raport5 .= "<th>" . pretty_number (round($Data["obrona"] / $Data['count'])) . "</th>";
                            }
                        }
                    }
                    $raport1 .= "</tr>";
                    $raport2 .= "</tr>";
                    $raport3 .= "</tr>";
                    $raport4 .= "</tr>";
                    $raport5 .= "</tr>";
                    $raport .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
                    $raportX .= $raport1 . $raport2 . $raport3 . $raport4 . $raport5;
                } else {
                    $zniszczony = true;
                    $raport .= "<br />" . $lang['sys_destroyed'];
                    $raportX .= "<br />" . $lang['sys_destroyed'];
                }
                $raport .= "</table></center></th></tr></table>";
                $raportX .= "</table></center></th></tr></table>";

                if (($zniszczony == false) and !($a == 8)) {
                    $AttackWaveStat = sprintf ($lang['sys_attack_attack_wave'], pretty_number (floor($b["atakujacy"]["atak"])), pretty_number (floor($b["wrog"]["tarcza"])));
                    $DefendWavaStat = sprintf ($lang['sys_attack_defend_wave'], pretty_number (floor($b["wrog"]["atak"])), pretty_number (floor($b["atakujacy"]["tarcza"])));
                    $raport .= "<br /><center>" . $AttackWaveStat . "<br />" . $DefendWavaStat . "</center>";
                    $raportX .= "<br /><center>" . $AttackWaveStat . "<br />" . $DefendWavaStat . "</center>";
                }
            }
            switch ($FleetResult) {
                case "a":
                    $Pillage = sprintf ($lang['sys_stealed_ressources'], pretty_number ($Mining['metal']), $lang['metal'], pretty_number ($Mining['crystal']), $lang['crystal'], pretty_number ($Mining['deuter']), $lang['Deuterium']);
                    $raport .= $lang['sys_attacker_won'] . "<br />" . $Pillage . "<br />";
                    $raport .= $DebrisField . "<br />";
                    $raport .= $ChanceMoon . "<br />";
                    $raport .= $GottenMoon . "<br />";
                    $raportX .= $lang['sys_attacker_won'] . "<br />" . $Pillage . "<br />";
                    $raportX .= $DebrisField . "<br />";
                    $raportX .= $ChanceMoon . "<br />";
                    $raportX .= $GottenMoon . "<br />";
                    break;
                case "r":
                    $raport .= $lang['sys_both_won'] . "<br />";
                    $raport .= $DebrisField . "<br />";
                    $raport .= $ChanceMoon . "<br />";
                    $raport .= $GottenMoon . "<br />";
                    $raportX .= $lang['sys_both_won'] . "<br />";
                    $raportX .= $DebrisField . "<br />";
                    $raportX .= $ChanceMoon . "<br />";
                    $raportX .= $GottenMoon . "<br />";
                    break;
                case "w":
                    $raport .= $lang['sys_defender_won'] . "<br />";
                    $raport .= $DebrisField . "<br />";
                    $raport .= $ChanceMoon . "<br />";
                    $raport .= $GottenMoon . "<br />";
                    $raportX .= $lang['sys_defender_won'] . "<br />";
                    $raportX .= $DebrisField . "<br />";
                    $raportX .= $ChanceMoon . "<br />";
                    $raportX .= $GottenMoon . "<br />";
                    doquery("DELETE FROM {{table}} WHERE `fleet_id` = '" . $FleetRow["fleet_id"] . "';", 'fleets');
                    break;
                default:
                    break;
            }
            $SimMessage = sprintf ($lang['sys_rapport_build_time'], $totaltime);
            $raport .= $SimMessage . "</table>";
            $raportX .= $SimMessage . "</table>";

            $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
            $rid = md5($raport);
            $QryInsertRapport = "INSERT INTO {{table}} SET ";
            $QryInsertRapport .= "`time` = UNIX_TIMESTAMP(), ";
            $QryInsertRapport .= "`id_owner1` = '" . $FleetRow['fleet_owner'] . "', ";
            $QryInsertRapport .= "`id_owner2` = '" . $TargetUserID . "', ";
            $QryInsertRapport .= "`rid` = '" . $rid . "', ";
            $QryInsertRapport .= "`a_zestrzelona` = '" . $a_zestrzelona . "', ";
            $QryInsertRapport .= "`raport` = '" . addslashes ($raport) . "';";
            doquery($QryInsertRapport , 'rw');
            // mod TOP KB
        $dpath = (!$user["dpath"]) ? DEFAULT_SKINPATH : $user["dpath"];
        $rid   = md5($raport);
        $QryInserttopkb  = "INSERT INTO {{table}} SET ";
        $QryInserttopkb .= "`time` = UNIX_TIMESTAMP(), ";
        $QryInserttopkb .= "`id_owner1` = '". $FleetRow['fleet_owner'] ."', ";
        $QryInserttopkb .= "`angreifer` = '". $angreifer ."', ";
        $QryInserttopkb .= "`id_owner2` = '". $TargetUserID ."', ";
        $QryInserttopkb .= "`defender` = '". $defender ."', ";
        $QryInserttopkb .= "`gesamtunits` = '". $strunitsgesamt ."', ";
        $QryInserttopkb .= "`gesamttruemmer` = '". $strtruemmerfeld ."', ";
        $QryInserttopkb .= "`rid` = '". $rid ."', ";
        $QryInserttopkb .= "`a_zestrzelona` = '". $a_zestrzelona ."', ";
        $QryInserttopkb .= "`raport` = '". addslashes ( $raportX ) ."',";
        $QryInserttopkb .= "`fleetresult` = '". $FleetResult ."';";
                doquery("LOCK TABLE {{table}} WRITE", 'topkb');
                doquery( $QryInserttopkb , 'topkb');
                doquery("UNLOCK TABLES", '');              
$user1stat = $FleetRow['fleet_owner'];
$user2stat = $TargetUserID;
// mod TOP KB
            // Colorisation du résumé de rapport pour l'attaquant
            $raport = "<a href # OnClick="f( 'rw.php?raport=" . $rid . "', '');" >";
            $raport .= "<center>";
            $raportX = "<a href # OnClick="f( 'rw.php?raport=" . $rid . "', '');" >";
            $raportX .= "<center>";
            if ($FleetResult == "a") {
                $raport .= "<font color="green">";
                $raportX .= "<font color="green">";
            } elseif ($FleetResult == "r") {
                $raport .= "<font color="orange">";
                $raportX .= "<font color="orange">";
            } elseif ($FleetResult == "w") {
                $raport .= "<font color="red">";
                $raportX .= "<font color="red">";
            }
            $raport .= $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "] </font></a><br /><br />";
            $raport .= "<font color="red">" . $lang['sys_perte_attaquant'] . ": " . pretty_number ($zlom["atakujacy"]) . "</font>";
            $raport .= "<font color="green">   " . $lang['sys_perte_defenseur'] . ":" . pretty_number ($zlom["wrog"]) . "</font><br />" ;
            $raport .= $lang['sys_gain'] . " " . $lang['Metal'] . ":<font color="#adaead">" . pretty_number ($Mining['metal']) . "</font>   " . $lang['Crystal'] . ":<font color="#ef51ef">" . pretty_number ($Mining['crystal']) . "</font>   " . $lang['Deuterium'] . ":<font color="#f77542">" . pretty_number ($Mining['deuter']) . "</font><br />";
            $raport .= $lang['sys_debris'] . " " . $lang['Metal'] . ":<font color="#adaead">" . pretty_number ($zlom['metal']) . "</font>   " . $lang['Crystal'] . ":<font color="#ef51ef">" . pretty_number ($zlom['crystal']) . "</font><br /></center>";
            $raportX .= $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "] </font></a><br /><br />";
            $raportX .= "<font color="red">" . $lang['sys_perte_attaquant'] . ": " . pretty_number ($zlom["atakujacy"]) . "</font>";
            $raportX .= "<font color="green">   " . $lang['sys_perte_defenseur'] . ":" . pretty_number ($zlom["wrog"]) . "</font><br />" ;
            $raportX .= $lang['sys_gain'] . " " . $lang['Metal'] . ":<font color="#adaead">" . pretty_number ($Mining['metal']) . "</font>   " . $lang['Crystal'] . ":<font color="#ef51ef">" . pretty_number ($Mining['crystal']) . "</font>   " . $lang['Deuterium'] . ":<font color="#f77542">" . pretty_number ($Mining['deuter']) . "</font><br />";
            $raportX .= $lang['sys_debris'] . " " . $lang['Metal'] . ":<font color="#adaead">" . pretty_number ($zlom['metal']) . "</font>   " . $lang['Crystal'] . ":<font color="#ef51ef">" . pretty_number ($zlom['crystal']) . "</font><br /></center>";

            

         $QryUpdateFleet  = "UPDATE {{table}} SET ";
         $QryUpdateFleet .= "`fleet_amount` = '". $FleetAmount ."', ";
         $QryUpdateFleet .= "`fleet_array` = '". $FleetArray ."', ";
         $QryUpdateFleet .= "`fleet_mess` = '1', ";
         $QryUpdateFleet .= "`fleet_resource_metal` = `fleet_resource_metal` + '". $Mining['metal'] ."', ";
         $QryUpdateFleet .= "`fleet_resource_crystal` = `fleet_resource_crystal` + '". $Mining['crystal'] ."', ";
         $QryUpdateFleet .= "`fleet_resource_deuterium` = `fleet_resource_deuterium` + '". $Mining['deuter'] ."' ";
         $QryUpdateFleet .= "WHERE fleet_id = '". $FleetRow['fleet_id'] ."' ";
         $QryUpdateFleet .= "LIMIT 1 ;";
         doquery( $QryUpdateFleet , 'fleets');            
         
         SendSimpleMessage ($CurrentUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport);
            // Ajout du petit point raideur
            $AddPoint = $CurrentUser['xpraid'] + 1;

            $QryUpdateOfficier = "UPDATE {{table}} SET ";
            $QryUpdateOfficier .= "`xpraid` = '" . $AddPoint . "' ";
            $QryUpdateOfficier .= "WHERE id = '" . $CurrentUserID . "' ";
            $QryUpdateOfficier .= "LIMIT 1 ;";
            doquery($QryUpdateOfficier, 'users');
            // Ajout d'un point au compteur de raids
            $RaidsTotal = $CurrentUser['raids'] + 1;
            if ($FleetResult == "a") {
                $RaidsWin = $CurrentUser['raidswin'] + 1;
                $QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
                $QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsWin . "', ";
                $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
                $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
                $QryUpdateRaidsCompteur .= "LIMIT 1 ;";
                doquery($QryUpdateRaidsCompteur, 'users');
            } elseif ($FleetResult == "r" || $FleetResult == "w") {
                $RaidsLoose = $CurrentUser['raidsloose'] + 1;
                $QryUpdateRaidsCompteur = "UPDATE {{table}} SET ";
                $QryUpdateRaidsCompteur .= "`raidswin` ='" . $RaidsLoose . "', ";
                $QryUpdateRaidsCompteur .= "`raids` ='" . $RaidsTotal . "' ";
                $QryUpdateRaidsCompteur .= "WHERE id = '" . $CurrentUserID . "' ";
                $QryUpdateRaidsCompteur .= "LIMIT 1 ;";
                doquery($QryUpdateRaidsCompteur, 'users');
            }
            // Colorisation du résumé de rapport pour l'attaquant
            $raport2 = "<a href # OnClick="f( 'rw.php?raport=" . $rid . "', '');" >";
            $raport2 .= "<center>";
            if ($FleetResult == "a") {
                $raport2 .= "<font color="green">";
            } elseif ($FleetResult == "r") {
                $raport2 .= "<font color="orange">";
            } elseif ($FleetResult == "w") {
                $raport2 .= "<font color="red">";
            }
            $raport2 .= $lang['sys_mess_attack_report'] . " [" . $FleetRow['fleet_end_galaxy'] . ":" . $FleetRow['fleet_end_system'] . ":" . $FleetRow['fleet_end_planet'] . "] </font></a><br /><br />";

            SendSimpleMessage ($TargetUserID, '', $FleetRow['fleet_start_time'], 3, $lang['sys_mess_tower'], $lang['sys_mess_attack_report'], $raport2);
        }
        // Update de la base
      $user1   = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user1stat ."';", 'users');
      while($user1data = mysql_fetch_assoc($user1))
       {
             $strtruemmermetaluser1    = $strtruemmermetal + $user1data['kbmetal'];
             $strtruemmercrystaluser1  = $strtruemmercrystal + $user1data['kbcrystal'];
             $user1lostunits           = $user1lostunits + $user1data['lostunits'];
             $user1shotunits           = $user1shotunits + $user1data['desunits'];
             $user1wons                = $user1data['wons'];
             $user1loos                = $user1data['loos'];
             $user1draws               = $user1data['draws'];
             }
      $user2   = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user2stat ."';", 'users');
      while($user2data = mysql_fetch_assoc($user2))
       {
             $strtruemmermetaluser2    = $strtruemmermetal + $user2data['kbmetal'];
             $strtruemmercrystaluser2  = $strtruemmercrystal + $user2data['kbcrystal'];
             $user2lostunits           = $user2lostunits + $user2data['lostunits'];
             $user2shotunits           = $user2shotunits + $user2data['desunits'];
             $user2wons                = $user2data['wons'];
             $user2loos                = $user2data['loos'];
             $user2draws               = $user2data['draws'];
              }

   if   ($FleetResult == "a") {
             $user1wons++;
             $user2loos++;
         } elseif ($FleetResult == "r") {
             $user1draws++;
             $user2draws++;
        } elseif ($FleetResult == "w") {
             $user1loos++;
             $user2wons++;
        }
//Update Angreifer Truemerfeld, Kampfergebniss und Units
   $userstat   = doquery("SELECT * FROM {{table}} WHERE `id` = '". $user1stat ."';", 'users');
   while($userwrite = mysql_fetch_assoc($userstat))
{

                    $QryUpdateuserstat  = "UPDATE {{table}} SET ";
                    $QryUpdateuserstat .= "`wons` = '". $user1wons ."', ";
                    $QryUpdateuserstat .= "`loos` = '". $user1loos ."', ";
                    $QryUpdateuserstat .= "`draws` = '". $user1draws  ."', ";
                    $QryUpdateuserstat .= "`kbmetal` = '". $strtruemmermetaluser1 ."', ";
                       $QryUpdateuserstat .= "`kbcrystal` = '". $strtruemmercrystaluser1 ."', ";
                    $QryUpdateuserstat .= "`lostunits` = '". $user1lostunits ."', ";
                    $QryUpdateuserstat .= "`desunits` = '". $user1shotunits ."' ";
                    $QryUpdateuserstat .= "WHERE ";
                    $QryUpdateuserstat .= "`id` = '". $user1stat ."';";
                    doquery ( $QryUpdateuserstat , 'users');
//Update Verteidiger Truemerfeld, Kampfergebniss und Units
                    $QryUpdateuserstat  = "UPDATE {{table}} SET ";
                    $QryUpdateuserstat .= "`wons` = '". $user2wons ."', ";
                    $QryUpdateuserstat .= "`loos` = '". $user2loos ."', ";
                    $QryUpdateuserstat .= "`draws` = '". $user2draws  ."', ";
                    $QryUpdateuserstat .= "`kbmetal` = '". $strtruemmermetaluser2 ."', ";
                       $QryUpdateuserstat .= "`kbcrystal` = '". $strtruemmercrystaluser2 ."', ";
                    $QryUpdateuserstat .= "`lostunits` = '". $user2lostunits ."', ";
                    $QryUpdateuserstat .= "`desunits` = '". $user2shotunits ."' ";
                    $QryUpdateuserstat .= "WHERE ";
                    $QryUpdateuserstat .= "`id` = '". $user2stat ."';";
                    doquery ( $QryUpdateuserstat , 'users');

}
        // Retour de flotte (s'il en reste)
        $fquery = "";
        if ($FleetRow['fleet_end_time'] <= time()) {
            if (!is_null($CurrentSet)) {
                foreach($CurrentSet as $Ship => $Count) {
                    $fquery .= "`" . $resource[$Ship] . "` = `" . $resource[$Ship] . "` + '" . $Count['count'] . "', ";
                }
            } else {
                $fleet = explode(";", $FleetRow['fleet_array']);
                foreach($fleet as $a => $b) {
                    if ($b != '') {
                        $a = explode(",", $b);
                        $fquery .= "{$resource[$a[0]]}={$resource[$a[0]]} + {$a[1]}, n";
                    }
                }
            }

            doquery ("DELETE FROM {{table}} WHERE `fleet_id` = " . $FleetRow["fleet_id"], 'fleets');
            if (!($FleetResult == "w")) {
                $QryUpdatePlanet = "UPDATE {{table}} SET ";
                $QryUpdatePlanet .= $fquery;
                $QryUpdatePlanet .= "`metal` = `metal` + " . $FleetRow['fleet_resource_metal'] . ", ";
                $QryUpdatePlanet .= "`crystal` = `crystal` + " . $FleetRow['fleet_resource_crystal'] . ", ";
                $QryUpdatePlanet .= "`deuterium` = `deuterium` + " . $FleetRow['fleet_resource_deuterium'] . " ";
                $QryUpdatePlanet .= "WHERE ";
                $QryUpdatePlanet .= "`galaxy` = " . $FleetRow['fleet_start_galaxy'] . " AND ";
                $QryUpdatePlanet .= "`system` = " . $FleetRow['fleet_start_system'] . " AND ";
                $QryUpdatePlanet .= "`planet` = " . $FleetRow['fleet_start_planet'] . " AND ";
                $QryUpdatePlanet .= "`planet_type` = " . $FleetRow['fleet_start_type'] . " LIMIT 1 ;";
                doquery($QryUpdatePlanet, 'planets');
            }
        }
    }
}

?>
 language :

topkb.mo :

<?php
$lang['top']                    = "Hall of Fame";
$lang['gratz']                  = "Toute l equipe felicite le Top 100";
$lang['Platz']                  = "Place";
$lang['Beteiligte']             = "Bataille";
$lang['Datum']                  = "Date";
$lang['Legende']                = "<b>Legende: </b>";
$lang['Gewinner']               = "<b>-Vainqueur-      </b>";
$lang['Verlierer']              = "<b>-Perdant-     </b>";
$lang['unentschieden']          = "<b>-Match Nul- </b>";
$lang['Missing']                = "<br/>Action Impossible: Le compte n'existe plus.";
?>

leftmenu.mo :

rajoutez ceci :

$lang['HallofFame']   = 'Hall of Fame';

leftmenu.TPL

rajoutez ceci :

</tr><tr>
    <td colspan="2"><div>
  <div align="center"><a href="topkb.php" accesskey="x" target="{mf}">Hall of Fame</a></div>
</div></td>
</tr><tr>

Et enfin les requete a appliquer via phpAdmin :

CREATE TABLE `game_topkb` (
  `id` bigint(11) unsigned NOT NULL AUTO_INCREMENT,
  `id_owner1` bigint(20) NOT NULL DEFAULT '0',
  `angreifer` varchar(64) NOT NULL DEFAULT '',
  `id_owner2` bigint(20) NOT NULL DEFAULT '0',
  `defender` varchar(64) NOT NULL DEFAULT '',
  `gesamtunits` bigint(20) NOT NULL DEFAULT '0',
  `gesamttruemmer` bigint(20) NOT NULL DEFAULT '0',
  `rid` varchar(72) NOT NULL DEFAULT '',
  `raport` text NOT NULL,
  `fleetresult` varchar(64) NOT NULL DEFAULT '',
  `a_zestrzelona` tinyint(3) unsigned NOT NULL DEFAULT '0',
  `time` int(10) unsigned NOT NULL DEFAULT '0',
  PRIMARY KEY (`id`),
  KEY `id_owner1` (`id_owner1`,`rid`),
  KEY `id_owner2` (`id_owner2`,`rid`),
  KEY `time` (`time`),
  FULLTEXT KEY `raport` (`raport`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

ALTER TABLE `game_users` ADD `wons` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `loos` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `draws` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `kbmetal` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `kbcrystal` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `lostunits` bigint(20) NOT NULL DEFAULT '0';
ALTER TABLE `game_users` ADD `desunits` bigint(20) NOT NULL DEFAULT '0';

Voia en esperant que sa servira

arno

samedi 23 octobre 2010 (Dernière édition mardi 26 octobre 2010)

Courroux Messages : 2216

Oula, alors soit c'est un bug du forum, soit c'est hyper mal écrit...

Je pense plutôt que c'est un bug du forum

samedi 23 octobre 2010

arno Messages : 83

oui c'est un bug je pense , je ne peut meme pas le rééditer

samedi 23 octobre 2010

Courroux Messages : 2216

Ouais moi non plus, je peux pas éditer mon message...

samedi 23 octobre 2010

arno Messages : 83

je repasserais plus tard pour voir si il faut que je recommence

samedi 23 octobre 2010

SiMax Messages : 7572

C'est un bug qui ne vient pas du forum (pour une fois ). Il faut bien penser à mettre tous les codes dans des balises code !

Merci pour le tutoriel sinon

dimanche 24 octobre 2010

arno Messages : 83

ah!!oui , en effet ,j'avais oublié ,merci

dimanche 24 octobre 2010

Mizur Messages : 6617

Et... Il fait quoi ce tuto?

Une screen meme?

lundi 25 octobre 2010

arno Messages : 83

timal kahn1994
VS
Les flottes suivantes se sont affrontées le Mon, 25 Oct 2010 23:01:55 +0200 :

Attaquant timal [X:XXX:XX]
Type P.transp.
Nombre 67.065.092.943.515.010.000
Armes 48
Bouclier 108
Coque 3.840

Défenseur kahn1994 [X:XXX:XX]
Armes: 560 % Bouclier: 610 % Coque: 610 %
Type Sonde Sat.sol. Exterm. Giga recycleur Missile
Nombre 49.962 1.810.634.856 102.158.051.458.009.960.000.000 10.000.000.000.000.000.000.000 29.688.556.649.373.995.000.000.000
Armes 7 6 118.800.000 6 618
Bouclier 0 82 132.060.000 5.822 136
Coque 1 1.420 35.500.000 1.136.000 1.420

La flotte attaquante tire avec une puissance de 3.185.591.914.816.962.500.000 sur le défenseur. Les boucliers du défenseur absorbent 3.185.591.914.816.962.500.000 points de dégâts.
La flotte défensive tire au total 12.154.716.976.027.305.000.000.000.000.000 sur l'attaquant. Les boucliers de l'attaquant absorbent 7.218.886.604.439.954.000.000 points de dégâts.

Attaquant timal [X:XXX:XX]

Détruit!

Défenseur kahn1994 [X:XXX:XX]
Armes: 560 % Bouclier: 610 % Coque: 610 %
Type Sonde Sat.sol. Exterm. Giga recycleur Missile
Nombre 49.958 1.810.634.852 102.158.051.458.009.960.000.000 10.000.000.000.000.000.000.000 29.688.556.649.373.995.000.000.000
Armes 7 8 110.880.000 8 454
Bouclier 0 70 163.300.000 6.390 160
Coque 1 1.420 35.500.000 1.136.000 1.420
Le défenseur a gagné la bataille !
L'attaquant a perdu au total 268.260.371.774.060.050.000.000 unités.
Le défenseur a perdu au total 0 unités.
Un champ de débris contenant 80.478.111.532.217.970.000.000 unités de Métal et 80.478.111.532.217.970.000.000 unités de Cristal se forme dans l'orbite de cette planète.
La probabilitée de création d'une lune est de : 20 %

Rapport simulé en 0.00070405006408691 secondes

voila desolé je ne sais pas insérer le screen ,

mardi 26 octobre 2010 (Dernière édition mardi 26 octobre 2010)

arno Messages : 83

je voudrais rééditer le tuto si possible ,merci

mardi 26 octobre 2010

Page suivante »