Index: interests.install =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/interests/interests.install,v retrieving revision 1.5 diff -u -p -b -r1.5 interests.install --- interests.install 24 Apr 2009 06:43:38 -0000 1.5 +++ interests.install 17 Dec 2010 09:21:26 -0000 @@ -11,6 +11,16 @@ */ function interests_install() { drupal_install_schema('interests'); + update_sql('CREATE VIEW {interests_nodes} AS + SELECT i.uid AS interest_user, n.nid, SUM(i.counter) AS total_count FROM + {interests} i, + {term_node} tn, + {node} n + WHERE + n.nid = tn.nid AND + i.tid = tn.tid + GROUP BY n.nid, i.uid + '); } /** @@ -81,9 +91,25 @@ function interests_update_6001() { return $ret; } +function interests_update_6002() { + $ret = array(); + $ret[] = update_sql('CREATE VIEW {interests_nodes} AS + SELECT i.uid AS interest_user, n.nid, SUM(i.counter) AS total_count FROM + {interests} i, + {term_node} tn, + {node} n + WHERE + n.nid = tn.nid AND + i.tid = tn.tid + GROUP BY n.nid, i.uid + '); + return $ret; +} + /** * Implementation of hook_uninstall(). */ function interests_uninstall() { + update_sql('DROP VIEW {interests_nodes}'); drupal_uninstall_schema('interests'); } Index: interests.module =================================================================== RCS file: /cvs/drupal-contrib/contributions/modules/interests/interests.module,v retrieving revision 1.7.2.2 diff -u -p -b -r1.7.2.2 interests.module --- interests.module 3 Jun 2009 11:24:58 -0000 1.7.2.2 +++ interests.module 17 Dec 2010 09:21:27 -0000 @@ -158,6 +158,16 @@ function interests_link($type, $node = N } /** + * Implementation of hook_node_views(). + */ +function interests_views_api() { + return array( + 'api' => 2, + 'path' => drupal_get_path('module', 'interests') .'/views', + ); +} + +/** * Interests settings form. */ function interests_settings_form() {