Changeset 1895 for trunk/admin
- Timestamp:
- Mar 12, 2007, 1:04:25 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/admin/cat_modify.php
r1861 r1895 31 31 32 32 include_once(PHPWG_ROOT_PATH.'admin/include/functions.php'); 33 include_once(PHPWG_ROOT_PATH.'include/functions_mail.inc.php'); 33 34 34 35 // +-----------------------------------------------------------------------+ … … 526 527 ); 527 528 529 // info by email to an access granted group of category informations 530 if (isset($_POST['submitEmail'])) 531 { 532 $query = ' 533 SELECT 534 user_id, 535 '.$conf['user_fields']['email'].' AS email 536 FROM '.USER_GROUP_TABLE.' 537 INNER JOIN '.USERS_TABLE.' ON '.$conf['user_fields']['id'].' = user_id 538 WHERE '.$conf['user_fields']['email'].' IS NOT NULL 539 AND group_id = '.$_POST['group'].' 540 ;'; 541 $result = pwg_query($query); 542 543 while ($row = mysql_fetch_array($result)) 544 { 545 pwg_mail( 546 $row['email'], 547 array( 548 'content' => get_absolute_root_url().make_index_url( 549 array( 550 'category' => array( 551 'id' => $category['id'], 552 'name' => $category['name'], 553 'permalink' => $category['permalink'], 554 ) 555 ) 556 ), 557 'subject' => $category['name'] 558 ) 559 ); 560 } 561 562 $query = ' 563 SELECT 564 name 565 FROM '.GROUPS_TABLE.' 566 WHERE id = '.$_POST['group'].' 567 ;'; 568 list($group_name) = mysql_fetch_row(pwg_query($query)); 569 570 array_push( 571 $page['infos'], 572 sprintf( 573 l10n('An information email was sent to group "%s"'), 574 $group_name 575 ) 576 ); 577 } 578 579 if ('private' == $category['status']) 580 { 581 $query = ' 582 SELECT 583 group_id 584 FROM '.GROUP_ACCESS_TABLE.' 585 WHERE cat_id = '.$category['id'].' 586 ;'; 587 } 588 else 589 { 590 $query = ' 591 SELECT 592 id AS group_id 593 FROM '.GROUPS_TABLE.' 594 ;'; 595 } 596 $group_ids = array_from_query($query, 'group_id'); 597 598 if (count($group_ids) > 0) 599 { 600 $query = ' 601 SELECT 602 id, 603 name 604 FROM '.GROUPS_TABLE.' 605 WHERE id IN ('.implode(',', $group_ids).') 606 ORDER BY name ASC 607 ;'; 608 $result = pwg_query($query); 609 610 while ($row = mysql_fetch_array($result)) 611 { 612 $template->assign_block_vars( 613 'group_option', 614 array( 615 'VALUE' => $row['id'], 616 'OPTION' => $row['name'], 617 ) 618 ); 619 } 620 } 528 621 529 622 //----------------------------------------------------------- sending html code
Note: See TracChangeset
for help on using the changeset viewer.