Ankündigung

Einklappen
Keine Ankündigung bisher.

php4 mit MySQL 5.1.3-alpha

Einklappen

Neue Werbung 2019

Einklappen
X
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

  • php4 mit MySQL 5.1.3-alpha

    Hi,
    ich bin neu hier und muss gestehen das ich absolut keine Ahnung habe von php bzw Linux.


    Mein problem besteht darin das ich mein linux einen Update verpasst hatte sprich php4 standart von yast aus Installiert und phpmyadmin bzw MySQL 5.1.3-alpha von hand mit dieser gz usw...

    Jetzt habe ich aber eine Page am laufen die auch sichtbar ist nur wenn man jetzt mit strg+c was kopiert aus einer hompage und das in meinen eingabefeld einfügen möchte macht er das wohl nur er gibt die nicht richtig aus.

    Laut Install anleitung steht folgendes:

    Requirements:

    - MySQL 4.x (functionality not checked on versions minor than 4.0)
    - PHP 4.3.x (preferable the latest working)

    meine Frage ist jetzt ist meine sql zu neu wenn ja was müste man bei die php`s ändern damit die laufen.


    um einen besseren verständniss zu bekommen kann ich auch ein zugang erstellen in der page wo dieser fehler ist.
    einfach eine igm an mich.

    hier mal ein schnipsel aus einer php datei vieleicht kann das ja helfen und ich brauche nur was ändern was identisch währe mit den anderen php datein.


    PHP-Code:
    <?php

    $currenthour  
    mktime (date("H"),0,0,date("m"),date("d"),date("Y"));
    $thishour mktime(strftime("%H"$time),0,0,strftime("%m"$time),strftime("%d"$time),strftime("%y"$time));

    $link sqlcon();

    /* Fleet Cleanup */
    $query "SELECT * FROM fleetdata;";
    $result = @mysql_query($query);
    while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
    {
        
    $totaltime $line['eta'] + $line['battletime'] + $line['combattime'];
        
    $endtime = ($line['time'] + ($totaltime 3600));
        if(
    $time $endtime)
        {
            if(
    $onetimer != 1) { $onetimer 1; echo "Cleaning"; }
            
    $query "DELETE FROM fleetdata WHERE flightmode='".$line['flightmode']."' AND ships='".$line['ships']."' AND stealth='".$line['stealth']."' AND cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND player='".$line['player']."' AND cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."' AND time='".$line['time']."';";
            @
    mysql_query($query);
            echo 
    ".";
        }
    }
    $query "SELECT * FROM fleetscans;";
    $result = @mysql_query($query);
    while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
    {
        
    $totaltime $line['eta'] + $line['battletime'] + $line['combattime'];
        
    $endtime = ($line['time'] + ($totaltime 3600));
        if(
    $time $endtime)
        {
            if(
    $onetimer != 1) { $onetimer 1; echo "Cleaning"; }
            
    //$query = "DELETE FROM fleetscans WHERE unit='".$line['unit']."' AND news='".$line['news']."' AND mili='".$line['mili']."' AND ships='".$line['ships']."' AND time='".$line['time']."' AND cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND fleet='".$line['fleet']."' AND battletype='".$line['battletype']."' AND cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."' AND eta='".$line['eta']."' AND battletime='".$line['battletime']."' AND cloaking='".$line['cloaking']."';";
            
    $query "DELETE FROM fleetscans WHERE cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND fleet='".$line['fleet']."';";
            @
    mysql_query($query);
            echo 
    ".";
        }
    }
    /* Fleet Cleanup */

    sqldis($link$result);

    if(isset(
    $_GET['removeflin']) && $moderator == 1)
    {
        
    $link sqlcon();
        
    $remdet explode(";"$_GET['removeflin']);
        
    $query "DELETE FROM fleetdata WHERE flightmode='0' AND ships='".$remdet[0]."' AND stealth='".$remdet[1]."' AND cluster_from='".$remdet[2]."' AND galaxy_from='".$remdet[3]."' AND planet_from='".$remdet[4]."' AND player='".base64_decode($remdet[5])."' AND cluster_to='".$remdet[6]."' AND galaxy_to='".$remdet[7]."' AND planet_to='".$remdet[8]."' AND time='".$remdet[9]."';";
        @
    mysql_query($query);
        
        
    $query "DELETE FROM fleetscans WHERE cluster_from='".$remdet[2]."' AND galaxy_from='".$remdet[3]."' AND planet_from='".$remdet[4]."' AND cluster_to='".$remdet[6]."' AND galaxy_to='".$remdet[7]."' AND planet_to='".$remdet[8]."' AND time='".$remdet[9]."';";
        @
    mysql_query($query);
        
        
    $query "INSERT INTO adminlogs VALUES ('".(time()+$gozeit)."', '".$_SESSION['authusername']."', 'FLEET INC Delete ".$remdet[0].";".$remdet[1].";".$remdet[2].";".$remdet[3].";".$remdet[4].";".base64_decode($remdet[5]).";".$remdet[6].";".$remdet[7].";".$remdet[8].";".$remdet[9]."');";
        @
    mysql_query($query);
        
    sqldis($link$result);
        echo 
    "
    Removed Fleet Data!
    "
    ;
        
    updatedb("fleetdata");
        
    updatedb("adminlogs");
    }
    if(isset(
    $_GET['removeflout']) && $moderator == 1)
    {
        
    $link sqlcon();
        
    $remdet explode(";"$_GET['removeflout']);
        
    $query "DELETE FROM fleetdata WHERE flightmode='1' AND ships='".$remdet[0]."' AND stealth='".$remdet[1]."' AND cluster_from='".$remdet[2]."' AND galaxy_from='".$remdet[3]."' AND planet_from='".$remdet[4]."' AND player='".base64_decode($remdet[5])."' AND cluster_to='".$remdet[6]."' AND galaxy_to='".$remdet[7]."' AND planet_to='".$remdet[8]."' AND time='".$remdet[9]."';";
        @
    mysql_query($query);
        
        
    $query "DELETE FROM fleetscans WHERE cluster_from='".$remdet[2]."' AND galaxy_from='".$remdet[3]."' AND planet_from='".$remdet[4]."' AND cluster_to='".$remdet[6]."' AND galaxy_to='".$remdet[7]."' AND planet_to='".$remdet[8]."' AND time='".$remdet[9]."';";
        @
    mysql_query($query);

        
    $query "INSERT INTO adminlogs VALUES ('".(time()+$gozeit)."', '".$_SESSION['authusername']."', 'FLEET OUT Delete ".$remdet[0].";".$remdet[1].";".$remdet[2].";".$remdet[3].";".$remdet[4].";".base64_decode($remdet[5]).";".$remdet[6].";".$remdet[7].";".$remdet[8].";".$remdet[9]."');";
        @
    mysql_query($query);
        
    sqldis($link$result);
        echo 
    "
    Removed Fleet Data!
    "
    ;
        
    updatedb("fleetdata");
        
    updatedb("adminlogs");
    }

    //////////////////////// LOAD MODULE //////////////////////////
    ////////////////// process fleet db storage ///////////////////
    ///////////////////////////////////////////////////////////////

    ?>
        <script language='JavaScript'>
        <!--
        function popup(scan, timeage, coordinate, xw, xh, xs) {
        window.open('<?php echo $filename?>.php?do='+scan+'&popup=scan&age='+timeage+'&show='+coordinate, 'scanfenster', 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+xs+',resizable=0,width='+xw+',height='+xh+',top=0,left=0');
        }
        //-->
        </script>
    <?php

    $timeout2d  
    mktime (date("H"),date("i"),0,date("m"),date("d")-2,date("Y")) + $gozeit;

    $link sqlcon();
    $query "SELECT * FROM fleetdata LIMIT 0,1;";
    $result = @mysql_query($query);
    $line = @mysql_fetch_array($resultMYSQL_ASSOC);
    if(
    $line['time'] != null || $line['time'] != '')
    {
        echo 
    "
    Display Fleetmovement from Gala: "
    ;

        
    $query2 "SELECT * FROM fleetdata;";
        
    $result2 = @mysql_query($query2);
        while (
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC))
        {
            if(
    $line2['flightmode'] == 0)
            {
                
    $flgala $line2['cluster_to'].".".$line2['galaxy_to'];
            }
            else {
                
    $flgala $line2['cluster_from'].".".$line2['galaxy_from'];
            }
            if(!@
    in_array($flgala$fl_gala)) {
                
    $fl_gala[] = $flgala; }
        }
        @
    mysql_free_result($result2);
        echo 
    "[url='".$filename.".php?view=tactics&do=fleet&displaygala=inc']Inc[/url]";
        echo 
    "[url='".$filename.".php?view=tactics&do=fleet&displaygala=out']Out[/url]";
        for(
    $i=0;$i<count($fl_gala);$i++)
        {
            echo 
    "[url='".$filename.".php?view=tactics&do=fleet&displaygala=$fl_gala[$i]']".$fl_gala[$i]."[/url]";
        }
        echo 
    "
    "
    ;
    }
    sqldis($link$result);

    $incomings 0;
    $link sqlcon();

    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */

    $tempsql "CREATE TEMPORARY TABLE IF NOT EXISTS `fleetcombo` (
      `flightmode` enum('0','1') NOT NULL default '0',
      `time` int(11) NOT NULL default '0',
      `ships` int(11) NOT NULL default '0',
      `stealth` int(11) default NULL,
      `cluster_from` tinyint(2) NOT NULL default '0',
      `galaxy_from` tinyint(2) NOT NULL default '0',
      `planet_from` tinyint(2) NOT NULL default '0',
      `player` varchar(120) NOT NULL default '(undefined)',
      `status` enum('attacking','defending') default NULL,
      `cluster_to` tinyint(2) NOT NULL default '0',
      `galaxy_to` tinyint(2) NOT NULL default '0',
      `planet_to` tinyint(2) NOT NULL default '0',
      `eta` tinyint(2) default NULL,
      `combattime` tinyint(1) default NULL,
      `flighttype` enum('waiting','sneak') default NULL,
      `battlehour` tinyint(1) default NULL,
      `battletime` tinyint(1) default NULL,

      `unit` tinyint(1) default NULL,
      `news` tinyint(1) default NULL,
      `mili` tinyint(1) default NULL,
      `cloaking` enum('0','1') default NULL,
      `fleet` enum('1','2','3') default NULL,
      `battletype` enum('Attack','Defend','Return') default NULL,

      `rasse_from` enum('trill','trillA','pred','atta','attaF','attaP') default NULL,
      `rasse_to` enum('trill','trillA','pred','atta','attaF','attaP') default NULL,
      PRIMARY KEY ( `flightmode`, `time`, `ships`, `cluster_from`, `galaxy_from`, `planet_from`, `cluster_to`, `galaxy_to`, `planet_to` )
    ) TYPE=MyISAM;"
    ;

    $query = @mysql_query($tempsql);

    /**********************************/
    $query "SELECT fleetdata.*,globalplayers.rasse AS rasse_from FROM fleetdata,globalplayers WHERE fleetdata.cluster_from=globalplayers.cluster AND fleetdata.galaxy_from=globalplayers.galaxy AND fleetdata.planet_from=globalplayers.planet AND flightmode = '0';";
    $result mysql_query($query);
    while(
    $line mysql_fetch_array($resultMYSQL_ASSOC))
    {
        
    $query2 "SELECT rasse AS rasse_to FROM globalplayers WHERE ".$line['cluster_to']."=cluster AND ".$line['galaxy_to']."=galaxy AND ".$line['planet_to']."=planet;";
        
    $result2 mysql_query($query2);
        
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
        
    mysql_free_result($result2);
        
    //$player = preg_replace('@ - @', ' ', $line['player']);
        
    $query "INSERT INTO fleetcombo VALUES ('".$line['flightmode']."','".$line['time']."','".$line['ships']."','".$line['stealth']."','".$line['cluster_from']."','".$line['galaxy_from']."','".$line['planet_from']."','".$line['player']."','".$line['status']."','".$line['cluster_to']."','".$line['galaxy_to']."','".$line['planet_to']."','".$line['eta']."','".$line['combattime']."','".$line['flighttype']."','".$line['battlehour']."','".$line['battletime']."',null,null,null,null,null,null,'".$line['rasse_from']."','".$line2['rasse_to']."');";
        
    mysql_query($query);
    }
    mysql_free_result($result);
    /**********************************/
    $query "SELECT fleetdata.*,globalplayers.rasse AS rasse_from FROM fleetdata,globalplayers WHERE fleetdata.cluster_from=globalplayers.cluster AND fleetdata.galaxy_from=globalplayers.galaxy AND fleetdata.planet_from=globalplayers.planet AND flightmode = '1';";
    $result mysql_query($query);
    while(
    $line mysql_fetch_array($resultMYSQL_ASSOC))
    {
        
    $store 1;
        if(
    $line['status'] == 'defending')
        {
            
    $query2 "SELECT * FROM fleetcombo WHERE ships='".$line['ships']."' AND cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."';";
            
    $result2 mysql_query($query2);
            
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
            
    mysql_free_result($result2);
            if(
    $line2['time'] != null)
            {
                
    $store 0;    
            }
        }
        if(
    $store == 1)
        {
            
    $inally 0;
            if(
    $line['status'] == 'defending')
            {
                
    $politic "SELECT id FROM politicstats WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."';";
                
    $result2 mysql_query($politic);
                
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
                
    mysql_free_result($result2);
                if(
    $line2['id'] != null) { $inally++; }
                
    $politic "SELECT id FROM politicstats WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."';";
                
    $result2 mysql_query($politic);
                
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
                
    mysql_free_result($result2);
                if(
    $line2['id'] != null) { $inally++; }
            }
            if(
    $inally == 2) { $line['flightmode'] = 0; }
            
    $query2 "SELECT rasse AS rasse_to FROM globalplayers WHERE ".$line['cluster_to']."=cluster AND ".$line['galaxy_to']."=galaxy AND ".$line['planet_to']."=planet;";
            
    $result2 mysql_query($query2);
            
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
            
    mysql_free_result($result2);
            
    //$player = preg_replace('@ - @', ' ', $line['player']);
            
    $query "INSERT INTO fleetcombo VALUES ('".$line['flightmode']."','".$line['time']."','".$line['ships']."','".$line['stealth']."','".$line['cluster_from']."','".$line['galaxy_from']."','".$line['planet_from']."','".$line['player']."','".$line['status']."','".$line['cluster_to']."','".$line['galaxy_to']."','".$line['planet_to']."','".$line['eta']."','".$line['combattime']."','".$line['flighttype']."','".$line['battlehour']."','".$line['battletime']."',null,null,null,null,null,null,'".$line['rasse_from']."','".$line2['rasse_to']."');";
            
    mysql_query($query);
        }
    }
    mysql_free_result($result);
    /**********************************/
    $query "SELECT fleetscans.*,globalplayers.rasse AS rasse_from,globalplayers.herrschername FROM fleetscans,globalplayers WHERE fleetscans.cluster_from=globalplayers.cluster AND fleetscans.galaxy_from=globalplayers.galaxy AND fleetscans.planet_from=globalplayers.planet;";
    $result mysql_query($query);
    while(
    $line mysql_fetch_array($resultMYSQL_ASSOC))
    {
        
    $politic "SELECT id FROM politicstats WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."';";
        
    $result2 mysql_query($politic);
        
    $line2 mysql_fetch_array($result2MYSQL_ASSOC);
        
    mysql_free_result($result2);
        
    $query3 "SELECT rasse AS rasse_to FROM globalplayers WHERE ".$line['cluster_to']."=cluster AND ".$line['galaxy_to']."=galaxy AND ".$line['planet_to']."=planet;";
        
    $result3 mysql_query($query3);
        
    $line3 mysql_fetch_array($result3MYSQL_ASSOC);
        
    mysql_free_result($result3);
        
    // Prüfe ob Flotteninc bereits vorhanden sind
        
    $query4 "SELECT * FROM fleetcombo WHERE cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."' AND cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND ships='".$line['ships']."';";
        
    $result4 mysql_query($query4);
        
    $line4 mysql_fetch_array($result4MYSQL_ASSOC);
        
    mysql_free_result($result4);
        if(
    $line4['flightmode'] == null && $line4['flightmode'] == '')
        {
            if(
    $line2['id'] != null && $line2['id'] != '')
            {
                
    $query "INSERT INTO fleetcombo VALUES ('0','".$line['time']."','".$line['ships']."',null,'".$line['cluster_from']."','".$line['galaxy_from']."','".$line['planet_from']."','".$line['herrschername']."',null,'".$line['cluster_to']."','".$line['galaxy_to']."','".$line['planet_to']."','".$line['eta']."',null,null,null,'".$line['battletime']."','".$line['unit']."','".$line['news']."','".$line['mili']."','".$line['cloaking']."','".$line['fleet']."','".$line['battletype']."','".$line['rasse_from']."','".$line3['rasse_to']."');";
            }
            else
            {
                
    $query "INSERT INTO fleetcombo VALUES ('1','".$line['time']."','".$line['ships']."',null,'".$line['cluster_from']."','".$line['galaxy_from']."','".$line['planet_from']."','".$line['herrschername']."',null,'".$line['cluster_to']."','".$line['galaxy_to']."','".$line['planet_to']."','".$line['eta']."',null,null,null,'".$line['battletime']."','".$line['unit']."','".$line['news']."','".$line['mili']."','".$line['cloaking']."','".$line['fleet']."','".$line['battletype']."','".$line['rasse_from']."','".$line3['rasse_to']."');";
            }
            
    mysql_query($query);
        }
    }
    mysql_free_result($result);

    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */
    /*
    echo "<hr>";
    $query = "SELECT * FROM fleetcombo ORDER BY flightmode,cluster_from,galaxy_from,planet_from ASC;";
    $result = mysql_query($query);
    while($line = mysql_fetch_array($result, MYSQL_ASSOC))
    {
        print_r($line);
        echo "
    ";
    }
    mysql_free_result($result);
    echo "<hr>";
    */
    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */
    /* ------------------------------------------------------------------- */

    $query "SELECT * FROM fleetcombo WHERE flightmode='0' LIMIT 0,1;";
    $result = @mysql_query($query);
    $line = @mysql_fetch_array($resultMYSQL_ASSOC);

    $query2 "SELECT time FROM fleetcombo WHERE battletype='Attack' ORDER BY time DESC LIMIT 0,1;";
    $result2 = @mysql_query($query2);
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
    if(
    $line2['time'] > $timeout2d) { $incomings 1; }
    mysql_free_result($result2);

    if(
    $line['time'] == null || $line['time'] == '' && $incomings == 0)
    {
        echo 
    "
    <font size=+1>Keine Incomings</font>"
    ;
    }
    else
    {
        @
    mysql_free_result($result);
        echo 
    "
    <font size=+1>Flotten Daten (Incoming)</font>"
    ;

        
    // Check Incoming from Scan (no Fleetdata)
        
    if($displaygala != 'out')
        {
            
    $query "SELECT * FROM fleetcombo ORDER BY cluster_to,galaxy_to,planet_to ASC;";
            
    $result = @mysql_query($query);
            while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
            {

                
    $correction strftime("%H"$line['time']);
                
    $correction $correction $line['eta'] + $line['combattime'];
                
    $correctiontime mktime($correction,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                if(
    $correctiontime $thishour && $line['battletype'] == 'Attack')
                {
                
    // Zeigt nur neue Fleetdaten
                
    $query2 "SELECT * FROM fleetcombo WHERE flightmode='0' AND cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                if(
    $line2['time'] == '' || $line2['time'] == null)
                {
                    
    $correction strftime("%H"$line['time']);
                    
    $correction $correction $line['eta'];
                    
    $correctiontime mktime($correction,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                    
    $neweta strftime("%H", ($correctiontime $thishour));
                    if(
    ereg("([0]{1})"$neweta[0])) { $neweta substr($neweta1); } // delete leading 0
                    
    $neweta--; // Time Loss Correction
                    
    $zielzeit strftime ("%d.%m.%y - %H Uhr"$correctiontime);

                    
    $userlisteracedisplay "bg_empty.gif";
                    if(
    $line['rasse_from'] != null)
                    {
                        
    $userlisteracedisplay "bg_".$line['rasse_from'].".gif";
                    }
                    
    $userlisteracedisplay2 "bg_empty.gif";
                    if(
    $line['rasse_to'] != null)
                    {
                        
    $userlisteracedisplay2 "bg_".$line['rasse_from'].".gif";
                    }

                    if(
    $line['player'] == '') { $herrscher '[i](Unknown)[/i]'; }
                    else { 
    $herrscher $line['player']; }
                    echo 
    "<div id='fleetdata' class='fleet att'><span class='ships'>".$line['ships']." <font class='stealth'>+?</font></span><span class='text1'>Ships from</span><span>[img]".$userlisteracedisplay."[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$herrscher."</span><span class='text2'>attacking</span><span>[img]".$userlisteracedisplay2."[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$neweta." h</span><span class='battle'>( ".$line['battletime']." h attack )</span><span class='time'>($zielzeit)</span>";

                    echo 
    "<span class='link scan'>";
                    if(
    $line['unit'] == 1)
                    {
                        echo 
    "[url=".chr(34)."]U[/url]";
                    }
                    else { echo 
    ""; }
                    echo 
    "</span>";
                    echo 
    "<span class='link scan'>";
                    if(
    $line['news'] == 1)
                    {
                        echo 
    "[url=".chr(34)."]N[/url]";
                    }
                    else { echo 
    ""; }
                    echo 
    "</span>";
                    echo 
    "<span class='link scan'>";
                    if(
    $line['mili'] == 1)
                    {
                        echo 
    "[url=".chr(34)."]M[/url]";
                    }
                    else { echo 
    ""; }
                    echo 
    "</span>";
                    echo 
    "</span><span class='link scan'></span><span class='link scan'></span><span class='transp'>[i](Scanned)[/i]</span></div>";
                }
                @
    mysql_free_result($result2);
                }
            }
            @
    mysql_free_result($result);
        }

        
    $query "SELECT * FROM fleetcombo WHERE flightmode='0' ORDER BY cluster_to,galaxy_to,planet_to,eta,cluster_from,galaxy_from,planet_from ASC;";
        
    $result = @mysql_query($query);
        while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
        {
            
    $prevfleetcoord $newfleetcoord;
            
    $newfleetcoord $line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to'];

            if(isset(
    $displaygala) && $displaygala=="".$line['cluster_to'].".".$line['galaxy_to']."") { $displayfleet 1; }
            elseif(isset(
    $displaygala) && $displaygala=='inc') { $displayfleet 1; }
            if(!isset(
    $displaygala)) { $displayfleet 1; }

            if(
    $prevfleetcoord!=$newfleetcoord) { $dodisplay 1;}
            else { 
    $dodisplay 0; }

            if(
    $dodisplay==1)
            {

                if(
    $countattout=="") { $countattout 0; }
                if(
    $countdefout=="") { $countdefout 0; }
                if(
    $prevfleetcoord!="" && $displayfleet == 1) {
                    
    // Check Home Defense
                    
    $homecoords explode("."$prevfleetcoord);
                    
    $query2 "SELECT * FROM galafleetsum WHERE cluster='".$homecoords[0]."' AND galaxy='".$homecoords[1]."';";
                    
    $result2 = @mysql_query($query2);
                    
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                    @
    mysql_free_result($result2);
                    
    $homeships $line2[$homecoords[2].'_pos'];
                    
    $query2 "SELECT * FROM fleetcombo WHERE flightmode='1' AND cluster_from='".$homecoords[0]."' AND galaxy_from='".$homecoords[1]."' AND planet_from='".$homecoords[2]."';";
                    
    $result2 = @mysql_query($query2);
                    while(
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC))
                    {
                        if(
    $line2['stealth'] != -1) { $homeships -= $line2['stealth']; }
                        
    $homeships -= $line2['ships'];
                    }
                    if(
    $homeships 0)
                    {
                        
    $query3 "SELECT * FROM globalplayers WHERE cluster='".$homecoords[0]."' AND galaxy='".$homecoords[1]."' AND planet='".$homecoords[2]."';";
                        
    $result3 = @mysql_query($query3);
                        
    $line3 = @mysql_fetch_array($result3MYSQL_ASSOC);
                        @
    mysql_free_result($result3);
                        
    $userlisteracedisplay "bg_empty.gif";
                        if(
    $line3['rasse'] != null)
                        {
                            
    $userlisteracedisplay "bg_".$line3['rasse'].".gif";
                        }
                        
    $countdefout += $homeships;
                        echo 
    "<div id='fleetdata' class='fleet def'><span class='ships'>".$homeships." </span><span class='text1'>Ships from</span><span>[img]".$userlisteracedisplay."[/img]</span><span class='coords'>".$prevfleetcoord."</span><span class='name'>(Home Defense)</span><span class='text2'>defending</span><span>[img]".$userlisteracedisplay."[/img]</span><span class='coords'>".$prevfleetcoord."</span><span class='eta'>ETA 0 h</span><span class='battle'>( ? h defend )</span><span class='time'>(00.00.00 - 00 Uhr)</span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='transp'></span></div>";
                    }
                    echo 
    "<div id='fleetsummary' class='fleet'><span class='text'>Summary at $prevfleetcoord</span><span class='att zahl'>$countattout</span><span>vs</span><span class='def zahl'>$countdefout</span></div>";
                }
                unset(
    $countattout$countdefout);
            }

            if(
    $displayfleet==1) {
                
    $displayfleet 0;

                
    $correction strftime("%H"$line['time']);
                
    $correction $correction $line['eta'];
                
    $correctiontime mktime($correction,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                
    $zielzeit strftime ("%d.%m.%y - %H Uhr"$correctiontime);

                if(
    $prevfleetcoord!=$newfleetcoord) { echo "<div id='fleetspacer'></div>"; }
                
    // Count Ships
                
    if($line['status'] == 'attacking')
                {
                    if(
    $line['stealth'] == -1) { $stealther 0; }
                    else { 
    $stealther $line['stealth']; }
                    
    $countattout += $line['ships'] + $stealther;
                }
                else {
                    if(
    $line['stealth'] == -1) { $stealther 0; }
                    else { 
    $stealther $line['stealth']; }
                    
    $countdefout += $line['ships'] + $stealther;
                }
                
    // Check Stealther
                
    if($line['stealth'] == -1) { $stealther 0$flstealther "?"; }
                else { 
    $stealther $line['stealth']; $flstealther $line['stealth']; }
                
    $fleetsum $line['ships'] + $stealther;
                
    // Check Battle or Eta
                
    if ($line['battletime'] != && $line['battlehour'] != 0)
                {
                    
    $scanbattletime $line['battletime'];
                }
                else {
                    
    $scanbattletime $line['combattime'];
                }
                
    // Correct Virtual Ship Count from Scans
                
    $query2 "SELECT * FROM fleetcombo WHERE cluster_from='".$line['cluster_from']."' AND galaxy_from='".$line['galaxy_from']."' AND planet_from='".$line['planet_from']."' AND battletime='".$scanbattletime."' AND battletype='Attack' AND cluster_to='".$line['cluster_to']."' AND galaxy_to='".$line['galaxy_to']."' AND planet_to='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                while(
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC))
                {
                    if(
    $line2['cloaking'] == 1)
                    {
                        
    $line2['ships'] -= $line['ships'] - $line['stealther'];
                        if(
    $flstealther == '?') { $flstealther $line2['ships'].' +'.$flstealther; }
                        else { 
    $flstealther += $line2['ships']; }
                        
    $countattout += $line2['ships'];
                    }
                    else {
                        
    $line2['ships'] -= $line['ships'] - $line['stealther'];
                        if(
    $flstealther == '?') { $flstealther $line2['ships']; }
                        else { 
    $flstealther += $line2['ships']; }
                        
    $countattout += $line2['ships'];
                    }
                }
                @
    mysql_free_result($result2);
                
    // Set Race Icon
                
    $userlisteracedisplay "bg_empty.gif";
                if(
    $line['rasse_from'] != null)
                {
                    
    $userlisteracedisplay "bg_".$line['rasse_from'].".gif";
                }
                
    $userlisteracedisplay2 "bg_empty.gif";
                if(
    $line['rasse_to'] != null)
                {
                    
    $userlisteracedisplay2 "bg_".$line['rasse_to'].".gif";
                }


                if (
    $line['battletime'] != && $line['battlehour'] != 0)
                {
                    
    $battlecorrection $line['battletime'] + 1;
                    
    $battlecorrectiontime mktime($correction+$battlecorrection,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                    
    $battlezielzeit strftime ("%d.%m.%y - %H Uhr"$battlecorrectiontime);
                    echo 
    "<div id='fleetdata' class='fleet ".substr($line['status'], 0, -6)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$line['status']."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='inbattle'>[ [b]".$line['battlehour']."[/b] / ".$line['battletime']." ] hours of ".$line['status']."</span><span class='time'>($battlezielzeit)</span>";
                }
                else {
                    
    $starthour mktime(strftime("%H"$line['time']),0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                    
    $arrivaltime $starthour + ($line['eta'] * 3600);
                    
    $etatime = ( $arrivaltime $thishour ) / 3600;
                    
    $finaltime $arrivaltime + (($line['combattime'] + $line['battletime'])*3600);
                    if(
    $line['status'] != null) { $modus $line['status']; }
                    else { 
    $modus strtolower($line['battletype'])."ing"; }

                    if(
    $line['combattime'] != null && $line['combattime'] > 0) { $battletime $line['combattime']; }
                    else { 
    $battletime $line['battletime']; }
                    if(
    $time $arrivaltime)
                    {
                        
    $battlehour = ( ( $thishour $arrivaltime ) / 3600 ) + 1;
                        
    $battlecorrection $line['battletime']+$line['combattime'];
                        
    $battlecorrectiontime mktime($correction+$battlecorrection,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                        
    $battlezielzeit strftime ("%d.%m.%y - %H Uhr"$battlecorrectiontime);
                        echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='inbattle'>[ [b]".$battlehour."[/b] / ".$battletime." ] hours of ".$modus."</span><span class='time'>($battlezielzeit)</span>";
                    }
                    else
                    {
                        echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$etatime." h</span><span class='battle'>( ".$battletime." h ".substr($modus0, -3)." )</span><span class='time'>($zielzeit)</span>";
                    }
                }

                
    $query2 "SELECT time FROM unitscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]U[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM newsscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]N[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM miliscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]M[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM roidscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]R[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM techscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]T[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);

                if(
    $moderator==1){
                    echo 
    "<span class='remove'><a href=\"".$filename.".php?view=tactics&do=fleet&removeflin=".$line['ships'].";".$line['stealth'].";".$line['cluster_from'].";".$line['galaxy_from'].";".$line['planet_from'].";".base64_encode($line['player']).";".$line['cluster_to'].";".$line['galaxy_to'].";".$line['planet_to'].";".$line['time']."\">remove</a></span>";
                }
                else { echo 
    "<span class='transp'></span>"; }
                echo 
    "</div>";

            } 
    // displayfleet
        
    // while loop

        
    if($displayfleet == && $displaygala != 'out')
        {
        if(
    $countattout=="") { $countattout 0; }
        if(
    $countdefout=="") { $countdefout 0; }
        
    // Check Home Defense
        
    $homecoords explode("."$newfleetcoord);
        
    $query2 "SELECT * FROM galafleetsum WHERE cluster='".$homecoords[0]."' AND galaxy='".$homecoords[1]."';";
        
    $result2 = @mysql_query($query2);
        
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
        @
    mysql_free_result($result2);
        
    $homeships $line2[$homecoords[2].'_pos'];
        
    $query2 "SELECT * FROM fleetcombo WHERE flightmode='1' AND cluster_from='".$homecoords[0]."' AND galaxy_from='".$homecoords[1]."' AND planet_from='".$homecoords[2]."';";
        
    $result2 = @mysql_query($query2);
        while(
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC))
        {
            if(
    $line2['stealth'] != -1) { $homeships -= $line2['stealth']; }
            
    $homeships -= $line2['ships'];
        }
        if(
    $homeships 0)
        {
            
    $query3 "SELECT * FROM globalplayers WHERE cluster='".$homecoords[0]."' AND galaxy='".$homecoords[1]."' AND planet='".$homecoords[2]."';";
            
    $result3 = @mysql_query($query3);
            
    $line3 = @mysql_fetch_array($result3MYSQL_ASSOC);
            @
    mysql_free_result($result3);
            
    $userlisteracedisplay "bg_empty.gif";
            if(
    $line3['rasse'] != null)
            {
                
    $userlisteracedisplay "bg_".$line3['rasse'].".gif";
            }
            
    $countdefout += $homeships;
            echo 
    "<div id='fleetdata' class='fleet def'><span class='ships'>".$homeships." </span><span class='text1'>Ships from</span><span>[img]".$userlisteracedisplay."[/img]</span><span class='coords'>".$prevfleetcoord."</span><span class='name'>(Home Defense)</span><span class='text2'>defending</span><span>[img]".$userlisteracedisplay."[/img]</span><span class='coords'>".$prevfleetcoord."</span><span class='eta'>ETA 0 h</span><span class='battle'>( ? h defend )</span><span class='time'>(00.00.00 - 00 Uhr)</span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='link scan'></span><span class='transp'></span></div>";
        }
        echo 
    "<div id='fleetsummary' class='fleet'><span class='text'>Summary at $newfleetcoord</span><span class='att zahl'>$countattout</span><span>vs</span><span class='def zahl'>$countdefout</span></div>";
        unset(
    $countattout$countdefout);
        }
    // else show incoming

    ////////////////////////////////////////////////////////////////////////////////////////////////

    unset($dodisplay);
    unset(
    $newfleetcoord);
    unset(
    $prevfleetcoord);

    ////////////////////////////////////////////////////////////////////////////////////////////////

    $query "SELECT * FROM fleetcombo WHERE flightmode='1' LIMIT 0,1;";
    $result = @mysql_query($query);
    $line = @mysql_fetch_array($resultMYSQL_ASSOC);
    if(
    $line['time'] == null || $line['time'] == '')
    {
        echo 
    "
    <font size=+1>Keine Outgoings</font>"
    ;
        
    sqldis($link$result);
    }
    else
    {
        @
    mysql_free_result($result);
        echo 
    "
    <font size=+1>Flotten Daten (Outgoing)</font>"
    ;

        
    $query "SELECT * FROM fleetcombo WHERE flightmode='1' ORDER BY cluster_to,galaxy_to,planet_to,cluster_from,galaxy_from,planet_from ASC;";
        
    $result = @mysql_query($query);
        while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
        {
            
    $prevfleetcoord $newfleetcoord;
            
    $newfleetcoord $line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to'];

            if(isset(
    $displaygala) && $displaygala=="".$line['cluster_to'].".".$line['galaxy_to']."") { $displayfleet 1; }
            elseif(isset(
    $displaygala) && $displaygala=='out') { $displayfleet 1; }
            if(!isset(
    $displaygala)) { $displayfleet 1; }

            if(
    $prevfleetcoord!=$newfleetcoord) { $dodisplay 1;}
            else { 
    $dodisplay 0; }

            if(
    $dodisplay==1)
            {

    /*            // Check Enemy Defense
                $homecoords = explode(".", $prevfleetcoord);
                $query2 = "SELECT * FROM fleetcombo WHERE cluster_to='".$homecoords[0]."' AND galaxy_to='".$homecoords[1]."' AND planet_to='".$homecoords[2]."';";
            //    $result2 = @mysql_query($query2);
                while($line2 = @mysql_fetch_array($result2, MYSQL_ASSOC))
                {
                    $homeships = $line2['ships'];
                    $countdefout += $homeships;
                    if($homeships > 0)
                    {
                        $query3 = "SELECT * FROM globalplayers WHERE cluster='".$homecoords[0]."' AND galaxy='".$homecoords[1]."' AND planet='".$homecoords[2]."';";
                        $result3 = @mysql_query($query3);
                        $line3 = @mysql_fetch_array($result3, MYSQL_ASSOC);
                        @mysql_free_result($result3);
                        switch($line3['rasse'])
                        {
                            case 'trill':
                                $userlisteracedisplay = "bg_trill.gif";
                                break;
                            case 'trillA':
                                $userlisteracedisplay = "bg_trillA.gif";
                                break;
                            case 'pred':
                                $userlisteracedisplay = "bg_pred.gif";
                                break;
                            case 'atta':
                                $userlisteracedisplay = "bg_atta.gif";
                                break;
                            case 'attaF':
                                $userlisteracedisplay = "bg_attaF.gif";
                                break;
                            case 'attaP':
                                $userlisteracedisplay = "bg_attaP.gif";
                                break;
                            default:
                                $userlisteracedisplay = "bg_empty.gif";
                                break;
                        }
                        $unit = "";
                        $news = "";
                        $mili = "";
                        if($line2['unit'] == 1)
                        {
                            $unit = "[url=".chr(34)."]U[/url]";
                        }
                        if($line2['news'] == 1)
                        {
                            $news = "[url=".chr(34)."]N[/url]";
                        }
                        if($line2['mili'] == 1)
                        {
                            $mili = "[url=".chr(34)."]M[/url]";
                        }
                        $correction = strftime("%H", $line2['time']);
                        $correction = $correction + $line2['eta'];
                        $correctiontime = mktime($correction,0,0,strftime("%m", $line2['time']),strftime("%d", $line2['time']),strftime("%y", $line2['time']));
                        $eta = ($correctiontime - $thishour) / 3600;
                        $zielzeit = strftime ("%d.%m.%y - %H Uhr", $correctiontime);
                        $battlezielzeit = strftime ("%d.%m.%y - %H Uhr", $correctiontime + ($line2['battletime'] * 3600));
                        if($eta > 0)
                        {
                            echo "<div id='fleetdata' class='fleet def'><span>[img]".$userlisteracedisplay."[/img]</span><span class='ships'>".$homeships." </span><span class='text1'>Ships from</span><span class='coords'>".$line2['cluster_from'].".".$line2['galaxy_from'].".".$line2['planet_from']."</span><span class='name'>".$line3['herrschername']."</span><span class='text2'>defending</span><span class='coords'>".$prevfleetcoord."</span><span class='eta'>ETA ".$eta." h</span><span class='battle'>( ".$line2['battletime']." h defend )</span><span class='time'>($zielzeit)</span><span class='link scan'>$unit</span><span class='link scan'>$news</span><span class='link scan'>$mili</span><span class='link scan'></span><span class='link scan'></span><span class='transp'></span></div>";
                        }
    /* DEV */                    //elseif(0 - $eta > $line2['battletime']) { /* Do nothing */ }
    /*                    else {
                            $battlehour = 0 - $eta;
                            echo "<div id='fleetdata' class='fleet def'><span>[img]".$userlisteracedisplay."[/img]</span><span class='ships'>".$homeships." </span><span class='text1'>Ships from</span><span class='coords'>".$line2['cluster_from'].".".$line2['galaxy_from'].".".$line2['planet_from']."</span><span class='name'>".$line3['herrschername']."</span><span class='text2'>defending</span><span class='coords'>".$prevfleetcoord."</span><span class='inbattle'>[ [b]".$battlehour."[/b] / ".$line2['battletime']." ] hours of defending</span><span class='time'>($battlezielzeit)</span><span class='link scan'>$unit</span><span class='link scan'>$news</span><span class='link scan'>$mili</span><span class='link scan'></span><span class='link scan'></span><span class='transp'></span></div>";
                        }
                    }
                }
                @mysql_free_result($result2);
    */
                
    if($countattout=="") { $countattout 0; }
                if(
    $countdefout=="") { $countdefout 0; }
                if(
    $prevfleetcoord!="" && $displayfleet == 1) {
                    echo 
    "<div id='fleetsummary' class='fleet'><span class='text'>Summary at $prevfleetcoord</span><span class='att zahl'>$countattout</span><span>vs</span><span class='def zahl'>$countdefout</span></div>";
                }
                unset(
    $countattout$countdefout);
            }

            if(
    $displayfleet==1) {
                
    $displayfleet 0;

                
    $correction strftime("%H"$line['time']);
                
    $correction $correction $line['eta'] +0;
                if(
    $line['flighttype'] == 'waiting') { $correction++; }
                
    $correctiontime mktime($correction,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                
    $zielzeit strftime ("%d.%m.%y - %H Uhr"$correctiontime);

                if(
    $prevfleetcoord!=$newfleetcoord) { echo "<div id='fleetspacer'></div>"; }

                if(
    $line['status'] == 'attacking')
                {
                    if(
    $line['stealth'] == -1) { $stealther 0; }
                    else { 
    $stealther $line['stealth']; }
                    
    $countattout += $line['ships'] + $stealther;
                }
                else {
                    if(
    $line['stealth'] == -1) { $stealther 0; }
                    else { 
    $stealther $line['stealth']; }
                    
    $countdefout += $line['ships'] + $stealther;
                }

                if(
    $line['stealth'] == -1) { $stealther 0$flstealther "?"; }
                else { 
    $stealther $line['stealth']; $flstealther $line['stealth']; }
                
    $fleetsum $line['ships'] + $stealther;

                
    // Set Race Icon
                
    $userlisteracedisplay "bg_empty.gif";
                if(
    $line['rasse_from'] != null)
                {
                    
    $userlisteracedisplay "bg_".$line['rasse_from'].".gif";
                }
                
    $userlisteracedisplay2 "bg_empty.gif";
                if(
    $line['rasse_to'] != null)
                {
                    
    $userlisteracedisplay2 "bg_".$line['rasse_to'].".gif";
                }
    /*
                $attdeff = 1;
                $deffatt = 1;
                $politic = "SELECT id FROM politicstats WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."';";
                $result2 = mysql_query($politic);
                $line2 = mysql_fetch_array($result2, MYSQL_ASSOC);
                mysql_free_result($result2);
                if($line2['id'] == null)
                {
                    $attdeff = -1;
                }
                $politic = "SELECT id FROM politicstats WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."';";
                $result2 = mysql_query($politic);
                $line2 = mysql_fetch_array($result2, MYSQL_ASSOC);
                mysql_free_result($result2);
                if($line2['id'] == null)
                {
                    $deffatt = -1;
                }
                if($attdeff == 1 && $deffatt == 1) { $modus = 'defending'; }
                elseif($attdeff == 1 && $deffatt == -1) { $modus = 'attacking'; }
                elseif($attdeff == -1 && $deffatt == 1) { $modus = 'attacking'; }
                elseif($attdeff == -1 && $deffatt == -1) { $modus = 'defending'; }
    */
                
    if($line['status'] != null) { $modus $line['status']; }
                else { 
    $modus strtolower($line['battletype'])."ing"; }

                if (
    $line['battletime'] != && $line['battlehour'] != 0)
                {
                    
    $battlecorrection $line['battletime'] + 1;
                    
    $battlecorrectiontime mktime($correction+$battlecorrection,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                    
    $battlezielzeit strftime ("%d.%m.%y - %H Uhr"$battlecorrectiontime);
                    echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$line['status']."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='inbattle'>[ [b]".$line['battlehour']."[/b] / ".$line['battletime']." ] hours of ".$modus."</span><span class='time'>($battlezielzeit)</span>";
                }
                elseif(
    $line['flighttype'] == 'sneak')
                {
                    
    $starthour mktime(strftime("%H"$line['time']),0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time'])) + 3600;
                    
    $arrivaltime $starthour + ($line['eta'] * 3600);
                    
    $etatime = (( $arrivaltime $thishour ) / 3600 ) - 1;
                    echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$line['status']."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$etatime." h</span><span class='sneak'>SNEAK-FLIGHT</span><span class='time'>($zielzeit)</span>";
                }
                elseif(
    $line['flighttype'] == 'waiting')
                {
                    
    $starthour mktime(strftime("%H"$line['time']),0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time'])) + 3600;
                    if(
    $thishour $starthour)
                    {
                        echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$line['eta']." h</span><span class='jump'>Waiting for Jump</span><span class='time'>($zielzeit)</span>";
                    }
                    else
                    {
                        
    $arrivaltime $starthour + ($line['eta'] * 3600);
                        
    $etatime = ( $arrivaltime $thishour ) / 3600;
                        switch(
    $line['status'])
                        {
                            case 
    'attacking':
                                if(
    $time $arrivaltime) { $battletime '3'; }
                                else { 
    $combattime '3'; }
                                break;
                            case 
    'defending':
                                if(
    $time $arrivaltime) { $battletime '6'; }
                                else { 
    $combattime '6'; }
                                break;
                        }
                        
    $finaltime $arrivaltime + (($combattime $battletime)*3600);
                        if(
    $time $arrivaltime)
                        {
                            
    $battlehour = ( $thishour $arrivaltime ) / 3600;
                            
    $battlecorrection $line['battletime']+$line['combattime'];
                            
    $battlecorrectiontime mktime($correction+$battlecorrection,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                            
    $battlezielzeit strftime ("%d.%m.%y - %H Uhr"$battlecorrectiontime);
                            echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='inbattle'>[ [b]".$battlehour."[/b] / ".$battletime." ] hours of ".$modus."</span><span class='time'>($battlezielzeit)</span>";
                        }
                        else
                        {
                            echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$etatime." h</span><span class='battle'>( ".$combattime." h ".substr($modus0, -3)." )</span><span class='time'>($zielzeit)</span>";
                        }
                    }
                }
                else {
                    
    $starthour mktime(strftime("%H"$line['time']),0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                    
    $arrivaltime $starthour + ($line['eta'] * 3600);
                    
    $etatime = ( $arrivaltime $thishour ) / 3600;
                    
    $finaltime $arrivaltime + (($line['combattime'] + $line['battletime'])*3600);

                    if(
    $line['combattime'] != null && $line['combattime'] > 0) { $battletime $line['combattime']; }
                    else { 
    $battletime $line['battletime']; }
                    if(
    $time $arrivaltime)
                    {
                        
    $battlehour = ( ( $thishour $arrivaltime ) / 3600 ) + 1;
                        
    $battlecorrection $line['battletime']+$line['combattime'];
                        
    $battlecorrectiontime mktime($correction+$battlecorrection,0,0,strftime("%m"$line['time']),strftime("%d"$line['time']),strftime("%y"$line['time']));
                        
    $battlezielzeit strftime ("%d.%m.%y - %H Uhr"$battlecorrectiontime);
                        echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='inbattle'>[ [b]".$battlehour."[/b] / ".$battletime." ] hours of ".$modus."</span><span class='time'>($battlezielzeit)</span>";
                    }
                    else
                    {
                        echo 
    "<div id='fleetdata' class='fleet ".substr($modus03)."'><span class='ships'>".$line['ships']." <font class='stealth'>+".$flstealther."</font></span><span class='text1'>Ships from</span><span>[img]$userlisteracedisplay[/img]</span><span class='coords'>".$line['cluster_from'].".".$line['galaxy_from'].".".$line['planet_from']."</span><span class='name'>".$line['player']."</span><span class='text2'>".$modus."</span><span>[img]$userlisteracedisplay2[/img]</span><span class='coords'>".$line['cluster_to'].".".$line['galaxy_to'].".".$line['planet_to']."</span><span class='eta'>ETA ".$etatime." h</span><span class='battle'>( ".$battletime." h ".substr($modus0, -3)." )</span><span class='time'>($zielzeit)</span>";
                    }
                }

                
    $query2 "SELECT time FROM unitscans WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."' AND planet='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]U[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM newsscans WHERE cluster='".$line['cluster_from']."' AND galaxy='".$line['galaxy_from']."' AND planet='".$line['planet_from']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]N[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM miliscans WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."' AND planet='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]M[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM roidscans WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."' AND planet='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]R[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);
                
    $query2 "SELECT time FROM techscans WHERE cluster='".$line['cluster_to']."' AND galaxy='".$line['galaxy_to']."' AND planet='".$line['planet_to']."';";
                
    $result2 = @mysql_query($query2);
                
    $line2 = @mysql_fetch_array($result2MYSQL_ASSOC);
                echo 
    "<span class='link scan'>";
                if(
    $line2['time'] != null || $line2['time'] != '')
                {
                    echo 
    "[url=".chr(34)."]T[/url]";
                }
                else { echo 
    ""; }
                echo 
    "</span>";
                @
    mysql_free_result($query2);



                if(
    $moderator==1){
                    echo 
    "<span class='remove'><a href=\"".$filename.".php?view=tactics&do=fleet&removeflout=".$line['ships'].";".$line['stealth'].";".$line['cluster_from'].";".$line['galaxy_from'].";".$line['planet_from'].";".base64_encode($line['player']).";".$line['cluster_to'].";".$line['galaxy_to'].";".$line['planet_to'].";".$line['time']."\">remove</a></span>";
                }
                else { echo 
    "<span class='transp'></span>"; }
                echo 
    "</div>";

            } 
    // displayfleet
        
    // while loop

        
    if($displayfleet == && $displaygala != 'inc')
        {
            if(
    $countattout=="") { $countattout 0; }
            if(
    $countdefout=="") { $countdefout 0; }
            echo 
    "<div id='fleetsummary' class='fleet'><span class='text'>Summary at $newfleetcoord</span><span class='att zahl'>$countattout</span><span>vs</span><span class='def zahl'>$countdefout</span></div>";
            unset(
    $countattout$countdefout);
        }
    }


    sqldis($link$result);
    ////////////////////////  END MODULE //////////////////////////
    ///////////////////////////////////////////////////////////////


    //////////////////////// LOAD MODULE //////////////////////////
    ///////////////dynamic gala fleet calculation /////////////////
    ///////////////////////////////////////////////////////////////

    // Process Gala Databases

    $link sqlcon();
    $query "SELECT * FROM fleetdata LIMIT 0,1;";
    $result = @mysql_query($query);
    $line = @mysql_fetch_array($resultMYSQL_ASSOC);
    if(
    $line['time'] == null || $line['time'] == '')
    {
        
    sqldis($link$result);
    }
    else
    {
        @
    mysql_free_result($result);

        
    $query "SELECT * FROM fleetdata ORDER BY cluster_from,galaxy_from,planet_from ASC;";
        
    $result = @mysql_query($query);
        while(
    $line = @mysql_fetch_array($resultMYSQL_ASSOC))
        {
            if(
    $line['status'] == 'attacking')
            {
                if(
    $line['stealth'] == -1) { $stealther 0; }
                else { 
    $stealther $line['stealth']; }
            }
            else {
                if(
    $line['stealth'] == -1) { $stealther 0; }
                else { 
    $stealther $line['stealth']; }
            }
            switch(
    $line['flightmode'])
            {
                case 
    0:
                    switch(
    $line['status'])
                    {
                        case 
    'attacking':
                            
    $totals[$line['cluster_to'].".".$line['galaxy_to']][inc][att][ships] += $line['ships'];
                            
    $totals[$line['cluster_to'].".".$line['galaxy_to']][inc][att][stealth] += $stealther;
                            break;
                        case 
    'defending':
                            
    $totals[$line['cluster_to'].".".$line['galaxy_to']][inc][def][ships] += $line['ships'];
                            
    $totals[$line['cluster_to'].".".$line['galaxy_to']][inc][def][stealth] += $stealther;
                            break;
                    }
                    break;
                case 
    1:
                    switch(
    $line['status'])
                    {
                        case 
    'attacking':
                            
    $totals[$line['cluster_from'].".".$line['galaxy_from']][out][att][ships] += $line['ships'];
                            
    $totals[$line['cluster_from'].".".$line['galaxy_from']][out][att][stealth] += $stealther;
                            break;
                        case 
    'defending':
                            
    $totals[$line['cluster_from'].".".$line['galaxy_from']][out][def][ships] += $line['ships'];
                            
    $totals[$line['cluster_from'].".".$line['galaxy_from']][out][def][stealth] += $stealther;
                            break;
                    }
                    break;
            }
        }
        
    sqldis($link$result);

  • #2
    Bitte noch etwas mehr Code. Drei Seiten mehr sollten wohl genügen. Wenn sich das Board wegen der Länge weigert, ruhig über mehrere Postings verteilen :-S

    vermutlich: http://dev.mysql.com/doc/refman/5.0/en/old-client.html
    php4 ist in diesem Fall dann der "old client"

    Kommentar


    • #3
      @Bruchpilot
      Du willst doch wohl nicht behaupten, dass dir die gut 1000 Zeile Quellcode einfach zu viel sind, um die mal eben durchzulesen, oder? Das verstehe ich aber echt nicht.

      Gruß
      phpfan

      Kommentar


      • #4
        Kommt immer auf den Code an

        In diesem Fall sage ich nur: http://www.php.net/manual/en/language.types.array.php
        Array do's and don'ts
        Why is $foo[bar] wrong?

        You should always use quotes around a string literal array index. For example, use $foo['bar'] and not $foo[bar]. But why is $foo[bar] wrong? You might have seen the following syntax in old scripts:
        ...

        Kommentar


        • #5
          PHP-Code:
          echo "
          <font size=+1>Gesamte Flottenbewegungen</font>"
          ;
              echo 
          "
          "
          ;
              foreach(
          $totals as $key => $value)
              {
                  
          $totalincatt $value[inc][att][ships] + $value[inc][att][stealth];
                  
          $totalincdef $value[inc][def][ships] + $value[inc][def][stealth];
                  
          $totaloutatt $value[out][att][ships] + $value[out][att][stealth];
                  
          $totaloutdef $value[out][def][ships] + $value[out][def][stealth];
                  
          $supertotal[inc][att][ships] += $value[inc][att][ships];
                  
          $supertotal[inc][att][stealth] += $value[inc][att][stealth];
                  
          $supertotal[inc][def][ships] += $value[inc][def][ships];
                  
          $supertotal[inc][def][stealth] += $value[inc][def][stealth];
                  
          $supertotal[out][att][ships] += $value[out][att][ships];
                  
          $supertotal[out][att][stealth] += $value[out][att][stealth];
                  
          $supertotal[out][def][ships] += $value[out][def][ships];
                  
          $supertotal[out][def][stealth] += $value[out][def][stealth];
                  echo 
          "<div id='galaview' class='style'>";
                  echo 
          "<div id='left'><span class='text'>Gala <span class='udata'>$key</span></span></div>";
                  echo 
          "<div id='right'>";
                  echo 
          "<span class='text att'>Attacker Incoming into Galaxy:</span><span class='wert1 att'>$totalincatt</span><span class='wert2 att'>[".$value[inc][att][ships]." <span class='stealth'>+".$value[inc][att][stealth]."</span>]</span>
                  <span class='text1 att'>Attacker Outgoing from Galaxy:</span><span class='wert1 att'>
          $totaloutatt</span><span class='wert2 att'>[".$value[out][att][ships]." <span class='stealth'>+".$value[out][att][stealth]."</span>]</span>
                  <span class='text def'>Defender Incoming into Galaxy:</span><span class='wert1 def'>
          $totalincdef</span><span class='wert2 def'>[".$value[inc][def][ships]." <span class='stealth'>+".$value[inc][def][stealth]."</span>]</span>
                  <span class='text1 def'>Defender Outgoing from Galaxy:</span><span class='wert1 def'>
          $totaloutdef</span><span class='wert2 def'>[".$value[out][def][ships]." <span class='stealth'>+".$value[out][def][stealth]."</span>]</span>
                  </div>"
          ;
                  echo 
          "</div>";
              }
          // else

          if(count($totals) > 1)
          {
              
          $supertotalincatt $supertotal[inc][att][ships] + $supertotal[inc][att][stealth];
              
          $supertotalincdef $supertotal[inc][def][ships] + $supertotal[inc][def][stealth];
              
          $supertotaloutatt $supertotal[out][att][ships] + $supertotal[out][att][stealth];
              
          $supertotaloutdef $supertotal[out][def][ships] + $supertotal[out][def][stealth];
          // Final
              
          echo "<div id='galaview' class='style'>";
              echo 
          "<div id='left'><span class='text'>Ally Summary<span class='udata'></span></span></div>";
              echo 
          "<div id='right'>
              <span class='text att'>Attacker Incoming into Ally:</span><span class='wert1 att'>
          $supertotalincatt</span><span class='wert2 att'>[".$supertotal[inc][att][ships]." <span class='stealth'>+".$supertotal[inc][att][stealth]."</span>]</span>
              <span class='text1 att'>Attacker Outgoing from Ally:</span><span class='wert1 att'>
          $supertotaloutatt</span><span class='wert2 att'>[".$supertotal[out][att][ships]." <span class='stealth'>+".$supertotal[out][att][stealth]."</span>]</span>
              <span class='text def'>Defender Incoming into Ally:</span><span class='wert1 def'>
          $supertotalincdef</span><span class='wert2 def'>[".$supertotal[inc][def][ships]." <span class='stealth'>+".$supertotal[inc][def][stealth]."</span>]</span>
              <span class='text1 def'>Defender Outgoing from Ally:</span><span class='wert1 def'>
          $supertotaloutdef</span><span class='wert2 def'>[".$supertotal[out][def][ships]." <span class='stealth'>+".$supertotal[out][def][stealth]."</span>]</span>
              </div>"
          ;
              echo 
          "</div>";
          }

          ////////////////////////  END MODULE //////////////////////////
          ///////////////////////////////////////////////////////////////

          ?> 

          So das ist alles gewesen von der einen php datei
          insgesamt habe ich 33 php datein aber die muss ich hier nicht alle posten. Ich hoffe das man daraus vieleicht erkennen kann woran das liegen könnte.


          evtl kann ich noch nen test zugang legen oder am besten über TS² schildern was ich für ein problem habe.

          Wer Intresse hat mir zu Helfen kann mich gerne eine igm schicken und dort die ip bekommen für den TS² zugang.

          Gruß Nightwalker

          Kommentar


          • #6
            Ja, bitte nicht mehr Code - das war die Aussage.
            Ich hoffe das man daraus vieleicht erkennen kann woran das liegen könnte.


            evtl kann ich noch nen test zugang legen oder am besten über TS² schildern was ich für ein problem habe.
            Die beiden Sahcen hast Du schon abgearbeitet?
            Vermutlich: http://dev.mysql.com/doc/refman/5.0/en/old-client.html
            php4 ist in diesem Fall dann der "old client"

            Kommentar

            Lädt...
            X