Diff for /loncom/interface/lonsearchcourse.pm between versions 1.11 and 1.12

version 1.11, 2024/02/11 22:20:06 version 1.12, 2024/02/11 23:03:13
Line 138  sub course_search { Line 138  sub course_search {
     my $c=$r->connection;      my $c=$r->connection;
     if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db",      if (tie(%hash,'GDBM_File',$env{'request.course.fn'}.".db",
             &GDBM_READER(),0640)) {              &GDBM_READER(),0640)) {
         foreach (sort(keys(%hash))) {          foreach my $key (sort(keys(%hash))) {
             if ($c->aborted()) { last; }              last if ($c->aborted());
             if (($_=~/^src\_(.+)$/)) {              if ($key =~ /^src\_(.+)$/) {
                 my $rid = $1;                  my $rid = $1;
                 unless ($env{'request.role.adv'}) {                  unless ($env{'request.role.adv'}) {
                     next if ($hash{'randomout_'.$rid} || $hash{'deeplinkout_'.$rid});                      next if ($hash{'randomout_'.$rid} || $hash{'deeplinkout_'.$rid});
Line 152  sub course_search { Line 152  sub course_search {
                     }                      }
                 }                  }
                 my $symb=&make_symb($1);                  my $symb=&make_symb($1);
                 &checkonthis($r,$1,$hash{$_},0,&Apache::lonnet::gettitle($symb),                  &checkonthis($r,$1,$hash{$key},0,&Apache::lonnet::gettitle($symb),
                              $fulltext,$symb,$target,@allwords);                               $fulltext,$symb,$target,@allwords);
             }              }
         }          }
Line 296  sub checkonthis { Line 296  sub checkonthis {
 # Check also the dependencies of this one  # Check also the dependencies of this one
     my $dependencies=      my $dependencies=
                 &Apache::lonnet::metadata($url,'dependencies');                  &Apache::lonnet::metadata($url,'dependencies');
     foreach (split(/\,/,$dependencies)) {      foreach my $url (split(/\,/,$dependencies)) {
        if (($_=~/^\/res\//) && (!$alreadyseen{$id})) {         if (($url =~ /^\/res\//) && (!$alreadyseen{$id})) {
           &checkonthis($r,$id,$_,$level+1,'',$fulltext,undef,$target,@allwords);            &checkonthis($r,$id,$url,$level+1,'',$fulltext,undef,$target,@allwords);
        }         }
     }      }
 }  }
   
 sub checkwords {  sub checkwords {
     my ($result,$applies,@allwords) = @_;      my ($result,$applies,@allwords) = @_;
     foreach (@allwords) {      foreach my $word (@allwords) {
         if ($_=~/\w/) {          if ($word =~ /\w/) {
             if ($result=~/$_/si) {              if ($result =~ /$word/si) {
                 $applies++;                  $applies++;
             }              }
         }          }

Removed from v.1.11  
changed lines
  Added in v.1.12


FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>