1

Topic: Quick question about a small ugly hack I have done...

Hello dear community I need some fast help with this:

<?php if( $user_id = '1' )
                {
                    echo '
                        guest
                    ';
                }
                else 
                {
                    echo '
                           logged in
                     ';    
                }
                ?>

This should according to my "PRO" reasoning give a logged in IF i've logged in at the forums? But it won't so I'm guessing that there is something wrong with PunBB, now you make this work! (kidding) anyone that can explain what I've done wrong?

2 (edited by Utchin 2008-09-08 20:17)

Re: Quick question about a small ugly hack I have done...

It is $pun_user['userid']

And you can also do !$pun_user['guest'] Something like that

Sorry. Unactive due to personal life.

3

Re: Quick question about a small ugly hack I have done...

tyvm

4 (edited by SpiXx 2008-09-10 19:31)

Re: Quick question about a small ugly hack I have done...

mkay this acc works, BUT (im sorry if you find my questions moronic but if I dont ask I will never learn...) the (script) works but now i reggs me as Online even when I have logged out, do i have to check for cookie or similar? The thing I'm trying to fix is a small "community" function where I use the login from punbb's database and add other functions to another DB that will hold the userpage and such tongue?

ohh the code:

<?php if($pun_user['1'])
                {
                    echo ' logged out ';
                }
                else
                {
                    echo ' logged in';   
                }
                ?>

Re: Quick question about a small ugly hack I have done...

What is the aim of the If statment? I dont think $pun_user['1'] is doing what you want.

Sorry. Unactive due to personal life.

Re: Quick question about a small ugly hack I have done...

Agree with Utchin.

Try this:

print_r($pun_user);
Carpe diem