4images Forum & Community

4images Issues / Ausgaben => Discussion & Troubleshooting => Topic started by: Robmaster on May 12, 2005, 01:24:56 PM

Title: registration
Post by: Robmaster on May 12, 2005, 01:24:56 PM
Hi, I am searching for a solution where any user of my gallery first has to register/login befor he can enter the page. Everytime! Sort of like the login-page for the admin. Any ideas how to realize it?

I used the following example from another Discussion:

Code: [Select]
<form action=http://www.mysite.com/4images/login.php method=post>
        <input type="text" size="18" name="user_name" class="blackCopy" value="Username" onFocus="if(this.value=='Username')this.value='';">
          <br />
        Password:<br />
        <input type="password" size="18" name="user_password" class="blackCopy" />       
       
        <table border="0" cellspacing="0" cellpadding="0">
        <tr valign="top">
            <td height="20">
              <input type="checkbox" name="auto_login" value="1" />            </td>
            <td><span class="smalltext">Log me on automatically next visit?</span></td>
          </tr>
        </table>
      <input type="hidden" name="url" value="http://www.www.mysite.com/4images/index.php">
        <input type="submit" value="Log In" class="blackCopy" />
      </form>


The Problem is, that there is no registration choice for "first-timers"

Thanks!

Robin
Title: Re: registration
Post by: martrix on May 12, 2005, 03:11:00 PM
there is:

you may put the whole template site into a tag:

Code: [Select]
{if user_loggedin}
...normal template here...
{endif user_loggedin}
and beneath that you can place

Code: [Select]
{if user_loggedout}
You must be registered and logged in to visit this page.
{user_box}
{endif user_loggedout}


or similar and for non-registered visitors it will show only the text from above and the login-form with the registeration link (if it is included in your ./templates/<yourtemplate>/user_loginform.html
Title: Re: registration
Post by: Robmaster on May 12, 2005, 03:29:55 PM
Thanks, but this solution I cannot use if I want to insert the login-box on my personal webpage like the example does. Or am I wrong? Isn't there a way to modify the code above?
Title: Re: registration
Post by: Chris on May 12, 2005, 03:50:46 PM
I didn't understand your first request but now that I've seen Martrix and you reply I can only say that you should try what Martrix posted.  That is the solution from what I can tell.  Your custom login HTML template should be named ./templates/<yourtemplate>/user_loginform.html just as Martrix posted.

If you're thinking of non-4images pages, then check out this FAQ post:
FAQ: How can I add a new, custom template like FAQ.html? (http://www.4homepages.de/forum/index.php?topic=4996)
Title: Re: registration
Post by: martrix on May 12, 2005, 04:32:25 PM
If you just want to add a "registration link", then add it  :wink: - this is plain html and the link should point to

http://www.yoursite.com/register.php

That's all you need to insert into your code from above to have it...

If you'd send your home.html for example as an attachment, we could show you, what I meant...

Title: Re: registration
Post by: Robmaster on May 12, 2005, 05:04:42 PM
That's it!!! Thanks