DataLife Engine English Support Site » DatalifeEngine Add-ons » Two stage {login}: {login_if} and {login_else}
Welcome,. Enter Username, or register.
Login: password:  



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}

Author Tak, Category DatalifeEngine Add-ons31 August 2006.
In index.php place with the other $tpl->set tags,

$tpl->set('{login_if}',$login_panel_if);
$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';


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;

}
?>


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;
}
?>


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
    • 51
     (Votes #: 2)
  
  • Weed links in the static page
  • How to translate the calendar all versions
  • The gallery mod
  • Online Module 2.2
  • Readmore (For News) with AJAX





  • User Group: Member
    what this do in dle i don't understand the benefit of it?
    Joined: 3.05.2008 | ICQ: --

    Information

    Members of Guest cannot leave comments.


    Your Ad Here

    Vote

    Datalife Engine is
    Excellent
    Good
    Fair
    Poor
    Bad

    Get Chitika eMiniMalls

    The information

    Online Now:
    Users: 0
    Not Online.

    Robots: 2
    GooglebotWebAlta Crawler

    Guests: 10
    Total: 12

    Last Online Users:
    Users: 20
    abdouaniba admin7
    alnoah bethuy
    bitto dato_var4
    funning17 g-mic
    javad kyoko
    MaCeLMp4 Magid
    Motor name_less
    pakio sanalreis
    sma_eslami topsoftware
    whosthis.ee zigmuntt

    Tgs Cloud

    4support, Added, After, Appointmentmodule, BBcode, CHMOD, Cache, Clear, Cropping, Datalifeengine, Description, Dle, EMail, ENGINE_DIRincparseclassphp, Length, Uberat, access, according, adding, additional, administrator, attention, categories, certain, changes, closing, comments, corrected, creation, directly, domain SUPPORT, editing, enginecachesystemStart, errors, everything, files, folder, forum, friends, indispensable, install, installation, installphp, issue, itsinstructions, language, large, listof, moved, myFAQ, notice, opening, opublikovanye, patterns, player, possible, published, question, received, record, referring, registration, removal, responses, roach, script, server, submit, support, system, titla, upgrade, useful, users, using, version, versions, visitors, which, worry

    To show all tags