| 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(). |
| 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 |
} |
} |
| 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 |