Forums / Cotonti / Skins / login fields in header and index

pieter
#1 2010-09-04 14:10
Hello guys,

Standard template the login is in an other screen.

Here at cotonti it is in the header.
How can we do this.
Can it also be done in the index?

Before we needed the leetlogin

Thx
... can we help you ...
Kort
#2 2010-09-04 14:25
<ul>
<!-- BEGIN: GUEST -->
	<form name="login" action="{HEADER_GUEST_SEND}" method="post">
	<li>{PHP.skinlang.header.Welcome}</li>
	<li><input type="text" class="tinput" name="rusername" maxlength="32" value="{PHP.L.User}" onfocus="if(this.value=='{PHP.L.User}') this.value=''"
onblur="if(this.value=='') this.value='{PHP.L.User}'" /></li>
	<li><input type="password" class="tinput" name="rpassword" maxlength="32" value="{PHP.L.Password}" onfocus="if(this.value=='{PHP.L.Password}') this.value=''"
onblur="if(this.value=='') this.value='{PHP.L.Password}'"/></li>
	<li><label><input type="checkbox" name="rremember" />{PHP.skinlang.usersauth.Rememberme}</label></li>
	<li><input type="submit" class="tinput" value="{PHP.L.Login}" /></li>
	<li><a href="users.php?m=register">{PHP.L.Register}</a></li>
	<li><a href="plug.php?e=passrecover">{PHP.skinlang.usersauth.Lostpassword}</a></li>
	</form>
<!-- END: GUEST -->
<!-- BEGIN: USER -->
	<li>{PHP.L.User}: {PHP.usr.name}</li>
<!-- IF {PHP.usr.profile.user_avatar} -->
	<li><img src="{PHP.usr.profile.user_avatar}" alt="{PHP.L.Avatar}" /></li>
<!-- ELSE -->
	<li><img src="datas/defaultav/blank.png" alt="{PHP.L.Avatar}" /></li>
<!-- ENDIF -->
<!-- IF {PHP.usr.isadmin} -->
	<li><a href="admin.php" title="{PHP.L.Adminpanel}">{PHP.L.Adminpanel}</a></li>
<!-- ENDIF -->
	<li><a href="users.php?m=profile" title="{PHP.L.Profile}">{PHP.L.Profile}</a></li>
	<li><a href="users.php" title="{PHP.L.Users}">{PHP.L.Users}</a></li>
	<li><a href="pfs.php" title="{PHP.L.PFS}">{PHP.L.PFS}</a></li>
	<li><a href="pm.php" title="{PHP.L.Private_Messages}">{PHP.L.PM}</a></li>
	<li><a href="{PHP.out.loginout_url}" title="{PHP.L.Logout}">{PHP.L.Logout}</a></li>
<!-- END: USER -->
</ul>
Placing login form in index.tpl requires
<form name="login" action="{PHP.cfg.mainurl}/users.php?m=auth&a=check" method="post">
Leetlogin can be discarded in Cotonti.
SED.by - создание сайтов, разработка плагинов и тем для Котонти
pieter
#3 2010-09-04 14:49
thx
... can we help you ...
Kort
#4 2010-09-04 15:10
It's time we started Cotonti knowledge base to record most commonly requested stuff.
SED.by - создание сайтов, разработка плагинов и тем для Котонти
pieter
#5 2010-09-04 19:50
Good idea. Maybe install a Cotonti-pedia
... can we help you ...
fraze
#6 2010-09-05 17:32
what <ul> style do you use for the login box on cotonti.com? cos if you add that code into the current sed-light header.tpl you dont get an inline list, just standard bullet-points.

thanks :)
pieter
#7 2010-09-05 18:53
You can add:

#header #userBar .text ul { padding:0; margin:0; }
#header #userBar .text li { display:inline; list-style:none; padding:0; margin:0; }
... can we help you ...
fraze
#8 2010-09-05 22:24
hmm - i've installed a fresh version of 0.6.10 the the header code doesnt work...

is there anything i need to change elsewhere?
zboy812
#9 2010-09-28 07:47
<!-- BEGIN: GUEST -->
not working in index. now how to do?
pieter
#10 2010-09-28 15:53
you can use:

<!-- IF {PHP.usr.id} < 1 -->
CODE YOU WANT TO BE VIEWED BY GUESTS
<!-- ENDIF -->
... can we help you ...
zboy812
#11 2010-09-29 03:38
so awesome, thanx!
Franco
#12 2011-07-24 23:47

i know it's an old bump, but appartently the <!-- BEGIN: USER --> isn't working either in the index, and if i use <!-- IF {PHP.usr.id} > 1 --> or <!-- IF {PHP.usr.maingrp} > 1 --> it has some kind of conflict with the IF of the avatar and admin panel