mdj1,
This is a totally design issue. If you can provide the specs for what you want to appear, I can assist with writing the HTML codes. If I understand you correctly, you want to have a table that has two columns. One column with a menu and another column with the search results, right?
Also, you might be having problems with the header codes, which could be adversely affecting the table. If I may provide a suggestion? Try to use an inserted .txt or .htm file for the header file.
You can do this by adding the following codes to the bottom of your
db.cgi file:
Code:
sub header_file {
#---------------------------------------------
# This prints out header file that is inserted into web pages.
open (INC, "/path/to/header.txt") or return "Can't find include file: $patterns{'Other'}";
return join ("", <INC> );
}
Change the /path/to/ to your header.txt file. The header.txt file should include the HTML codes for the header portion of your site minus the following codes:
Code:
<html>
<head>
<title></title>
</head>
<body>
These codes are already in your view_success routine.
Then in your
sub html_header routine, use the following codes:
Code:
sub html_top_header {
# --------------------------------------------------------
# Print the top header.
print qq|
|;print &header_file; print qq|
|;
}
Then in your
sub view_success, place the following codes below the <body> tag:
Code:
|; &html_top_header; print qq|
You could also repeat these above steps in creating a "menu sub-routine" for the links in the left column of your table. Make sure that you rename the sub-routines to something specific relating to "menus".
Example:
sub menu_file (in db.cgi)
sub html_menu (in html.pl)
An example table for your
sub view_sucess routine could look like the following:
Code:
<table border="0" cellpadding="2" cellspacing="0" width="90%">
<tr>
<td width="30%">|; print html_menu; print qq|</td>
<td width="70%">
HTML codes
|;
<P>
<$font>
Your search for <$font_subtitle><b>$search_terms</b></font><br>
returned <b>$db_total_hits</b> match(es) out of a total of <b>|; &num_records;
print qq|</b> Records.
<p>
|;
if ($db_next_hits) {
print "<p><center><$font><b>Result Pages:</b> $db_next_hits</font></center></p>";
}
print qq|
</font></center></p>
|;
# Go through each hit and convert the array to hash and send to
# html_record for printing.
if ( $db_total_hits == 1 ) {
%rec = &array_to_hash(0, @hits);
&html_record_long(%rec);
print "<P><CENTER><$font><b><a href=\"$ENV{'HTTP_REFERER'}\"><img src=\"http://www.coco.cc.az.us/images/navigation/smredarrow.gif\" border=\"0\"> Previous Page</a></b></font>";
}
else {
&html_record_row(&array_to_hash($_, @hits));
for (0 .. $numhits - 1) {
&html_record(&array_to_hash($_, @hits));
}
print "</TABLE></DIV></CENTER>";
}
if ($db_next_hits) {
print "<p><center><$font><b>Result Pages:</b> $db_next_hits</font></center>";
}
&html_footer;
</td></tr>
</table>
Of course, you can change the width percentages to something that fits your site. You can also change the alignment of the table by adding in the following codes:
Code:
<div align="center"><center>
</div></center>
I tend to use percentages rather than pixils, because percentages show up more universally with different screen size resolutions (e.g., 640x480, 800x600, 1024x800, etc.). Using pixils creats too much white space.
Hope this helps.
Regards,
------------------
Eliot Lee
Founder and Editor
Anthro TECH, L.L.C
http://www.anthrotech.com/
info@anthrotech.com
==========================
Coconino Community College
http://www.coco.cc.az.us/
Web Technology
Coordinator
elee@coco.cc.az.us
[This message has been edited by Eliot (edited September 27, 1999).]