baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from Christoph Bergmann on 10/1 2003, 18:19 +01:00
    EMail: info@baseportal.com

    Re: Password Protection with User Database


      The example from the library uses a different method to display the database - you can't mix it with the "setting" tab.

      Please post the HTML code of your page. Its surely just a simple thing you have to add...

    Your reply:

    Name: EMail: WWW:
    Subject:
    Text:
    Timezone:

    Post a new message


 All messages from this thread: To the list 
    Message from Thom on 10/1 2003, 05:26 +00:00
    EMail: misc@thewhistleshop.com

    Password Protection with User Database


      I've set up a database using the "Password Protection with User Database" template. When I try to change the "Order of Output" (using the "Setting" tab in my my administation area), I end up with two separate tables - the top one is still in cronological order, the one below it is in the order that I want it to be (sorted by the 1st text field).

      I don't quite understand how I should add the commands into the html. I'm assuming that I should add it where the "do_all" line is, but I don't know exactly what to add there..

      Thanks!
     Post a reply

    Message from Christoph Bergmann on 10/1 2003, 18:19 +01:00
    EMail: info@baseportal.com

    Re: Password Protection with User Database


      The example from the library uses a different method to display the database - you can't mix it with the "setting" tab.

      Please post the HTML code of your page. Its surely just a simple thing you have to add...

     Post a reply


    Message from Thom on 10/1 2003, 23:24 +00:00
    EMail: misc@thewhistleshop.com

    Re: Password Protection with User Database


      Christoph,

      Thank you for the reply. Since I don't understand yet how to make adjusments, my html looks pretty much exactly like it does in the library section of your website, except that I added a few lines of text at the top of the page. I'd like to be adjust things like having the entries sorted alphabetically, change the number of entries shown per page, etc.


      <html><head><title>Lucca Grill Monday Night Session Tune List</title>
      </head><body bgcolor=ffffff>
      <CENTER><H1>Lucca Grill Monday Night Session Tune List</H1>
      <P>
      When adding a Title, please do not use words like "The" at the beginning of a Title. For example, use "Butterfly, The", instead of "The Butterfly".
      Multiple entries of the same title are acceptable (this will give us a better idea of how many people know a given tune).

      <P>
      To sort the list by any given catagory, use just an asterisk (*) for your search. For example, to sort the entire list alphabetically, put just an asterisk in the "Name of Tune" search field.
      <P>
      A great source of free sheetmusic for Traditional tunes is <A HREF="http://trillian.mit.edu/~jc/music/abc/FindTune.html">JC's TuneFinder</A>.

      </CENTER>
      <P>
      <br><ul>

      <perl>

      if($name_in ne "")
      {
      get "Name==!$name_in", "users";

        if($Password ne "" && $Password eq $password_in)
        {
          do_all "", "name_in", "password_in";
        } else
        {
          out "<b>Access denied!</b>";
          $name_in="";
        }

      }

      if($name_in eq "")
      {

      out <<EOF;
      <h2>Sign in</h2>Please sign in:
      <form action="/cgi-bin/baseportal.pl?htx=$htx" method="post" enctype="multipart/form-data">
      <input type=hidden name="htx=" value="$htx">
      <table>
      <tr><td>Name:</td><td><input type="text" name="name_in="></td></tr>
      <tr><td>Password:</td><td><input type="password" name="password_in="></td></tr>
      <tr><td></td><td><input type=submit value="Sign in"></td></tr>
      </table></form>
      EOF

      }

      </perl>

     Post a reply

    Message from Christoph Bergmann on 10/2 2003, 16:06 +01:00
    EMail: info@baseportal.de

    Re: Password Protection with User Database


      As you assumed the line

      do_all "", "name_in", "password_in";

      is where you have to make changes, inside the "". I.g. reverse the sorting looks like:

      do_all "sort=-", "name_in", "password_in";

      or sort alphabetically with field "Name" and set the number of shown entries to 15:

      do_all "Name==* range^=0,15", "name_in", "password_in";

      Its exactly the same you would write in the <do action=all ...> tag.

      You find more about queries, sorting and the range in the documentation:

      http://baseportal.com/doku/index.html#a20

      and about parameters here:

      http://baseportal.com/doku/index.html#a54

      ;-)
     Post a reply

    Message from Thom on 10/1 2003, 23:38 +00:00
    EMail: misc@thewhistleshop.com

    Re: Password Protection with User Database


      One other question - I'd like to get rid of the "modify" and "delete" options shown for each entry. How do I do this without being able to do it with the tabs in the administration section? In other words, I want others to be able to add their entries when they log-in, but I want me to be the only one that can actually change or delete the entries.

      Thanks again!
     Post a reply

    Message from Christoph Bergmann on 10/2 2003, 16:13 +01:00
    EMail: info@baseportal.com

    Re: Password Protection with User Database


      Then write

      if($Password ne "" && $Password eq $password_in && $cmd ne "mod" && $cmd ne "do_mod" && $cmd ne "del")
      {
      do_all "listfields=-Id,Action allfields=-Id,Action", "name_in", "password_in";
      } else
      ...etc.

      instead of

      if($Password ne "" && $Password eq $password_in)
      {
      do_all "", "name_in", "password_in";
        } else


      You can add more parameters to do_all "..." as you like ;-)

     Post a reply
     
 Messages from 3300 to 3450: To the input form 
<< Newest messages | < Newer messages | To the input form | Older messages > | Oldest messages >>


Back to the homepage

© baseportal.com. All rights reserved. Terms of use



powered in 0.04s by baseportal.com
Get your own Web Database - for FREE!