vForums Support > vForums :: Report a Bug :: Resolved Bugs :: > API Not Working(v2)

API Not Working(v2) - Posted By dog199200 (dog199200) on 10th Jun 09 at 10:50am
Ross for some reason after my staff forum was upgraded to v2, the API on the main website stopped working. The API is still active and the password is set so i'm not sure whats wrong..

Re: API Not Working(v2) - Posted By Ross (admin) on 10th Jun 09 at 11:37am
Can you let me know if this is still an issue?

Re: API Not Working(v2) - Posted By dog199200 (dog199200) on 10th Jun 09 at 12:03pm
Yea it is:

http://shiningashes.net/

thats the website url, anything needing the url to the forum, you should have it in your PM still and if not i'll PM it to you. But line 25 which is giving the error is calling a post in a thread using the API system.

Re: API Not Working(v2) - Posted By Ross (admin) on 10th Jun 09 at 1:08pm
That site is not loading for me?

Re: API Not Working(v2) - Posted By dog199200 (dog199200) on 10th Jun 09 at 11:00pm
hmm works fine for me, tired clearing your DNS setting yet? But the site is the best way to see if its working. Because here is the errors i am getting:

Trying to call a thread:

Warning: Invalid argument supplied for foreach() in /home/Private/public_html/index.php on line 25


Trying to call profile information:

Fatal error: Cannot use string offset as an array in /home/Private/public_html/includes/sidebar.php on line 21


Edit: but the odd thing is that I can still login via the API..

Re: API Not Working(v2) - Posted By Ross (admin) on 10th Jun 09 at 11:06pm
I can access it fine now but couldn't earlier. Although I wouldn't be surprised if it was a problem with our ISP in the office.

Anyway, what API action is that trying to call? (/api/an-action/...)

Re: API Not Working(v2) - Posted By dog199200 (dog199200) on 11th Jun 09 at 12:30am
i'll just post all my main API data, guessing you change one of the settings in v2 that would cause it to break?

Thread Calling
Code:
 
  1. <?php
  2. $latest_news = $vforums_api -> request('api/recent/board/publicupdates/max/1/mode/topics/allow_all/1');
  3. foreach($latest_news as $post) {
  4. ?>
  5.  
  6. <div class="content">
  7.     <h2>News</h2>
  8.     <div class="text">
  9.         <div class="right"><?=date('l dS \of F Y', $post['timestamp']);?></div>
  10.                          <h4 class="subject"><u><?=$post['subject'];?></u></h4>
  11.                          <blockquote><?=$post['message'];?></blockquote>
  12.                          <div style="text-align : right;">~ <?=$post['display_name'];?></div>
  13.     </div>
  14. </div>
  15.  
  16. <?php
  17. }
  18. ?>
 


Also as for th mini-profile, the <?php if(!$logged_in) { ?> isn't being recognized it just shows <!

Re: API Not Working(v2) - Posted By Ross (admin) on 11th Jun 09 at 8:41am
Should be showing up OK now?

Re: API Not Working(v2) - Posted By dog199200 (dog199200) on 11th Jun 09 at 11:57am
yes seems like it, thanks Ross. Disaster averted {Tongue Out}