[Solved]: Member Specific Messages [Solved]: Member Specific Messages
 

News:

CPG Release 1.6.26
Correct PHP8.2 issues with user and language managers.
Additional fixes for PHP 8.2
Correct PHP8 error with SMF 2.0 bridge.
Correct IPTC supplimental category parsing.
Download and info HERE

Main Menu

[Solved]: Member Specific Messages

Started by formulx, March 24, 2008, 10:38:11 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

formulx

Hello,
I bridged Coppermine with SMF and am having a small issue.

Im using the customheader.php file to allow myself to use PHP in my custom theme. The problem is that in the header I have a spot that displays a certain message (telling them to signup) if they arent logged in. Now ive tried the code im using on php file thats not linked to CP using SMF's SSI.php file and it works fine. When I try to use the exact code on customheader.php it doesnt seem to work at all.

What im using is:

      <?php
      if ($context['user']['is_guest'])
      {
                ... etc

At the top of the customheader.php file I have:
require_once('../forum/SSI.php');
(the gallery is located at domain.com/gallery and forum at domain.com/forum therefore the need to include the ../)

Im not sure why it isnt working so I was wondering if there was any coppermine specific code I could use to check if a user is logged in?

formulx

Whoops forgot to mention that I would be more than happy to say the real domain but due to it containing adult material I would rather not post a direct link to protect any "minors" from reaching the page by accident.

Nibbler

It doesn't work like that because the bridge already includes SSI.php. You can do it the Coppermine way instead.


if (USER_ID){
  echo 'You are logged in as ' . USER_NAME;
} else {
  echo 'You are not logged in';
}

formulx

Ah I see, if I wanted to use the SSI.php file how would I go about doing it?

Nibbler

Add a

global $context;

to bring the SSI info into scope.

formulx

Thanks so much! Also im having one small problem. Perhaps my script is messed up (I might have messed it up unknowingly) but the first code you gave me wont work. Instead I have to use if (!USER_ID) as being if the user is logged in and the else conditional shows something if the user isnt logged in.

formulx

Ignore my last post, it was my stupidity.