Znote / ZnoteAAC

Developement repository for the Znote AAC project. A website portal to represent and manage your Open Tibia server.
MIT License
145 stars 126 forks source link

Using ZnoteAAC API #219

Closed olszak94 closed 7 years ago

olszak94 commented 8 years ago

How can i call ZnoteAAC API ? for example, to pull data of a player?

Znote commented 8 years ago

https://github.com/Znote/ZnoteAAC/blob/master/engine/function/users.php#L1246-L1279

$player = user_data(player_ID, 'name', 'level');
echo "Character name: ". $player['name'] .". is level: ". $player['level'];

To find character id, you can use function user_character_id if you got the name.

$cid = user_character_id("Chaosruler");
$player = user_data($cid, 'name', 'level');
echo "Character name: ". $player['name'] .". is level: ". $player['level'];

Or wait, are you talking about this? http://demo.znote.eu/api/?debug=true

This is place for you if you want to make a restful service, a sample of a topExperience module: http://demo.znote.eu/api/modules/highscores/topExperience.php DEBUG mode if you don't got a json reader: http://demo.znote.eu/api/modules/highscores/topExperience.php?debug=true

You can very easily create your own modules by adding a folder in \api\modules\ with your scripts. Have a look at the sample blank script: https://github.com/Znote/ZnoteAAC/blob/master/api/modules/samples/blank.php

Just copy that file to your own folder in /api/modules/ and it should appear on http://demo.znote.eu/api/

olszak94 commented 8 years ago

For me the topExperience.php doesn't work. And yes, i ment using api & api modules.

Znote commented 8 years ago

Dosn't work? Thats odd, it works for me on my local site and the demo site.

olszak94 commented 8 years ago

Maybe i have to set chmod/chown on some files ? Like with cache?

Dnia 26 paź 2015 o godz. 13:47 Stefan A. Brannfjell notifications@github.com napisał(a):

Dosn't work? Thats odd, it works for me on my local site and the demo site.

— Reply to this email directly or view it on GitHub.

Znote commented 8 years ago

No. Do you get any error messages? What system do you use?

olszak94 commented 8 years ago

No errors, just blank page. I'm using Ubuntu 14.04 x64

W dniu wt., 27 paź 2015 o 19:26 Stefan A. Brannfjell < notifications@github.com> napisał(a):

No. Do you get any error messages? What system do you use?

— Reply to this email directly or view it on GitHub https://github.com/Znote/ZnoteAAC/issues/219#issuecomment-151617317.