I am using a relational database setup.
My sub html_record_long does display $rec2{fieldname} --> see code below.
My sub html_record will not display $rec2{fieldname} --> see code below.
When I try to use the same code from sub html_record_long in sub html_record I have problems; the $rec2{fieldname} displays but the actual item record gets corrupted.
Can anyone help me out with this switch?
Thank you.
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# This is the "short display" -- the list of records that are returned
# from a search.
my (%rec) = @_;
$rec{$db_key} =~ s/<.?B>//g;
# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $i);
$long_url = $ENV{'QUERY_STRING'};
$long_url =~ s/\&nh=\d+//;
$long_url =~ s/\&mh=\d+//;
$long_url = "$db_script_url?$long_url&nh=$record_number&mh=1";
print "<TD HEIGHT=10>"; # do not remove this! It is necessary to make the records display properly
# <-- START of short display formatting -- >
print qq|<a href="$long_url"><font size=4>$rec{'RecipeName'}</font></a> (<$font>a $rec{'RecipeCategory'} usually served at $rec{'MealTime'} and prepared $rec{'UsedWhen'}</font>)
|;
# <-- End of short display formatting -- >
print "</TD>"; # do not remove this! It is necessary to make the records display properly
}
sub html_record_long {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
$rec{$db_key} =~ s/<.?B>//g;
&switch_to_user;
$rec{'UserID'} =~ s/<\/?B>//g;
%rec2 = &get_record($rec{'UserID'});
&switch_to_item;
($db_auto_generate and print &build_html_record(%rec) and return);
My sub html_record_long does display $rec2{fieldname} --> see code below.
My sub html_record will not display $rec2{fieldname} --> see code below.
When I try to use the same code from sub html_record_long in sub html_record I have problems; the $rec2{fieldname} displays but the actual item record gets corrupted.
Can anyone help me out with this switch?
Thank you.
sub html_record {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
# This is the "short display" -- the list of records that are returned
# from a search.
my (%rec) = @_;
$rec{$db_key} =~ s/<.?B>//g;
# create link to full display
$record_number = ((($nh - 1) * $db_max_hits) + $i);
$long_url = $ENV{'QUERY_STRING'};
$long_url =~ s/\&nh=\d+//;
$long_url =~ s/\&mh=\d+//;
$long_url = "$db_script_url?$long_url&nh=$record_number&mh=1";
print "<TD HEIGHT=10>"; # do not remove this! It is necessary to make the records display properly
# <-- START of short display formatting -- >
print qq|<a href="$long_url"><font size=4>$rec{'RecipeName'}</font></a> (<$font>a $rec{'RecipeCategory'} usually served at $rec{'MealTime'} and prepared $rec{'UsedWhen'}</font>)
|;
# <-- End of short display formatting -- >
print "</TD>"; # do not remove this! It is necessary to make the records display properly
}
sub html_record_long {
# --------------------------------------------------------
# How a record will be displayed. This is used primarily in
# returning search results and how it is formatted. The record to
# be displayed will be in the %rec hash.
my (%rec) = @_; # Load any defaults to put in the VALUE field.
$rec{$db_key} =~ s/<.?B>//g;
&switch_to_user;
$rec{'UserID'} =~ s/<\/?B>//g;
%rec2 = &get_record($rec{'UserID'});
&switch_to_item;
($db_auto_generate and print &build_html_record(%rec) and return);