dog199200 Guest | API Array Printing Error (10th Aug 09 at 10:54pm UTC) Resolved | | URL: http://www.divineshadowsonline.com Browser: FF For some reason the API just keeps printing out a C when trying to call forum information. Was something changed in how the array is suppos to be formaed cause this is what i currently have:
Code: - <?php
- $users_online = $vforums_api -> request("api/info/online/1/stats/0");
- echo "Total Players: " . $users_online['total_members'];
- ?>
| |
|
Ross Administrator
Posts: 3,709 Status: Offline Gender: Male Age: 8 1⁄1 Joined:
Additional Groups: Support Team
pmwwwgtalkvForum | Re: API Array Printing Error (11th Aug 09 at 1:13am UTC) | | Give it a try now. I recently updated some of the server file structure and thought I had updated all of the API files to reflect this. Apparently I missed one of the functions used by this API module. You can always check exactly what is being returned by doing a print_r() on the array. eg. print_r($users_online); | |
|
|
dog199200 Guest | Re: API Array Printing Error (11th Aug 09 at 3:20am UTC) | | OK i printed all of the major arrays and i can't find the array with the "total_members" in it. Its not in $users_online anymore, or at least it doesn't come up when calling its array. | |
|
Ross Administrator
Posts: 3,709 Status: Offline Gender: Male Age: 8 1⁄1 Joined:
Additional Groups: Support Team
pmwwwgtalkvForum | Re: API Array Printing Error (11th Aug 09 at 5:08pm UTC) | | Hi Dwight, The API request you are doing there specifies the "stats" parameter as "0" (ie. false) therefore it doesn't fetch that information and only returns information about the current users online.
Code: - <?php
- $users_online = $vforums_api -> request("api/info/online/1/stats/1");
- echo "Total Players: " . $users_online['total_members'];
- ?>
| |
|
|
dog199200 Guest | Re: API Array Printing Error (11th Aug 09 at 10:08pm UTC) | | oh oops i forgot to change the 0. Ok thank you. Edit: after the C vanished i now can't print the array and nothing in the user online is working, but yet the login checking system is still working. | |
|
dog199200 Guest | Re: API Array Printing Error (13th Aug 09 at 12:27am UTC) | | I found out that for some reason you can't have Online functions and forum stat functions active at the same time, even if you split them in different php calls, the first call is what is activated. | |
|