1 (edited by Android 2004-08-15 13:57)

Topic: Checking for login.

I downloading PunBB today and I think it's great, just what I needed. I tried to write a script that would work out if a user was logged on on other pages of my site, but I gives this error:

"The file 'config.php' doesn't exist or is corrupt. Please run install.php to install PunBB first."

I know config.php is working because the rest of the forum is fine.

Here is the code that I used:

I wrote:

<?

require ('include/common.php');

if ($cookie['is_guest'])
{
    echo "guest";
}

if (!$cookie['is_guest'])
    {
        $username = $cur_user['username'];
        $email = $cur_user['email'];
       
        echo $username;
        echo $email;
    }


?>

Are they any adjustments to be made or is it alot less simple than I originally thought?
Any help will be greatly appreciated.
Thanks smile

Re: Checking for login.

The problem is that you must set $pun_root to make it work. $pun_root defines where the forum is installed, so add a line like this before the require-line:

$pun_root = './';

Of cource, if your php-file is located somewhere else you have to change the path.

Re: Checking for login.

Thanks, works a charm! big_smile

Re: Checking for login.

Damm! It's stopped working once I take it out of the forum root.
I set it up as follows:

$pun_root = 'forum/';

But it still gives a config.php error.

Re: Checking for login.

Change it to:

$pun_root = './forum/';

and it'll probably work

Re: Checking for login.

Still no luck! sad
Sorry!

7

Re: Checking for login.

If someone could explain me ...
how on ALL PAGES in a site ...

1. log
2. once log, how to do to appear new messages, new posts since ... blablabla ...

I know, it's not easy for people to explain, but php and me = 40 ...

8 (edited by Android 2004-08-15 15:25)

Re: Checking for login.

Now it does work, I had a spare / which was confusing it. Thanks alot Chacmoo for all your helpl. big_smile

@Rod-
You want something that shows who is online etc. on every page of your site? If so try making a function and including it in every page. I expect the experts will be able to help you better than I could! big_smile