Changeset 9564 for extensions/adult_content/charte_user.php
- Timestamp:
- Mar 7, 2011, 4:09:40 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/adult_content/charte_user.php
r9557 r9564 12 12 $page['body_id'] = 'adult_content_page'; 13 13 include(PHPWG_ROOT_PATH.'include/page_header.php'); 14 //include(get_language_filepath('plugin.lang.php', $adult_content->plugin_path));15 14 load_language('plugin.lang', $adult_content->plugin_path); 16 15 … … 19 18 'PLUGIN_NAME' => $adult_content->plugin_name 20 19 )); 20 ////////////lié à quoi///// 21 $adult_content->fill_idgroups_user(); 22 $adult_content->fill_idgroups_ad_c(); 21 23 22 if (isset($_GET['etat']) and $_GET['etat'] == 'not_defined' and !is_a_guest() ) 23 { 24 $template->assign( 25 array( 26 'EXPLIC' => $lang['ac_not_def'], 27 'MAIN' => $lang['ac_text_charte'], 28 'ETAT' => $_GET['etat'], 29 ) 30 ); 31 } 32 elseif (isset($_GET['etat']) and $_GET['etat'] == 'defined' and !is_a_guest() ) 33 { 34 $query = ' 35 SELECT group_id FROM '.USER_GROUP_TABLE.' 36 WHERE user_id IN (\''.$user['id'].'\') 37 ;'; 38 $data_group = mysql_fetch_array(pwg_query($query)); 39 $query = ' 40 SELECT name FROM '.GROUPS_TABLE.' 41 WHERE id IN (\''.$data_group['group_id'].'\') 42 ;'; 43 $data_group_n = mysql_fetch_array(pwg_query($query)); 44 if ($data_group_n['name'] == '+18') 45 { 24 if (!is_a_guest() and !$adult_content->is_in_ad_c_group()) 25 { 26 $template->assign( 27 array( 28 'EXPLIC' => $lang['ac_not_def'], 29 'MAIN' => $lang['ac_text_charte'], 30 ) 31 ); 32 } 33 elseif (!is_a_guest() and $adult_content->is_in_ad_c_group() ) 34 { 35 $link=$adult_content->is_in_ad_c_group(); 36 if ($link == $adult_content->idgroups_ad_c[0]) 37 { 46 38 $statut = $lang['ac_statut'].$lang['ac_user_text_18']; 47 48 if ($data_group_n['name'] == '16-17')49 39 } 40 if ($link == $adult_content->idgroups_ad_c[1]) 41 { 50 42 $statut = $lang['ac_statut'].$lang['ac_user_text_16']; 51 52 if ($data_group_n['name'] == 'nothing')53 43 } 44 if ($link == $adult_content->idgroups_ad_c[2]) 45 { 54 46 $statut = $lang['ac_user_no']; 55 47 } 56 48 57 49 $main = '<p>'.$statut.'</p>' … … 61 53 'EXPLIC' => $lang['ac_def'], 62 54 'MAIN' => $main, 63 'ETAT' => $_GET['etat'],64 55 ) 65 56 ); … … 78 69 elseif ( $_POST['groupe'] == '+18' or $_POST['groupe'] == '16-17' or $_POST['groupe'] == 'nothing') 79 70 { 80 71 ////////////anciennement lié à quoi///// 72 $adult_content->fill_idgroups_user(); 73 $adult_content->fill_idgroups_ad_c(); 81 74 ////////////placer dans group//////////// 82 75 $query = ' … … 86 79 $data_group = mysql_fetch_array(pwg_query($query)); 87 80 88 if ( $_POST['etat'] == 'not_defined')81 if (!$adult_content->is_in_ad_c_group()) 89 82 { 90 83 pwg_query('INSERT INTO '.USER_GROUP_TABLE.' VALUES(\''.$user['id'].'\', \''.$data_group['id'].'\' )' ); 91 84 } 92 else if ($_POST['etat'] == 'defined')85 else 93 86 { 94 pwg_query('UPDATE '.USER_GROUP_TABLE.' SET group_id=\''.$data_group['id'].'\' WHERE user_id IN (\''.$user['id'].'\') ' );87 pwg_query('UPDATE '.USER_GROUP_TABLE.' SET group_id=\''.$data_group['id'].'\' WHERE user_id IN (\''.$user['id'].'\') AND group_id IN (\''.$adult_content->is_in_ad_c_group().'\')' ); 95 88 } 96 89 $query = '
Note: See TracChangeset
for help on using the changeset viewer.