Frontainer's current version: 1.0
What is Frontainer
Frontainer is a powerful frontend user management plugin based on ItemManager for GetSimple-CMS and perfect to generate password protected, private areas on the GetSimple website. Frontainer is a simple and useful tool for plugin developers, provides a good basis for further development of user management based scripts or e-commerce plugins, for instance.
Application example: [ SimpleForum theme ]
Frontainer Features
Requirements
To run Frontainer on your GetSimple website just needs a number of things:
1. ItemManager 2.3+ plugin must be installed and configured
2. Users category must have been created in ItemManager (see bellow: Creating ItemManager's Users Category)
3. Configured mail server to send and receive emails from your GetSimple site
Installation
Creating ItemManager's Users category
Preparing your theme for using Frontainer is really easy. Open template.php file in your editor and add the following lines to the very beginning (first line).
After that you’ll need to add a single line anywhere within the body of your template.php file for the output of Frontier’s contents:
To access Frontainers sections and to switch between Frontainers pages you can use following navigation structure for example:
And that is all you need to do to run Frontainer!
User's private area
After a successful login the user is redirected by default to www.your_site.com/accounts/ page in the users private section.
To modify this private area, just edit '/plugins/frontainer/loggedin.php' file within the 'build_user_area()' function and put there any content you like, after: ////////// Your can put your content here //////////// comment. You can delete all lines subsequent to that code
Using Frontainer session variables
To check whether the user is logged use code:
You can get the logged in users ID on this way:
Have fun!
What is Frontainer
Frontainer is a powerful frontend user management plugin based on ItemManager for GetSimple-CMS and perfect to generate password protected, private areas on the GetSimple website. Frontainer is a simple and useful tool for plugin developers, provides a good basis for further development of user management based scripts or e-commerce plugins, for instance.
Application example: [ SimpleForum theme ]
Frontainer Features
- Frontend login form
- Registration and the lost password form
- Fully customizable HTML, CSS
- Fully scalable and extendable functionality
- Multilingual (currently English language file included)
Requirements
To run Frontainer on your GetSimple website just needs a number of things:
1. ItemManager 2.3+ plugin must be installed and configured
2. Users category must have been created in ItemManager (see bellow: Creating ItemManager's Users Category)
3. Configured mail server to send and receive emails from your GetSimple site
Installation
- First of, create following pages in admin, these pages are used by Frontainer for integrate corresponding functionality.
- Login
- Signup
- Accounts
- Logout
- Recovery
- Activate
- Login
- Install/activate Frontainer v. 1.0 from GitHub or Extend
- Go to Plugins > Frontainer settings and put there your eMail data (used by Frontainer to build the email-content for user authentification)
Creating ItemManager's Users category
- Let’s go to ItemManager’s tab > Categories and create there a category named Users:
- After that go to ItemManager’s Fields menu select Users category and click Reload, then create following fields for it:
- Name: email, Label: eMail (or your choice), Type: Text field
- Name: password, Label: Password (or your choice), Type: Password
- Name: recovery, Label: Recovery password (or your choice), Type: Hidden field
- Name: email, Label: eMail (or your choice), Type: Text field
Preparing your theme for using Frontainer is really easy. Open template.php file in your editor and add the following lines to the very beginning (first line).
Code:
<?php
if(!defined('IN_GS')) die();
if(!isset($_SESSION)){session_start();}
$fnavi = array(
'login' => null,
'signup' => null,
'accounts' => null,
'logout' => null,
'recovery' => null
);
$fcontent = '';
if(function_exists('frontainer_get_content')) {
$fcontent = frontainer_get_content();
$fnavi['login'] = htmlspecialchars(get_section_url(LOGIN_SLUG));
$fnavi['signup'] = htmlspecialchars(get_section_url(SIGNUP_SLUG));
$fnavi['accounts'] = htmlspecialchars(get_section_url(ACCOUNTS_SLUG));
$fnavi['logout'] = htmlspecialchars(get_section_url(LOGOUT_SLUG));
$fnavi['recovery'] = htmlspecialchars(get_section_url(RECOVERY_SLUG));
}
?>
After that you’ll need to add a single line anywhere within the body of your template.php file for the output of Frontier’s contents:
Code:
<?php echo $fcontent; ?>
To access Frontainers sections and to switch between Frontainers pages you can use following navigation structure for example:
Code:
<ul class="nav navbar-nav">
<li><a href="<?php get_site_url(); ?>forum/">Forum</a></li>
<?php
if(!isset($_SESSION['loggedin'])) {
echo '<li ';
if($id == $fnavi['login'] || $id == $fnavi['recovery'])
echo 'class="active"';
echo ' ><a href="'.$fnavi['login'].'">Login</a></li>';
echo '<li ';
if($id == $fnavi['signup'])
echo 'class="active"';
echo ' ><a href="'.$fnavi['signup'].'">Sign up</a></li>';
} else {
echo '<li ';
if($id == $fnavi['accounts'])
echo 'class="active"';
echo ' ><a href="'.$fnavi['accounts'].'">Private</a></li>';
echo '<li ';
if($id == $fnavi['logout'])
echo 'class="active"';
echo ' ><a href="'.$fnavi['logout'].'">Logout</a></li>';
}
?>
</ul>
And that is all you need to do to run Frontainer!
User's private area
After a successful login the user is redirected by default to www.your_site.com/accounts/ page in the users private section.
To modify this private area, just edit '/plugins/frontainer/loggedin.php' file within the 'build_user_area()' function and put there any content you like, after: ////////// Your can put your content here //////////// comment. You can delete all lines subsequent to that code
Using Frontainer session variables
To check whether the user is logged use code:
Code:
<?php
if(!empty($_SESSION['loggedin'])) {
// This is the theme section for logged in users only
}
?>
You can get the logged in users ID on this way:
Code:
<?php
$user_id = (!empty($_SESSION['userid']) ? (int) $_SESSION['userid'] : false);
?>
Have fun!