/[drupal]/contributions/modules/uurec/uurec.module
ViewVC logotype

Diff of /contributions/modules/uurec/uurec.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.2, Sat Feb 28 17:11:28 2009 UTC revision 1.3, Sun Mar 1 04:20:31 2009 UTC
# Line 1  Line 1 
1  <?php  <?php
2  // $Id: uurec.module,v 1.1 2009/02/28 01:50:51 danithaca Exp $  // $Id: uurec.module,v 1.2 2009/02/28 17:11:28 danithaca Exp $
3    
4  /**  /**
5   * Implementation of hook_help().   * Implementation of hook_help().
# Line 55  function uurec_block($op='list', $delta= Line 55  function uurec_block($op='list', $delta=
55      global $user;      global $user;
56      if ($delta == 0) {      if ($delta == 0) {
57        $users = uurec_get_similar_users($user->uid);        $users = uurec_get_similar_users($user->uid);
58        if (!empty($user)) {        if (!empty($users)) {
59          $block['subject'] = t('Similar users');          $block['subject'] = t('Similar users');
60          $block['content'] = theme('item_list', $users);          $block['content'] = theme('item_list', $users);
61        }        }
# Line 130  function _uurec_run_recommender() { Line 130  function _uurec_run_recommender() {
130    db_query("INSERT INTO {uurec_comments}(uid, nid, weight)    db_query("INSERT INTO {uurec_comments}(uid, nid, weight)
131                SELECT uid, nid, COUNT(weight) weight FROM                SELECT uid, nid, COUNT(weight) weight FROM
132                   (SELECT uid, nid, 1 AS weight FROM {node}                   (SELECT uid, nid, 1 AS weight FROM {node}
133                    WHERE type IN $enabled_types AND changed<$timestamp                    WHERE type IN $enabled_types AND changed<$timestamp AND uid<>0
134                    UNION ALL                    UNION ALL
135                    SELECT c.uid, c.nid, 1 AS weight                    SELECT c.uid, c.nid, 1 AS weight
136                    FROM {comments} c INNER JOIN {node} n ON c.nid=n.nid                    FROM {comments} c INNER JOIN {node} n ON c.nid=n.nid
137                    WHERE n.type IN $enabled_types AND c.timestamp<$timestamp) a                    WHERE n.type IN $enabled_types AND c.timestamp<$timestamp AND c.uid<>0) a
138                GROUP BY uid, nid");                GROUP BY uid, nid");
139    
140    // pass the view to Recommender API    // pass the view to Recommender API

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.2