• Sign up for September Mapping Competition! The prize includes Otland Premium time.
  • There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Problem z Outfitterem.

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
Cześć mam problem z Outfitterem od GEsiora.

Chciałbym go zrobić pod XML na 7.6 w ACC by mi wyświetlał ale nie mam pojęcia jak.
Probowałem zrobić tak by wciągnąć same liczy z Feet ,body etc ale nie idzie .
Może wy macie jakiś pomysł ....

PHP:
// OUTFIITER Próba 1 //
            if(substr($tag, 0, 6) == "look ")
                {
                if($temppos = stristr($tag, "type=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $temptype = $temp[1];
                    }
                if($temppos = stristr($tag, "head=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $temphead = $temp[1];
                    }
                if($temppos = stristr($tag, "body=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $tempbody = $temp[1];
                    }
                if($temppos = stristr($tag, "legs=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $templegs = $temp[1];
                    }
                if($temppos = stristr($tag, "feet=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $tempfeet = $temp[1];
                    }
Próbowałem nawet tak by to wydobyć ale nie idzie , pokazuje mi brak obrazka....
Myślałem ze skoro Magic lvl tak idzie zrobić , to i reszte też da rade ale jednak lipa....

A tu linijka do Outfita:

PHP:
<image src='outfitter.php?id=$temptype&head=$temphead&body=$tempbody&legs=$templegs&feet=$tempfeet'/>

Pomożecie ? ;d

A tu wrzucam swój cały Character.php


PHP:
<table width='100%' cellspacing='0' cellpadding='10' border='0' style='margin: 10px 0px 10px 0px;' class='cellspadding'>
    <tbody><tr class='tableheader'><td colspan='3'><strong><span lang='en'>General Information</span>
    </strong>
<?php


$char = $_REQUEST['char'];
$format = '%d/%m/%Y %H:%M:%S';
$monster_folder = "$data_folder\\monsters\\";
$folderplayer = "$data_folder\\players\\";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char)
    {     
    }
else if(!$f)
    {
    echo "<center><b style='color:#6c0000'>Postać nieistnieje.</b></center><br>";
    }
else
    {
    $contents = fread($f, filesize($file));
    $tags = explode("<", $contents);
    $name = "";
    $exp = 0;
    $level = 0;
    $magic_level = 0;
    $vipticks = 0;
    $voc = 0;
    $lastlogin = 0;
    $temple = 0;
    $redskull = 0;
    $redskulltime = 0;
    $skills = array(0, 1, 2, 3, 4, 5, 6);
    $IMG = array(0, 1, 2, 3, 4, 5, 6); 
    foreach($tags as $tag)
        {
        if(substr($tag, 0, 6) == "player")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $name = $temp[1];
                }
                $housepath = $data_folder . '/houses/';
                $housefolder = opendir($housepath);
                $found_house = 0;
                $owner_of_house = '';
                while (($housename = readdir($housefolder)) && ($found_house !== 1))
                    {
                    if ($housename == "." || $housename == "..") continue;
                    $temp = explode(".", $housename);
                    if ($temp[1] == "xml")
                        {
                        $house_name = $temp[0];
                        $house_name2 = $housepath . $house_name . '.xml';
                        $open_file = fopen($house_name2, "r");
                        $house_contents = fread($open_file, filesize($house_name2));
                        $house_tags = explode("<", $house_contents);
                        foreach($house_tags as $house_tag)
                            {
                            if (substr($house_tag, 0, 5) == "owner")
                                {
                                if ($temppos = stristr($house_tag, "name=\""))
                                    {
                                    $temp = explode("\"", $temppos);
                                    $owner_name = $temp[1];
                                    if ($owner_name == ($_GET['char']))
                                        {
                                        $found_house = 1;
                                        $owner_of_house = $house_name;
                                        }
                                    }
                                }
                            }
                        }
                    }
                if ($owner_of_house == '')
                    {
                    $owner_of_house = 'Brak';
                    }
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = $temp[1];
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = "<a style='color:#6A402E;text-decoration:none'href='index.php?subtopic=guild&guild=$temp[1]'>$temp[1]</a>";
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }


            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $level = $temp[1];
                }

            if($temppos = stristr($tag, "exp=\""))
                {
                $temp = explode("\"", $temppos);
                $exp = $temp[1];
                }

            if($temppos = stristr($tag, "account=\""))
                {
                $temp = explode("\"", $temppos);
                $acc = $temp[1];
                }

            if($temppos = stristr($tag, "access=\""))
                {
                $temp = explode("\"", $temppos);
                $access = $temp[1];
                }
            if($temppos = stristr($tag, "sex=\""))
                {
                $temp = explode("\"", $temppos);
                $sexx = $temp[1];
                } 
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $pacc = $temp[1];
                } 
            if($temppos = stristr($tag, "maglevel=\""))
                {
                $temp = explode("\"", $temppos);
                $magic_level = $temp[1];
                }
            if($temppos = stristr($tag, "banned=\""))
                {
                $temp = explode("\"", $temppos);
                $ban = $temp[1];
                }
            if($temppos = stristr($tag, "voc=\""))
                {
                $temp = explode("\"", $temppos);
                $voc = $temp[1];
                }
            if($temppos = stristr($tag, "vipticks=\""))
                {
                $temp = explode("\"", $temppos);
                $vipticks = $temp[1];
                }     
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $promoted = $temp[1];
                }
            if($temppos = stristr($tag, "lastlogin=\""))
                {
                $temp = explode("\"", $temppos);
                $lastlogin = $temp[1];
                }
            }
        if(substr($tag, 0, 6) == "skull ")
            {
            if($temppos = stristr($tag, "redskull=\""))
                {
                $temp = explode("\"", $temppos);
                $redskull = $temp[1];
                }

            if($temppos = stristr($tag, "redskulltime=\""))
                {
                $temp = explode("\"", $temppos);
                $redskulltime = $temp[1];
                }
            }


        if(substr($tag, 0, 6) == "skill ")
            {
            if($temppos = stristr($tag, "skillid=\""))
                {
                $temp = explode("\"", $temppos);
                $tempid = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($tempid && $templvl)
                {
                $skills[$tempid] = $templvl;
                }
            }

    
        if(substr($tag, 0, 6) == "death ")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $tempname = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($temppos = stristr($tag, "time=\""))
                {
                $temp = explode("\"", $temppos);
                $temptime = $temp[1];
                }

                // OUTFIITER Próba 1 //
            if(substr($tag, 0, 6) == "look ")
                {
                if($temppos = stristr($tag, "type=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $temptype = $temp[1];
                    }
                if($temppos = stristr($tag, "head=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $temphead = $temp[1];
                    }
                if($temppos = stristr($tag, "body=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $tempbody = $temp[1];
                    }
                if($temppos = stristr($tag, "legs=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $templegs = $temp[1];
                    }
                if($temppos = stristr($tag, "feet=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $tempfeet = $temp[1];
                    }       

                }


        $deadtime = strftime($format, $temptime);
        if($tempname && $templvl && $deadtime)
            {
            if(file_exists("$monster_folder$tempname.xml"))
                {
                $deathtext[] = "
                    <tr class='tablerow'>
                        <td width='25%' align='left'> $deadtime </td>
                        <td><span lang='pl'> Zabity na levelu </span> <b>$templvl</b> przez a $tempname </td></tr>";
                }
            else if(file_exists("$folderplayer$tempname.xml"))
                {
                $deathtext[] = "<tr class='tablerow'>
                                    <TD> $deadtime </td>
                                    <TD> Zabity na levelu <b>$templvl</b> przez <b><a style='color:black;text-decoration:none' href=\"index.php?subtopic=character&char=$tempname\">$tempname</a></b> </td></tr>";
                }
            else
                {
                $deathtext[] = "<tr class='tablerow'>
                                    <TD> $deadtime </td>
                                    <TD> Zabity na levelu <b>$templvl</b> przez<b> $tempname</b></td></tr>";
                }
            }
        }
    }


if ($access > 0)
    {
    echo "<b style='color:#6c0000'>Nie możesz zobaczyć statystyk tej postaci.</b><br />";
    }
else
    {
    

    $rstime = strftime($format, $redskulltime);
    if ($redskulltime == '0')
        {
        $rstime = "Brak";
        }
        
        echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/name.gif'></td><td width='30%'><b><span lang='pl'>Outfit</span>:</b></td><td><center><span lang='pl'><image src='outfitter.php?id=130&addons=3&head=$temphead&body=$tempbody&legs=$templegs&feet=$tempfeet'/></span></center></td></tr>";     
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/name.gif'></td><td width='30%'><b><span lang='pl'>Nazwa</span>:</b></td><td><center><span lang='pl'>$name</span></center></td></tr>";
    

    $sex = array("Dziewczyna","Chłopak","Nimfa","Dwarf");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/sex.gif'></td><td width='30%'><b><span lang='pl'>Płeć</span>:</b></td><td><center><span lang='pl'>$sex[$sexx]</span></center></td></tr>";



    if($promoted == 0)
    {
    $vocations = array("No Vocation", "Sorcerer", "Druid", "Paladin", "Knight");
    }
    else
    {
    $vocations = array("No Vocation", "Master Sorcerer", "Elder Druid", "Royal Paladin", "Elite Knight");
    }
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/profesja.gif'></td><td width='30%'><b><span lang='pl'>Profesja</span>:</b></td><td><center><span lang='pl'>$vocations[$voc]</span></center></td></tr>";
    
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/level.gif'></td><td width='30%'><b><span lang='pl'>Level</span>:</b></td><td><center><span lang='pl'>$level</span></center></td></tr>";

    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/guildmembership.gif'></td><td width='30%'><b><span lang='pl'>Członkostwo w gildii</span>:</b></td><td><center><span lang='pl'>$guild_name</span></center></td></tr>";

    

    
    $login = strftime($format, $lastlogin);
    if ($lastlogin == '0')
        {
        $login = "Nigdy";
        }
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/lastlogin.gif'></td><td width='30%'><b><span lang='pl'>Ostatnie zalogowanie</span>:</b></td><td><center><span lang='pl'>$login</span></center></td></tr>";


    $VIP = array("<font color='red'><b>NIE</b><font>", "<font color='green'><b>TAK</b><font>");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/svipp.gif'></td><td width='30%'><b><span lang='pl'>VIP</span>:</b></td><td><center><span lang='pl'>$VIP[$vipticks]</span></center></td></tr>";



    $accessname = array("Gracz", "<b>Tutor</b>", "Consuller", "Gamemaster");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/groupp.gif'></td><td width='30%'><b><span lang='pl'>Grupa</span>:</b></td><td><center><span lang='pl'>$accessname[$access]</span></center></td></tr>";

    
    $premium = array("<font color='red'><b>NIE</b><font>", "<font color='green'><b>TAK</b><font>");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/createdd.gif'></td><td width='30%'><b><span lang='pl'>PACC</span>:</b></td><td><center><span lang='pl'>$premium[$pacc]</span></center></td></tr>";

    echo "<tr class='tablerow'><td width='2%'><img src='http://www.rpgclassic.zapto.org.pl/housesss.gif'></td><td width='30%'><b><span lang='pl'>Domek</span>:</b></td><td><center><span lang='pl'>$owner_of_house</span></center></td></tr>";


    echo '<table width="100%" cellspacing="0" cellpadding="10" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">
    <tbody><tr class="tableheader"><td colspan="3"><strong><span lang="pl">Statystyki</span>
    </strong>';
    $skillnames = array(
                            '1' => 'Fist',
                            '2' => 'Club',
                            '3' => 'Sword',
                            '4' => 'Dist',
                            '5' => 'Axe',
                            '6' => 'Shielding');

    $IMG = array(
                            '1' => '<img src="http://rpgclassic.zapto.org/images/fist.gif">',
                            '2' => '<img src="http://rpgclassic.zapto.org/images/staff.gif">',
                            '3' => '<img src="http://rpgclassic.zapto.org/images/mls.gif">',
                            '4' => '<img src="http://rpgclassic.zapto.org/images/kusza.gif">',
                            '5' => '<img src="http://rpgclassic.zapto.org/images/axe.gif">',
                            '6' => '<img src="http://rpgclassic.zapto.org/images/shield.gif">');
                                                

    foreach($skills as $k => $skill)
        {
        if(!$skill) continue;
        echo "<tr class='tablerow'><td width='2%'>$IMG[$k]</td><td width='30%'><b><span lang='pl'>$skillnames[$k]</span>:</b></td><td><center><span lang='pl'>$skill</span></center></td></tr>";
        }
    if($deathtext)
        {
            echo "</div>";
echo '<table width="100%" cellspacing="0" cellpadding="10" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">
    <tbody><tr class="tableheader"><td colspan="3"><strong><span lang="pl">Śmierci</span>
    </strong>';

        foreach($deathtext as $temp)
            {
            echo "$temp";
            }
        }
    echo "</table>";




echo '<br>
    <table class="cellspadding" style="width: 100%">
        <tbody>
        <tr class="tableheader">
                    <td style="width: 10%;">Item</td>
                    <td>Quest</td>
                    <td style="width: 10%;">Status</td>
                    </tr>';

  include("keys.php");
  $xml = simplexml_load_file($file);

  foreach ($keys as $qs)
  {
      $mess = "";
      $key = array_keys($keys, $qs);

      foreach ($xml->storage->data as $storage)
          if($key[0] == $storage['key'])
              $mess = "<tr class='tablerow'><td> $qs </td><TD><center><img src='http://www.rpgclassic.zapto.org.pl/true.gif'></center></td></tr>";

      if($mess == "")  $mess = "<tr class='tablerow'><td> $qs </td><TD><center><img src='http://www.rpgclassic.zapto.org.pl/public/images/false.gif'></center></td></tr>";
  echo($mess);
  }
  echo "</table>";

      
    }
}
?><br>
<fieldset style="border-color:#6f1713">
<legend><b style="color:#6c0000">Informacja</b></legend>
Tutaj znajdziesz szczegółowe informacje na temat każdego gracza na naszym serwerze.</fieldset><br><center>
<form method="POST">
<input type="hidden" name="a" value="search">
<input type="text" name="char">
<input type="submit" value="Szukaj">
</form>
</center>

<div class="content"><br><br></div>
                                            </div>
                                        </div>
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
Patrzyłem na tej stronie ale nie wiem jak to zastosować.. Wskazówka jakąś?
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
XML:
<?xml version="1.0"?>
<player name="Abbys" account="1" sex="4" lookdir="Polnoc" exp="125538930" voc="4" level="198" access="6" bless="0" cap="0" maglevel="4" lastlogin="1599680238" premticks="0" promoted="1" vipticks="0" namelock=""><spawn x="341" y="233" z="8"/><temple x="295" y="140" z="7"/><skull type="0" kills="0" zabojstwo="0" ticks="0" absolve="0"/><health now="5855" max="5855" food="1000"/><mana now="1925" max="1925" spent="0"/><ban banned="0" banstart="0" banend="0" comment="" reason="" action="" deleted="0" finalwarning="0" banrealtime=""/><look type="131" head="20" body="30" legs="40" feet="50"/><skills><skill skillid="0" level="100" tries="0"/><skill skillid="1" level="100" tries="0"/><skill skillid="2" level="100" tries="0"/><skill skillid="3" level="100" tries="0"/><skill skillid="4" level="100" tries="0"/><skill skillid="5" level="100" tries="0"/><skill skillid="6" level="100" tries="0"/></skills><deaths/><inventory><slot slotid="1"><item id="2490"/></slot><slot slotid="2"><item id="2129"/></slot><slot slotid="3"><item id="1988"><inside><item id="2424"/><item id="2352"/><item id="2396"/><item id="2498"/><item id="2352"/><item id="2270"/><item id="2195"/><item id="2396"/><item id="2087"/><item id="2547" count="48"/><item id="2525"/><item id="2498"/><item id="2390"/><item id="2466"/><item id="2466"/><item id="2542"/><item id="2424"/><item id="2160" count="100"/><item id="2160" count="100"/><item id="2160" count="99"/></inside></item></slot><slot slotid="4"><item id="2463"/></slot><slot slotid="6"><item id="2390"/></slot><slot slotid="7"><item id="2468"/></slot><slot slotid="8"><item id="2195"/></slot><slot slotid="10"><item id="2498"/></slot></inventory><depots/><storage><data key="100" value="1"/><data key="2087" value="1"/><data key="2432" value="1"/><data key="2487" value="1"/><data key="2519" value="1"/><data key="2645" value="1"/><data key="9255" value="1"/><data key="9999" value="1"/><data key="50377" value="77"/><data key="50378" value="500"/><data key="50379" value="0"/></storage></player>
 

averatec

Advanced OT User
Joined
Jun 1, 2007
Messages
2,242
Best answers
4
Reaction score
151
Location
Poland
XML:
<?xml version="1.0"?>
<player name="Abbys" account="1" sex="4" lookdir="Polnoc" exp="125538930" voc="4" level="198" access="6" bless="0" cap="0" maglevel="4" lastlogin="1599680238" premticks="0" promoted="1" vipticks="0" namelock=""><spawn x="341" y="233" z="8"/><temple x="295" y="140" z="7"/><skull type="0" kills="0" zabojstwo="0" ticks="0" absolve="0"/><health now="5855" max="5855" food="1000"/><mana now="1925" max="1925" spent="0"/><ban banned="0" banstart="0" banend="0" comment="" reason="" action="" deleted="0" finalwarning="0" banrealtime=""/><look type="131" head="20" body="30" legs="40" feet="50"/><skills><skill skillid="0" level="100" tries="0"/><skill skillid="1" level="100" tries="0"/><skill skillid="2" level="100" tries="0"/><skill skillid="3" level="100" tries="0"/><skill skillid="4" level="100" tries="0"/><skill skillid="5" level="100" tries="0"/><skill skillid="6" level="100" tries="0"/></skills><deaths/><inventory><slot slotid="1"><item id="2490"/></slot><slot slotid="2"><item id="2129"/></slot><slot slotid="3"><item id="1988"><inside><item id="2424"/><item id="2352"/><item id="2396"/><item id="2498"/><item id="2352"/><item id="2270"/><item id="2195"/><item id="2396"/><item id="2087"/><item id="2547" count="48"/><item id="2525"/><item id="2498"/><item id="2390"/><item id="2466"/><item id="2466"/><item id="2542"/><item id="2424"/><item id="2160" count="100"/><item id="2160" count="100"/><item id="2160" count="99"/></inside></item></slot><slot slotid="4"><item id="2463"/></slot><slot slotid="6"><item id="2390"/></slot><slot slotid="7"><item id="2468"/></slot><slot slotid="8"><item id="2195"/></slot><slot slotid="10"><item id="2498"/></slot></inventory><depots/><storage><data key="100" value="1"/><data key="2087" value="1"/><data key="2432" value="1"/><data key="2487" value="1"/><data key="2519" value="1"/><data key="2645" value="1"/><data key="9255" value="1"/><data key="9999" value="1"/><data key="50377" value="77"/><data key="50378" value="500"/><data key="50379" value="0"/></storage></player>

PHP:
$xml = <<<XML
<?xml version="1.0"?>
<player name="Abbys" account="1" sex="4" lookdir="Polnoc" exp="125538930" voc="4" level="198" access="6" bless="0" cap="0" maglevel="4" lastlogin="1599680238" premticks="0" promoted="1" vipticks="0" namelock=""><spawn x="341" y="233" z="8"/><temple x="295" y="140" z="7"/><skull type="0" kills="0" zabojstwo="0" ticks="0" absolve="0"/><health now="5855" max="5855" food="1000"/><mana now="1925" max="1925" spent="0"/><ban banned="0" banstart="0" banend="0" comment="" reason="" action="" deleted="0" finalwarning="0" banrealtime=""/><look type="131" head="20" body="30" legs="40" feet="50"/><skills><skill skillid="0" level="100" tries="0"/><skill skillid="1" level="100" tries="0"/><skill skillid="2" level="100" tries="0"/><skill skillid="3" level="100" tries="0"/><skill skillid="4" level="100" tries="0"/><skill skillid="5" level="100" tries="0"/><skill skillid="6" level="100" tries="0"/></skills><deaths/><inventory><slot slotid="1"><item id="2490"/></slot><slot slotid="2"><item id="2129"/></slot><slot slotid="3"><item id="1988"><inside><item id="2424"/><item id="2352"/><item id="2396"/><item id="2498"/><item id="2352"/><item id="2270"/><item id="2195"/><item id="2396"/><item id="2087"/><item id="2547" count="48"/><item id="2525"/><item id="2498"/><item id="2390"/><item id="2466"/><item id="2466"/><item id="2542"/><item id="2424"/><item id="2160" count="100"/><item id="2160" count="100"/><item id="2160" count="99"/></inside></item></slot><slot slotid="4"><item id="2463"/></slot><slot slotid="6"><item id="2390"/></slot><slot slotid="7"><item id="2468"/></slot><slot slotid="8"><item id="2195"/></slot><slot slotid="10"><item id="2498"/></slot></inventory><depots/><storage><data key="100" value="1"/><data key="2087" value="1"/><data key="2432" value="1"/><data key="2487" value="1"/><data key="2519" value="1"/><data key="2645" value="1"/><data key="9255" value="1"/><data key="9999" value="1"/><data key="50377" value="77"/><data key="50378" value="500"/><data key="50379" value="0"/></storage></player>
XML;

$dom  = simplexml_load_string($xml);
$type = (int) $dom->look['type'];
$head = (int) $dom->look['head'];
$body = (int) $dom->look['body'];
$legs = (int) $dom->look['legs'];
$feet = (int) $dom->look['feet'];

?>
Teraz tylko dostosuj to do swojego pliku który wrzuciłeś wyżej. Zamiast simplexml_load_string użyj simplexml_load_file
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
PHP:
$file = "$folderplayer$char.xml";
$dom  = simplexml_load_file($file);
$type = (int) $dom->look['type'];
$head = (int) $dom->look['head'];
$body = (int) $dom->look['body'];
$legs = (int) $dom->look['legs'];
$feet = (int) $dom->look['feet'];

Nic nie wyświetla ? - coś źle zrobiłem?
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
PHP:
<ul class="tabs">
                <li class="tab-link current" data-tab="general">General Information</li>
                <li class="tab-link" data-tab="quests">Quests</li>         
            </ul>
            <script>
$(document).ready(function() {
    $('ul.tabs li').click(function(){
        var tab_id = $(this).attr('data-tab');
        $('ul.tabs li').removeClass('current');
        $('.tab-content').removeClass('current');
        $(this).addClass('current');
        $("#"+tab_id).addClass('current');
    });
    $("#outfits_click").click(function() {
        if ($("#outfits_click").html() == "Show more outfits") {
            $(".hidden").show();
            $("#outfits_click").html("Show less outfits");
        } else {
            $(".hidden").hide();
            $("#outfits_click").html("Show more outfits");
        }
    });

    $("#suggest-name").autocomplete({
        source: "?subtopic=suggest_name",
        minLength: 1,
        select: function(event, ui) {
            $("#suggest-name").val(ui.item.value);
            $("#searchForm").submit();
        }
    });

    /*.data("ui-autocomplete")._renderItem = function(ul, item) {
        return $("<li>")
        .attr("data-value", item.value)
        .append($("<a>").html(item.label.replace(new RegExp(this.term, 'gi'), "<b>$&</b>")))
        .appendTo(ul);
    };*/
});
</script>

<style type="text/css">
ul.tabs{
            margin: 0px;
            padding: 0px;
            list-style: none;
        }
        ul.tabs li{
            background: none;
            color: #60432e;
            display: inline-block;
            padding-top: 5px;
            padding-left: 10px;
            padding-right: 10px;
            padding-bottom: 5px;
            cursor: pointer;
        }

        ul.tabs li.current{
            margin-top: 8px;
            margin-bottom: 8px;
            background: #eee4b8;
            border: 1px solid #32231b;
            padding: 0px;
            color: #80614d;
            font-size: 13px;
            padding-top: 5px;
            padding-left: 10px;
            padding-right: 10px;
            padding-bottom: 5px;
        }

        .tab-content{
            display: none;
            /*background: #ededed;
            padding: 15px;*/
        }

        .tab-content.current{
            display: inline;
        }
    .ui-menu-item-wrapper {
        font-family: Tahoma, Verdana, Segoe, sans-serif;
        text-shadow: none;
    }
    li.ui-menu-item:first-child {
        font-weight: bold;
    }
    li.ui-menu-item {
        padding-left: 0px;
    }
</style>
<div id="general" class="tab-content current">
<table width='100%' cellspacing='0' cellpadding='10' border='0' style='margin: 10px 0px 10px 0px;' class='cellspadding'>
    <tbody><tr class='tableheader'><td colspan='3'><strong><span lang='en'>General Information</span>
    </strong>

<?php
$char = $_REQUEST['char'];
$format = '%d/%m/%Y %H:%M:%S';
$monster_folder = "$data_folder\\monsters\\";
$folderplayer = "$data_folder\\players\\";
$file= "$folderplayer$char.xml";
$f = @fopen($file, "r");
if(!$char)
    {     
    }
else if(!$f)
    {
    echo "<center><b style='color:#6c0000'>Postać nieistnieje.</b></center><br>";
    }
else
    {
    $contents = fread($f, filesize($file));
    $tags = explode("<", $contents);
    $name = "";
    $exp = 0;
    $level = 0;
    $magic_level = 0;
    $vipticks = 0;
    $voc = 0;
    $lastlogin = 0;
    $temple = 0;
    $redskull = 0;
    $redskulltime = 0;
    $skills = array(0, 1, 2, 3, 4, 5, 6);
    $IMG = array(0, 1, 2, 3, 4, 5, 6); 
    foreach($tags as $tag)
        {
        if(substr($tag, 0, 6) == "player")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $name = $temp[1];
                }
                $housepath = $data_folder . '/houses/';
                $housefolder = opendir($housepath);
                $found_house = 0;
                $owner_of_house = '';
                while (($housename = readdir($housefolder)) && ($found_house !== 1))
                    {
                    if ($housename == "." || $housename == "..") continue;
                    $temp = explode(".", $housename);
                    if ($temp[1] == "xml")
                        {
                        $house_name = $temp[0];
                        $house_name2 = $housepath . $house_name . '.xml';
                        $open_file = fopen($house_name2, "r");
                        $house_contents = fread($open_file, filesize($house_name2));
                        $house_tags = explode("<", $house_contents);
                        foreach($house_tags as $house_tag)
                            {
                            if (substr($house_tag, 0, 5) == "owner")
                                {
                                if ($temppos = stristr($house_tag, "name=\""))
                                    {
                                    $temp = explode("\"", $temppos);
                                    $owner_name = $temp[1];
                                    if ($owner_name == ($_GET['char']))
                                        {
                                        $found_house = 1;
                                        $owner_of_house = $house_name;
                                        }
                                    }
                                }
                            }
                        }
                    }
                if ($owner_of_house == '')
                    {
                    $owner_of_house = 'Brak';
                    }
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = $temp[1];
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }
            $guild_file = $data_folder . "/guilds.xml";
            $g = fopen($guild_file, "r");
            $guild_contents = fread($g, filesize($guild_file));
            $guild_tags = explode("<", $guild_contents);
            $found = 0;
            foreach($guild_tags as $guild_tag)
                {
                if (substr($guild_tag, 0, 5) == "guild" && $found != 1)
                    {
                    if ($temppos = stristr($guild_tag, "name=\""))
                        {
                        $temp = explode("\"", $temppos);
                        $guild_name = "<a style='color:#6A402E;text-decoration:none'href='index.php?subtopic=guild&guild=$temp[1]'>$temp[1]</a>";
                        }
                    }
                if (substr($guild_tag, 0, 6) == "member")
                    {
                    if ($temppos = stristr($guild_tag, "name=\"$char"))
                        {
                        $temp = explode("\"", $temppos);
                        $member_name = $temp[1];
                        $found = 1;
                        }
                    }
                }
            if ($found == 0)
                {
                $guild_name = 'Brak';
                }


            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $level = $temp[1];
                }

            if($temppos = stristr($tag, "exp=\""))
                {
                $temp = explode("\"", $temppos);
                $exp = $temp[1];
                }

            if($temppos = stristr($tag, "account=\""))
                {
                $temp = explode("\"", $temppos);
                $acc = $temp[1];
                }

            if($temppos = stristr($tag, "access=\""))
                {
                $temp = explode("\"", $temppos);
                $access = $temp[1];
                }
            if($temppos = stristr($tag, "sex=\""))
                {
                $temp = explode("\"", $temppos);
                $sexx = $temp[1];
                } 
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $pacc = $temp[1];
                } 
            if($temppos = stristr($tag, "maglevel=\""))
                {
                $temp = explode("\"", $temppos);
                $magic_level = $temp[1];
                }
            if($temppos = stristr($tag, "banned=\""))
                {
                $temp = explode("\"", $temppos);
                $ban = $temp[1];
                }
            if($temppos = stristr($tag, "voc=\""))
                {
                $temp = explode("\"", $temppos);
                $voc = $temp[1];
                }
            if($temppos = stristr($tag, "vipticks=\""))
                {
                $temp = explode("\"", $temppos);
                $vipticks = $temp[1];
                }     
            if($temppos = stristr($tag, "promoted=\""))
                {
                $temp = explode("\"", $temppos);
                $promoted = $temp[1];
                }
            if($temppos = stristr($tag, "lastlogin=\""))
                {
                $temp = explode("\"", $temppos);
                $lastlogin = $temp[1];
                }
            }
        if(substr($tag, 0, 6) == "skull ")
            {
            if($temppos = stristr($tag, "redskull=\""))
                {
                $temp = explode("\"", $temppos);
                $redskull = $temp[1];
                }

            if($temppos = stristr($tag, "redskulltime=\""))
                {
                $temp = explode("\"", $temppos);
                $redskulltime = $temp[1];
                }
            }


        if(substr($tag, 0, 6) == "skill ")
            {
            if($temppos = stristr($tag, "skillid=\""))
                {
                $temp = explode("\"", $temppos);
                $tempid = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($tempid && $templvl)
                {
                $skills[$tempid] = $templvl;
                }
            }

    
        if(substr($tag, 0, 6) == "death ")
            {
            if($temppos = stristr($tag, "name=\""))
                {
                $temp = explode("\"", $temppos);
                $tempname = $temp[1];
                }
            if($temppos = stristr($tag, "level=\""))
                {
                $temp = explode("\"", $temppos);
                $templvl = $temp[1];
                }
            if($temppos = stristr($tag, "time=\""))
                {
                $temp = explode("\"", $temppos);
                $temptime = $temp[1];
                }

                // OUTFIITER Próba 1 //
            if(substr($tag, 0, 6) == "look ")
                {
                if($temppos = stristr($tag, "type=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $type = $temp[1];
                    }
                if($temppos = stristr($tag, "head=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $head = $temp[1];
                    }
                if($temppos = stristr($tag, "body=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $body = $temp[1];
                    }
                if($temppos = stristr($tag, "legs=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $legs = $temp[1];
                    }
                if($temppos = stristr($tag, "feet=\""))
                    {
                    $temp = explode("\"", $temppos);
                    $feet = $temp[1];
                    }       

                }






        $deadtime = strftime($format, $temptime);
        if($tempname && $templvl && $deadtime)
            {
            if(file_exists("$monster_folder$tempname.xml"))
                {
                $deathtext[] = "
                    <tr class='tablerow'>
                        <td width='25%' align='left'> $deadtime </td>
                        <td><span lang='pl'> Zabity na levelu </span> <b>$templvl</b> przez a $tempname </td></tr>";
                }
            else if(file_exists("$folderplayer$tempname.xml"))
                {
                $deathtext[] = "<tr class='tablerow'>
                                    <TD> $deadtime </td>
                                    <TD> Zabity na levelu <b>$templvl</b> przez <b><a style='color:black;text-decoration:none' href=\"index.php?subtopic=character&char=$tempname\">$tempname</a></b> </td></tr>";
                }
            else
                {
                $deathtext[] = "<tr class='tablerow'>
                                    <TD> $deadtime </td>
                                    <TD> Zabity na levelu <b>$templvl</b> przez<b> $tempname</b></td></tr>";
                }
            }
        }
    }


if ($access > 0)
    {
    echo "<b style='color:#6c0000'>Nie możesz zobaczyć statystyk tej postaci.</b><br />";
    }
else
    {
    

    $rstime = strftime($format, $redskulltime);
    if ($redskulltime == '0')
        {
        $rstime = "Brak";
        }

$file = "$folderplayer$char.xml";
$xml = simplexml_load_file($file);
$type = (int) $xml->look['type'];
$head = (int) $xml->look['head'];
$body = (int) $xml->look['body'];
$legs = (int) $xml->look['legs'];
$feet = (int) $xml->look['feet'];
        
        echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/name.gif'></td><td width='30%'><b><span lang='pl'>Outfit</span>:</b></td><td><center><span lang='pl'><image src='outfitter.php?id=$type&head=$head&body=$body&legs=$legs&feet=$feet'/></span></center></td></tr>";     
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/name.gif'></td><td width='30%'><b><span lang='pl'>Nazwa</span>:</b></td><td><center><span lang='pl'>$name</span></center></td></tr>";
    

    $sex = array("Dziewczyna","Chłopak","Nimfa","Dwarf");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/sex.gif'></td><td width='30%'><b><span lang='pl'>Płeć</span>:</b></td><td><center><span lang='pl'>$sex[$sexx]</span></center></td></tr>";



    if($promoted == 0)
    {
    $vocations = array("No Vocation", "Sorcerer", "Druid", "Paladin", "Knight");
    }
    else
    {
    $vocations = array("No Vocation", "Master Sorcerer", "Elder Druid", "Royal Paladin", "Elite Knight");
    }
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/profesja.gif'></td><td width='30%'><b><span lang='pl'>Profesja</span>:</b></td><td><center><span lang='pl'>$vocations[$voc]</span></center></td></tr>";
    
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/level.gif'></td><td width='30%'><b><span lang='pl'>Level</span>:</b></td><td><center><span lang='pl'>$level</span></center></td></tr>";

    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/guildmembership.gif'></td><td width='30%'><b><span lang='pl'>Członkostwo w gildii</span>:</b></td><td><center><span lang='pl'>$guild_name</span></center></td></tr>";

    

    
    $login = strftime($format, $lastlogin);
    if ($lastlogin == '0')
        {
        $login = "Nigdy";
        }
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/lastlogin.gif'></td><td width='30%'><b><span lang='pl'>Ostatnie zalogowanie</span>:</b></td><td><center><span lang='pl'>$login</span></center></td></tr>";


    $VIP = array("<font color='red'><b>NIE</b><font>", "<font color='green'><b>TAK</b><font>");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/svipp.gif'></td><td width='30%'><b><span lang='pl'>VIP</span>:</b></td><td><center><span lang='pl'>$VIP[$vipticks]</span></center></td></tr>";



    $accessname = array("Gracz", "<b>Tutor</b>", "Consuller", "Gamemaster");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/groupp.gif'></td><td width='30%'><b><span lang='pl'>Grupa</span>:</b></td><td><center><span lang='pl'>$accessname[$access]</span></center></td></tr>";

    
    $premium = array("<font color='red'><b>NIE</b><font>", "<font color='green'><b>TAK</b><font>");
    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/createdd.gif'></td><td width='30%'><b><span lang='pl'>PACC</span>:</b></td><td><center><span lang='pl'>$premium[$pacc]</span></center></td></tr>";

    echo "<tr class='tablerow'><td width='2%'><img src='http://www.memsoria.pl/housesss.gif'></td><td width='30%'><b><span lang='pl'>Domek</span>:</b></td><td><center><span lang='pl'>$owner_of_house</span></center></td></tr>";

    echo "</table>";

    echo '<table width="100%" cellspacing="0" cellpadding="10" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">
    <tbody><tr class="tableheader"><td colspan="3"><strong><span lang="pl">Statystyki</span>
    </strong>';
    $skillnames = array(
                            '1' => 'Fist',
                            '2' => 'Club',
                            '3' => 'Sword',
                            '4' => 'Dist',
                            '5' => 'Axe',
                            '6' => 'Shielding');

    $IMG = array(
                            '1' => '<img src="http://rpgclassic.zapto.org/images/fist.gif">',
                            '2' => '<img src="http://rpgclassic.zapto.org/images/staff.gif">',
                            '3' => '<img src="http://rpgclassic.zapto.org/images/mls.gif">',
                            '4' => '<img src="http://rpgclassic.zapto.org/images/kusza.gif">',
                            '5' => '<img src="http://rpgclassic.zapto.org/images/axe.gif">',
                            '6' => '<img src="http://rpgclassic.zapto.org/images/shield.gif">');
                                                

    foreach($skills as $k => $skill)
        {
        if(!$skill) continue;
        echo "<tr class='tablerow'><td width='2%'>$IMG[$k]</td><td width='30%'><b><span lang='pl'>$skillnames[$k]</span>:</b></td><td><center><span lang='pl'>$skill</span></center></td></tr>";
        }
    if($deathtext)
        {
            echo "</div>";
echo '<table width="100%" cellspacing="0" cellpadding="10" border="0" style="margin: 10px 0px 10px 0px;" class="cellspadding">
    <tbody><tr class="tableheader"><td colspan="3"><strong><span lang="pl">Śmierci</span>
    </strong>';

        foreach($deathtext as $temp)
            {
            echo "$temp";
            }
        }
    echo "</table></div>";




echo '<br>
<div id="quests" class="tab-content">
    <table class="cellspadding" style="width: 100%">
        <tbody>
        <tr class="tableheader">
                    <td style="width: 10%;">Item</td>
                    <td>Quest</td>
                    <td style="width: 10%;">Status</td>
                    </tr>';

  include("keys.php");
  $xml = simplexml_load_file($file);

  foreach ($keys as $qs)
  {
      $mess = "";
      $key = array_keys($keys, $qs);

      foreach ($xml->storage->data as $storage)
          if($key[0] == $storage['key'])
              $mess = "<tr class='tablerow'><td> $qs </td><TD><center><img src='http://www.memsoria.pl/true.gif'></center></td></tr>";

      if($mess == "")  $mess = "<tr class='tablerow'><td> $qs </td><TD><center><img src='http://www.memsoria.pl/public/images/false.gif'></center></td></tr>";
  echo($mess);
  }
  echo "</table></div>";

 
      
    }
}
?><br>
<fieldset style="border-color:#6f1713">
<legend><b style="color:#6c0000">Informacja</b></legend>
Tutaj znajdziesz szczegółowe informacje na temat każdego gracza na naszym serwerze.</fieldset><br><center>
<form method="POST">
<input type="hidden" name="a" value="search">
<input type="text" name="char">
<input type="submit" value="Szukaj">
</form>
</center>

<div class="content"><br><br></div>
                                            </div>
                                        </div>
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
Jeżeli dam normalnie sam ID feet etc, normalnie mi pokazuje obrazek.
 

averatec

Advanced OT User
Joined
Jun 1, 2007
Messages
2,242
Best answers
4
Reaction score
151
Location
Poland
Hmmm masz chyba jednak błąd w skrypcie, tzn html nie jest do końca poprawny
XML:
<!--- twoja wersja -->
<image src='....'/>
<!--- a poprawnie jest -->
<img src='...'/>
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
Obrazek mi się pojawią więc skrypt musi działać " outffiter " .
Ale to co Ty mi kazałeś zrobić nie wyciąga żądnych wartości z pliku XML.
Dlatego mi nie pokazuje obrazka...? więc jak to zrobić..
 

averatec

Advanced OT User
Joined
Jun 1, 2007
Messages
2,242
Best answers
4
Reaction score
151
Location
Poland
Obrazek mi się pojawią więc skrypt musi działać " outffiter " .
Ale to co Ty mi kazałeś zrobić nie wyciąga żądnych wartości z pliku XML.
Dlatego mi nie pokazuje obrazka...? więc jak to zrobić..
No wg mnie wyciąga dane z XMLa.
 
OP
P

Progresina

New Member
Joined
Apr 15, 2014
Messages
10
Best answers
0
Reaction score
0
No wg mnie wyciąga dane z XMLa.
Same zera pokazuję , więc skoro twierdzisz że działa to co dałeś,
to teraz pytanie dlaczego nie czyta mi danych z postaci ?

Edit#
Już wiem gdzie jest problem.
Jeżeli jest Addon to wyświetli obrazek.
PHP:
<img src='outfitter.php?id=128&addons=3&head=1&body=50&legs=80&feet=120'/>
A jeżeli nie ma Addon w linku to nie wyświetla obrazka.
PHP:
<img src='outfitter.php?id=128&head=1&body=50&legs=80&feet=120'/>
I mysle że źle podłaczyłem twoja tabele pod swoje pliki.
Tylko gdzie jest bład ^^
 
Last edited:
Top