- Moderated by:
- Support
-
- rank:
-
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 -
- rank:
-
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 -
- rank:
-
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. -
- rank:
-
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&module=NS-LostPassword">Log in Problems?</a><br> 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 -
- rank:
-
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 ... -
- rank:
-
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... -
- rank:
-
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&module=NS-LostPassword">Log in Problems?</a><br> New User? <a href="user.php">Sign Up!</a>
<?php
}
?>
PS: thanks Nate.. for pointing that out..
--
http://www.invalidresponse.com -
- rank:
-
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>
-
- rank:
-
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... -
- rank:
-
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&module=NS-LostPassword">Log in Problems?</a><br> 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: -
- rank:
-
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...
