News:

SMF 2.1.6 has been released! Take it for a spin! Read more.

Main Menu

if (logged_in() )

Started by Dekudude, April 02, 2008, 10:47:14 PM

Previous topic - Next topic

Dekudude

Is there a simple code to check if a user is logged in, and return "true" if so? Thanks! =P

Also, is there a file I can include on my "top.php" file to include all of SMF's built-in functions, such as logged_in, (if it exists) etc? My forum, and my site, are in different folders.

Kindred

did you try a search?


<?php
require_once('/path/to/your/forum/SSI.php');

ssi_welcome();
if (
$context['user']['is_guest']) {
ssi_login('http://www.turtleshellprod.com/test.php');
} else {
ssi_logout('http://www.turtleshellprod.com/test.php');


try using search. try looking at ssi_examples.php in your forum directory/
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

Advertisement: