• This forum has been archived. New threads and replies may not be made. All add-ons/resources that are active should be migrated to the Resource Manager. See this thread for more information.

forumConnector

Status
Not open for further replies.

Digital Doctor

Well-known member
Thanks.
Again ... great job on maison.com - it's a thing of beauty.
Should you update the first post reflecting what you are using ?
Maybe the reasons why you are using your new method vs. the one outlined here ?
 

Benjy

Well-known member
Again ... great job on maison.com - it's a thing of beauty.
Thanks! :)
Maybe the reasons why you are using your new method vs. the one outlined here ?
The site and the forums are on the same server, so there is no remote stuff needed. Also, I wasn't sure if we'd use xF or another system so an all-in-one connector seemed like a good idea. Now that we use xF and don't plan to change, having a versatile connector isn't that critical so I ended up putting directly the xF stuff (very light: user info retrieval, thread and post info retrieval, thread posting, thread editing) inside the codebase.

I should also point that I only load xF on the pages where I need it, not systematically.
 

Claudio

Well-known member
This script might allow me to make a login box on javascript (for Wordpress for example) to login into my forum?
 

Benjy

Well-known member
This script might allow me to make a login box on javascript (for Wordpress for example) to login into my forum?
Err... you can make a JS login box without this, but I guess you're looking for some kind of a XF/WP connector, in which case it's a bit more complicated :)
 

Claudio

Well-known member
I was refering to be able to login into my forum account through a different page out of the forum...for example an html page
 

Benjy

Well-known member
I was refering to be able to login into my forum account through a different page out of the forum...for example an html page
This doesn't get simpler than that:
HTML:
<form action="#XENFORO_HOME_PATH#/login/login" method="post">
    <label for="xflogin">Name / Email:</label>
    <input type="text" id="xflogin" name="login" />
    <label for="xfpassword">Password:</label>
    <input type="password" id="xfpassword" name="login" />
    <input type="submit" value="Log in" />
    <label for="xfremember"><input type="checkbox" id="xfremember" value="1" name="remember" /> Stay logged in</label>
    <input type="hidden" name="cookie_check" value="1" />
    <input type="hidden" name="redirect" value="#WHERE_YOU_WANT_TO_GO_AFTER_LOGIN#" />
    <input type="hidden" name="_xfToken" value="" />
</form>
 

fronix

Member
How exactly do I use this script?

Whenever I do $whatever = $fcc->getuser(1); it echoes out everything, how can I use the information so I can put it where I want it?
 

Benjy

Well-known member
How exactly do I use this script?

Whenever I do $whatever = $fcc->getuser(1); it echoes out everything, how can I use the information so I can put it where I want it?
$whatever is an XML string. You have to parse it by using SimpleXML, XMLReader, Zend_Config_Xml... or even Zend_Json::fromXml() which will return a JSON string that you can transform into an array.
 

fronix

Member
$whatever is an XML string. You have to parse it by using SimpleXML, XMLReader, Zend_Config_Xml... or even Zend_Json::fromXml() which will return a JSON string that you can transform into an array.

Ohhhh..

It would be nice with some examples of that as well if not that is too much trouble.
I'm also having trouble getting the isloggedin() to work, even when I'm logged in it only returns "0", you do mention that my site need access to the forum cookies but how?
 

fronix

Member
$whatever is an XML string. You have to parse it by using SimpleXML, XMLReader, Zend_Config_Xml... or even Zend_Json::fromXml() which will return a JSON string that you can transform into an array.

I got the isloggedin() working now but only if I go to
Code:
http://mywebsite.com/forum/xf_server.php?do=isloggedin&ipaddress=MYIP&useragentppl&sessionid=xf_session&sessionuser=xf_user

If I do $fcc->isloggedin(); on http://mywebsite.com/index.php it returns 0
 

Benjy

Well-known member
you do mention that my site need access to the forum cookies but how?
By default, XF cookies are stored for the entire domain, so a site in root is able to access cookies stored by an XF install located in /forums... Anyway, you can ensure that by editing your library/config.php file and inserting:
PHP:
$config['cookie']['path'] = '/'; //the cookie is accessible in every folder
$config['cookie']['domain'] = ''; //the cookie is accessible in every subdomain
 
Status
Not open for further replies.
Top