[10574] | 1 | <?php |
---|
| 2 | |
---|
| 3 | //add prefiter |
---|
| 4 | add_event_handler('loc_end_page_header', 'adddinfousersI', 55 ); |
---|
| 5 | |
---|
| 6 | function adddinfousersI() |
---|
| 7 | { |
---|
| 8 | load_language('plugin.lang', ADDINFOUSERS_PATH); |
---|
| 9 | load_language('lang', PHPWG_ROOT_PATH.'local/', array('no_fallback'=>true, 'local'=>true) ); |
---|
| 10 | |
---|
| 11 | global $template; |
---|
| 12 | $template->set_prefilter('register', 'adddinfousersT'); |
---|
| 13 | $template->set_filename('profile_add', realpath(ADDINFOUSERS_PATH.'profile_add.tpl')); |
---|
| 14 | $template->assign_var_from_handle('PROFILE_ADD', 'profile_add'); |
---|
| 15 | } |
---|
| 16 | |
---|
| 17 | function adddinfousersT($content, &$smarty) |
---|
| 18 | { |
---|
| 19 | $search = '<p class="bottomButtons">'; |
---|
| 20 | return str_replace($search, '{$PROFILE_ADD}'."\n".$search, $content); |
---|
| 21 | } |
---|
| 22 | |
---|
| 23 | add_event_handler('register_user_check', 'addInfousersT'); |
---|
| 24 | |
---|
| 25 | function addInfousersT($errors) |
---|
| 26 | { |
---|
| 27 | global $prefixeTable,$conf; |
---|
| 28 | |
---|
| 29 | if (count($errors) == 0) |
---|
| 30 | { |
---|
| 31 | $query = ' |
---|
| 32 | SELECT MAX('.$conf['user_fields']['id'].') + 1 |
---|
| 33 | FROM '.USERS_TABLE.' |
---|
| 34 | ;'; |
---|
| 35 | list($next_id) = pwg_db_fetch_row(pwg_query($query)); |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | $q = ' |
---|
| 39 | INSERT INTO ' . $prefixeTable . 'AddInfo_users(id,info1,info2,info3,info4,info5,info6,info7)VALUES ("'.$next_id.'","'.$_POST['inser'].'","'.$_POST['inser2'].'","'.$_POST['inser3'].'","'.$_POST['inser4'].'","'.$_POST['inser5'].'","'.$_POST['inser6'].'","'.$_POST['inser7'].'");'; |
---|
| 40 | pwg_query($q); |
---|
| 41 | } |
---|
| 42 | |
---|
| 43 | return $errors; |
---|
| 44 | } |
---|
| 45 | |
---|
| 46 | ?> |
---|