First time here? First time here? Newsletter Signup Newsletter
Login | Register | 651326 Members and growing!
Search tutorials
Author: James Greenhalgh | Website: http://www.odslinux.com

DGS Search Setup


Once 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)
/* 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
» Level Advanced

Added: 2001-02-19
Rating: 8.04 Votes: 48
(10 being the highest)
» Author
I work for a Canadian software company as a logisitics director. We provide custom configured Linux distributions. In my spare time I sleep.
» Download
Download the files used in this tutorial.
» Forums
More help? Search our boards for quick answers!

Comments

  • There are no comments yet. Be the first to comment!

  • You must have javascript enabled in order to post comments.

Leave a Comment
  • Your email address will not be published. All fields are required.
Featured Flash FLA
» Author: work2survive
» Title: Girl Walking 1kb
» Description: Walking girl, animation just takes 1kb, using high heels shoes, and fashion model attitude.
Featured Sound Loops
Image for equalize

Audio Player

» Author: BoxCat
» Title: CPU Talk
» Description: From the cyberpunk RPG, "Nameless: the Hackers" Completely Free to use! Keywords: edm hip hop rap electronic mysterious mission hacking chase exciting spy ios ambient chilling love happy sad angry suspense
Latest Font
» Author: Fábio FAFERS
» Description: I created this font for free use. Everyone can apply it in personal or business texts. Its free, but I want to be communicated in case of business use. Donations are accepted to keep the project of free fonts alive! Thank you all
Featured Sound Fx
Image for equalize

Audio Player

» Author: nathan
» Description:

A recorded sound of the Dimensional Fork Gate.