XF 1.3 Accessing forums as user from external website.

Adam K M

Active member
Hello!

I've got two setups running at the moment:
  1. Xenforo 1.3
  2. MODx
The MODx installation is for a small business that I have, and has completely independent styling from Xenforo, as well as a close to being completely unassociated... however, I don't really like the MODx user system (I don't really know it too well) and I really love the tested and proven user upgrades on Xenforo. Since my small business is selling digital products (ie. Downloads), it's extremely easy for me to have users pay with the user-upgrades on xenforo to get into a user group, which in turn, can see/download certain files.

However, these users are not on my xenforo installation, and I want to offer them a seamless account/website integration, meaning: keeping them on my MODx installation instead of on a wild-goose chase on a forums that is completely unrelated. I've already set up what I can on Xenforo.

Currently on my Xenforo installation, I have a 'style' which forcefully removes all styling/templating/theming from xenforo pages, which are the core of the inter-website system. The Xenforo pages then use xen syntax to return all of the information I need. (For example, a users' ID, if they're a part of a certain group or not).
Right now, in my mind, I am envisioning two-three possible types of integrating this into my MODx installation, with the "Efficient Integration" being my favorite choice - if it is possible (with my skills anyways).

Preferred Integration (Server Based)
This method is quite simple - it uses php's
PHP:
file_get_contents('http://yoursite.com/your-page.html');
to load all of the HTML from a xenforo page, which I can then use in my own php on MODx to run whatever processes I need to. For example, on Xenforo right now, I have a page which returns the user's (who's accessing the page) ID. This is great! However - when I attempt to get this through php, triggered by a user (who's no on MODx), obviously the Xenforo installation returns information valid as if the MODx were a member of the forums, rather than the user who actually issued the information fetching.
I'm wondering if there is some sort of way to take the users' session/IP/cookie or w/e that Xenforo uses to authenticate and have my MODx server appear as them - allowing me to get all the information I could ever need!!!


Basic Integration (Client Based)
This method is a cheap-ish work around in my opinion, but it also might be the only possible way, and it might screw up on older browsers. What it would involve is having the users' themselves load that page through javascript or possibly an iframe (the styling from iframes is going to be a problem :X) - this way my own xenforo installation will see this and recognise where the request is coming from and return the appropriate information. Due to this, I would have to process all of the major data on the Xenforo installation (ie, what code to display if they're logged in vs not logged in) rather than the MODx installation, since the MODx installation would not have any access to this information at all.

Intense Integration (Server ~ Database Based)
This method would simply be having my MODx server run the php classes which manage xenforo's account system, and having them query the same database for verification and whatnot. If you know about this, please do point out the files (directory to them, if possible) of what I'd need, as well as how to manage the session/cookie/etc. The main things here would be being able to retrieve the users' username, email, and user groups (to see if they've purchased a product or not).

Any help is greatly appreciated - I'm not currently able to afford two xenforo licenses, and even though these are hosted on the same machine, they are different domains and located in different directories, so... It would be amazing if you could give me a detailed "laymans" response, as I'm completely inexperienced with this specific area of php.

 
Top Bottom