Customizing SMF > Portals, Bridges, and Integrations

New tools to help integrating SMF with something else

<< < (24/27) > >>

LillyWhite:
Hi! I've been trying to integrate a website with smf (using the same account of smf) but i need some help. This does work fine if i login on the forum for the first time (This is on the website):

      require_once($_SERVER['DOCUMENT_ROOT'] . '/forum/smf_2_api.php');
         
      global $user_info;
      $username = $user_info['username'];

      if ($user_info['is_guest']) {
         $data['header'] = "header";
      } else {
         $data['header'] = "headerlogged";
      }

If i close the web browser, when i visit my website i remain logged on the forum but it loads the guest "header" on the website. If i want this code to work again, I have to logout from the forum and login again. How can i check on my site if im already logged on the forum so i can display the "headerlogged" if i'm logged?

Thank you.

LillyWhite:
Can someone help please? :)

Arantor:
You have to do more than simply load the API file.

You can either change the require to reference /forum/SSI.php which will make your code work as expected, or you can add more code to make it work.

LillyWhite:
Hi. Ty for the quick help. If i change the require to SSI.php it works in the same way it did before. When i close the web browser it stops working. Checking the cookies, i see that they are not set when i visit the site without login first on the forum. This only works if i login first on the forum. Any idea what i must do to check if i am already logged on the forum by just visiting my site? I'm using codeigniter framework and im trying to use the same account of the forum in the site. Thank you. 

Arantor:
Well, SSI should be set first, and you probably have to also set subdomain independent cookies in Admin > Configuration > Server Settings > Cookies and Sessions.

Any other sessions will not play nicely with SMF's.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version