update subscriptions

Project:web site
Component:User interface
Category:task
Priority:normal
Assigned:augustin
Status:active
Project wiki:How to use this web site
Description

I just enabled subscriptions module. I need to check that it works as intended.
Posting this issue will allow me to do just that!

Comments

#1

test comment.

#2

second test comment.

#3

with some html

here

but none here.

#4

Title:check subscriptions settings» update subscriptions

TODO: subscribe existing users (up to uid 8) to past nodes (up to nid 81).

#5

update subscriptions by node authors:

<?php
$result
= db_query('SELECT * FROM {node} WHERE uid != 1');

while (

$node = db_fetch_object($result)) {
 
$result2 = db_query("SELECT * FROM {subscriptions} WHERE module = 'node' AND field = 'nid' AND value = %d AND recipient_uid = %d", $node->nid, $node->uid);
  if (!
mysql_num_rows($result2)) {
   
db_query("INSERT INTO {subscriptions} (module, field, value, recipient_uid, send_interval, author_uid, send_updates, send_comments)
                  VALUES ('node', 'nid', %d, %d, 1, -1, 1, 1)"
, $node->nid, $node->uid);
  }
}
?>

#6

Update subscription by comments:

<?php
$result
= db_query('SELECT * FROM {comments} WHERE uid != 1');

while (

$comment = db_fetch_object($result)) {
 
$result2 = db_query("SELECT * FROM {subscriptions} WHERE module = 'node' AND field = 'nid' AND value = %d AND recipient_uid = %d", $comment->nid, $comment->uid);
  if (!
mysql_num_rows($result2)) {
   
db_query("INSERT INTO {subscriptions} (module, field, value, recipient_uid, send_interval, author_uid, send_updates, send_comments)
                  VALUES ('node', 'nid', %d, %d, 1, -1, 1, 1)"
, $comment->nid, $comment->uid);
  }
}
?>

#7

todo: check the send_interval. Set by default to reasonable value.

#8

Priority:normal» critical

#9

Priority:critical» normal