Gossamer Forum
Home : Products : Links 2.0 : Customization :

Different Sites (folders) - Same Database

Quote Reply
Different Sites (folders) - Same Database
Referring to: http://www.gossamer-threads.com/...um3/HTML/004924.html

would I have to upload all of the files in to a new directory but just change the reference to the links.db file?

I need to be able to allow other sites to link to us (or SSI a call to the search.cgi) which would display only titles as called in the search form and display a list of them on different templated page then what we use on the main site - which would link to a different templated details page.

Any idea? Basically looking for the easiest way of doing this.



Quote Reply
Re: Different Sites (folders) - Same Database In reply to
In Reply To:
would I have to upload all of the files in to a new directory but just change the reference to the links.db file?
For organization purposes, it would be best to have the copies of files in another directory. And yes, you would change the reference for $db_links_name in the new .cfg file.

In Reply To:
I need to be able to allow other sites to link to us (or SSI a call to the search.cgi) which would display only titles as called in the search form and display a list of them on different templated page then what we use on the main site - which would link to a different templated details page.
I have already provided suggestions for doing this twice over the past month in this forum and also in the Links 2.0 Discussion Forum....There is a Search Partner Mod that will put a link in your search_results.html file in the Resource Center.

It is very easy to install. And you don't have to use different template files.....

In addition to the Search Partners Mod, you can simply add additional hidden fields in the external search form codes you provide for different HTML elements, then add the tags in your search_results.html template file....

Example:

<input type="hidden" name="bgcolor" value="INSERT BGCOLOR CODES">
<input type="hidden" name="logo" value="INSERT LOGO URL">

You can have your link partners INSERT values in the value attributes for these hidden fields.

The fields will show up in the query string as follows:

Code:

&bgcolor=INSERT BGCOLOR CODES&logo=INSERT LOGO URL


Then all you have to do is add the following in your search_results.html file:

Code:

<%if bgcolor%>
<body bgcolor="<%bgcolor%>">
<%endif%>
<%ifnot bgcolor%>
YOUR BGCOLOR CODES
<%endif%>


AND

Code:

<%if logo%>
<%logo%>
<%endif%>
<%ifnot logo%>
YOUR LOGO CODES
<%endif%>


To see affliate search codes in action, go to:

http://vlib.anthrotech.com/search/searchform.shtml

Regards,

Eliot Lee
Quote Reply
Re: Different Sites (folders) - Same Database In reply to
thank you for your response. i will upload the files then. I like your suggestion but these other pages vary in display (meaning exterior graphic content other than what can be produced by links.)

thanks again... I will give it a whirl.

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
In Reply To:
I like your suggestion but these other pages vary in display (meaning exterior graphic content other than what can be produced by links.)
Isn't that what you wanted???

Smile

Regards,

Eliot Lee
Quote Reply
Re: Different Sites (folders) - Same Database In reply to
yes, it is, but it has to be carried right through to the detailed pages, not just the search, that's the problem.

I understand what you are saying and it would be perfect if I only wanted to have links displayed, but i also want to have a detailed view available and since both link results would display, i think i might as well be the same if i did upload the rest of the files.



Quote Reply
Re: Different Sites (folders) - Same Database In reply to
So, you want Link Owners to choose the type of detailed page they would like? Again...this has been discussed before in this forum.

Wink

Regards,

Eliot Lee
Quote Reply
Re: Different Sites (folders) - Same Database In reply to
no, it is only for certain sites - if we do it. as our site is based on a certain template, so will their results and detailed pages will be. this way they can access it from their site with the appearance of still their site only searching specific titles.

Anyways, that's fine. can you tell me if i only wanted to use the search to show links.html and the detailed, which of the .pl and .cgi files will i need in the seperate folders. i want to keep the space to a minimum for now. all modifying, adding will be done through our templates.

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
I am still confused about what you want to do...Please be more specific.

Regards,

Eliot Lee
Quote Reply
Re: Different Sites (folders) - Same Database In reply to
Ok, I will try to explain better.

I have a site with a database in it from the links program. Our site has links to the outside but as well, vistors can select to see a detailed page of the link they are linking on. This is perfect and we are happy with it.

Now, we want some of these customers, to be able to search the database from their site - maybe having an SSI on one of their pages for just a search - so when their visitors go to their links page, only links that qualify will display. I know this can be done and can do it from the search.cgi? command search. That's no problem.

What i want to be able to do, is have those links that display, use a different template, a template that is of a totally different look from our site, it would have to match their sites.

i think i am fine with all of this so far, but here is my problem. when people visit our site, they will see all of the links. when people visit their sites, they will see only certain links. this goes the same for detailed pages. how can i go about setting up the templates (remember, they will be very different in appearance from ours). Again, i can set the search.cgi call up within their sites, it would just have to be when they select the detailed view that we need a different look.

also, really important question, if there is no way of doing this without having to upload the files to another directory for each other site, is there a way that when their pages are built, the build command only builds pages if a certain field=x. this is because, i don't want to have 1000 pages in everyones directory if they only require 5 to be their.

all i am looking for is information, and the easiest way to do this. i suppose i could set-up two new fields within the db that are called header, footer, and depending on the listing, input the codes right there then make a call for them from the detailed pages. but i really want to have all the detailed pages matching our site unless the detailed pages are accessed from others sites.

thank you.

oh yea, i can't find that Search Partner mod you spoke of, is it called something ellse?

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
ok, i have done a lot of searching and thinking here... ignore the above post, and give me your thoughts on the folloiwng.

i upload the all of the scripts to a different folder. i then include the details.cgi script that will build pages as called into this new links folder.

what happens then would be the different site, would have a search page on their site. it would call the links info from the original links.db file in the main folder, but, it would use the link.html format that i have in the new folder.

when a user selects a link, they are taken to a detailed page that is built as called and in place of the header call, i would put othersitesnameheader.txt. this way, if they access through my site, they see my pages in my templates, but if they access from others sites, they will in fact be using different templates, same db, and be presented with a detailed.cgi page that is built on the spot that would allow for different headers and footers because of the extended header, footer name tag.

sounds like it will work. can anyone see some flaws or make suggestions?

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
one problem, would <%include <%othersitesheader.txt%>%> work though?

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
ok, i have it working so far. it displays the files from the main db ok in the search. the above poost doesn't work. is there a way that i can get differnet headers and footers displaying from the search link.html page?

i have made a new field in the db, it is called dcompany, this is where i type in a short company abbreviation.

what i want is for any pages that have templates, to be able to call that field and insert it before the header.txt include command - this way, i can have the same details pages showing but with different templates.

eliot, you said in your first post that i could include hidden fields from the search, is there any way of doing this that way? or can you suggest a better way.

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
In Reply To:
eliot, you said in your first post that i could include hidden fields from the search, is there any way of doing this that way? or can you suggest a better way.
Not really....and if I understand you correctly, you have added two fields in your links.db file for the header and footer files from outside sources, right?

Well, putting them in another directory than the templates directory will NOT work with the include codes you've posted and you cannot use SSI with other files located on another server.

Again, my original suggestion, simply including different HTML element hidden fields will do what you want...but since you have chosen another path to take (a more complicated one to say the least), I will have to think about this some more.

Regards,

Eliot Lee
Quote Reply
Re: Different Sites (folders) - Same Database In reply to
thanks, eliot. actually, it works all fine right now. i will use your suggestion regarding the bgcolor calls and logo calls, that's fine.

i am happy with the results it is making. it would be nice if there was a way, but you know, i'll probably neer use it. i am just going to offer as it is, if they want a certain bg, then fine, but that's it.

thanks for your help.

Quote Reply
Re: Different Sites (folders) - Same Database In reply to
You're welcome.

BTW: For the certain background image, all you have to do is have your users add in the following hidden field:

Code:

<input type="hidden" name="backimg" value="http://www.theirdomain.com/images/background.gif">


Then add the following tags in your search_results.html file:

Code:

<%if backimg%?
<body background="<ºckimg%>">
<%endif%>


Regards,

Eliot Lee