memeberpage

Third Party Plugins to CMSimple - how to install, use and create plugins

Moderator: Tata

Post Reply
fesselix
Posts: 30
Joined: Tue Dec 22, 2009 2:00 pm
Location: Germany

memeberpage

Post by fesselix » Fri Jan 08, 2010 11:12 am

Hello,

I would like to show the" login" for the memberpages on the top menu point for the memberpage. But if logged in, I would like to show this and the logout information in a separate area of the page which is always visible as long as the member is logged in. But if logged out this "area" should disappear.

I think there must be a possibility to do that, any ideas? Which are the variables which control the login and logout information which is shown?

Regards

Fesselix

Martin
Posts: 346
Joined: Thu Oct 23, 2008 11:57 am
Contact:

Re: memeberpage

Post by Martin » Fri Jan 08, 2010 12:36 pm

Hi fesselix,

I have done this once by putting this

Code: Select all

<?php
      if(isset($_SESSION['Name'],$_SESSION['sessionnr'])) {
             echo '<form action="'.$sn.'?'.$su.'" method="post">'
            .tag('input type="hidden" name="function" value="memberslogout"')
            .tag('input type="submit" class="member_button" value="Abmelden"')
            .'</form>';
      }
?>
into the template. Hope it works.

Martin

Gert
Posts: 3078
Joined: Fri May 30, 2008 4:53 pm
Location: Berlin
Contact:

Re: memeberpage

Post by Gert » Fri Jan 08, 2010 2:43 pm

Hallo,

I have memberpages 2.1 in progress since a long time, but I have so much work with CMSimple_XH, I cant make it ready for publishing next time.

There will be a new function:

Code: Select all

<?php echo memberswarning();?>
You can insert this function anywhere in the Template and style it with div.mpp_loggedin_warning in the css-file of memberpages. Here you can see it:

http://www.cmsimple-xh.de/xhtest/ Go to "memberpages" and login with: user1 / pass1

It's a test-installation, don't wonder ;) Some pages have other templates, there you can't see the warning, of course.

That's the code:

Code: Select all

function memberswarning(){global $sn,$su,$plugin_cf,$plugin_tx,$tx;$plugin=basename(dirname(__FILE__),"/");
if(isset($_SESSION['Name'],$_SESSION['sessionnr'])|| se('sessionnr') == session_id()) {
$o = '<div class="mpp_loggedin_warning">' . $plugin_tx[$plugin]['loggedin'].'<form action="'.$sn.'?'.$su.'" method="post">'.tag('input type="hidden" name="function" value="memberslogout"').tag('input type="submit" class="mpp_member_button" value="'.$plugin_tx[$plugin]['logout'].'"').'</form>' . '</div>';}return $o;
 
Insert it in the index.php of memberpages behind the end of "function memberslogin()", I think it's ca. line 178. Then add the class div.mpp_loggedin_warning to the css file of memberpages.

Update: you can change in the language-files:

Code: Select all

$plugin_tx['memberpages']['loggedin']="the text"; 
Gert Ebersbach | CMSimple | Templates - Plugins - Services

Post Reply