diff --git a/Repositories/statistics/includes/inc.class.mysql.es.php b/Repositories/statistics/includes/inc.class.mysql.es.php index 9b34fa1..7dfdb8d 100755 --- a/Repositories/statistics/includes/inc.class.mysql.es.php +++ b/Repositories/statistics/includes/inc.class.mysql.es.php @@ -237,6 +237,9 @@ $this->addViewTypeCondition( 'download', $where_parts ); // End of addition -------------------------------------------------- + // Filter out unknown and deleted eprints. + $this->addDeletedFilter( $where_parts ); + $limit = $this->buildWhereClause( $where_parts, 'AND' ); // NJS 2006-01-18: Added count of country_code. @@ -296,6 +299,9 @@ $this->addStringCondition( 'country_code', '=', $ccode, $where_parts ); $this->addViewTypeCondition( 'download', $where_parts ); + // Filter out unknown and deleted eprints. + $this->addDeletedFilter( $where_parts ); + $limit = $this->buildWhereClause( $where_parts, 'AND' ); // NJS 2003-05-02: Added ascending order of title for eprints with @@ -691,6 +697,24 @@ } /* + NJS 2008-01-23 + + addDeletedFilter() + arguments: + $where_parts reference to an array to which to add the new + condition string + returns: void + + Add conditions to filter out eprints whose titles are either + "Unknown item [xxx]" or "Yyy [deleted]". + */ + function addDeletedFilter ( &$where_parts ) + { + $where_parts[] = "eprint_name NOT LIKE 'Unknown item [%]'"; + $where_parts[] = "eprint_name NOT LIKE '%[deleted]'"; + } + + /* NJS 2006-06-14 addStringCondition()