FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » FUDforum » How To » Forum Integration
Show: Today's Messages :: Polls :: Message Navigator
Switch to threaded view of this topic Create a new topic Submit Reply
Forum Integration [message #159368] Mon, 25 May 2009 19:01 Go to next message
bhavionline is currently offline  bhavionline   India
Messages: 5
Registered: May 2009
Karma: 0
Junior Member
Hey Ilia et all,

Well i have an external site and forum installed under forum/ directory.
I have user login in my main website and have successfully integrated user registration and user login using external_fud_login thanks to the wonderful API.

I have also included the sites header to forum header... all's well till here.

Now my problem :

The user logs in to the main site : I store memberId in the session( this is users id in the main website). The user also gets logged in to the forum using external_fud_login function.
Now when i am on my main site i can retreive the memberId from session but on forum pages my main websites memberId is not getting passed. I dont understand why?

Secondly,
Does the forum use keep_alive_sessions, what i want is, when a user logs in from my main site and a cookie is created by the external_fud_login i set the user status as "Online", i have a code which sets this status to "Offline" when user logs out. However if the user does not log-out the status remains "online", is there a way that i can track if the session is active and may be say after 1 hour of inactive session, the session and cookie both expire and the user status is set to offline.

Please let me know.

Thanks
Re: Forum Integration [message #159369 is a reply to message #159368] Mon, 25 May 2009 20:10 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Hi,

Quote:
when i am on my main site i can retrieve the memberId from session


My guess is the cookie doesn't get passed to the server for some reason (different url or path?). Check your Cookie Path in the Global Settings Manager.

Quote:
Does the forum use keep_alive_sessions


You should be able to control it via the Cookie Timeout and Session Timeout settings.

Best regards.

Frank
Re: Forum Integration [message #159371 is a reply to message #159369] Tue, 26 May 2009 16:36 Go to previous messageGo to next message
bhavionline is currently offline  bhavionline   India
Messages: 5
Registered: May 2009
Karma: 0
Junior Member
naudefj wrote on Mon, 25 May 2009 16:10
Hi,

Quote:
when i am on my main site i can retrieve the memberId from session


My guess is the cookie doesn't get passed to the server for some reason (different url or path?). Check your Cookie Path in the Global Settings Manager.

Well i need to retreive the memberId of my main site. Which i think i should be able to retreive using $_SESSION['memberID'].
But no value is returned when i am on forum pages. Does the forum not use $_SESSION.

Quote:
Does the forum use keep_alive_sessions


You should be able to control it via the Cookie Timeout and Session Timeout settings.

Ok, so if i set the session time out, how and where can i write a code which will update a flag in my database table setting the online status to false when the cookie expires.

Best regards.

Frank


Re: Forum Integration [message #159374 is a reply to message #159371] Wed, 27 May 2009 05:30 Go to previous messageGo to next message
bhavionline is currently offline  bhavionline   
Messages: 5
Registered: May 2009
Karma: 0
Junior Member
Well i need to retreive the memberId of my main site. Which i think i should be able to retreive using $_SESSION['memberID'].
But no value is returned when i am on forum pages. Does the forum not use $_SESSION.

Also once i set the time for session where do i write the code to update my database field to set the online status to false once the cookie or session expires.

Regards
Bhavi
Re: Forum Integration [message #159377 is a reply to message #159374] Wed, 27 May 2009 15:48 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
I couldn't find any reference to $_SESSION in the code. So, I assume it's not used.

The forum should do it automatically - look at the code in login.php.t.
Re: Forum Integration [message #159382 is a reply to message #159368] Wed, 27 May 2009 20:10 Go to previous messageGo to next message
bhavionline is currently offline  bhavionline   India
Messages: 5
Registered: May 2009
Karma: 0
Junior Member
I have included a php file in the forum header, how can i get the logged in user info in the included php file.

I want to show the logged in uses Login Name in the file which i
include.

Will this work
<?php echo $u->login?>

Please advise.
Re: Forum Integration [message #159384 is a reply to message #159382] Thu, 28 May 2009 06:25 Go to previous messageGo to next message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Try this:

Logged in with uid = [ {DEF: __fud_real_user__} ], alias = [ {VAR: usr->alias} ]<br />
Re: Forum Integration [message #159386 is a reply to message #159384] Thu, 28 May 2009 18:02 Go to previous messageGo to next message
bhavionline is currently offline  bhavionline   India
Messages: 5
Registered: May 2009
Karma: 0
Junior Member
naudefj wrote on Thu, 28 May 2009 02:25
Try this:

Logged in with uid = [ {DEF: __fud_real_user__} ], alias = [ {VAR: usr->alias} ]<br />




Well it is not working.
I am including a php file.

And if i put
<br/>
Logged in with uid = [ {DEF: __fud_real_user__} ], alias = [ {VAR: usr->alias} ]<br />

It prints as is without replacing the value.

I actually want to get the logged in users login name to be stored in a php variable so that i can check that against the user of my main site.
Please explain how to do that.

Secondly, i have user profile being set and updated on my main site, i also accept the user picture in the main site is it possible to integrate user profile in such a way that against a topic in the forum it will show the picture from the main sites corresponding user profile or is there any other way to accomplish this.

Lastly i have checked Cookie sessions in the forum and it works great, on my main site's user profile i need to show a user online or offline, i think there is a table in the forum database which tracks the logged in users sessions, so if i can find out the login names of the online users it should solve my problem, can u give me a query for this.

Thanks in advance.
Re: Forum Integration [message #159387 is a reply to message #159386] Thu, 28 May 2009 20:25 Go to previous message
naudefj is currently offline  naudefj   South Africa
Messages: 3771
Registered: December 2004
Karma: 28
Senior Member
Administrator
Core Developer
Quote:
Well it is not working.

It should work if you put it in one of the forum's templates, for example in header.tmpl.

As for getting stuff in variables, why don't you extend the login API to return the required data from the users and sessions tables (join fud28_ses with fud28_users).

As for syncing avatars, look at the code in fudapi.inc.php.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: How to search for attachments to messages
Next Topic: FudForum theme and template edition - probleme to have stable css
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 00:05:47 GMT 2024

Total time taken to generate the page: 0.02814 seconds