News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

SSI Include (1.1.7) with Joomla (1.5.8)

Started by Shadowwolf_tw, January 04, 2009, 08:37:28 AM

Previous topic - Next topic

Shadowwolf_tw

Im looking for a bit of advice and direction on an issue im having.

Im not looking to bridge Joomla and SMF, at least not at this time as I have no need for it. Basically my objective, and I've partially achieved this, is to use the SSI include to display various SMF related items on a main site which is running Joomla 1.5.

Right now I'm only looking to display latest forum posts, a welcome greeting and logout link, and a shoutbox (using Ultimate Shoutbox).

Now the issues I am having are with the log out link and the shoutbox. Basically what appears to be happening is the session ID its including for both are not matching up with the forum log on.

using the following in the template index file for Joomla:
require_once("/<localpathtoforum>/SSI.php");

allows me to display all these things just fine. Forum posts display work fine, greeting message is displayed properly with the total number of PM's the person has, shoutbox displays fine as well. Anytime you attempt to use the logout button or post to the shoutbox from the Joomla site however, SMF returns the error that "Session Verification Failed".

I thought perhaps that SSI wasnt being loaded before everything else being included with the template index file, so I attempted to include the same line of code above into the main Joomla index file and I got the following errors: (paths sanitized for this posting)

Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_query(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Subs.php on line 325
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_error(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Errors.php on line 123
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_errno(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Errors.php on line 124
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  filemtime(): stat failed for /Load.php in /.../Sources/Load.php on line 2147
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_query(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Subs.php on line 325
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_error(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Errors.php on line 123
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  mysql_errno(): supplied argument is not a valid MySQL-Link resource in /.../Sources/Errors.php on line 124
Jan  4 07:53:34 server httpd2-prefork: PHP Warning:  filemtime(): stat failed for /Load.php in /.../Sources/Load.php on line 2147


Line 325 of Subs.php is the following:
$ret = mysql_query($db_string, $db_connection);

Line 2147 of Load.php is the following:
$key = md5($boardurl . filemtime($sourcedir . '/Load.php')) . '-SMF-' . $key;

Basically all I want to do is figure out what I need to do to pull the proper session ID for both the link and the shoutbox form to work properly. Im not a PHP guru but I know enough to be dangerous to myself...so any help here would be appreciated.

This is a recent upgrade to Joomla 1.5 from 1.0 where this stuff all worked before so its clear to me something in Joomla is creating this mess for me, unfortunately what is actually doing it is beyond me.

Orstio

global $context;
$sc = &$context['session_id'];
$_SESSION['USER_AGENT'] = $_SERVER['HTTP_USER_AGENT'];

Shadowwolf_tw

Im not sure what thats supposed to do for me other than return Joomla's session ID for the visitor.

My issue is im trying to have the logout link and the shoutbox both being included via SSI use the forum's session ID like they should because they are pulling Joomla's for some reason and so anyone who clicks logout from the main page gets a session verification error.

This worked fine and dandy on Joomla 1.0 but 1.5 is where it broke somewhere and thats what Im trying to narrow down.

Im looking for if maybe the session ID is saved locally with the browser in a cookie as well as in the database or figure out exactly whats making the SSI pull a different session ID altogether.

Orstio

It pulls in SMF's session information so you can use it.

Shadowwolf_tw

With regard to my problem, we ended up fixing it.

A friend of mine helping me solve this little riddle ended up noticing that Joomla 1.5 kills any prior existing PHP Session ID's, so while SSI was loading the proper one, the reason the SSI modules were pulling the Joomla one instead of the SMF one was because thats all that existed once the page finished loading.

We had to modify some settings in the SSI file to specifically tell it to pull the session ID's from the database and where instead of from the PHPSESSID cookie value and everything worked.

While in theory, your suggestion would have worked, because of what Joomla 1.5 was doing and that we didnt know it was doing it, this didnt do anything for us until we altered some of the code around how each handles its own session ID's.

I do appreciate the attempt to help, this was just one of those things that Joomla 1.5 was doing differently from 1.0 that we had to dissect to figure out.

Advertisement: