| 1 | <?php |
| 2 | |
| 3 | |
| 4 | class ubik { |
| 5 | |
| 6 | |
| 7 | function ubikRegister() { |
| 8 | |
| 9 | global $db; |
| 10 | $user_info=$_POST['user_info']; |
| 11 | $login=$_POST['login']; |
| 12 | // $user_www=$_POST['user_www']; |
| 13 | $email=$_POST['email']; |
| 14 | // $icq=$_POST['user_icq']; |
| 15 | |
| 16 | $text=nodes::processContent($user_info)."<br><br>"; |
| 17 | $node_name="user $login registration"; |
| 18 | |
| 19 | $params['node_creator']=UBIK_ID; |
| 20 | $params['node_content']=$text; |
| 21 | $params['node_name']=$node_name; |
| 22 | $params['node_parent']=63802; |
| 23 | return nodes::addNode($params); |
| 24 | |
| 25 | } |
| 26 | |
| 27 | function ubikMail($params) { |
| 28 | global $db; |
| 29 | if (is_numeric($params['mail_to'])) $mail_to=$params['mail_to']; |
| 30 | else return false; |
| 31 | if (!empty($params['mail_text'])) $mail_text=addslashes($params['mail_text']); |
| 32 | else return false; |
| 33 | |
| 34 | |
| 35 | $q_i = sprintf('insert into mail set mail_user = %2$d, mail_from = %1$d, mail_to = %2$d, mail_timestamp = NOW(), mail_text = "%3$s"' |
| 36 | ,UBIK_ID, $mail_to, $mail_text); |
| 37 | $db->update($q_i); |
| 38 | $q_u = sprintf('update users set user_mail = user_mail + 1, user_mail_id = %1$d where user_id = %2$d', UBIK_ID, $mail_to); |
| 39 | $db->update($q_u); |
| 40 | } |
| 41 | } |
| 42 | |
| 43 | ?> |