Index: nodewords.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/nodewords/Attic/nodewords.module,v
retrieving revision 1.57.2.20
diff -u -p -r1.57.2.20 nodewords.module
--- nodewords.module	9 Feb 2009 08:29:20 -0000	1.57.2.20
+++ nodewords.module	14 May 2009 09:41:32 -0000
@@ -84,6 +84,41 @@ function nodewords_init() {
 }
 
 /**
+ * Implementation of hook_views_pre_render().
+ */
+function nodewords_views_pre_render(&$view) {
+  // Don't really do anything with the view. This is just a pretense to insert meta tags.
+  $curpath = drupal_get_normal_path($_REQUEST['q']);
+  // Check to see if the view path matches the current path.
+  $viewpage = FALSE;
+  foreach ($view->display as $display) {
+    // We're only interested in main page views.
+    if (drupal_substr($display->id, 0, 5)  != 'page_' || $display->handler->view->is_attachment) continue;
+    $bits = explode('/', $display->display_options['path']);
+    $viewargs = $view->args;
+    foreach ($bits as $pos => $bit) {
+      if ($bit == '%' && !empty($viewargs)) {
+        $bits[$pos] = array_shift($viewargs);
+      }
+    }
+    if (!empty($viewargs)) {
+      // Add any additional arguments to end of path.
+      $bits = array_merge($bits, $viewargs);
+    }
+    $viewpath = implode('/', $bits);
+    $viewpage = $viewpage || _custom_breadcrumbs_paths_page_match($curpath, $viewpath);
+  }
+  if ($viewpage) {
+    $tags = nodewords_get('views', array($view->vid));
+    foreach ($tags as $name => $content) {
+      if (!empty($content)) {
+        drupal_set_html_head('<meta name="'. $name .'" content="'. $content .'" />');
+      }
+    }
+  }
+}
+
+/**
  * Implementation of hook_nodeapi().
  */
 function nodewords_nodeapi(&$node, $op, $teaser = NULL, $page = NULL) {
@@ -777,7 +812,8 @@ function _nodewords_detect_type_and_ids(
     }
   }
 */
-
+  
+/* TODO: Remove this since we are adding views support through hook_views_pre_render
   if (module_exists('views')) {
     $result = db_query("SELECT vid, display_options FROM {views_display} WHERE display_plugin = '%s'", 'page');
     while ($view = db_fetch_object($result)) {
@@ -788,7 +824,8 @@ function _nodewords_detect_type_and_ids(
       }
     }
   }
-
+*/
+  
   switch (arg(0)) {
     case 'node':
       // Node paths: node/$nid
