source: extensions/AddInfousers/initregister.php @ 31810

Last change on this file since 31810 was 10574, checked in by ddtddt, 13 years ago

[extensions] - AddInfousers - First release

  • Property svn:eol-style set to LF
  • Property svn:keywords set to Author Date Id Revision
File size: 1.3 KB
Line 
1<?php
2
3//add prefiter
4add_event_handler('loc_end_page_header', 'adddinfousersI', 55 );
5
6function 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
17function adddinfousersT($content, &$smarty)
18 {
19  $search = '<p class="bottomButtons">';
20  return str_replace($search, '{$PROFILE_ADD}'."\n".$search, $content);
21 }
22
23add_event_handler('register_user_check', 'addInfousersT');
24
25function addInfousersT($errors)
26{
27global $prefixeTable,$conf;
28
29  if (count($errors) == 0)
30  {
31    $query = '
32SELECT 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 = '
39INSERT 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?>
Note: See TracBrowser for help on using the repository browser.