baseportal
Start

baseportal message board

Welcome to the baseportal message board...

Please read the FAQ.

 
 Selected message: To the list 
    Message from mamet on 12/31 2003, 20:03 +00:00
    EMail: poeticsoul203@aol.com

    Black Planet Page


      i have created a BP page, but i want to make it look different from what is normaly seen on BP. I've seen people hoosing their own backgrounds, putting various pictures and writing on them and i want to do thesame. Can you help me?

    Your reply:

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

    Post a new message


 All messages from this thread: 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>";

      }

     Post a reply

    Message from TheOneRing on 1/2 2004, 07:18 +00:00
    EMail: theonering@thegateroom.com WWW: geocities.com/theonering_stargate

    Woo hoo, I got it!


      Figured out how to use perl to substitute characters. So, now I substitute a "\ " for every space in the title field. My $Title field is converted from "The Line" to "The\ Line" and I search using that with no more problems!

      TheOneRing
     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