SimplePortal

Support => English Support => Topic started by: mez on January 18, 2011, 06:35:03 AM

Title: Registration Block (How to)
Post by: mez on January 18, 2011, 06:35:03 AM
How to create a registration block on your home page.

NOTE: This should work for "Standalone" and "Front Page" modes, so first up - make sure you are set to one or the other in Admin > Simple Portal > Configuration > General Settings then follow the steps below.


1) Go to Admin > Members > Registration > Registration Agreement and uncheck "Show and require agreement letter when registering", then save it.
2) Go to Admin > Simple Portal > Blocks > Add Block and choose "Custom PHP", then name the block "Test" for now.
3) Set the permissions for "One Membergroup" and check "Guests" under [Select permission for each group]
4) Copy this code into the "Custom PHP" box:

Code: [Select]
<?php
global $user_info;

if (
$user_info['is_guest']) {
    echo 
'
        <script language="JavaScript">
            document.location.href = "http://www.yoursite.com/yourforum/index.php?action=register";
        </script>
    '
;
}
?>


* be sure to replace your site and yourforum with the location of your forum etc.

5) Check "No title" and "No Body" in the style options.
6) Now save the block.
7) Now decorate your Registration page by adding other blocks to it (via Display Options > Advanced Options > Select Actions > Register).

OPTIONAL: If you know how to edit your SQL tables, open settings and scroll down to "logout_redirect_url" and copy the same link into that field (http://www.yoursite.com/yourforum/index.php?action=register)


:)
SimplePortal 2.3.8 © 2008-2024, SimplePortal