version 1.48, 2003/12/25 13:11:56
|
version 1.52, 2003/12/27 01:52:04
|
Line 134 sub dynamicmeta {
|
Line 134 sub dynamicmeta {
|
'count' => 0, |
'count' => 0, |
'course' => 0, |
'course' => 0, |
'course_list' => '', |
'course_list' => '', |
'avetries' => 0, |
'avetries' => 'NULL', |
'avetries_list' => '', |
'avetries_list' => '', |
'stdno' => 0, |
'stdno' => 0, |
'stdno_list' => '', |
'stdno_list' => '', |
Line 144 sub dynamicmeta {
|
Line 144 sub dynamicmeta {
|
'goto_list' => '', |
'goto_list' => '', |
'comefrom' => 0, |
'comefrom' => 0, |
'comefrom_list' => '', |
'comefrom_list' => '', |
'difficulty' => 0, |
'difficulty' => 'NULL', |
'difficulty_list' => '' |
'difficulty_list' => '', |
|
'clear' => 'NULL', |
|
'technical' => 'NULL', |
|
'correct' => 'NULL', |
|
'helpful' => 'NULL', |
|
'depth' => 'NULL', |
|
'comments' => '' |
); |
); |
my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//); |
my ($adomain,$aauthor)=($url=~/^(\w+)\/(\w+)\//); |
my $prodir=&propath($adomain,$aauthor); |
my $prodir=&propath($adomain,$aauthor); |
Line 182 sub dynamicmeta {
|
Line 188 sub dynamicmeta {
|
if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } |
if (defined($cnt{$cat})) { $cnt{$cat}++; } else { $cnt{$cat}=1; } |
unless ($listitems{$cat} eq 'app') { |
unless ($listitems{$cat} eq 'app') { |
if (defined($sum{$cat})) { |
if (defined($sum{$cat})) { |
$sum{$cat}+=$evaldata{$esckey}; |
$sum{$cat}+=&unescape($evaldata{$esckey}); |
$concat{$cat}.=','.$item; |
$concat{$cat}.=','.$item; |
} else { |
} else { |
$sum{$cat}=$evaldata{$esckey}; |
$sum{$cat}=&unescape($evaldata{$esckey}); |
$concat{$cat}=$item; |
$concat{$cat}=$item; |
} |
} |
} else { |
} else { |
if (defined($sum{$cat})) { |
if (defined($sum{$cat})) { |
if ($evaldata{$esckey}=~/\w/) { |
if ($evaldata{$esckey}=~/\w/) { |
$sum{$cat}.='<hr>'.$evaldata{$esckey}; |
$sum{$cat}.='<hr />'.&unescape($evaldata{$esckey}); |
} |
} |
} else { |
} else { |
$sum{$cat}=''.$evaldata{$esckey}; |
$sum{$cat}=''.&unescape($evaldata{$esckey}); |
} |
} |
} |
} |
} |
} |
Line 235 sub dynamicmeta {
|
Line 241 sub dynamicmeta {
|
# --------------- Read loncapa_apache.conf and loncapa.conf and get variables |
# --------------- Read loncapa_apache.conf and loncapa.conf and get variables |
my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf'); |
my $perlvarref=LONCAPA::Configuration::read_conf('loncapa.conf'); |
my %perlvar=%{$perlvarref}; |
my %perlvar=%{$perlvarref}; |
undef $perlvarref; # remove since sensitive and not needed |
undef $perlvarref; |
delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed |
delete $perlvar{'lonReceipt'}; # remove since sensitive and not needed |
|
|
# ------------------------------------- Only run if machine is a library server |
# ------------------------------------- Only run if machine is a library server |
Line 276 my $dbh;
|
Line 282 my $dbh;
|
"title TEXT, author TEXT, subject TEXT, url TEXT, keywords TEXT, ". |
"title TEXT, author TEXT, subject TEXT, url TEXT, keywords TEXT, ". |
"version TEXT, notes TEXT, abstract TEXT, mime TEXT, language TEXT, ". |
"version TEXT, notes TEXT, abstract TEXT, mime TEXT, language TEXT, ". |
"creationdate DATETIME, lastrevisiondate DATETIME, owner TEXT, ". |
"creationdate DATETIME, lastrevisiondate DATETIME, owner TEXT, ". |
"copyright TEXT, ". |
"copyright TEXT, dependencies TEXT, ". |
|
"modifyinguser TEXT, authorspace TEXT, ". |
|
"lowestgradelevel INTEGER UNSIGNED, highestgradelevel INTEGER UNSIGNED, ". |
|
"standards TEXT, ". |
"count INTEGER UNSIGNED, ". |
"count INTEGER UNSIGNED, ". |
"course INTEGER UNSIGNED, course_list TEXT, ". |
"course INTEGER UNSIGNED, course_list TEXT, ". |
"goto INTEGER UNSIGNED, goto_list TEXT, ". |
"goto INTEGER UNSIGNED, goto_list TEXT, ". |
Line 285 my $dbh;
|
Line 294 my $dbh;
|
"stdno INTEGER UNSIGNED, stdno_list TEXT, ". |
"stdno INTEGER UNSIGNED, stdno_list TEXT, ". |
"avetries FLOAT, avetries_list TEXT, ". |
"avetries FLOAT, avetries_list TEXT, ". |
"difficulty FLOAT, difficulty_list TEXT, ". |
"difficulty FLOAT, difficulty_list TEXT, ". |
|
"clear FLOAT, technical FLOAT, correct FLOAT, helpful FLOAT, depth FLOAT, ". |
|
"comments TEXT, ". |
|
|
"FULLTEXT idx_title (title), ". |
"FULLTEXT idx_title (title), ". |
"FULLTEXT idx_author (author), FULLTEXT idx_subject (subject), ". |
"FULLTEXT idx_author (author), FULLTEXT idx_subject (subject), ". |
"FULLTEXT idx_url (url), FULLTEXT idx_keywords (keywords), ". |
"FULLTEXT idx_url (url), FULLTEXT idx_keywords (keywords), ". |
"FULLTEXT idx_version (version), FULLTEXT idx_notes (notes), ". |
"FULLTEXT idx_notes (notes), ". |
"FULLTEXT idx_abstract (abstract), FULLTEXT idx_mime (mime), ". |
"FULLTEXT idx_abstract (abstract), FULLTEXT idx_mime (mime), ". |
"FULLTEXT idx_language (language), FULLTEXT idx_owner (owner), ". |
"FULLTEXT idx_owner (owner), ". |
"FULLTEXT idx_copyright (copyright)) ". |
"FULLTEXT idx_standards (standards))". |
"TYPE=MyISAM"; |
"TYPE=MyISAM"; |
# It would sure be nice to have some logging mechanism. |
# It would sure be nice to have some logging mechanism. |
unless ($dbh->do($make_metadata_table)) { |
unless ($dbh->do($make_metadata_table)) { |
Line 326 my $insert_sth = $dbh->prepare
|
Line 338 my $insert_sth = $dbh->prepare
|
"?,". # revisiondate |
"?,". # revisiondate |
"?,". # owner |
"?,". # owner |
"?,". # copyright |
"?,". # copyright |
|
"?,". # dependencies |
|
"?,". # modifyinguser |
|
"?,". # authorspace |
|
"?,". # lowestgradelevel |
|
"?,". # highestgradelevel |
|
"?,". # standards |
"?,". # count |
"?,". # count |
"?,". # course |
"?,". # course |
"?,". # course_list |
"?,". # course_list |
Line 340 my $insert_sth = $dbh->prepare
|
Line 358 my $insert_sth = $dbh->prepare
|
"?,". # avetries |
"?,". # avetries |
"?,". # avetries_list |
"?,". # avetries_list |
"?,". # difficulty |
"?,". # difficulty |
"?". # difficulty_list |
"?,". # difficulty_list |
|
"?,". # clear |
|
"?,". # technical |
|
"?,". # correct |
|
"?,". # helpful |
|
"?,". # depth |
|
"?". # comments |
")" |
")" |
); |
); |
|
|
Line 379 foreach my $user (@homeusers) {
|
Line 403 foreach my $user (@homeusers) {
|
sqltime($ref->{'lastrevisiondate'}), |
sqltime($ref->{'lastrevisiondate'}), |
$ref->{'owner'}, |
$ref->{'owner'}, |
$ref->{'copyright'}, |
$ref->{'copyright'}, |
|
$ref->{'dependencies'}, |
|
$ref->{'modifyinguser'}, |
|
$ref->{'authorspace'}, |
|
$ref->{'lowestgradelevel'}, |
|
$ref->{'highestgradelevel'}, |
|
$ref->{'standards'}, |
$dyn{'count'}, |
$dyn{'count'}, |
$dyn{'course'}, |
$dyn{'course'}, |
$dyn{'course_list'}, |
$dyn{'course_list'}, |
Line 393 foreach my $user (@homeusers) {
|
Line 423 foreach my $user (@homeusers) {
|
$dyn{'avetries'}, |
$dyn{'avetries'}, |
$dyn{'avetries_list'}, |
$dyn{'avetries_list'}, |
$dyn{'difficulty'}, |
$dyn{'difficulty'}, |
$dyn{'difficulty_list'} |
$dyn{'difficulty_list'}, |
|
$dyn{'clear'}, |
|
$dyn{'technical'}, |
|
$dyn{'correct'}, |
|
$dyn{'helpful'}, |
|
$dyn{'depth'}, |
|
$dyn{'comments'} |
)) { |
)) { |
print LOG "\nMySQL Error Insert: ".$dbh->errstr."\n"; |
print LOG "\nMySQL Error Insert: ".$dbh->errstr."\n"; |
die $dbh->errstr; |
die $dbh->errstr; |