Gossamer Forum
Home : Products : Gossamer Links : Pre Sales :

What I Will Need Links SQL to Do

Quote Reply
What I Will Need Links SQL to Do
Hello everyone,

Since I'm only allow one copy of Links SQL per site, I'm going to have to combine all my Links 2.0 searches into one. If you visit my site http://www.christian-search.net, you see that I have a LinkSearch, JokeSearch, MusicSearch, etc. and I will need to put all those into Links SQL, is this possible? Meaning, I need to import multiple databases and have either a link or detailed page depending on the search like the Resource Center. Also, would it be a big problem with MySQL since I have some big listings (ex: the Joke and Music have a lot of text with them like jokes and lyrics, that are not just links). I also want to give them the option of just searching one Search (like the MusicSearch) or searching all of them. The whole idea is that I need Links SQL to run different types of searches by itself.

Another question, what does the user registration feature with Links SQL allow? I signed up for it in the demo and I didn't see any change at all.

Another question, can I use the page.cgi that dynaically changes the layout for other sites that I partner with to allow a search engine on their site? Like if I wanted to give them the option of having a custom search results page that would appear if someone used a search box on their site and then have a "Powered by Christian-Search.Net" link on it, is this what it is meant for?

Thanks for your time and God bless!



<><-----------------><>
Daniel
AKA Dan the Great
<><-----------------><>
Quote Reply
Re: What I Will Need Links SQL to Do In reply to
In Reply To:
and I will need to put all those into Links SQL, is this possible?
Yes...It is possible. You can accomplish this via two methods:

1) Create a separate database with individual tables for each database.

2) Create separate tables within one database for each of the database.

The first option is better since you can organize your tables into different databases. Most hosting companies will allow you to have multiple MySQL databases. If they don't, you can simply create multiple tables within one database.

Think of tables as separate "database" files (as you have in Links 2.0).

In Reply To:
Also, would it be a big problem with MySQL since I have some big listings (ex: the Joke and Music have a lot of text with them like jokes and lyrics, that are not just links).
Not a problem. All you have to do is delete the valid expressions in the valid expressions column in the Links and Validate tables. Then you can just enter in pages where these lyrics are located. Of course, you could simply remove the URL field, and then use the built-in Detailed pages option or a dynamic version of the Detailed pages like widgetz wrote for detail.cgi, which I have re-written in different versions to work with Links SQL that parses data from multiple tables in my MySQL database.

In Reply To:
I also want to give them the option of just searching one Search (like the MusicSearch) or searching all of them. The whole idea is that I need Links SQL to run different types of searches by itself.
Yes...this is possible...by tweaking the search.cgi to call data from different .def files associated with different tables/databases.

In Reply To:
Another question, what does the user registration feature with Links SQL allow? I signed up for it in the demo and I didn't see any change at all.
This is being re-written for the next version. Gossamer Threads (Alex) is re-writing the user registration process to make it more modular and also to make it easier to maintain multiple tables where user information is stored.

In Reply To:
Another question, can I use the page.cgi that dynaically changes the layout for other sites that I partner with to allow a search engine on their site? Like if I wanted to give them the option of having a custom search results page that would appear if someone used a search box on their site and then have a "Powered by Christian-Search.Net" link on it, is this what it is meant for?
Yes...you can use page.cgi to show multiple views/templates. However, the templates need to be stored locally. But of course, you could use a combination of javascript and also arguments in the query string of page.cgi to show different elements of pages, like the following:

1) Background Color
2) Link Colors
3) Font size and style

I hope this helps.

Regards,

Eliot Lee


Quote Reply
Re: What I Will Need Links SQL to Do In reply to
Hello everyone,

Thanks for your reply and sorry I didn't reply sooner but I was vacation in Colorado.

I also want to have different fields for each search, is this possible? Like the LinkSearch will have Title, URL, etc. but the MusicSearch will have a field for Lyric, Artist, etc. and I want those to only show up on the MusicSearch search, is there a way I can define the fields for each search?

Also, when I asked about if it was ok to put lyrics and jokes into the MySQL database, I meant as a block of text, actually in the database like a Description, not a link to the lyric. I know this can get pretty big to have a lot of text in there.

Also, have MyLinks.cgi been converted to Links SQL yet?

Thanks and God bless!



<><-----------------><>
Daniel
AKA Dan the Great
<><-----------------><>
Quote Reply
Re: What I Will Need Links SQL to Do In reply to
I've worn myself out on this topic over the past two months, I'm too mentally drained to really read Elliot's explanation (sorry, Elliot)

But, FWIW, there might be a built in way to allow different databases within the new framework, since it was a much-asked for feature. (The ability to have a classified and links database, for example). Either way, there is a way to run multiple databases, and once the new version comes out I'll be working on that aspect (within the license agreement).

As for the MySQL table, it can hold _anything_. It has a text field, as well as a "blob" field, so it can even hold and serve graphics.

Because of the way indexes work, the larger fields don't really slow anything down, _except_ the re-index and initial add -- when all the text has to be scanned, parsed, and put into the indexes.

The size of the database is really limited by diskspace, and your ISP, but the larger it gets, the more important REGULAR BACKUPS!! are!!

http://www.postcards.com
FAQ: http://www.postcards.com/FAQ/LinkSQL/

Quote Reply
Re: What I Will Need Links SQL to Do In reply to
the beauty of Links SQL is making the database objects allow easy access to do anything with the database..

databases can be created to do anything.. in most of my links sql projects that people have paid me to do I make numerous tables for different levels of data.. searching multiple databases is much easier than modding nph-build.cgi though.. nph-build.cgi is the largest hassle in this.. i went about it this way.. another field in category db.. called it.. 'Database'.. database is either Hardware, Software or Accessories.. there is only one database for categories.. so that doesn't matter.. there are three databases for links.. for building category pages.. i checked which database to use by using the $category_r->{Database} scalar.. then i changed this line..

Code:
$get_links = $LINKDB->prepare (" SELECT * FROM Links WHERE CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
to..

Code:
$OUT{Database} = $category_r->{Database};
$get_links = $LINKDB->prepare (" SELECT * FROM $OUT{Database} WHERE CategoryID = ? ORDER BY $LINKS{build_sort_order_category} LIMIT 1000 ");
(and i obviously put that into the loop..)

then there are many occurences of these..

Code:
$tmp = $LINKDB->array_to_hash (${$links_r}[$i]);
so i assigned the object to the correct DB to $DB with ifelse statements..

and with all the hashrefs.. i put.. $tmp->{Database} = $OUT{Database}; so i could check in HTML_Templates.pm which template to use.. (simply by make the template.. "${$tags}{Database}_link.html"

ok.. that is category pages..

umm.. now what... detailed pages??

ok.. well.. i just made a loop.. ie.. foreach (@database) {

}..

so basically it goes through each of them getting each record..

i didn't do anything else.. too complicated..

Jerry Su
Quote Reply
Re: What I Will Need Links SQL to Do In reply to
Hello Again!

I've been looking at the demo and am I correct when I say that there is a MySQL database for the Links, Validate, Category, Subscribers, and Registered Users? If this is true, I could create a database for each of my searches (LinkSearch, MusicSearch, BibleSearch, etc.) and then just copy the basics files like search.cgi, add.cgi, links.def, etc. for each search and then use them one admin to run all the them? It would just be a matter of adding some more links to the admin toolbar and modifing admin.cgi to call on a different links.def, links.cfg, etc. depending on the search it is administering. This way would also make it impossible to have my visitors be able to search one or two or all searches at a time since I would be using different search.cgi. Ideas?

Also, Alex will only convert one database when he installs it, right? Could I get a copy of the convert.pl (or whatever it is called) so that I could convert the other databases as well unless he will do them also. I would also just like to have it because I come across other databases from time to time and it would be handy.

Also, would Alex right a custom convert.pl to convert the database of other script with the installation because I have a bible and quotes script that I would like to use with Links SQL as well.

Thanks for all help and God bless!



<><-----------------><>
Daniel
AKA Dan the Great
<><-----------------><>
Quote Reply
Re: What I Will Need Links SQL to Do In reply to
About the different "databases"...you should just create additional tables within the Links SQL database that you are using. And you would not really have to use separate copies of search.cgi. Also, you will have to add additional .def files for the other tables. Now in terms of indexing these tables, you will have to add some index codes to the SQL.mysql file and also create the tables via the setup.cgi script.

Just add some parameters and conditional statements in the sub search routine, like the following:

Code:

# Now let's search the links table, but first figure out any filters.
if ($in->param('SearchMode') eq 'BibleSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Bible.def";
}
if ($in->param('SearchMode') eq 'MusicSearch') {
$linkdb = new Links::DBSQL "$LINKS{admin_root_path}/defs/Music.def";
}
if ($in->param('SearchMode') eq 'LinksSearch') {
$linkdb = new Links::DBSQL "$LINKS {admin_root_path}/defs/Links.def";
}


Then in your search form codes, add the following radio buttons:

Code:

<input type="radio" name="SearchMode" value="BibleSearch"> Bible
<input type="radio" name="SearchMode" value="LinkSearch" CHECKED> Links
<input type="radio" name="SearchMode" value="MusicSearch"> Music


OR a drop-down menu:

Code:

<select name="SearchMode" size="1">
<option value="BibleSearch"> Bible</option>
<option value="LinksSearch" SELECTED> Links</option>
<option value="MusicSearch"> Music</option>
</select>


Regards,

Eliot Lee

Quote Reply
Re: What I Will Need Links SQL to Do In reply to
Hello Again,

Sorry I haven't replied in a couple days but the forum wouldn't hold my cookie so I couldn't post anything.

Does anyone know a good tutorial for MySQL? That seems to be the biggest thing scaring me about Links SQL because I don't understand how the databasing works (or at least I think I don't) and I wouldn't be able to fix a problem if one came up.

Thanks and God bless!



<><-----------------><>
Daniel
AKA Dan the Great
<><-----------------><>
Quote Reply
Re: What I Will Need Links SQL to Do In reply to
http://www.mysql.com

Regards,

Eliot Lee