vForums Support Banner


Visit Base Classics - Gaming Chairs

 

Welcome Guest! Please Login or Register
vForums Support :: vForums :: Report a Bug :: Resolved Bugs :: API Array Printing Error - View Topic
Topic Rating: *****
Printable View
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:
 
  1. <?php
  2. $users_online = $vforums_api -> request("api/info/online/1/stats/0");
  3. echo "Total Players: " . $users_online['total_members'];
  4. ?>
 
Ross
Administrator
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
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);

Image
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
*****

[Avatar]

Posts: 3,709
Status: Offline
Gender: Male
Age: 8 11
Joined:  

Additional Groups:
Support Team
***


Reputation: 45%  


pmwwwtwittergtalkvForum
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:
 
  1. <?php
  2. $users_online = $vforums_api -> request("api/info/online/1/stats/1");
  3. echo "Total Players: " . $users_online['total_members'];
  4. ?>
 

Image
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.
 Printable View

All times are GMT+0 :: The current time is 7:54pm
Page generated in 0.3903 seconds
This Forum is Powered By vForums (v2.4)
Create a Forum for Free | Find Forums