| 1 |
<?php |
<?php |
| 2 |
// $Id: og2list.module,v 1.107 2007/08/05 12:27:09 killes Exp $ |
// $Id: og2list.module,v 1.108 2007/08/05 12:30:19 killes Exp $ |
| 3 |
|
|
| 4 |
// Defines for outgoing mail |
// Defines for outgoing mail |
| 5 |
define('OG2LIST_OUTGOING_NOT_SENT', 1); |
define('OG2LIST_OUTGOING_NOT_SENT', 1); |
| 378 |
} |
} |
| 379 |
break; |
break; |
| 380 |
case 'update': |
case 'update': |
| 381 |
|
// If the node previously did not have an address and one has just been assigned, |
| 382 |
|
// then we need to set it now. If the node did have an og2list_groups row before |
| 383 |
|
// then the recipient wasn't set and we update it. For now you still cannot change |
| 384 |
|
// a recipient once it's set. |
| 385 |
|
// |
| 386 |
|
if ($node->recipient && (db_num_rows(db_query("SELECT recipient FROM {og2list_groups} WHERE nid = %d", $node->nid)) == 0)) { |
| 387 |
|
db_query("INSERT INTO {og2list_groups} (nid, recipient, status) VALUES(%d, '%s', 1)", $node->nid, $node->recipient); |
| 388 |
|
} |
| 389 |
|
|
| 390 |
if ($node->status == 1) { |
if ($node->status == 1) { |
| 391 |
db_query('UPDATE {og2list_outgoing_arguments} a INNER JOIN {og2list_outgoing_content} c ON a.mid = c.mid SET a.status = %d WHERE c.is_node = 1 AND c.id = %d AND a.status = %d', OG2LIST_OUTGOING_NOT_SENT, $node->nid, OG2LIST_OUTGOING_MODERATED); |
db_query('UPDATE {og2list_outgoing_arguments} a INNER JOIN {og2list_outgoing_content} c ON a.mid = c.mid SET a.status = %d WHERE c.is_node = 1 AND c.id = %d AND a.status = %d', OG2LIST_OUTGOING_NOT_SENT, $node->nid, OG2LIST_OUTGOING_MODERATED); |
| 392 |
} |
} |