1
Mythoss
Login and user menu
  • 2009/12/7 9:06

  • Mythoss

  • Just popping in

  • Posts: 5

  • Since: 2009/12/6


Hello! I am creating a web and for it I am designing the theme. Up to the moment I have not had any problem but now the difficult part comes.

I have seen that in some webs the login is not necessarily in a block but it can be in any part of the theme.

Since there my problem goes. I have managed to put the part of the login but once initiated I would like the session that this login was turning into a panel of the user (it already alone I can personalize it) The only thing that I need it is the code that does that when the session is initiated the login disappears and appears another thing.

Thanks!!!

PD: Sorry for my English, I'm Spanish (olé) xDD

2
ghia
Re: Login and user menu
  • 2009/12/7 10:34

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Quote:
I have seen that in some webs the login is not necessarily in a block but it can be in any part of the theme.
I assume, you did something, as is to see here (on XOOPS.org) at the top?
Many Morphogenesis based themes have this panel. See the theme repository for examples.
Quote:
I have managed to put the part of the login but once initiated I would like the session that this login was turning into a panel of the user (it already alone I can personalize it) The only thing that I need it is the code that does that when the session is initiated the login disappears and appears another thing.
Not clear what happens. Can you explain more? Show some code you added in your theme?

3
Mythoss
Re: Login and user menu
  • 2009/12/7 10:41

  • Mythoss

  • Just popping in

  • Posts: 5

  • Since: 2009/12/6


I want to do something like in xoops.org.
When you log in xoops.org appears a user menu (Logout | Welcome back Mythoss and more options)

But in my theme when i log in doesnt a appears a user menu because i don't know the code to change this part of the theme when an user is log in web...

Can you understand me now?

4
ghia
Re: Login and user menu
  • 2009/12/7 10:59

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Add something like this:
<{if xoops_isuser}>
Welcome back, <{xoops_uname}>!
... list 
of menu icons with links 
<{/if}>
Examples of this kind of code are in some themes.

5
Mythoss
Re: Login and user menu
  • 2009/12/7 11:06

  • Mythoss

  • Just popping in

  • Posts: 5

  • Since: 2009/12/6


Thank, i think that it's the thing which i'm looking for.

<[code of the form to log in]>

<{if 
xoops_isuser}>
Welcome back, <{xoops_uname}>!
... list 
of menu icons with links 
<{/if}>


When an user will log in the website, will it disappear the form?

6
ghia
Re: Login and user menu
  • 2009/12/7 11:13

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Put the form after an <{else}> or <{if !xoops_isuser}>

7
Mythoss
Re: Login and user menu
  • 2009/12/7 14:21

  • Mythoss

  • Just popping in

  • Posts: 5

  • Since: 2009/12/6


<{if xoops_isuser}>
Welcome back, <{xoops_uname}>!
... list 
of menu icons with links 
<{/if}>
<{else}>
<[
code of the form to log in]>


I mean...
<{if xoops_isuser}>          
<
b>Usuario:</b><br />     
<
input type="text" name="uname" size="12" value="<{$block.unamevalue}>" maxlength="25" /><br />     <b>Contraseña:</b><br /> 
<
input type="password" name="pass" size="12" maxlength="32" /><br />    
<{if 
$block.rememberme }>     <input type="checkbox" name="rememberme" value="On" /><{$block.lang_rememberme}><br />     
<{/if}>     
<
input type="hidden" name="xoops_redirect" value="<{$xoops_requesturi}>" />     
<
input type="hidden" name="op" value="login" />     <input type="submit" value="Conectarse" /><br />     <{$block.sslloginlink}> </form>      
<{else}>     
Welcome back!     ... list of menu icons with links    
<{/if}>


8
ghia
Re: Login and user menu
  • 2009/12/7 17:04

  • ghia

  • Community Support Member

  • Posts: 4953

  • Since: 2008/7/3 1


Get also once into the Smarty documentation (on the Smarty Site).

It is
<{if condition}> part to do when it is true <{else}> part to do when it is false <{/if}>

<{if xoops_isuser}> is true when a user is logged in.
In that case you want to say helo and show the menu, else showing the login form.

Login

Who's Online

98 user(s) are online (73 user(s) are browsing Support Forums)


Members: 0


Guests: 98


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Apr 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits