I think I found it. This from a post in 1999 from Elliot. This "mod" was not added to the resource page and so I want to post and make sure this is still good. You can find all of this and more at http://gossamer-threads.com/perl/forum/showflat.pl?ubb=000413:Forum11
<------ Start of Quote --------->
Okay, I figured out a way to link header and footer text files into LINKS web pages. Here is what you do:
1) Insert the following codes into the "links.cfg" file after the SITE TITLE line:
Codes:
---------------------------------------------
sub site_header {
# -----------------------------------
# This is the header sub-routine. It will place a header into your web pages.
my (%patterns) = (
'MSIE' => 'header.txt',
'Mozilla\/4' => 'header.txt',
'Mozilla\/3' => 'header.txt',
'Mozilla\/2.02' => 'header.txt',
'Mozilla\/2' => 'header.txt',
'Mozilla\/1.01' => 'header.txt',
'Mozilla\/1' => 'header.txt',
'other' => 'header.txt'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "/path/to/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "/path/to/$patterns{'other'}") or return "Can't find include file: $patterns{'other'}";
return join ("", <INC> );
}
sub site_footer {
# -----------------------------------
# This is footer sub-routine. It will place
a footer into your web pages.
my (%patterns) = (
'MSIE' => 'footer.txt',
'Mozilla\/4' => 'footer.txt',
'Mozilla\/3' => 'footer.txt',
'Mozilla\/2.02' => 'footer.txt',
'Mozilla\/2' => 'footer.txt',
'Mozilla\/1.01' => 'footer.txt',
'Mozilla\/1' => 'footer.txt',
'other' => 'footer.txt'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "/path/to/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "/path/to/$patterns{'other'}") or return "Can't find include file: $patterns{'other'}";
return join ("", <INC> );
}
---------------------------------------------
(Change the /path/to/ to the ABSOLUTE path where your header and footer text files are located.)
2) Insert the following codes into your global settings in your "site_html_template.pl" file:
Codes:
--------------------------------------------
site_header => &site_header,
site_footer => &site_footer,
--------------------------------------------
3) Upload these files to the appropriate directories in your server. Make sure that you also upload the header and footer text files into your server in the directory you specified in the "links.cfg" file.
4) In your template files, insert the following codes in the places where you want to insert your header and footer files:
Code: (for Header)
---------------------------------------------
<%site_header%>
---------------------------------------------
Code: (for Footer)
---------------------------------------------
<%site_footer%>
---------------------------------------------
The advantage of doing this is that you do not have to clean up your codes (by inserting operators, such as \) and that if you want to change the header and footer, you can do this via a text or WYSIWYG editor (Front Page, Claris Home Page, etc.). Also, like my site, if you have linked pages that are not included in the LINKS program, then you can use a header/footer program that will allow text files to be inserted via SSI.
This reduces the time you have to spend cleaning up codes and putting them into the
site_html_template.pl file.
Note: This mod will only work if you have Server Side Includes (SSI) activated on your server. For Apache Servers, make sure that you make your "index" files to be index.shtml. For NT Servers, make sure that you active shtml or shtm files.
Regards,
------------------
Eliot Lee
<--------- End of Quote ----------->
Does this work? Any suggested changes, improvements etc? This is from an old post. I want to make sure this is still good to go.
Thanks,
Jack
Administrator
SoapVoice.com!
<------ Start of Quote --------->
Okay, I figured out a way to link header and footer text files into LINKS web pages. Here is what you do:
1) Insert the following codes into the "links.cfg" file after the SITE TITLE line:
Codes:
---------------------------------------------
sub site_header {
# -----------------------------------
# This is the header sub-routine. It will place a header into your web pages.
my (%patterns) = (
'MSIE' => 'header.txt',
'Mozilla\/4' => 'header.txt',
'Mozilla\/3' => 'header.txt',
'Mozilla\/2.02' => 'header.txt',
'Mozilla\/2' => 'header.txt',
'Mozilla\/1.01' => 'header.txt',
'Mozilla\/1' => 'header.txt',
'other' => 'header.txt'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "/path/to/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "/path/to/$patterns{'other'}") or return "Can't find include file: $patterns{'other'}";
return join ("", <INC> );
}
sub site_footer {
# -----------------------------------
# This is footer sub-routine. It will place
a footer into your web pages.
my (%patterns) = (
'MSIE' => 'footer.txt',
'Mozilla\/4' => 'footer.txt',
'Mozilla\/3' => 'footer.txt',
'Mozilla\/2.02' => 'footer.txt',
'Mozilla\/2' => 'footer.txt',
'Mozilla\/1.01' => 'footer.txt',
'Mozilla\/1' => 'footer.txt',
'other' => 'footer.txt'
);
foreach (keys %patterns) {
if ($ENV{'HTTP_USER_AGENT'} =~ /$_/) {
open (INC, "/path/to/$patterns{$_}") or return "Can't find include file: $patterns{$_}";
return join ("", <INC> );
}
}
open (INC, "/path/to/$patterns{'other'}") or return "Can't find include file: $patterns{'other'}";
return join ("", <INC> );
}
---------------------------------------------
(Change the /path/to/ to the ABSOLUTE path where your header and footer text files are located.)
2) Insert the following codes into your global settings in your "site_html_template.pl" file:
Codes:
--------------------------------------------
site_header => &site_header,
site_footer => &site_footer,
--------------------------------------------
3) Upload these files to the appropriate directories in your server. Make sure that you also upload the header and footer text files into your server in the directory you specified in the "links.cfg" file.
4) In your template files, insert the following codes in the places where you want to insert your header and footer files:
Code: (for Header)
---------------------------------------------
<%site_header%>
---------------------------------------------
Code: (for Footer)
---------------------------------------------
<%site_footer%>
---------------------------------------------
The advantage of doing this is that you do not have to clean up your codes (by inserting operators, such as \) and that if you want to change the header and footer, you can do this via a text or WYSIWYG editor (Front Page, Claris Home Page, etc.). Also, like my site, if you have linked pages that are not included in the LINKS program, then you can use a header/footer program that will allow text files to be inserted via SSI.
This reduces the time you have to spend cleaning up codes and putting them into the
site_html_template.pl file.
Note: This mod will only work if you have Server Side Includes (SSI) activated on your server. For Apache Servers, make sure that you make your "index" files to be index.shtml. For NT Servers, make sure that you active shtml or shtm files.
Regards,
------------------
Eliot Lee
<--------- End of Quote ----------->
Does this work? Any suggested changes, improvements etc? This is from an old post. I want to make sure this is still good to go.
Thanks,
Jack
Administrator
SoapVoice.com!