2016-04-12, 23:49:06
(2016-04-12, 18:08:27)Bigin Wrote:(2016-04-12, 07:55:41)DesruX Wrote: I have managed to make it show two different texts based on login status, but I still cannot show the actual content of the page with the "get_page_content();" that is normally used:
Yes because $content is a global variable also used by GetSimple. To get it working you could change the line:
toPHP Code:$content = frontainer_get_content();
andPHP Code:$frontainersContent = frontainer_get_content();
toPHP Code:<?php echo $content; ?>
PHP Code:<?php echo $frontainersContent; ?>
That should do the trick.
Awsome! It worked like a charm. I now have a dedicated template: templateprotected.php that I can easily assign to pages in order to protect them.
Code:
<?php
if(!defined('IN_GS')){ die('you cannot load this page directly.'); }
if(!isset($_SESSION)){session_start();}
// Frontainer call
$frontainersContent = frontainer_get_content();
/****************************************************
*
* @File: templateprotected.php
* @Package: GetSimple
* @Action: Bootstrap3 for GetSimple CMS
*
*****************************************************/
?>
<?php include('header.inc.php'); ?>
<div class="row">
<div class="col-md-8">
<h1><?php get_page_title(); ?></h1>
<?php
if(!empty($_SESSION['loggedin'])) {
// This is the theme section for logged in users only
get_page_content();
echo '<p>Du er logget ind</p>';
//echo $frontainersContent;
}
else {
echo '<p>Du skal logge ind for at se denne side</p>';
echo '<li ';
if($id == LOGIN_SLUG || $id == RECOVERY_SLUG)
echo 'class="active"';
echo ' ><a href="'.htmlspecialchars(get_section_url(LOGIN_SLUG)).'">Login</a></li>';
}
?>
</div>
<div class="col-md-4">
<?php get_component('sidenav'); ?>
</div>
</div>
<?php include('footer.inc.php'); ?>
However I would be great if I could directly show the login prompt and upon entering credentials going directly to the page I was at instead of getting the accounts page.
Any suggestions on this?
BTW I have made a da_DA language file, just need to validate it, then I will place it here if you want to include it in the plugin.