- Added EPrints version configuration item.
- Added support for different database structures in v2/v3 of EPrints.
1 parent 6528a9d commit b9980097e303f0f31026921a21bd5bc5365b0f4a
nstanger authored on 24 Jul 2007
Showing 3 changed files
View
4
Repositories/statistics/config/inc.vars.es_src.php
"prog_title_public" => "ePrints Statistics",
"short_prog_title" => "es",
"public_prog" => "index.php",
"public_prog_request_uri" => "/index.php",
// NJS 2007-07-24: Added EPrints version setting, as the
// repository database structure changed between version
// 2.x and 3.x. Use the major version number only.
"eprints_version" => 3,
// NJS 2006-06-15: Made location URL a list and added list of
// full repository names.
"eprints_location" => array(
"default" => "http://##EPRINTS_HOST####EPRINTS_PORT##",
View
38
Repositories/statistics/includes/inc.class.mysql.es.php
$GLOBALS["config_vars"]["connections"]["eprints_archives"][$archive]["sqlpass_eprints"]
);
$db_eprints = mysql_select_db( $archive, $conn_eprints );
if (!$db_eprints) return $eprint_title;
$query_eprints = "
SELECT title
FROM archive
WHERE eprintid = $eprint_id
";
// NJS 2007-07-24: Added check for EPrints version, as the
// database structure changed between versions 2 and 3.
if ($GLOBALS["config_vars"]["general"]["eprints_version"] > 2)
{
$query_eprints = "
SELECT title
FROM eprint
WHERE eprintid = $eprint_id
AND eprint_status = 'archive'
";
}
else
{
$query_eprints = "
SELECT title
FROM archive
WHERE eprintid = $eprint_id
";
}
$result_eprints = mysql_query($query_eprints,$conn_eprints);
$row_eprints = mysql_fetch_assoc($result_eprints);
$eprint_title = trim($row_eprints["title"]);
$eprint_title = preg_replace("/\s+/"," ",$eprint_title);
View
Repositories/statistics/scripts/eprints-usage_src.php