Aivenn's Profile User Rating: -----

Reputation: 0 Apprentice
Group:
Members
Active Posts:
34 (0.04 per day)
Joined:
04-November 10
Profile Views:
2,524
Last Active:
User is offline Dec 13 2011 06:20 PM
Currently:
Offline

Previous Fields

Country:
US
OS Preference:
Windows
Favorite Browser:
FireFox
Favorite Processor:
Intel
Favorite Gaming Platform:
XBox
Your Car:
Toyota
Dream Kudos:
0

Latest Visitors

Icon   Aivenn Frustrated

Posts I've Made

  1. In Topic: Problem with php getting information from xml

    Posted 18 Nov 2011

    Thanks, sorry I'm a little slow sometimes. I Appreciate your help I've been working on this for days.
  2. In Topic: Problem with php getting information from xml

    Posted 18 Nov 2011

    NULL NULL NULL NULL - with
    var_dump($icon);
    


    int(4511) int(26048) int(35380) int(12718) - with
    var_dump($displayid);
    


    I got it to work $icon=$treffer[1]; all i had to do was change $aval to $icon and now all the icons are showing up perfectly

    Thanks a ton for this.
  3. In Topic: Problem with php getting information from xml

    Posted 18 Nov 2011

    Put these under var_dump($treffer); ?

    array(2) { [0]=> string(49) "INV_Misc_Bandana_03" [1]=> string(19) "INV_Misc_Bandana_03" } int(4511) NULL 28155-array(2) { [0]=> string(47) "INV_Misc_Cape_06" [1]=> string(16) "INV_Misc_Cape_06" } int(26048) NULL 4695-array(2) { [0]=> string(49) "INV_Boots_Cloth_05" [1]=> string(18) "INV_Boots_Cloth_05" } int(35380) NULL 22991-array(2) { [0]=> string(49) "INV_Chest_Cloth_19" [1]=> string(18) "INV_Chest_Cloth_19" } int(12718) NULL 22986-

    Thats what I get with those under the first
  4. In Topic: Problem with php getting information from xml

    Posted 18 Nov 2011

    http://paranoia-gami...viewchar&char=5

    That put some weird writing in my box, with echo $itemid.'-';

    18array(2) { [0]=> string(49) "INV_Misc_Bandana_03" [1]=> string(19) "INV_Misc_Bandana_03" } 28155-array(2) { [0]=> string(47) "INV_Misc_Cape_06" [1]=> string(16) "INV_Misc_Cape_06" } 4695-array(2) { [0]=> string(49) "INV_Boots_Cloth_05" [1]=> string(18) "INV_Boots_Cloth_05" } 22991-array(2) { [0]=> string(49) "INV_Chest_Cloth_19" [1]=> string(18) "INV_Chest_Cloth_19" } 22986-
    thats what the dump put.
  5. In Topic: Problem with php getting information from xml

    Posted 18 Nov 2011

    Everything I have is right here
    function getImage($itemid)
      {
        /*
        * Returns the ImageFilename for any Item in Database.
        * If The itemdisplayinfo table doesnt exists in mysql database, it creats it
        * and fills in the info by itself using xml data from wow.allakhazam.com :)/>
        *
        */
    
    
        //create itemdisplayinfo table if not exist:
        $this->rsdb->query("CREATE TABLE IF NOT EXISTS `itemdisplayinfo` (
            `id` bigint(20) NOT NULL default '0',
            `icon` text NOT NULL,
            PRIMARY KEY  (`id`)
            ) ENGINE=InnoDB DEFAULT CHARSET=latin1 COMMENT='ItemDisplayId2Filename';
        ");
    
        if ($itemid==0){
          $return="404";
        }else{
    
          $xitemid=$this->wsdb->select("SELECT displayid FROM item_template WHERE entry=".$itemid."");
          $displayid=(int)$xitemid[0]['displayid'];
          $itemimage=$this->rsdb->select("SELECT * FROM itemdisplayinfo WHERE id='$displayid';");
          if (count($itemimage)<1){
            $xmlfile=file_get_contents("http://www.wowhead.com/item='.$itemid.'&xml");
    		
            preg_match("@<icon[^>]*>(.*)</icon>@",$xmlfile, $treffer);
            {
              $aval=$treffer[1];
    
                $this->rsdb->query("INSERT INTO itemdisplayinfo (id,icon) VALUES ($displayid,'$icon')");
                $return=$icon;
            }
    		//echo $xmlfile;
    		echo $itemid.'-';
    		//echo $displayid.' - ';
    		//echo $icon.' - ';
          }else{
            $return=$itemimage[0]['icon'];
          }
        }
    
        return $return;
      }
    


    I just found out that it already knows what the display ID is, we need to get the Icon name. The INV_Misc_Cape_06 from the xml and it does the rest.

    which would be just editing the preg_match again correct?

My Information

Member Title:
New D.I.C Head
Age:
27 years old
Birthday:
August 5, 1985
Gender:
Location:
THeodore, Alabama
Interests:
Enjoyed learning a bit of C++ and moved on to learn Flash AS3. Always looking for a helpful voice to make sure I'm on the right page.
Full Name:
Travis
Years Programming:
1
Programming Languages:
C/C++, Flash AS3

Contact Information

E-mail:
Click here to e-mail me
Yahoo:
Yahoo  tlallen85@yahoo.com

Friends

Comments

Aivenn has no profile comments yet. Why not say hello?