Gossamer Forum
Home : Products : Links 2.0 : Customization :

Page That's Customed to Other Webmaster's Sites

Quote Reply
Page That's Customed to Other Webmaster's Sites
Hello everyone,

I already have most of this done. What it is: I'm having a Links-generated page appear with the webpage layout of another website, who I'm partnering with, instead of mine so that they (the other webmaster) can use my database of links without the his visitors leaving his site. In return, I get exposure but having a "Powered by Christian-Search.Net" link on it. So I have it where the differnet page comes up then what i have for my site, see, but i want to make this page customizable to a bunch of differnet layout so don't have to make a new page for each webmaster i partner with. i'm using templates, to start. i want it so i have user file with all the info of the other website (URL of their header file, footer file, name of website, etc.) which will bb called user.txt. it will be on differnet lines in the file like this:

Code:
<%if site eq "01"%>
<%include /www/mydomain/data/01.txt[1]%>
<%endif%>

the [1] would mean to call the first line (i saw this in another script so i'm wondering if it's possible here), therefore calling the header file at http://www.whatever.com/header.txt. can i do this? thanks for any help you can give. God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
What you would have to do is add the following sub-routines (based on Widgetz's codes for the Rating Icons Mod) in your site_html_templates.pl file:

Code:
sub get_header {
#-----------------------------------------------------
my ($headerfile) = @_;
my $insert = `/absolute/path/to/header$i.txt`;
$insert =~ s,Content-type:\stext/html,,;
my ($i, $file);
for ($i = 0; $i++) {
$file = qq~$insert~;
}
return $file &#0124; &#0124; $headerfile;
}

AND

Code:
sub get_footer {
#-----------------------------------------------------
my ($footerfile) = @_;
my $insert = `/absolute/path/to/footer$i.txt`;
$insert =~ s,Content-type:\stext/html,,;
my ($i, $file);
for ($i = 0; $i++) {
$file = qq~$insert~;
}
return $file &#0124; &#0124; $footerfile;
}


Make sure there are NO spaces between the two | codes. (Also, I have not tested these codes, but they are based on the WebAdverts and Rating Graphics Mod. The logic is sound, but the codes may need to be tweaked.) Also, change /absolute/path/to/ to the complete absolute path to your template files.

Then add the following codes to your sub site_html_search_results routine in the site_html_templates.pl file:

Code:
headerfile => &get_header($rec{'FieldName'}),
footerfile => &get_footer($rec{'FieldName'})

Then you will have to name the template files in your template directory as the following:

Code:
header01.txt
header02.txt

etc.

AND

Code:
footer01.txt
footer02.txt

Then in your search_results.html file, add the following codes:

Code:
<%if site%>
<%headerfile%>
<%endif%>

and

Code:
<%if site%>
<%footerfile%>
<%endif%>

At least this would be the logical way to do it...In terms of exact syntax...it may take some more work.

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
I installed everything as like above and then you visit a script and it asks you to download it so the problem is in site_html_templates.pl. I'm not the CGI expert but I tried it with what I use to produce the header on my site and that didn't work, either.

Is there a way to have it so it can call the header and footer file from another domain so the webmaster can have the power to edit the file anytime?

I hope you can help with tweaking. God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
You might find this thread useful: http://www.gossamer-threads.com/...um3/HTML/004591.html

--Drew
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Nice suggestion...but I don't think that is what BoBo is after...He is after having one search template file with different included files in that search template file. Right, BoBo??

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
 
Quote:
Is there a way to have it so it can call the header and footer file from another domain so the webmaster can have the power to edit the file anytime?

Nope.

I will need some more time to work on this, okay?

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Hey Anthro!

Thanks very much for the help! You're right about what I'm after, one template that be can different files to be customized to a certain site's layout when needed. I had posted an earlier thread back in December (i think) when i was starting this idea. Now that i have the idea somewhat done, i'm just getting so it is easier and more efficient. I would have to create a file and sub routine for every site I wanted to partner with and it doesn't even work that well. You can see the thread I'm talking about at:

http://www.gossamer-threads.com/...um3/HTML/004207.html

Thank you very much for the help again, I'm messing with it myself but not having the best of luck. God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
I apologize that your other Topic got lost in the shuffle...it is hard to keep up with so many new Topics (and some duplicate Topics) in these forums.

I will try to stick with this Mod, since it seems like something I may want to integrate in my site. But I will entrust in you to test it and do the actual coding. I am finished writing formal Mods, since it is hard to support the ones that I've realized so far (with the help of other Gossamer users, of course).

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
BoBo - Would you want the site to have the same categories displayed too? I was thinking about doing something similar, but with having context-based categories. I am building several sections to my site and I wanted to have several discrete looking and acting link directories (say one for travel and one for cars). I didn't want a single mega-site (if you try to be all things to all people you end up nothing for no one ;-)

I also didn't want to run separate installs of Links.

I'd like to see what you end up with.

Pete
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Sorry I haven't replied to this thread in the last two days, I've been studying for mid-terms. I can agree with you, Eliot, you do a lot of help in this forum. Yes, I've been testing what you've given me and tried coding myself as well, so it's a team effort.

To totalhosting, I like your ideas, too. I was going to do that a while back but I didn't know how, then. You could use the multiple templates mod in the resource center and this mod to make a totally differnet type of search with the same Links program. I will post some stuff later, I need to study. God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Sorry....about the delay...still do not have a solution...I just got my computer back from the repair shop...my hard drive crashed last weekend...and I am now re-installing programs, and also downloading my web pages and scripts from the various servers where my sites are located PLUS I have two major reports to submit at work that are due next Friday...then I leave for a Conference for a week in San Francisco...so, it may be awhile.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
t aHello everyone!

I'm reviving this thread! Ok, so I have it so the custom search results page comes up when the visitor uses a special search box with a hidden field for the ID of the site. EX:

Code:
<input type="hidden" name="asite" value="siteID">

Then search.cgi sees that "?asite=siteID" with this:

Code:
# Blah.com Search Results Page
if ($in{'asite'} eq "siteID") {
$in{'query'} = "$orgquery";
&site_html_search_results_siteID;
}

then I have the sub routine "site_html_search_results_siteID" in site_html_template.pl that will bring up "search_siteID.html". It is the idea of Eliot (or AnthroRules) that he gave me in this thread:

http://www.gossamer-threads.com/...um3/HTML/004207.html

This works fine and thank you for it! My problem is when I try to put more than one of the if statement in search.cgi, like so:

Code:
# Blah.com Search Results Page
if ($in{'asite'} eq "siteID") {
$in{'query'} = "$orgquery";
&site_html_search_results_siteID;
}

# Bleh.com Search Results Page
if ($in{'asite'} eq "siteID2") {
$in{'query'} = "$orgquery";
&site_html_search_results_siteID2;
}

the first one will have it's template plus the default (or my) template come up on the search results page. I think this code needs to be made into a universal code for all the site IDs. Like this:

Code:
# Partner Site's Search Results Page
if ($in{'asite'} eq "ANY ID") {
$in{'query'} = "$orgquery";
&site_html_search_results_ANY ID;
}

i'm not a professional but wouldn't it look like this:

Code:
# JCNews.Net Search Results Page
if ($in{'asite'} eq "$in{'ID'}") {
$in{'query'} = "$orgquery";
&site_html_search_results_$in{'ID'};
}

thanks for the help, everything is work great! God bless!

------------------
Daniel

dan@christian-search.net
www.christian-search.net

[This message has been edited by BoBo (edited March 20, 2000).]
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
That will not work...The only thing you can do is what you have done with the other if conditional codes.

If you want the search results to go to your own search results, use else like the following:

Code:
else {
&site_html_search_results
}

This will take care of the ANY_ID thing you are trying to do.

Regards,


------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
That is the way I have it, exactly like this in my search.cgi:

Code:
# Print out the HTML results.
# JCNews.Net Search Results Page
if ($in{'asite'} eq "jcnews") {
$in{'query'} = "$orgquery";
&site_html_search_results_jcnews;
}

# LesPorter.org Search Results Page
if ($in{'asite'} eq "lesporter") {
$in{'query'} = "$orgquery";
&site_html_search_results_lesporter;
}

# Regular Search Results
else {
$in{'query'} = "$orgquery";
&site_html_search_results;
}
}

is there anything I can do? go try it out on JCNews.net and LesPorter.org. the one on JCNews.net is the one that is messed up, it's the third article down. thanks for the help, God bless!



------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Hello Everyone again,

I tried this code and it didn't work. But could this possibly work:

Code:
# Print out the HTML results.
if ($in{'asite'} eq "jcnews") {
$in{'query'} = "$orgquery";
&site_html_search_results_jcnews;
elsif ($in{'asite'} eq "lesporter") {
$in{'query'} = "$orgquery";
&site_html_search_results_lesporter;
else {
$in{'query'} = "$orgquery";
&site_html_search_results;
}
}

Thanks for the help, God bless!



------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Hello again!

I found some problems with the above code so it looks like this now:

Code:
# Print out the HTML results.
if ($in{'asite'} eq "jcnews") {
$in{'query'} = "$orgquery";
&site_html_search_results_jcnews;
}
elsif ($in{'asite'} eq "lesporter") {
$in{'query'} = "$orgquery";
&site_html_search_results_lesporter;
}
else {
$in{'query'} = "$orgquery";
&site_html_search_results;
}
}

The only problem is that all the search results templates, besides the default one, come up as the first or top template in the if statements (jcnews). What is the matter? Thanks for the help, God bless!



------------------
Daniel

dan@christian-search.net
http://www.christian-search.net
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Try using single quotes rather than double qoutes for the ID value.

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: Page That's Customed to Other Webmaster's Sites In reply to
Thanks again for your help. I tried you idea and it still only gives the 'jcnews' (or the first one) layout. This is exactly was I put in:

Code:
# Print out the HTML results.
if ($in{'asite'} eq 'jcnews') {
$in{'query'} = "$orgquery";
&site_html_search_results_jcnews;
}
elsif ($in{'asite'} eq 'lesporter') {
$in{'query'} = "$orgquery";
&site_html_search_results_lesporter;
}
else {
$in{'query'} = "$orgquery";
&site_html_search_results;
}
}

Is there anything that could be making it this way? Thanks again for all your help, God bless!

------------------
Daniel

dan@christian-search.net
http://www.christian-search.net