Welcome to Geeklog, Anonymous Saturday, November 30 2024 @ 02:46 am EST
Geeklog Forums
Login / Password on a static page.
Status: offline
Blaine
Forum User
Moderator
Registered: 07/16/02
Posts: 1232
Location:Canada
Uffe,
This is similar to how I have my site setup - with the login/logout in the header.
I order to accomplish, this you need to be able to change the variables used by COM_siteHeader and the template file header.thtml.
The header.thtml file is the only template file that you can add PHP so it may be possible add the logic test and hard code the login/logout links.
For my site, I used a different approach. The COM_siteHeader function will first look to see if the current theme has a custom function that should be used. I copied the code from COM_siteHeader and created a function in lib-custom called portalparts_siteHeader() and then customized the function to meet my needs. I added the logic to see if the user was logged in or not and then set the template variables needed.
This makes upgrades easier since I have not hacked lib-common and I can select another theme and all is back to normal.
Geeklog components by PortalParts -- www.portalparts.com
This is similar to how I have my site setup - with the login/logout in the header.
I order to accomplish, this you need to be able to change the variables used by COM_siteHeader and the template file header.thtml.
The header.thtml file is the only template file that you can add PHP so it may be possible add the logic test and hard code the login/logout links.
For my site, I used a different approach. The COM_siteHeader function will first look to see if the current theme has a custom function that should be used. I copied the code from COM_siteHeader and created a function in lib-custom called portalparts_siteHeader() and then customized the function to meet my needs. I added the logic to see if the user was logged in or not and then set the template variables needed.
This makes upgrades easier since I have not hacked lib-common and I can select another theme and all is back to normal.
Geeklog components by PortalParts -- www.portalparts.com
7
9
Quote
Status: offline
exaurdon
Forum User
Regular Poster
Registered: 08/13/03
Posts: 107
Hello, sounds like you got it working.
For anyone else reading this thread, the html form that Dirk refered to would be as follows:
<b>Username:</b><br>
<input type="text" size="10" name="loginname" value=""><br>
<b>Password:</b><br>
<input type="password" size="10" name="passwd"><br>
<input type="submit" value="Login">
</form>
Note that no php is required at all. However, in this state, the form will be seen by all users, whether they are logged in or not. You could do some simple code to hide the form if a user was logged in.
Exaurdon~
For anyone else reading this thread, the html form that Dirk refered to would be as follows:
Text Formatted Code
<form action="http://www.yoursite.net/users.php" method="POST"><b>Username:</b><br>
<input type="text" size="10" name="loginname" value=""><br>
<b>Password:</b><br>
<input type="password" size="10" name="passwd"><br>
<input type="submit" value="Login">
</form>
Note that no php is required at all. However, in this state, the form will be seen by all users, whether they are logged in or not. You could do some simple code to hide the form if a user was logged in.
Exaurdon~
11
12
Quote
All times are EST. The time is now 02:46 am.
- Normal Topic
- Sticky Topic
- Locked Topic
- New Post
- Sticky Topic W/ New Post
- Locked Topic W/ New Post
- View Anonymous Posts
- Able to post
- Filtered HTML Allowed
- Censored Content