-# add OPAC 'hidelostitems'
-#if (C4::Context->preference('hidelostitems') == 1) {
-# # either lost ge 0 or no value in the lost register
-# $query ="($query) and ( (lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='') )";
-#}
-#
-# add OPAC suppression - requires at least one item indexed with Suppress
-if (C4::Context->preference('OpacSuppression')) {
- # OPAC suppression by IP address
- if (C4::Context->preference('OpacSuppressionByIPRange')) {
- my $IPAddress = $ENV{'REMOTE_ADDR'};
- my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
- if ($IPAddress !~ /^$IPRange/) {
- if ( $query_type eq 'pqf' ) {
- $query = '@not '.$query.' @attr 1=9011 1';
- } else {
- $query = "($query) not Suppress=1";
- }
- }
- }
- else {
- if ( $query_type eq 'pqf' ) {
- #$query = "($query) && -(suppress:1)"; #QP syntax
- $query = '@not '.$query.' @attr 1=9011 1'; #PQF syntax
- } else {
- $query = "($query) not Suppress=1";
- }
- }
-}
-