coppermine-gallery.com/forum

Support => cpg1.4.x Support => Older/other versions => cpg1.4 bridging => Topic started by: martin667 on May 01, 2006, 12:11:03 PM

Title: Using SMF SSI Function in Custom_Header
Post by: martin667 on May 01, 2006, 12:11:03 PM
Hi,

I'm using SMF 1.0.6 and Coppermine 1.4.4. Bridged. Everythings works very well so far.

Now I want to use a Custom Header ( that means I'm simply using the custom header function in the admin area, there I name a PHP file ).
It includes the PHP file. No problem. Now I want to use a SMF SSI function in the PHP.

For testing purpose I just tried to do something very simple like echoing my username:

                     
<?php

require ( '../smf/SSI.php' ) ;

if (!$user_info['is_guest'] )
{
echo  $user_info['username'] ;
}
?>



But it don't work at all. The path to the SSI.php should be correct and I'm logged in ( I check that several times hehe ). So it should just echo my username. But nothing happens. If I add an "else" statement then it works. So the $user_info[] seems to be empty.

What's wrong here ?

Looking forward to your help.

Regards,
Martin
Title: Re: Using SMF SSI Function in Custom_Header
Post by: Nibbler on May 01, 2006, 12:30:38 PM
SSI.php is already included by the bridge system for authentication purposes, attempting to subsequently require it in your script would have no effect. This means you will need to make the variables you need global in your custom header file otherwise they will not be in scope.
Title: Re: Using SMF SSI Function in Custom_Header
Post by: martin667 on May 01, 2006, 12:41:29 PM
Ok now it works. Thanks for your help!
Title: Re: Using SMF SSI Function in Custom_Header
Post by: my evil twin on July 23, 2006, 02:52:56 AM
Quote from: Nibbler on May 01, 2006, 12:30:38 PM
SSI.php is already included by the bridge system for authentication purposes, attempting to subsequently require it in your script would have no effect. This means you will need to make the variables you need global in your custom header file otherwise they will not be in scope.

hello!

how do i do that?
can you give a hint to a coding newbie?

would be very nice.
thank you in advance.
Title: Re: Using SMF SSI Function in Custom_Header
Post by: Joachim Müller on July 23, 2006, 05:58:49 AM
http://www.php.net/manual/en/language.variables.scope.php