1 (edited by madjedo 2004-04-05 08:48)

Topic: Login Box problems

I've managed to put a login box on my site, check it out @ http://www.art4gamers.net

But here comes the problem, after the user has logged in the login box is still there! Now i want to remove it after the user is logged in and include some user status stuff, for an example a profile page or her/his last posts, or his last PM.

But how?

*EDIT: My problem is not including the stuff, it is removing the login box after login so i can add other stuff.

Re: Login Box problems

I'm guessing you have already included common.php like we discussed in that other topic. In that case, you can just check it like this:

if ($cookie['is_guest'])
{
    // Show login box
}
else
{
    // The user is logged in
]
"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Login Box problems

Eh... What are you talking about?

I have not included common.php and i havn't discussed it with you "in that other topic"

And "just check it like thsi?"

...That didn't help me much.

Re: Login Box problems

I almost understand what to do, if you can just tell me in wich order to do it. MOre specifik

Re: Login Box problems

You must have a very short memory:

http://punbb.org/forums/viewtopic.php?pid=11822#11822

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Login Box problems

what? I don't undeerstand... Where am i supose to put this:

if ($cookie['is_guest'])
{
    // Show login box
}
else
{
    // The user is logged in
]

Re: Login Box problems

This code is in and working:

<?php

define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);

$pun_root = './forum/';
@include $pun_root.'include/common.php';

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
    exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB

first.');

?>

And then... ?

8 (edited by madjedo 2004-04-05 20:55)

Re: Login Box problems

below it i put in this:

<?php

if ($cookie['is_guest'])
{
    // Show login box
}
else
{
    // The user is logged in
]

?>

Hole page white and showing only: Parse error: parse error, unexpected ']' in /customers/art4gamers.net/art4gamers.net/httpd.www/sheep.php on line 166

* I'm really screwed up...

Re: Login Box problems

First of all. I made a typo. The last ] should be a }. Secondly, the text after the //'s are comments. That means you should put code there to do whatever you want to do depending on whether the user is logged in or not. I can't really explain in any more detail. I guess you have to learn a little PHP.

"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Login Box problems

that little ] was that screwed everything up...

I am learning... Trust me smile

Re: Login Box problems

Well, it didn't work anyway...

<?php

define('PUN_TURN_OFF_MAINT', 1);
define('PUN_QUIET_VISIT', 1);

$pun_root = './forum/';
@include $pun_root.'include/common.php';

// If PUN isn't defined, config.php is missing or corrupt
if (!defined('PUN'))
    exit('config.php doesn\'t exist or is corrupt. Please run install.php to install PunBB

first.');
?>
<?php
if ($cookie['is_guest'])
{
   //  @include "loginBB.php";
}
else
{
   //  @include "loginBB.php";
}

?>

Nothing shows up, look at http://www.art4gamers.net/sheep.php under "USER" - where you wont see anything

Re: Login Box problems

Try this:

if ($cookie['is_guest'])
{
   @include "loginBB.php";
}
else
{
   echo 'Hello '.pun_htmlspecialchars($cur_user['username']);
}
"Programming is like sex: one mistake and you have to support it for the rest of your life."

Re: Login Box problems

Oh cool, thx man. It's working, now i can just start fixing some including stuff and voili vittu il do that tomorow.

Getting tired, thanks! - Again. Hihi smile

14 (edited by madjedo 2004-04-07 15:39)

Re: Login Box problems

It's working, but the latest topics is being shown under, the oldest on top, and the newest at the bottom. I want the oppposite

*EDIT, oops, posted this in the wrong forum tongue Ive made a post in my old topic, check it out.

http://punbb.org/forums/viewtopic.php?id=3538&p=2

15 (edited by RobvT 2004-12-14 16:41)

Re: Login Box problems

Rickard wrote:

Try this:

if ($cookie['is_guest'])
{
   @include "loginBB.php";
}
else
{
   echo 'Hello '.pun_htmlspecialchars($cur_user['username']);
}

Why is there still nothing showing on my site. See my site. On the right in the orange field the login box should appear.

Is there already a mod that's doing this function. I've searched the complete forum butt can't find it.

HTCClub.net team thx the builders of this great forum.