baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from TheOneRing on 1/1 2004, 06:45 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Still having problem with spaces in a data field


      This message is related to a previous post. I'm narrowing down the issue and believe I've found the root problem but don't know if/how to handle it with coding.

      My database has a field name "Title". Two entries in this field are:
        The Sun's Love
        The Line

      The variable field name "Title" is passed through a URL during a search as $Title.

      According to the baseportal documentation, you should handle spaces in a field query using \ like:

      <loop Title==The\ Sun's\ Love>

      My problem is that I need to use the variable $Title in the query and it doesn't know if there are spaces in the field:

      <loop Title==$Title>

      where $Title = The Sun's Love -->in one entry
      where $Title = The Line -->in the next entry

      The query "<loop Title==$Title>" will return "The Line" both times through the loop and never return "The Sun's Love".

      How do I handle spaces in a data field that will be used in a $field query?

      My exact code currently is below. The first "get" calls the database "Archive" which has the field "Title". The second "get" calls the relational database "Story" which has the field "Title" (maybe the same title more than once if a story has multiple chapters), the field "Chapter_number", and the field "Story". If the "Story" field is empty, it links to a web site. If the "Story" field has something in it, it returns a link to the baseportal database.

      <perl>
      get;
      out "<table width=100% cellspacing=\"0\" cellpadding=\"0\">";
      out "<tr><td align=\"left\" width=\"170\"><h3><a title=\"Select story title to link directly to the story\">Title</a></h3></td>";
        out "<td align=\"center\" width=\"100\"><h3>Author</a></h3></td>";
        out "<td align=\"center\" width=\"80\"><a title=\"Select rating to view categories and warnings\"><h3>Rating</h3></a></td>";
        out "<td align=\"center\" width=\"80\"><h3>Size</h3></td>";
        out "<td align=\"left\" width=\"500\"><h3>Description</h3></td></tr>";
      while(get_next)

      {
      get "Title~=$Title&Link==*&Chapter_number==*&sort=", "/TheOneRing/Story_archives/Story";
      out "<tr valign=\"top\"><td align=\"left\" width=\"170\">";

      if($Story ne "")
      {
      out "<a href=\"http://baseportal.com/baseportal/TheOneRing/Story_archives/Entire_story?db=/TheOneRing/Story_archives/Story&Title==$Title\" title=\"Select to link directly to the story\" class=\"links\">$Title</a>";
      } else
      {
      out "<a href=\"http://$Link\" target=\"_blank\" title=\"Select to link directly to the story\" class=\"links\">$Title</a>";

      }

    Your reply:

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

    Post a new message


 All messages from this thread: To the list 
    Message from J. Friedman on 1/1 2004, 15:15 -05:00
    EMail: JFriedmanlaw@aol.com WWW: baseportal.com/cgi-bin/baseportal.pl?htx=/JF/main

    How to hide all the data on the website


      I am trying to design a website with baseportal. I created a data base that users can add information to. However, I also want the users to be able to search for specific data that may be in the database, but I do not want them to see the entire data table (all)

      How do I put the database into the web page without users being able to see the "ALL" part of the database??

      Any help would be greatly appreciated
     Post a reply


    Message from J. Friedman on 1/10 2004, 20:27 -05:00
    EMail: JFriedmanlaw@aol.com

    Can you hide the Action Table


      Is there a way to hide the Action Table/tab and just have the # of entries found shown?

      What tags would I use and how would it read?

      Thanks
     Post a reply

    Message from TheOneRing on 1/12 2004, 01:29 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Re: Can you hide the Action Table


      I thought you might ask this. I'm assuming you used the <do action=all listfields=-...> When you do this and exclude all fields, for some reason, baseportal puts in the Id and Action fields. Just modify your <do action=all listfields=-Id,Aktion,field1,field2...>

      Yes, I know that's not how you spell "action" but it is how you spell action in German. A translation error -- use Aktion...it works!
     Post a reply
     
 Messages from 2850 to 3000: 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



baseportal.com