diff --git a/Repositories/statistics/scripts/eprints-usage_src.php b/Repositories/statistics/scripts/eprints-usage_src.php index b758373..f4c827a 100755 --- a/Repositories/statistics/scripts/eprints-usage_src.php +++ b/Repositories/statistics/scripts/eprints-usage_src.php @@ -586,7 +586,7 @@ if(isset($eprintname[$archive_name . $eprint_id])) { $eprint_name = $eprintname[$archive_name . $eprint_id]; } else { - $eprint_name = getePrintName($eprints_connections[$archive_name],$archive_name,$eprint_id); + $eprint_name = getePrintName($eprints_connections[$archive_name],$archive_name,$eprint_id,$eprints_version); $eprintname[$archive_name . $eprint_id] = $eprint_name; } if($eprint_name=='') { @@ -635,9 +635,11 @@ mysql_close($connect); // Look up the title corresponding to the specified eprint id. -function getePrintName($connection,$archive,$eprintid) { +function getePrintName($connection,$archive,$eprintid,$eprints_version) { // NJS 2006-06-14: DB connection now passed as an argument. $db = mysql_select_db($archive,$connection); + // NJS 2007-07-24: Added check for EPrints version, as the + // database structure changed between versions 2 and 3. if ( $eprints_version > 2 ) { $query3 = " @@ -661,6 +663,8 @@ // NJS 2006-04-25 Added check for empty result, probably a deleted item. // Look in the deleted items for details. if (mysql_num_rows($result3) == 0) { + // NJS 2007-07-24: Added check for EPrints version, as the + // database structure changed between versions 2 and 3. if ( $eprints_version > 2 ) { $query3 = "