Results 1 to 3 of 3

Thread: Auto forward Content element

  1. #1
    User
    Join Date
    07-20-09.
    Location
    Middlesbrough - United Kingdom
    Posts
    95

    Default Auto forward Content element

    Hi,

    Is there an extension or some code or something I can put onto a page to auto forward the user if they are logged in but display the page if the user is a guest?

    Thanks,
    Ste

  2. #2
    Experienced user
    Join Date
    06-20-09.
    Posts
    1,311

    Default Re: Auto forward Content element

    Site Structure::edit your page::Expert Settings::Show to guests only

    Will this not do what you want? (member auto forwarding is unneccessary in this case, as they won't ever see the page)
    Above is for members, not users though....

    Otherwise (if it is users you want to do this to) you'd need to include a {{file::myfile.php}} insert tag in a content element, place myfile.php in your templates folder, and have the script detect and forward them.

    untested:
    Code:
    <?php if (!defined('TL_ROOT')) die('You can not access this file directly!');
    
        if (BE_USER_LOGGED_IN)
        {
    	$redirection_url = 'the page to go to';
    	$this->redirect($redirection_url);
    	}
    ?>

  3. #3
    User
    Join Date
    07-20-09.
    Location
    Middlesbrough - United Kingdom
    Posts
    95

    Default Re: Auto forward Content element

    Hey,

    thats great thanks. I needed to detect if the member is logged in, the module forwards them to a page which I wanted to skip if the member was already logged in.

    I will try your solution with the myFile.php as soon as I get chance.

    Thanks again,
    Ste

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •