Index: openacs-4/packages/robot-detection/tcl/robot-detection-init.tcl =================================================================== RCS file: /usr/local/cvsroot/openacs-4/packages/robot-detection/tcl/robot-detection-init.tcl,v diff -u -r1.1 -r1.2 --- openacs-4/packages/robot-detection/tcl/robot-detection-init.tcl 20 Apr 2001 20:51:22 -0000 1.1 +++ openacs-4/packages/robot-detection/tcl/robot-detection-init.tcl 9 Mar 2002 02:00:02 -0000 1.2 @@ -7,26 +7,23 @@ @cvs-id $Id$ } -# Check to see if the robots table needs to be updated -# when the server starts (5 seconds after to be precise). -ad_schedule_proc -once t 5 ad_update_robot_list +# DRB: If the package is mounted check for robots. Since it's a singleton package +# we know there are only zero or one instances. +if { [db_0or1row robot_detection_id ""] } { -# this query is okay because robot-detection is a singleton package (ie, only one instance per site) -set robot_detection_id [db_string robot_detection_id { -select package_id from apm_packages -where package_key = 'robot-detection'} ] + # Check to see if the robots table needs to be updated + # when the server starts (5 seconds after to be precise). + ad_schedule_proc -once t 5 ad_update_robot_list -#FilterPattern is a comma separated value of URLs that you want to filter -set filter_pattern_parameter [string trim [ad_parameter -package_id $robot_detection_id FilterPattern]] -set filter_pattern_list [split $filter_pattern_parameter ","] + #FilterPattern is a comma separated value of URLs that you want to filter + set filter_pattern_parameter [string trim [ad_parameter -package_id $package_id FilterPattern]] + set filter_pattern_list [split $filter_pattern_parameter ","] -# Install ad_robot_filter for all specified patterns -foreach filter_pattern $filter_pattern_list { - ns_log Notice "Installing robot filter for $filter_pattern\n" - set filter_pattern [ad_urlencode [string trim $filter_pattern]] - ad_register_filter postauth GET $filter_pattern ad_robot_filter + # Install ad_robot_filter for all specified patterns + foreach filter_pattern $filter_pattern_list { + ns_log Notice "Installing robot filter for $filter_pattern\n" + set filter_pattern [ad_urlencode [string trim $filter_pattern]] + ad_register_filter postauth GET $filter_pattern ad_robot_filter + } } - - -