Zikula: A Flexible Open Source Content Management System
home | forum | contact us

Dizkus

Goto page: 1 - 2 [+1]

Bottom
Placing the login block on the page header
  • Posted: 28.05.2004, 02:25
     
    thevdo
    rank:
    Softmore Softmore
    registered:
     May 2004
    Status:
    offline
    last visit:
    02.05.05
    Posts:
    71
    Yo
    Wondering if anyone knows how to have a login form based on the core login module that usually appears in a block to users who are either unregistered or not logged in to appear in the header of a post nuke site as opposed to the default block setup. The postnuke.com site is a real example of what I mean, with the login form placed in the top section of the theme. I have placed the code based on the login block into my main theme but once logged in it stays where it was before I logged in. I tried setting permissions for the login block, but its not really a block now as its just a form. So anyone have any ideas?

    thanks for your time
  • Posted: 28.05.2004, 02:43
     
    InvalidResponse
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    21.10.07
    Posts:
    2423
    use this to encase the login code:

    if(!pnUserLoggedIn()){

    <-- login code -->

    }


    -IR

    --
    http://www.invalidresponse.com
  • Posted: 28.05.2004, 02:53
     
    thevdo
    rank:
    Softmore Softmore
    registered:
     May 2004
    Status:
    offline
    last visit:
    02.05.05
    Posts:
    71
    Yo 'invalid response' I put the code into the specific cell, such as this:if(!pnUserLoggedIn()){
    <form action="user.php" method="post">Username<input type="text" name="uname" size="12" maxlength="20" />
    Password<input type="password" name="pass" size="12" maxlength="20" /><input type="checkbox" value="1" name="rememberme" />
    <input type="hidden" name="module" value="NS-User" /><input type="hidden" name="op" value="login" />
    <input type="hidden" name="url" value="/index.php" /><input type="submit" value="Login" />
    Log in Problems?
     New User? Sign Up!</form>}
    But the form is still visible once logged in. What am I doing wrong? Thanks for the help.
  • Posted: 28.05.2004, 05:53
     
    InvalidResponse
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    21.10.07
    Posts:
    2423
    ..you'll need to wrap the PHP around the HTML..

    Code

    <?php
    if(pnUserLoggedIn()){
    ?>
    <form action="user.php" method="post">Username<input type="text" name="uname" size="12" maxlength="20">
    Password<input type="password" name="pass" size="12" maxlength="20"><input type="checkbox" value="1" name="rememberme" />
    <input type="hidden" name="module" value="NS-User" /><input type="hidden" name="op" value="login" />
    <input type="hidden" name="url" value="/index.php" /><input type="submit" value="Login" />
    </form>
    <a href="user.php?op=lostpassscreen&amp;module=NS-LostPassword">Log in Problems?</a><br>&nbsp;New User? <a href="user.php">Sign Up!</a>
    <?php
    }
    ?>

    ..should work from there.. if not.. check your servers error log..

    enjoy!
    -IR

    --
    http://www.invalidresponse.com
  • Posted: 28.05.2004, 16:37
     
    thevdo
    rank:
    Softmore Softmore
    registered:
     May 2004
    Status:
    offline
    last visit:
    02.05.05
    Posts:
    71
    I have implemented the code and it seems that, when the user is not logged in the form does not appear but when they do it does appear which is irrelevent. Is the solution not the change 'pnsureLoggedIn to something like 'pnUserLoggedOut' I tried this but it produced an error ...
  • Posted: 28.05.2004, 20:48
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    No, but you can add a NOT (exclamation point) to the from of the function. Change:

    Code

    if (pnUserLoggedIn()

    to:

    Code

    if (!pnUserLoggedIn()


    See the post below for more tweaks:
    many F.A.Tweaks">"VersaTheme" Starter…e w/many F.A.Tweaks

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Posted: 28.05.2004, 21:55
     
    InvalidResponse
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    21.10.07
    Posts:
    2423
    ..yeah.. typo.. should be an exclamation point.

    Code

    <?php
    if(!pnUserLoggedIn()){
    ?>
    <form action="user.php" method="post">Username<input type="text" name="uname" size="12" maxlength="20">
    Password<input type="password" name="pass" size="12" maxlength="20"><input type="checkbox" value="1" name="rememberme" />
    <input type="hidden" name="module" value="NS-User" /><input type="hidden" name="op" value="login" />
    <input type="hidden" name="url" value="/index.php" /><input type="submit" value="Login" />
    </form>
    <a href="user.php?op=lostpassscreen&amp;module=NS-LostPassword">Log in Problems?</a><br>&nbsp;New User? <a href="user.php">Sign Up!</a>
    <?php
    }
    ?>


    PS: thanks Nate.. for pointing that out..

    --
    http://www.invalidresponse.com
  • Posted: 19.06.2004, 17:00
     
    delcks
    rank:
    Freshman Freshman
    registered:
     April 2004
    Status:
    offline
    last visit:
    19.06.04
    Posts:
    14
    Hello, I changed it to

    Quote

    if(!pnUserLoggedIn()){
    ?>
    <form action="user.php" method="post">Username <input type="text" name="uname" size="12" maxlength="20" />
    Password <input type="password" name="pass" size="12" maxlength="20" /><input type="checkbox" value="1" name="rememberme" />
    <input type="hidden" name="module" value="NS-User" /><input type="hidden" name="op" value="login" />
    <input type="submit" value="Login" />
    Log in Problems? New User? Sign Up!
    </form>
  • Posted: 17.07.2004, 00:46
     
    wls460
    rank:
    Freshman Freshman
    registered:
     July 2004
    Status:
    offline
    last visit:
    25.02.05
    Posts:
    24
    I would also like to do this but where do I place it in the code and what file? Using PostNuke theme.
  • Posted: 17.07.2004, 12:09
     
    delcks
    rank:
    Freshman Freshman
    registered:
     April 2004
    Status:
    offline
    last visit:
    19.06.04
    Posts:
    14
    You have to place it in the theme.php file in your theme directory..

    Goodluck

    wls460

    I would also like to do this but where do I place it in the code and what file? Using PostNuke theme.
  • Posted: 17.07.2004, 14:41
     
    wls460
    rank:
    Freshman Freshman
    registered:
     July 2004
    Status:
    offline
    last visit:
    25.02.05
    Posts:
    24
    I had tried that and wherever I put it I get a parse error :x .
  • Posted: 17.07.2004, 18:28
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    The code is fine - it's about mixing php/html correctly etc... make sure you're doing it right...

    Theme Guide: Tips fo…g and starter theme

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Posted: 09.08.2004, 06:53
     
    grafixwerk
    rank:
    Freshman Freshman
    registered:
     May 2004
    Status:
    offline
    last visit:
    09.08.04
    Posts:
    14
    I've implemented the code below...

    InvalidResponse


    Code

    <?php
    if(!pnUserLoggedIn()){
    ?>
    <form action="user.php" method="post">Username<input type="text" name="uname" size="12" maxlength="20">
    Password<input type="password" name="pass" size="12" maxlength="20"><input type="checkbox" value="1" name="rememberme" />
    <input type="hidden" name="module" value="NS-User" /><input type="hidden" name="op" value="login" />
    <input type="hidden" name="url" value="/index.php" /><input type="submit" value="Login" />
    </form>
    <a href="user.php?op=lostpassscreen&amp;module=NS-LostPassword">Log in Problems?</a><br>&nbsp;New User? <a href="user.php">Sign Up!</a>
    <?php
    }
    ?>


    But, the "Login" appears above the header not in it? I'm using atPN-Blue. Is there something else I need to do... It seems to be working otherwise! :shock:
  • Posted: 09.08.2004, 07:09
     
    nate_02631
    rank:
    Professional Professional
    registered:
     September 2003
    Status:
    offline
    last visit:
    11.04.08
    Posts:
    3055
    It's just HTML, basically... put the form/php output code where it should appear in your theme's HTML...

    --
    Get PhotoGallery, PayPalCart, Dynamenu, Enhanced Blocks & other mods

    Cape Cod Travel Info...
  • Posted: 09.08.2004, 19:07
     
    thevdo
    rank:
    Softmore Softmore
    registered:
     May 2004
    Status:
    offline
    last visit:
    02.05.05
    Posts:
    71
    Yo Graffixwerk, try redefining the 'form' tag in CSS. Like this:

    Code

    form {
        display:inline;
    }

Goto page: 1 - 2 [+1]

Extensions Moderation

Main Menu

Extensions Database

Documentation

Development

Login

Donate to Zikula