diff --git a/Repositories/statistics/scripts/fix-titles_src.php b/Repositories/statistics/scripts/fix-titles_src.php index 998471f..9c2027a 100755 --- a/Repositories/statistics/scripts/fix-titles_src.php +++ b/Repositories/statistics/scripts/fix-titles_src.php @@ -1,5 +1,19 @@ $details) +foreach ($eprintsdbs as $archive => $details) { - $eprints_connections[$archive_name] = + $eprints_connections[$archive] = mysql_connect($details['sqlserver'],$details['username'],$details['password']); } @@ -75,10 +89,23 @@ "Unknown%", to make things faster, but that doesn't cover different titles for the same item (e.g., from corrected punctuation). */ -$query = " - SELECT DISTINCT archive_name, archiveid - FROM view - ORDER BY archive_name, archiveid"; +if ( $argc == 1 ) +{ + $query = " + SELECT DISTINCT archive_name, archiveid + FROM view + ORDER BY archive_name, archiveid"; +} +else +{ + $query = " + SELECT DISTINCT archive_name, archiveid + FROM view + WHERE archive_name = '$archive_name' + AND archiveid = $eprint_id + ORDER BY archive_name, archiveid"; +} + $result = mysql_query( $query, $connect ); $total_rows = ( $result ) ? mysql_num_rows( $result ) : 0; $count = 0;