web: make a global Fluksonians block allowing BLOCK_CACHE_GLOBAL

This commit is contained in:
Bart Van Der Meerssche 2010-03-06 10:43:03 +00:00
parent b35a723820
commit 862466ad2c
1 changed files with 21 additions and 19 deletions

View File

@ -367,6 +367,8 @@ function _logger_add($uid) {
WHERE requester_id = %d AND rtid = %d
GROUP BY rtid", $user->uid, $rtid));
// don't allow users to add themselves
if ($uid != $user->uid) {
// max subscriptions = 4
if ($result['COUNT(rid)'] < 4) {
user_relationships_request_relationship($user->uid, $uid, $rtid, TRUE);
@ -385,8 +387,8 @@ function _logger_add($uid) {
user_relationships_request_relationship($user->uid, $uid, $rtid, TRUE);
}
}
_logger_cache_clear('subscriptions');
}
$destination = drupal_get_destination();
drupal_goto($destination);
}
@ -502,7 +504,7 @@ function logger_block($op = 'list', $delta = 0, $edit = array()) {
$blocks['fluksonians']['region'] = 'right';
$blocks['fluksonians']['weight'] = 1;
$blocks['fluksonians']['pages'] = '<front>\nlogger/\nlogger/*';
$blocks['fluksonians']['cache'] = BLOCK_CACHE_PER_USER;
$blocks['fluksonians']['cache'] = BLOCK_CACHE_GLOBAL;
$blocks['unit']['info'] = t('Unit');
$blocks['unit']['status'] = TRUE;
@ -547,7 +549,7 @@ function logger_block($op = 'list', $delta = 0, $edit = array()) {
FROM ({users} u
INNER JOIN {users_roles} ur ON u.uid = ur.uid)
INNER JOIN {role} r ON ur.rid = r.rid
WHERE r.name = '%s' AND NOT u.uid = %d
WHERE r.name = '%s'
ORDER BY u.name", 'fluksonian', $user->uid);
$items = array();
while ($fluksonian = db_fetch_object($result)) {