| 1 |
<?php |
<?php |
| 2 |
// $Id: og2list.module,v 1.70.2.5 2007/01/05 22:43:32 killes Exp $ |
// $Id: og2list.module,v 1.70.2.6 2007/05/07 12:19:11 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); |
| 372 |
} |
} |
| 373 |
break; |
break; |
| 374 |
case 'update': |
case 'update': |
| 375 |
|
// If the node previously did not have an address and one has just been assigned, |
| 376 |
|
// then we need to set it now. If the node did have an og2list_groups row before |
| 377 |
|
// then the recipient wasn't set and we update it. For now you still cannot change |
| 378 |
|
// a recipient once it's set. |
| 379 |
|
// |
| 380 |
|
if ($node->recipient && (db_num_rows(db_query("SELECT recipient FROM {og2list_groups} WHERE nid = %d", $node->nid)) == 0)) { |
| 381 |
|
db_query("INSERT INTO {og2list_groups} (nid, recipient, status) VALUES(%d, '%s', 1)", $node->nid, $node->recipient); |
| 382 |
|
} |
| 383 |
|
|
| 384 |
if ($node->status == 1) { |
if ($node->status == 1) { |
| 385 |
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); |
| 386 |
} |
} |