Simple Machines Community Forum

Customizing SMF => SMF Coding Discussion => Topic started by: buttonbasher on March 29, 2004, 01:12:23 PM

Title: Site Login
Post by: buttonbasher on March 29, 2004, 01:12:23 PM
Im looking for a script, so i can login at my site (not the forum) with the same cookie tha the forum uses.
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:13:59 PM
SSI will make all the member info availiable.
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:17:48 PM
so i can just include it?
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:18:14 PM
yes
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:23:50 PM
Warning: session_start(): Cannot send session cache limiter - headers already sent (output started at /data/members/paid/p/s/psflames.nl/htdocs/test/test.php:8) in /data/members/paid/p/s/psflames.nl/htdocs/test/SSI.php on line 92

well i get this error

i used this

----------------------------------------test.php--------------------
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<?php
include ("SSI.php");
?>

</body>
</html>
------------------------------------------------------------------------------------
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:27:39 PM
----------------------------------------test.php--------------------
<?php
include ("SSI.php");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">

</body>
</html>
------------------------------------------------------------------------------------

Because of the headers, it must be the first thing, before anything is sent to the browser.
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:30:04 PM
Yawh but now i get a blank screen?

http://test.psflames.nl/test.php
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:41:37 PM
Ok, so you want to know what it makes availiable?
Sorry. I thought you wanted me to correct the test page, which didnt have any data in it anyway.


<?php
include ("SSI.php");
?>
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>

<body bgcolor="#FFFFFF" text="#000000">
<pre>
<?php print_r(get_defined_vars()); ?>
</pre>
</body>
</html>
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:44:46 PM
no sorry, your a great helper

could you look at it again, it looks kinda strange :) :)

i just want that login thing like the babylon user info
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:47:11 PM
Yeh, its basiacly everything that PHP knows.
If you view source it may look more readable.

I have modified the above, to include <pre> & </pre> which should format it on the page better.


Search for
user_info   & user_settings
Those contain user data.
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:49:02 PM
but how can i get that login?
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:51:03 PM
The SSI knows if the user is loged in or is a guest.

http://www.simplemachines.org/community/ssi_examples.php
<?php ssi_login(); ?> if you need a login form.
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 01:54:46 PM
ow okey, the login form works, but how can is show that userinfo if im logged in, and if youre not logged in the loginform
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 01:57:41 PM

if($user_info['is_guest']) {
    ssi_login();
} else {
    //User info
    echo 'Welcome' . $user_info['realName'];
}


Have a play, its  really quite informative.
Title: Re: Site Login
Post by: buttonbasher on March 29, 2004, 02:01:11 PM
Thank you!!

i will try somethings

only that realname, is that to show your nickname?, cuz it aint working but.. which tags can is use like that [realname]?
Title: Re: Site Login
Post by: MrCue on March 29, 2004, 02:03:12 PM
do this
<pre><?php print_r($user_info); ?></pre>
Now look at what values you have avaliable

to use one just do

echo $user_info['KEY FROM THE PRINT_R'];
Title: Re: Site Login
Post by: buttonbasher on March 30, 2004, 10:12:48 AM
how can i show the memberlist?