News:

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

Main Menu

n00b question - different look for logged in users

Started by doinshots, August 27, 2007, 09:00:18 AM

Previous topic - Next topic

doinshots

Hi All,

I am totally new to SMF and love it so far. My question is this:

Is it possible to have a 'home' page that looks different for people that are NOT logged in vs. people that are?

redone

Welcome to SMF! You could use SSI if you know a little php. You could use a portal that would allow you to move around your content for guests and members alike.

As a general rule with your forum your guests will be locked out of some boards and this depends on your own settings, permissions etc. This is generally the only change you would see from a "guest" view to a "registered" member view.

I have provided you links below for what I have mentioned:

Using SSI

Tinyportal


doinshots

Thanks!!! Looks like I have some reading to do  :)

codenaught

I think redone meant to link to:

http://docs.simplemachines.org/index.php?topic=400.msg529#msg529

For the Using SSI one. (Though searching it would have found a document with the title he posted) ;)

When you use SSI.php, you can access SMF variables to help you code your page in a way where it appears differently for guests and logged in users.

Example:


<?php

<call to SSI.php done here>
if (
$context['user']['is_logged'])
{
     echo
' Welcome back to the forums, ' . $context['user']['name'] . '!';
}

if (
$context['user']['is_guest'])
{

     echo
' Please login!';
}

// There are some helpful SSI functions such as this one...
ssi_login();

// Which will show a login form only if the user is not logged in.

// Not to mention, a similar thing to what I did above could be done with:
ssi_welcome();

?>
Dev Consultant
Former SMF Doc Coordinator

Advertisement: