Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Frontainer
#12
(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:

PHP Code:
$content frontainer_get_content(); 
to

PHP Code:
$frontainersContent frontainer_get_content(); 
and

PHP Code:
<?php echo $content?>
to

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'); ?>
When a user is not logged in then the page shows a message telling this page needs login and I have then taken and referenced the login_slug providing the link "Login" clicking that then returns the login page. When I login i get the accounts_slug. I can now click and access the original page.

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.
Reply


Messages In This Thread
Frontainer - by Bigin - 2016-02-22, 23:48:10
RE: Frontainer - by Tzvook - 2016-02-24, 07:20:45
RE: Frontainer - by Bigin - 2016-02-24, 07:25:28
RE: Frontainer - by Tzvook - 2016-02-24, 07:39:28
RE: Frontainer - by Bigin - 2016-02-24, 07:50:04
RE: Frontainer - by Tzvook - 2016-02-24, 07:54:03
RE: Frontainer - by Bigin - 2016-02-24, 07:59:36
RE: Frontainer - by DesruX - 2016-04-12, 07:55:41
RE: Frontainer - by Bigin - 2016-04-12, 17:41:37
RE: Frontainer - by Bigin - 2016-04-13, 00:17:33
RE: Frontainer - by DesruX - 2016-04-13, 00:36:22
RE: Frontainer - by Bigin - 2016-04-13, 01:37:49
RE: Frontainer - by DesruX - 2016-04-13, 04:24:49
RE: Frontainer - by Bigin - 2016-04-13, 05:25:05
RE: Frontainer - by DesruX - 2016-04-13, 05:32:45
RE: Frontainer - by Bigin - 2016-04-13, 05:51:48
RE: Frontainer - by DesruX - 2016-04-15, 06:45:34
RE: Frontainer - by Bigin - 2016-04-15, 19:39:53
RE: Frontainer - by Bigin - 2016-04-12, 18:08:27
RE: Frontainer - by DesruX - 2016-04-12, 23:49:06
RE: Frontainer - by Bigin - 2016-04-13, 00:20:00
RE: Frontainer - by DesruX - 2016-04-13, 00:31:16
RE: Frontainer - by Bigin - 2016-04-12, 20:14:09
RE: Frontainer - by Bigin - 2016-04-15, 20:12:41
RE: Frontainer - by jeckyl - 2017-02-07, 01:55:19
RE: Frontainer - by Bigin - 2017-02-07, 03:58:00
RE: Frontainer - by jeckyl - 2017-02-07, 04:36:08
RE: Frontainer - by Bigin - 2017-02-07, 05:16:52
RE: Frontainer - by jeckyl - 2017-02-07, 06:13:24
RE: Frontainer - by Bigin - 2017-02-07, 08:49:33
RE: Frontainer - by jeckyl - 2017-02-07, 09:14:22
RE: Frontainer - by nicco - 2017-05-12, 19:26:45
RE: Frontainer - by Bigin - 2017-05-12, 20:38:15
RE: Frontainer - by nicco - 2017-05-12, 23:28:17
RE: Frontainer - by Bigin - 2017-05-13, 00:58:52
RE: Frontainer - by nicco - 2017-05-13, 02:11:24
RE: Frontainer - by Bigin - 2017-05-13, 02:51:45
RE: Frontainer - by nicco - 2017-05-13, 03:04:30
RE: Frontainer - by Bigin - 2017-05-13, 03:09:48
RE: Frontainer - by Carlos - 2017-05-13, 03:19:09
RE: Frontainer - by Bigin - 2017-05-13, 03:28:10
RE: Frontainer - by Stéphane - 2020-04-13, 03:40:16
RE: Frontainer - by Bigin - 2020-04-13, 04:16:35
RE: Frontainer - by Stéphane - 2020-04-13, 08:02:32
RE: Frontainer - by Bigin - 2020-04-13, 20:32:51
RE: Frontainer - by Stéphane - 2020-04-13, 22:46:48



Users browsing this thread: 1 Guest(s)