ItemIcon

Version 1 (vl, 04/24/2009 03:19 pm)

1 1 vl
h1. ItemIcon
2 1 vl
3 1 vl
h2. Base URL
4 1 vl
5 1 vl
* http://atys.ryzom.com/api/item_icon.php
6 1 vl
7 1 vl
h2. URL Parameters
8 1 vl
9 1 vl
h3. @sheetid@
10 1 vl
11 1 vl
It's the id of an item that you can find in the [[Character]] xml file. For example, @iczahp_3.sitem@ is a valid @sheetid@ (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem").
12 1 vl
13 1 vl
h3. @c@ (optional)
14 1 vl
15 1 vl
The color of the item. It's a value between 0 and 7 (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&c=2").
16 1 vl
17 1 vl
h3. @q@ (optional)
18 1 vl
19 1 vl
The quality of the item (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&q=120").
20 1 vl
21 1 vl
h3. @s@ (optional)
22 1 vl
23 1 vl
Default is 1.
24 1 vl
25 1 vl
The size of the stack (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&s=10").
26 1 vl
27 1 vl
h3. @sap@ (optional)
28 1 vl
29 1 vl
Default is 0.
30 1 vl
The number of sap of the item.
31 1 vl
* 0: No sap icon (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&sap=0").
32 1 vl
* 1: sap icon with no number (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&sap=1").
33 1 vl
* 2: sap icon with number 1 (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&sap=2").
34 1 vl
* 3: sap icon with number 2 (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&sap=3").
35 1 vl
36 1 vl
h3. @destroyed@ (optional)
37 1 vl
38 1 vl
Default is @0@.
39 1 vl
* @0@: nothing special (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&destroyed=0").
40 1 vl
* @1@: display the item as if it was destroyed (with a red cross) (example:"http://atys.ryzom.com/api/item_icon.php?sheetid=iczahp_3.sitem&destroyed=1").
41 1 vl
42 1 vl
h2. Cache Duration
43 1 vl
44 1 vl
It's cached for ever. Since the icon is unique and never change. For a specific icon, it'll always return the same image.
45 1 vl
46 1 vl
h2. PHP Interface
47 1 vl
48 1 vl
h3. @ryzom_item_icon_image($sheetid, $c=-1, $q=-1, $s=-1, $sap=-1, $destroyed=false)@
49 1 vl
50 1 vl
Returns a string that contains the html code to display a item icon.
51 1 vl
52 1 vl
h3. @ryzom_item_icon_url($sheetid, $c=-1, $q=-1, $s=-1, $sap=-1, $destroyed=false)@
53 1 vl
54 1 vl
Returns a string that contains the url to display a item icon.
55 1 vl
56 1 vl
h3. @ryzom_item_icon_image_from_simplexml($item, $add_text='')@
57 1 vl
58 1 vl
* @$item@ is a "simplexml":http://fr3.php.net/manual/en/book.simplexml.php object that contains the item.
59 1 vl
* @add_text@ is an additional text you want to add in tooltip.
60 1 vl
61 1 vl
Returns a string that contains the html code to display a item icon depending of the content of @$item@.
62 1 vl
63 1 vl
h3. @ryzom_item_icon($sheetid, $c, $q, $s, $sap, $destroyed)@
64 1 vl
65 1 vl
Returns the image *data* of the item icon. You should never use it except if you want to use the image to combine with another image for example.
66 1 vl
67 1 vl
h2. Real Examples
68 1 vl
69 1 vl
If you have a website that use this Ryzom API, tell it in the forum and we'll add it.