DataLife Engine English Support Site » DatalifeEngine Add-ons » Two stage {login}: {login_if} and {login_else}
Welcome,. Enter Username, or register.
Welcome,. Enter Username, or register.
ApadanaGroup's Hosting Services available now with Unbelievable LOW
PRICES,
Unlimited SPACE AND Unlimited Transfer ....Check it out !!!
http://unlimitpackage.net/
Two stage {login}: {login_if} and {login_else}
In index.php place with the other $tpl->set tags,
In engine/init.php find:
Add after:
Make a new file called login_if.tpl and add to it:
Upload to the template folder you are currently using, the one with the the login.tpl file.
Make another new file called login_else.tpl:
Upload to the template folder also. Now instead of:
in the template you will use:
Thus you can have login in a top module, after the person logs in, the menu can be shown in another place, in another module or whatever.
You have two seperate tags now, the 'login' and then the 'login menu' after. See what you can do with it.
$tpl->set('{login_if}',$login_panel_if);
$tpl->set('{login_else}',$login_panel_else);
$tpl->set('{login_else}',$login_panel_else);
In engine/init.php find:
include_once $tpl->dir.'/login.tpl';
Add after:
include_once $tpl->dir.'/login_if.tpl';
include_once $tpl->dir.'/login_else.tpl';
include_once $tpl->dir.'/login_else.tpl';
Make a new file called login_if.tpl and add to it:
<?
if ($is_logged == TRUE){
$login_panel_if = <<<HTML
<div class="copy" style="padding: 7px 0px 0px 10px;">Welcome, <b>{$member_id['name']}</b>!
HTML;
if ($user_group[$member_id['user_group']]['allow_admin']) {
$login_panel_if .= <<<HTML
<a href="{$adminlink}" target="_blank">AdminCP</a>
HTML;
}
$login_panel_if .= <<<HTML
<a href="{$link_profile}">Profile</a>
<a href="{$link_pm}">Messages ({$member_id['pm_unread']} | {$member_id['pm_all']})</a>
<a href="{$link_favorites}">Favorites</a>
<a href="{$link_addnews}">Add News</a>
<a href="{$link_newposts}">Newposts</a>
<a href="{$link_logout}"><b>Logout</b></a></div>
HTML;
}
?>
if ($is_logged == TRUE){
$login_panel_if = <<<HTML
<div class="copy" style="padding: 7px 0px 0px 10px;">Welcome, <b>{$member_id['name']}</b>!
HTML;
if ($user_group[$member_id['user_group']]['allow_admin']) {
$login_panel_if .= <<<HTML
<a href="{$adminlink}" target="_blank">AdminCP</a>
HTML;
}
$login_panel_if .= <<<HTML
<a href="{$link_profile}">Profile</a>
<a href="{$link_pm}">Messages ({$member_id['pm_unread']} | {$member_id['pm_all']})</a>
<a href="{$link_favorites}">Favorites</a>
<a href="{$link_addnews}">Add News</a>
<a href="{$link_newposts}">Newposts</a>
<a href="{$link_logout}"><b>Logout</b></a></div>
HTML;
}
?>
Upload to the template folder you are currently using, the one with the the login.tpl file.
Make another new file called login_else.tpl:
<?
if ($is_logged == TRUE){
}
else {
$login_panel_else = <<<HTML
<div style="padding-top:5px; padding-left:0px;">
<table width="150" class="stext" border="0"><form method=post>
<tr align="left" valign="middle">
<td width="52" height="20" align="right" style="font-size:11px;">Name </td>
<td height="20" align="right"><input type="text" name="login_name" style="width:103px; height:17px; font-family:tahoma; font-size:11px; border:1px solid #E0E0E0;"></td>
</tr>
<tr align="left" valign="middle">
<td width="52" height="20" align="right" style="font-size:11px;">Password </td>
<td height="20" align="right"><input type="password" name="login_password" style="width:103px; height:17px; font-family:tahoma; font-size:11px; border:1px solid #E0E0E0;"></td>
</tr>
<tr align="left" valign="middle">
<td width="58" height="20" align="right"> </td>
<td height="30" align="left">
<input name="image" type="image" src="/templates/sp3_2/images/send.png" alt="ok" title="ok">
<input name="login" type="hidden" id="login" value="submit">
</td>
</tr></form>
</table>
</div><div class="slink" style="padding: 0px 5px 5px 50px;"><a href="{$link_regist}">Register!</a><br><a href="{$link_lost}">Lost pass?</a></div>
HTML;
}
?>
if ($is_logged == TRUE){
}
else {
$login_panel_else = <<<HTML
<div style="padding-top:5px; padding-left:0px;">
<table width="150" class="stext" border="0"><form method=post>
<tr align="left" valign="middle">
<td width="52" height="20" align="right" style="font-size:11px;">Name </td>
<td height="20" align="right"><input type="text" name="login_name" style="width:103px; height:17px; font-family:tahoma; font-size:11px; border:1px solid #E0E0E0;"></td>
</tr>
<tr align="left" valign="middle">
<td width="52" height="20" align="right" style="font-size:11px;">Password </td>
<td height="20" align="right"><input type="password" name="login_password" style="width:103px; height:17px; font-family:tahoma; font-size:11px; border:1px solid #E0E0E0;"></td>
</tr>
<tr align="left" valign="middle">
<td width="58" height="20" align="right"> </td>
<td height="30" align="left">
<input name="image" type="image" src="/templates/sp3_2/images/send.png" alt="ok" title="ok">
<input name="login" type="hidden" id="login" value="submit">
</td>
</tr></form>
</table>
</div><div class="slink" style="padding: 0px 5px 5px 50px;"><a href="{$link_regist}">Register!</a><br><a href="{$link_lost}">Lost pass?</a></div>
HTML;
}
?>
Upload to the template folder also. Now instead of:
{login}
in the template you will use:
{login_if} or {login_else}
Thus you can have login in a top module, after the person logs in, the menu can be shown in another place, in another module or whatever.
You have two seperate tags now, the 'login' and then the 'login menu' after. See what you can do with it.
Your are currently a guest on this site. Please click here to register
- views: 874
-
Print
|
|
| |
#1
asneet
asneet
Joined: 3.05.2008 | ICQ: --



Users: 0
User Group: Member