--- views.module.orig	2006-10-08 05:02:51.000000000 -0400
+++ views.module	2006-10-12 09:13:05.468750000 -0400
@@ -597,6 +597,12 @@ function views_view_block($vid) {
  *   without paging on.
 */
 function views_build_view($type, &$view, $args = array(), $use_pager = false, $limit = 0, $page = 0) {
+  // Call a hook that'll let modules modify the view query before it is created
+  foreach (module_implements('views_pre_query') as $module) {
+    $function = $module .'_views_pre_query';
+    $output .= $function($view);
+  }
+
   // Fix a number of annoying whines when NULL is passed in..
   if ($args == NULL) {
     $args = array();
