Limit Local Search to Content
| From: | George Langley | Date: | Thu, 26 Mar 2009 17:50:00 +0000 |
| Subject: | Limit Local Search to Content | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-290708@lists.php.net to get a copy of this message | ||
Hi all! Am building a Search feature following the excellent tutorial at:
<http://www.oreillynet.com/pub/a/php/2002/10/24/simplesearchengine.html>
It loops through a page and stores the words found in a mySQL database.
I have about 60 pages, and all of them share a number of common items like header, menu, footer,
etc. These get added as includes. The result is that every page gets marked as having "Contact
Us", "Terms of Use" or any other item in the menu, footer, etc. I would like to limit
the word list to items found just in the page's unique content.
I do have a div with an id of "divContent" for the actual content. So I could add an if
statement to only start storing words found after the word "divContent" has been found.
But, my question is:
How do I STOP it? Is it permissible to add the id again in the closing div tag ie </div
id="divContent">.
If this is allowed, I could keep an eye out for that id again and stop it when found a second time,
so that my list doesn't include items in the footer (which again is common to all 60 pages) or
any other items outside of the content section. Or is there a better way to trigger the recording of
words on/off? Thanks!
George Langley Multimedia Developer Audio/Video Editor Musician, Arranger, Composer
www.georgelangley.ca