Gossamer Forum
Home : Products : Gossamer Links : Version 1.x :

creating multiple searches with multipe databases

Quote Reply
creating multiple searches with multipe databases
Hello everyone!

Here is my plan: I have a LinkSearch, JokeSearch, PeopleSearch, and MusicSearch on my site and I want them all run by Links SQL. Each has there own MySql database. I have the LinkSearch running fine. I'm starting the implement of the other searches with the JokeSearch and if I'm successful, I'll do the other two. How I plan to do this:

1) Setup Database

modify setup.cgi to be jokesetup.cgi: Change all the occurances of 'setup.cgi' inside the script to be 'jokesetup.cgi' and change all the occurances of '/defs/Whatever.def' to be '/defs/JokeWhatever.def' and save

modify Import.pl to JokeImport.pl: Change all occurances of '/defs/Whatever.def' to be '/defs/JokeWhatever.def'

modfiy SQL.mysql to be JokeSQL.mysql: add a field for the Joke in Links Table and delete the table for Subscribes (no use for it) and remove the variable for Subscribers from %TABLES at the bottom

run jokesetup.cgi: create .def's and tables in MySql database named 'jokesearch'

2) Make Public CGI's Multiple Search Useable

edit add.cgi, modify.cgi, search.cgi, etc.: use a QUERY_STRING command to determine which database to add to or search (so if search.cgi is called with search.cgi?jokesearch, it will search the MySql database named 'jokesearch'). one example: search.cgi. i'll add:

use Links::Joke_DBSQL;
use Links::Joke_DB_Utils;
use Links::Joke_HTML_Templates;


to the required modules and then use if statements to call the required templates, .def file, database, or variable, like for the search and error templates:

if ($QUERY_STRING eq "jokesearch" && $in->param('query')) {
&joke_search ($in, $dynamic);
}
elsif ($in->param('query')) {
&search ($in, $dynamic);
}
elsif ($QUERY_STRING eq "'jokesearch") {
&joke_html_search_form ( { query => '' }, $dynamic );
}
else {
&site_html_search_form ( { query => '' }, $dynamic );
}


and then make a sub joke_search and a sub joke_search_build_linked_title and sub joke_log_query that pertain to the jokesearch and do likewise for the other public .cgi's

3) the admin area

make .pm files for the JokeSearch in the Links directory: put new path of .def's

add variables for the JokeSearch in Links.pm: url and path of directory to build jokesearch and then url and pathes for New, Cool, and Ratings

create a nph-build.cgi for JokeSearch: calls all the right joke subroutines and variables

create a nph-index.cgi for JokeSearch: create a subroutine that will index the jokesearch mysql database and use a $QUERY_STRING to tell which subroutine to use



there is more to do but I keep realizing that is basically just making another version of Links SQL. I'n hoping that someone has a better way of doing this. Before I got SQL, I had made a thread in the SQL Questions about this, and AnthroRules gave this:

http://www.gossamer-threads.com/...=&vc=1#Post99073

Thanks for any input! I plan to post more as I start to play with this idea. God bless!


<><------------><>
Daniel
http://www.christian-search.net
<><------------><>
Subject Author Views Date
Thread creating multiple searches with multipe databases OneDanShow 3606 Nov 18, 2000, 12:07 PM
Thread Re: creating multiple searches with multipe databases
OneDanShow 3501 Nov 19, 2000, 2:42 PM
Thread Re: creating multiple searches with multipe databases
Stealth 3486 Nov 19, 2000, 9:25 PM
Thread Re: creating multiple searches with multipe databases
OneDanShow 3479 Nov 20, 2000, 1:46 PM
Thread Re: creating multiple searches with multipe databases
Stealth 3479 Nov 20, 2000, 2:00 PM
Post Re: creating multiple searches with multipe databases
OneDanShow 3455 Nov 21, 2000, 10:28 PM