DGS Search v0.9.3 (08/27/00) - http://www.digitalgenesis.com

Quick Install:

  0. Untar the distribution into your websites tree. It will create a dgssearch
     directory. Several examples follow:

     For .tar.gz files:
       tar xvzf dgssearch-0.9.3.tar.gz
     For .tar.bz2 files:
       tar xvIf dgssearch-0.9.3.tar.bz2
        -or-
       tar xvf dgssearch-0.9.3.tar.bz2 --with-compress-program=bzip2
     For .zip files:
       pkunzip -x dgssearch_0.9.3.zip
        -or-
       Use WinZip or other GUI zip program.

  1. Open and configure config.php as needed (in the config directory).
     Most options are described to the right of the option.

     NOTE: If you are using a Windows platform, please make sure you are
           using two backslashes in paths (ie: c:\\inetpub\\wwwroot).

  2. Test your install. Use the included index.php file as a quick test.

     NOTE: If you have SAFE MODE enabled, you will need to make sure the files
           that DGS Search will be reading are owned by the user that your web
           server is running as. For more information on SAFE MODE, see the
           PHP documentation.

     NOTE: If DGS Search is gives the error 'Error: Must specify a query.',
           verify in php.ini that the option 'register_globals = On'.

Configuration:

  config.php - This file contains all configuration options for DGS Search.

  Below is a full list of options and descriptions of how they work:

  General Options
  ---------------

    $config["installBase"] - Datatype: (String) - Ex: "/usr/local/apache/htdocs/dgssearch"

      The directory that DGS Search was installed into.


    $config["modules"] - Datatype: (Array of String) - Ex: array("searchfs", "searchdb");

      The modules to use for your searches. Currently searchdb and searchfs are included
      with the distribution. Feel free to write additional modules.

      Modules will be called in the same order they appear within the modules array.

      Modules are nothing more than a php source file in the 'libs' directory containing
      a function of the same name. See MODULES for more information on modules.


    $config["header"] - Datatype: (String) - Ex: "config/header.php"

      The file that is used for the header on the results page.


    $config["footer"] - Datatype: (String) - Ex: "config/footer.php"

      The file that is used for the footer on the results page.


    $config["displayHeader"] - Datatype: (String) - Ex: "DGS Search Results"

      The string that is used as a header on the results page.


    $config["headerColor"] - Datatype: (String) - Ex: "666699"

      This is the color used for the header or title on the Display Results
      page. This can be any valid HTML color, either keywords like "blue" or
      RGB values like "666699".


    $config["infoColor"] - Datatype: (String) - Ex: "green"

      This is the color used for the info sections on the Display Results
      page. This can be any valid HTML color, either keywords like "blue" or
      RGB values like "666699".

      The info sections include the Navigation section and the filesize and
      last modified sections of each search result.


    $config["fonts"] - Datatype: (String) - Ex: "Arial, Sans-Serif, Helvetica"

      The fonts to be used on the Display Results page.


    $config["dateFormat"] - Datatype: (String) - Ex: "M j, Y H:i:s"

      Date format string used to generate Last Modified on Display Results.
      See the PHP documentation on the date() function for more details.


    $config["results"] - Datatype: (Integer) - Ex: 20

      The default number of results to display per page. When set to 0, all
      results will be displayed on one page. This will be used if 'r' is not
      specified in the call to search.php as shown in the example below:

      http://www.mydomain.com/dgssearch/search.php?q=keyword&r=10


    $config["boldQuery"] - Datatype: (Boolean) - Ex: true

      If set to true, the search word(s) will be bolded in the description on
      the results page.


    $config["timed"] - Datatype: (Boolean) - Ex: true

      If set to true, the results page will include the time taken to search.


    $config["query"] - Datatype: (Boolean) - Ex: true

      If set to true, the results page will include a query field which allows
      the user to submit a new search.


    $config["warn"] - Datatype: (Boolean) - Ex: true

      If set to true, warnings will be displayed on the results page.
      The most common use of this function is to allow SAFE MODE warnings
      to be displayed, so they can be fixed. Most of these will be caused
      by the script being owned by a different user than the files you
      will be searching.

      NOTE: If debug is enabled, warn will be enabled automatically.


    $config["debug"] - Datatype: (Boolean) - Ex: false

      If set to true, debugging information will be displayed on the results
      page. Unless you are a developer, this won't do much for you.


    $config["hideCredits"] - Datatype: (Boolean) - Ex: false

      If set to false, the string "DGS Search" and link to our site will be
      removed from the bottom of the results page. We would like to ask that
      you leave this option set to false, as makes it easy for others to 
      locate DGS Search.


   Filesystem Options
   ------------------

    $config["urlBase"] - Datatype: (String) - Ex: "http://www.digitalgenesis.com"

      The base URL for your site. The URL will be used to generate links to your 
      search results.


    $config["fsBase"] - Datatype: (String) - Ex: "/usr/local/apache/htdocs"

      The directory on your local filesystem to begin searching.


    $config["fsExclude"] - Datatype: (Array of String) - Ex: array("cgi-bin", "dgssearch", "secret.txt")

      A list of directories or files that should be excluded from your search.


    $config["cacheFile"] - Datatype: (String) - Ex: "/tmp/dgssearch.cache"

      Cache file to be used for storing the filenames that will be searched.
      Use of a cache file speeds up filesystem searches, since DGS Search
      won't need to scan the filesystem for ever search request. On Windows
      platforms, this should be set to "c:\\temp\\dgssearch.cache" or
      another temporary directory.


    $config["cacheTTL"] - Datatype: (Integer) - Ex: 3600

      The time to live (TTL) in seconds for the filesystem cache file.
      When the cache file becomes older than the TTL, DGS Search will scan the
      filesystem and generate a new cache file. If the TTL is set to 0, then
      filesystem caching will be disabled.


    $config["maxFileSize"] - Datatype: (Integer) - Ex: 51200

      The maximum filesize in bytes that DGS Search will search. If the file
      is larger than the specified size, it will be skipped. This gives you
      a way to exclude files that are not searchable in a reasonable amount
      of time.


    $config["stripTags"] - Datatype: (Boolean) - Ex:  true

      If set to true, all HTML and PHP tags will be stripped from files before
      they are searched for a query. If set to false, the actual HTML and PHP
      code could be found and displayed in the descriptions on the Search Results
      page, possibly exposing passwords or other sensitive information.


    $config["followLinks"] - Datatype: (Boolean) - Ex: true

      If set to true, SymLinks will be followed on systems that support SymLinks.
      On systems that lack the is_link() function, this setting will be ignored.

    $config["exts"] - Datatype: (Array of String) - Ex: array("html", "php", "txt")

      A list of extensions that will be read looking for your search word(s).
      Wildcards are NOT supported at this time.

      NOTE: If this option is set to NULL or undefined, then DGS Search will read
            all files within a directory, regardless of the file extension.


    $config["descWidth"] - Datatype: (Integer) - Ex: 80

      The width or string length of the description on the Search Results page.


    $config["descHeight"] - Datatype: (Integer) - Ex: 2

      The height of number of lines of description to be displayed on the Search
      Results page.


    $config["descEnd"] - Datatype: (String) - Ex: "..."

      The string that to be added to the beginning and end of the description.


  Database Options
  ----------------

    NOTE: The 'x' in $database[x]["keyword"] should be replace with an integer
          value such as 0, 1, 2, etc. This allows searching of multiple databases
          or tables within a database.

    $database[x]["type"] - Datatype: (String) - Ex: "mysql"

      This is the database type. This can be different on each database entry.
      Currently supported types are: odbc, mysql, and mssql.


    $database[x]["server"] - Datatype: (String) - Ex: "localhost"

      The hostname, IP address or PIPE name of the SQL server.

      NOTE: This options is ignored if $database[x]["type"] is set to 'odbc'.

      NOTE: If you are connecting to a local MSSQL server, use the PIPE name,
            localhost or 127.0.0.1 won't work. (At least on our test server.)
            Your interface IP address will also work.


    $database[x]["username"] - Datatype: (String) - Ex: "username"

      The username used to connect to your database. Set to an empty string
      if your database uses no username.


    $database[x]["password"] - Datatype: (String) - Ex: "password"

      The password used to connect to your database. Set to an empty string
      if your database uses no password.


    $database[x]["database"] - Datatype: (String) - Ex: "database"

      The name of the database to search.


    $database[x]["persistent"] - Datatype: (Boolean) - Ex: true

      If set to true, persistent database connections will be used.
      Non-persistent connections are slower, but may be needed for compatibility
      with some databases. (For example, MSSQL's ODBC driver isn't able to
      handle parallel selects on a persistent connection.)


    $database[x]["table"] - Datatype: (Array of String) - Ex: array("article", "magazine")

      The name of the table in your database to search.


    $database[x]["tableAssoc"] - Datatype: (String) - Ex: "article.magazineid = magazine.magazineid"

       A string of rules for associating the records in multiple tables. If you
       are only searching one table, set this value to the empty string.

       For those familiar with SQL, this string is as part of the WHERE clause
       as in the example below:

       SELECT * FROM article, magazine WHERE article.magazineid = magazine.magazineid


    $database[x]["returnField"] - Datatype: (Array of String) - Ex: array("author", "title", "mag_name", "articleid")

      The fields returned from the database. These fields can be used to substitute
      into the URL and description. The fields are referred to in the same order
      they are listed within the array, starting from 0. The first field 'author'
      would be referred to as '@0@'. The second field 'title' would be referred to as
      @1@. The third field 'mag_name' would be '@2@', etc.


    $database[x]["searchField"] - Datatype: (Array of String) - Ex: array("title")

      The fields search within your table.


    $database[x]["link"] - Datatype: (String) - Ex: "Article '@1@'"

      The descriptive link on the Search Results page. Variables '@0@', '@1@', etc
      can be used within the string to produce dynamic links. The variables refer
      to the fields within the $database[x]["returnField] array.


    $database[x]["url"] - Datatype: (String) - Ex: "http://www.mydomain.com/article.php?id=@3@"

      The URL that displays the content of the database matching the search query.
      Variables '@0@', '@1@', etc can be used within the string to produce a dynamic
      URL. The variables refer to the fields within the $database[x]["returnField]
      array.


    $database[x]["desc"] - Datatype: (Array of String) - Ex: array("@1@ was published in @2@.", "Authored by @0@")

      The description displayed below the link. Each string in the array will be
      a different line in the description. Variables '@0@', '@1@', etc can be used
      within the string to produce a dynamic URL. The variables refer to the
      fields within the $database[x]["returnField] array.


    $database[x]["wildcard"] - Datatype: (String) - Ex: "Both"

      This setting determines how DGS Search will search your database for the
      query. Supported options are: None, Left, Right or Both. If set to None,
      the query will match whole words only. If set to both, then the query will
      be treated as a substring. Left and Right will cause wildcard character to
      be placed on the corresponding side.

      For those familiar with SQL, setting None results in the following statement:

      SELECT * FROM table WHERE field = 'query'

      Setting Both results in the following statement (% is the wildcard character):

      SELECT * FROM table WHERE field = '%query%'

      Setting Left results in the following statement:
      
      SELECT * FROM table WHERE field = '%query'

      Setting Right results in the following statement:
      
      SELECT * FROM table WHERE field = 'query%'


    $database[x]["orderByDepth"] - Datatype: (Integer) - Ex: 2

      The order by depth sets the number of result fields to use when ordering the
      results from the database. The default of -1, will use all result fields to
      order the results. If set to 2, then only the first two result fields are
      used to order the results. If you are working with a large database, this
      setting may help you speed searches. The more fields you order by, the
      longer a result set usually takes.


   Constants
   ---------

  NOTE: These options generally don't need to be changed.

    $config["version"] - Datatype: (String) - Ex: "v0.9.3"

      The current version of DGS Search.


    $config["maxResults"] - Datatype: (String) - Ex: 65535

      The total number of results that can be displayed per page. This value is
      used internally to allow all results to be displayed on one page, if results
      is set to 0.


    $config["fileSeparator"] - Datatype: (String) - Ex: "/"

      The separator used in your filesystem. UNIX based systems use '/'.
      DOS/Win based systems use '\\'. Must be '\\' since '\' is the escape character.


    $config["extSeparator"] - Datatype: (String) - Ex: "."

      The file extension separator used to in your filesystem.


    $config["thisDir"] - Datatype: (String) - Ex: "."

      The string used in denote the current directory.


    $config["parentDir"] - Datatype: (String) - Ex: ".."

      The string used in denote the parent directory.
