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

Post new comment

Edit issue settings
Note: changing any of these items will update the issue's overall values.
active
Use this field if you want to associate this issue to a specific wiki page. Enter the title of the wiki page. You can enter a comma separated list of nodes.
The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Use [fn]...[/fn] (or <fn>...</fn>) to insert automatically numbered footnotes.
  • Allowed HTML tags: <a> <blockquote> <br> <em> <img> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd> <h2><h3><h4><h5><h6> <pre> <table> <th> <td> <tr>
  • You may post code using <code>...</code> (generic) or <?php ... ?> (highlighted PHP) tags.
  • Lines and paragraphs break automatically.
  • Project issue numbers (ex. [#12345]) turn into links automatically.
  • Use [toc list: ol; title: Table of Contents; minlevel: 2; maxlevel: 3; attachments: yes;] to insert a mediawiki style collapsible table of contents. All the arguments are optional.

More information about formatting options

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.