2 // [multimail buless send capatibility]
5 if (empty($_SESSION['user_id']) || empty($_SESSION['user_name'])) {
7 $error="Ak sa toto stane a citas tuto spravu chod navstivit buglist....ak robis picoviny a vidis tuto spravu tak ti uz ani buglist nepomoze a chod sa odjebat hackere:-)";
11 $user_id=mysql_real_escape_string($_SESSION['user_id']);
12 $user_name=mysql_real_escape_string($_SESSION['user_name']);
13 $mail_name=mysql_real_escape_string($_POST['mail_to']);
17 $error="Posta sa len tak nikomu neposiela.Co takto zadat aspon adresata??hm??";
19 $mail_to=explode(";",$mail_name);
20 $mail_text=$_POST['mail_text'];
21 $nohtml=$_POST['nohtml'];
23 if (count($mail_to)==1) {
24 $q="select user_id from users where login='".$mail_name."'";
25 $result=$db->query($q);
27 $to=$result->getRecord();
28 if (!$to['user_id']) {
30 $error="Dana osobka ktorej by si chcel poslat spravicku si bud zmenila nick alebo robis preklepy.";
34 elseif ($user_id == 1859269 && $to['user_id'] == 2334) {
40 $mail_to_id[]=$to['user_id'];
44 elseif (count($mail_to)>1) {
45 foreach ($mail_to as $mail_to_exploded) {
46 $q="select user_id from users where login='$mail_to_exploded'";
47 $result=$db->query($q);
49 $to=$result->getRecord();
50 if (!$to['user_id']) {
52 $error="Pravdepodobne si osobka $mail_to_exploded zmenila nick alebo mas niekde preklep. Skus to opravit a potom try again:-]";
55 elseif ($user_id == 1859269 && $to['user_id'] == 2334) {
60 else {$mail_to_id[]=$to['user_id'];}
64 if (empty($mail_text)) {
66 $error="Prilis kratka sprava. Syr vesela krava, student prava a ci
73 $mail_text=mysql_real_escape_string(nodes::processContent($mail_text));
79 foreach ($mail_to_id as $mail_to_id_send) {
80 $q="insert into mail set
81 mail_user='$user_id',mail_read='no',
82 mail_from='$user_id',mail_text='$mail_text',mail_to='$mail_to_id_send',mail_timestamp=NOW()";
83 $result=$db->query($q);
84 $duplicate_id=$db->getLastInsertId();
85 $q="insert into mail set mail_duplicate_id='$duplicate_id',
86 mail_read='no',mail_user='$mail_to_id_send',mail_from='$user_id',mail_text='$mail_text',
87 mail_to='$mail_to_id_send',mail_timestamp=NOW()";
88 $result=$db->query($q);
89 $db->query("update users set user_mail=user_mail+1,".
90 //"user_mail_name='$user_name',". //Not in DB yet!
91 "user_mail_id='".mysql_real_escape_string($_SESSION['user_id'])."' where user_id='$mail_to_id_send'");
99 $error="user $mail_to does not exist";