- Fixed variable scoping problems.
1 parent b998009 commit 5f735514ff284f19e04e9ff4ab3ce4938d25b760
nstanger authored on 24 Jul 2007
Showing 1 changed file
View
8
Repositories/statistics/scripts/eprints-usage_src.php
}
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=='') {
// Do nothing.
}
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 = "
SELECT title
$suffix = '';
// 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 = "
SELECT title