Gossamer Forum
Home : Products : Links 2.0 : Discussions :

Multiple db with one engine?

Quote Reply
Multiple db with one engine?
Is it possible to maintain multiple links.def and links.cfg with one engine?
Ie: I have 3 or 4 to set up, but each needs to display differently, either in sort and/or fields displayed. What would I have to duplicate in each sub directory (I can run cgi from any dir),to accomplish this.
I guess if all else fails, I could always load multiple copies, but I'm trying to get away from that
Thanks for any help!

Quote Reply
Re: Multiple db with one engine? In reply to
Links pulls it's config information from the links.def and links.cfg files.

Assuming you have the same category structure.

This is the line in each called file that tells links what paths to use:

Code:
require "admin/links.cfg";

If you want to run different configurations, you'll have to do some careful planning, but you can change the names of the files in the default ../links directory so rather than calling jump.cgi you call a_jump.cgi b_jump.cgi etc. Each group of files a_* b_* and a corresponding admin.cgi in the ../links/admin directory will use a different configuration file -- a_links.cfg a_links.def and a_category.def (unless the categories are the same.

Now, I haven't tested this, so there are probably minor things you'll have to work out, but that's the general idea.

The problem is that if you need different templates for the different databases, you are adding a layer of complexity that offers virtually no benefit over installing links several times.

There's a more elegant way if you seriously only want to run one set of scripts and several template directories that would use another passed variable to the script, and each script would use that variable in creating the configuration file to load --

Sort of like ../links/jump.cgi?ID=109&DB=a_

In the scripts, you'd pre-pend the DB filed to the links.cfg ($input_DB . 'links.cfg') test to make sure the file exists, and then load that config file.

You'd need only one set of scripts, but you'd want to keep the template files in different subdirectories so you could keep the same names in all the scripts.

Clear as mud???

This mission, should you choose....
Quote Reply
Re: Multiple db with one engine? In reply to
Thanks, that gives me a good direction...and some things to think about,,,
At least the site is not ready to publish, so I have a good bit of time to play with the setup...

Brad

Quote Reply
Re: Multiple db with one engine? In reply to
Hi !!!

I'm trying to make a copy of this files to have more than one database:

links.cfg => links2.cfg
links.def => products.def

... and I'm using the same categoy database structure.

I use only the admin panel to insert links into db and when I try to add a link for products.db the categories don't appear in the select field.

In the links.db it's appear correctly ....


What's is wrong, any ideas ???


Regards,

marcoBR


obs: soory, my English is very poor ...