Elxis CMS Forum

Extensions => Bridges => Topic started by: Xanadu on December 03, 2007, 15:48:16

Title: Custom bridge
Post by: Xanadu on December 03, 2007, 15:48:16
Hi there,

For my website I would like to add my own Forum system. For this you need to be logged in on the website. So I need a custom bridge (i think??)
I need to get the userID in a Session.

Can anyone help?
Title: Re: Custom bridge
Post by: datahell on December 03, 2007, 17:01:31
In elxis:
global $my;
if ($my->id) {
   $_SESSION['cuserid'] = $my->id;
}

In forum:
session_start(); //only needed if session has not already initialized
if (isset($_SESSION['cuserid'])) {
    .....do stuff....
}
Title: Re: Custom bridge
Post by: Ivan Trebješanin on December 03, 2007, 17:03:51
What forum are you using? There is PowerBoard Component for Elxis2008. It is in a BETA phase, but perfect solution for ANY Elxis site! You don't even need a bridge, because it is a component, and acts like one!
Title: Re: Custom bridge
Post by: Xanadu on December 03, 2007, 17:37:57
I use my own forum, I tried working with powerboard but it just didn't function as i wish.
I hope i can work things out with the code
Title: Re: Custom bridge
Post by: Xanadu on December 03, 2007, 18:15:27
Datahell, i tried your script. but cant make it work.

I placed the elxis part in index.php after this line (line 165):

$my = $mainframe->getUser();

Is this right or wrong??
Title: Re: Custom bridge
Post by: datahell on December 03, 2007, 20:47:59
I don't know what kind of bridge you want to create. You asked me how to transfer the user id from Elxis to a custom application using a session variable and I answered you correctly. I don't  know if it is the right way or not because I don't know what is "your forum". You build a forum by yourself and you don't know how to set a session? This sound a little weird!