I'm starting a new thread here.
I just noticed this problem. I did a search and the link in the short display of the second record sent me to 17 of 2. There was no data in the view fields, but it seemed OK in the edit field.
I commented out the new code JPDeni cacame up with (the class array), and all seems back to OK.
I pasted this code into sub html_record, just before you define the short display.
Perhaps there is a better place to put it?
CODE:
#next section added JPD/FMN 6/4/99 #class_name_array
#
#$teacher1_field = 9; # Change this to match the number of the field where the teacher's id is
#$class1_field = 10; # Change this to match the number of the field where the class name is
#open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name.
#Reason: $!");
# if ($db_use_flock) { flock(DB, 1); }
# LINE: while (<DB> ) {
# next if /^#/;
# next if /^\s*$/;
# $line1 = $_;
# chomp ($line1);
# @fields1 = &split_decode ($line1);
# if ($fields1[$teacher1_field] eq $db_userid) {
# if (!(grep $_ eq $fields1[$class1_field], @classes1)) {
# push (@classes1, $fields1[$class1_field]);
# }
# }
# }
#close DB;
I just noticed this problem. I did a search and the link in the short display of the second record sent me to 17 of 2. There was no data in the view fields, but it seemed OK in the edit field.
I commented out the new code JPDeni cacame up with (the class array), and all seems back to OK.
I pasted this code into sub html_record, just before you define the short display.
Perhaps there is a better place to put it?
CODE:
#next section added JPD/FMN 6/4/99 #class_name_array
#
#$teacher1_field = 9; # Change this to match the number of the field where the teacher's id is
#$class1_field = 10; # Change this to match the number of the field where the class name is
#open (DB, "<$db_file_name") or &cgierr("unable to open $db_file_name.
#Reason: $!");
# if ($db_use_flock) { flock(DB, 1); }
# LINE: while (<DB> ) {
# next if /^#/;
# next if /^\s*$/;
# $line1 = $_;
# chomp ($line1);
# @fields1 = &split_decode ($line1);
# if ($fields1[$teacher1_field] eq $db_userid) {
# if (!(grep $_ eq $fields1[$class1_field], @classes1)) {
# push (@classes1, $fields1[$class1_field]);
# }
# }
# }
#close DB;