Search Tutorials
DGS Search SetupOnce you've added a few database entries, you need to download DGS Search v0.9.5. DGS Search is the set of PHP scripts I used for the database search. I specifically liked it because it is modular, so creating the Flash integration was easy. DGS Search v0.9.5 (it also comes included in the attached zip) After you have unzipped it into your web directory, edit the config/config.php file to look like below. (Alternatively, I have included this file in the attached zip as well. It is titled config_flash.php You can make your changes with that file and then overwrite config/config.php with the config_flash.php)
<?
/*
** DGS Search
** config.php used for flash db by James Greenhalgh
** http://www.odslinux.com
** based on config.php written by James M. Sella
** Copyright (c) 2000 Digital Genesis Software, LLC. All Rights Reserved.
** Released under the GPL Version 2 License.
** http://www.digitalgenesis.com
*/
/* Change options below that are in bold */
/* General Options */
$config["installBase"] = "/path/to/dgssearch"; /* Absolute location of the directory of scripts. */
$config["searchModules"] = array("db"); /* Modules to search for results. */
$config["displayModules"] = array("flash"); /* Customized for Flash */
$config["fileSeparator"] = "/"; /* Would be "\\" for Win9x/NT/2000. */
$config["header"] = "config/header.php"; /* The page header. */
$config["footer"] = "config/footer.php"; /* The page footer. */
$config["displayHeader"] = ""; /* Header on the Display Results page. */
$config["headerColor"] = "666699"; /* The color of the header on the Display Results page. */
$config["infoColor"] = "008000"; /* The color of the info sections on the Display Results page. */
$config["fonts"] = "Arial, Sans-Serif, Helvetica"; /* Fonts to be used on the Display Results page. */
$config["dateFormat"] = "M j, Y H:i:s"; /* Date format for Last Modified on Display Results. */
$config["results"] = 10; /* Default results per page. 0 is unlimited. */
$config["boldQuery"] = true; /* Bold the query string in description. */
$config["timed"] = true; /* Displays search time to user. */
$config["translate"] = false; /* Displays a 'Translate' link for each result. */
$config["translateFrom"] = "en_de"; /* Sets the default translation to be preformed. See INSTALL. */
$config["warn"] = true; /* Displays warnings (ie: SAFE MODE warnings). */
$config["debug"] = false; /* Displays a lot of slightly useful or annoying information. */
/* Database Options -- Search module 'db' */
$database[0]["type"] = "mysql"; /* Supports mysql, mssql, odbc, ibase and pgsql. */
$database[0]["server"] = "localhost"; /* The SQL Server. (Ignored by ODBC). */
$database[0]["username"] = "username"; /* Username to connect to database. */
$database[0]["password"] = "password"; /* Password to connect to database. */
$database[0]["database"] = "mydatabase"; /* The database or DSN you will be accessing. */
$database[0]["persistent"] = true; /* Use persistent database connections. */
$database[0]["table"] = array("keyword_data"); /* The table in database to search. */
$database[0]["answertable"] = "keyword_data"; /* The table in database where the answer will come from. */
$database[0]["tableAssoc"] = "answer is not null"; /* A rules for associating the tables. See INSTALL. */
$database[0]["returnField"] = array("id", "keywords", "question"); /* Fields returned from db. Can be used to sub into link, url and desc. */
$database[0]["searchField"] = array("keywords"); /* The fields to search. */
$database[0]["link"] = "@2@"; /* This is the question returned. */
$database[0]["url"] = "@0@"; /* This is the ID returned on a match. */
$database[0]["desc"] = array("@3@"); /* The description to display. */
$database[0]["wildcard"] = "both"; /* Wildcard support: none, left, right or both */
$database[0]["orderByDepth"] = -1; /* OrderBy Depth. Default of -1 is all. See INSTALL. */
$database[0]["forceLower"] = true; /* Forces a case-insensitive search by lowercasing everything. */
/* Generic */
$config["version"] = "v0.9.5";
$config["hideCredits"] = true;
$config["maxResults"] = 65535;
/* FindExt() - utils.php */
$config["extSeparator"] = ".";
$config["thisDir"] = ".";
$config["parentDir"] = "..";
?>
Once your config is setup, you have to go and edit the footer.php and header.php in the config/ directory. It is imperative that both of these files have no data at all (0 byte file). I've also included those files in the attached zip
|
|||||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
|||||||||||||||||||||||||||||||||||||||||||||||||||
|