Beiträge von Raphael

    Hay
    Ich darf nacher / morgen meine Festplatte zum Kolegen bringen, der mir mein Windows neu Aufspielt, (meins ist 3 MOnate alt, aber egal, also seit ich es drauf habe xD ) Und ich weis nciht welches Windows ich holen soll, ob Windows 7 oder Windows 8 ?


    Also ich kann Auswählen welches ich will, das ist das gute :D


    Nun paar Fragen,
    Kann ich Folgende Anwendungen auf Win 8 Laufen lassen ?


    -Mozilla Firefox
    -Teamspeak
    -viele Spiele

    • German Truck Simulator
    • GTA VC
    • GTA SA
    • Samp
    • Skiregion Simulator
    • Scania Truck Driving Simulator
    • LS 11
    • Minecraft
    • OMSI

    -Scriptly


    -WinSCP


    -FileZilla


    -ATI HD 4850 Grafiktreiber ?


    Das wäre es eig.


    Weis jemand ob ich diese ganzen Dinge da zum Laufen bringe ?



    MFG
    Raphael

    Meinst das ?


    PHP
    <?php  class Player  {    private $name = '';    private $details = array();    private $ftpconnection = null;    public function __construct($name)    {      $this->name = $name;      $this->checkFTP();      if(!$this->download())        $this->name = '-INV-';      else        $this->details = parse_ini_file('cache/'. $this->stripName() .'.ini');    }    public function exists()    {      return ($this->name != '-INV-');    }    public function getName()    {      return $this->name;    }    public function getPassword()    {      return trim($this->details['Key']);    }    public function setPassword($newpw)    {      $this->details['Key'] = trim($newpw);      return $this->upload();    }    public function setMoney($newmoney){        $this->details['Money'] = trim($newmoney);        return $this->upload();}    public function getHighadmin(){        return  $this->details['Adminlevel'];}    public function getSkin(){        return $this->details['Char'];    }    public function getAutoschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['CarLic']);}    public function getBikeschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['BikeLic']);}    public function getFlugschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['FlyLic']);}    public function getBootschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['BoatLic']);}    public function getTruckschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['TruckLic']);}    public function getAngelschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['FishLic']);}    public function getWaffenschein(){        return str_replace(array("0", "1"), array("<img src='images/Erase.png' />", "<img src='images/Apply.png' />"), $this->details['GunLic']);}    public function getMoney(){        return $this->details['Money'];}    public function getLevel(){        return $this->details['Level'];}    public function getPremium(){        return $this->details['DonateRank'];}    public function getSex(){        return str_replace(array("1", "2"), array("M&auml;nnlich", "Weiblich"), $this->details['Sex']);}    public function getPayday(){        return $this->details['PayDayTime'];}    public function getMaxpayday(){        return str_replace(array("1", "0"), array("50", "60"), $this->details['DonateRank']);}    public function getBank(){        return $this->details['Bank'];}    public function getRespect(){        return $this->details['Respect'];}    public function getCrimes(){        return $this->details['Crimes'];}    public function getTode(){        return $this->details['Deaths'];}    public function getKills(){        return $this->details['Kills'];}    public function getFraktion(){        return $this->details['FMember'];}    public function getFraktionRang(){        return $this->details['Rank'];}    public function getJob(){        return $this->details['Job'];}    private function stripName()    {      $newname = '';      for($i = 0; $i < strlen($this->name); $i++)      {        if($this->name[$i] != '/' && $this->name[$i] != '\\')        {          $newname .= $this->name[$i];        }      }      return $newname;    }    private function checkFTP()    {      if($this->ftpconnection == null)      {        $this->ftpconnection = ftp_connect(FTP_HOST);        ftp_login($this->ftpconnection, FTP_USER, FTP_PASS);        ftp_chdir($this->ftpconnection, FTP_PATH);      }    }    private function isCached()    {      $path = 'cache/'. $this->stripName() .'.ini';      if(!file_exists($path)) return false;      if(filemtime($path) < time()-5*60) return false;      return true;    }    private function download()    {      $this->checkFTP();      if($this->isCached()) return true;      if(@ftp_get($this->ftpconnection, 'cache/'. $this->stripName() .'.ini', $this->stripName() . FTP_END, FTP_ASCII))      {        touch('cache/'. $this->stripName() .'.ini', time());        return true;      }      return false;    }    private function upload()    {      $this->checkFTP();      if(!$this->isCached()) return false;      // INI-Datei zusammensetzen      $string = '';      foreach($this->details as $key => $value)        $string .= $key .'='. $value ."\n";      file_put_contents('cache/'. $this->stripName() .'.ini', $string);      // Datei hochladen      @ftp_put($this->ftpconnection, $this->stripName() . FTP_END, 'cache/'. $this->stripName() .'.ini', FTP_ASCII);      return true;    }  }?>


    Das ist die Function für $player denke ich mal :)

    Hay
    Ich habe ein neues Problem,
    Ich wil in meinem UCP den Skin in Form des Skin Bildes Ausgeben, ich habe alle Skin's die es gibt im Wiki auf meinem PC, mit den namen : 0.png / 1.png 2.png usw
    Also der Name des Skin's ist immer die ID + die Endung .png


    Aber wie lasse ich diesen Ausgeben ?


    Also das ich diesen direct in der function habe, in der Player.class.php ?


    Hier mal der Code um die Skin ID auszulesen :

    PHP
    public function getSkin(){
            return $this->details['Char'];}


    Aber wie Lasse ich da nun die "getSkin" als Img Ausgeben ? die Bilder sind im Ordner : images/Skins/


    Kann mir das jemand eventuell machen ? denn ich weis nicht wie ich da nen Code Entwickeln soll xD


    MFG

    LeijaT
    Danke schonmal, Du verstehst richtig,
    Aber ich brauche das Array in der Player.class.php, und ich habe es nun so Eingefügt,

    PHP
    public function getBikeschein(){
            echo str_replace(array("0", "1"), array("Nicht bestanden", "Bestanden"), $this->details['bikeLic']);
            }


    Und in der Ausgabe datei, also wo ich alles Ausgegeben bekomm steht dieser Code

    PHP
    Bikeschein : <?php echo $player->getBikeschein() ?><br />


    Aber es wird nur das Ausgegeben: Bikeschein :

    Hay
    Ich habe mal wieder eine Frage , (nicht wundern, ich Erlerne PHP noch :D )


    Ich will nun eine Auflistung der Licensen in meinem UCP Ausgeben,
    Und will das mit einem Array machen, denn wenn in der .ini 0 Steht, dann soll kommen "Nicht Bestanden" aber wenn 1 ist, soll dort Stehen "Bestanden"
    Ich habe es nun so


    PHP
    public function getBikeschein(){
            return $this->details['BikeLic'];
            $arr = array("1" => "Bestanden", "0" => "Nicht Bestanden");
            }


    Aber er gibt mir nur die Zahl aus der ini datei aus :(


    Kann mir jemand eine Vorlage zur Array Nutzung machen ?


    Danke


    MFG