function send_status_update($uid, $ulogin, $uemail, $title, $msg) { if ($GLOBALS['FUD_OPT_1'] & 1024) { if (defined('no_inline')) { fud_use('private.inc'); fud_use('iemail.inc'); fud_use('rev_fmt.inc'); } $GLOBALS['recv_user_id'][] = $uid; $pmsg = new fud_pmsg(); $pmsg->to_list = addslashes($ulogin); $pmsg->ouser_id = _uid; $pmsg->post_stamp = __request_timestamp__; $pmsg->subject = addslashes($title); $pmsg->host_name = 'NULL'; $pmsg->ip_addr = '0.0.0.0'; list($pmsg->foff, $pmsg->length) = write_pmsg_body(nl2br($msg)); $pmsg->send_pmsg(); } else { if (defined('no_inline')) { fud_use('iemail.inc'); } send_email($GLOBALS['NOTIFY_FROM'], $uemail, $title, $msg); } }
if ($nid = q_singleval('SELECT p.id FROM phpgw_fud_pmsg p INNER JOIN phpgw_fud_users u ON u.id=p.ouser_id WHERE p.duser_id=' . _uid . ' AND p.fldr=' . $m->fldr . ' AND post_stamp>' . $m->post_stamp . ' ORDER BY p.post_stamp ASC LIMIT 1')) { $dpmsg_next_message = '<a href="/egroupware/fudforum/3814588639/index.php?t=pmsg_view&' . _rsid . '&id=' . $nid . '" class="GenLink">Messaggio successivo <img src="/egroupware/fudforum/3814588639/theme/italian/images/goto.gif" alt="" /></a>'; } else { $dpmsg_next_message = ''; } /* Prev Msg */ if ($pid = q_singleval('SELECT p.id FROM phpgw_fud_pmsg p INNER JOIN phpgw_fud_users u ON u.id=p.ouser_id WHERE p.duser_id=' . _uid . ' AND p.fldr=' . $m->fldr . ' AND p.post_stamp<' . $m->post_stamp . ' ORDER BY p.post_stamp DESC LIMIT 1')) { $dpmsg_prev_message = '<a href="/egroupware/fudforum/3814588639/index.php?t=pmsg_view&' . _rsid . '&id=' . $pid . '" class="GenLink"><img src="/egroupware/fudforum/3814588639/theme/italian/images/goback.gif" alt="" /> Messaggio precedente</a>'; } else { $dpmsg_prev_message = ''; } $private_message_entry = tmpl_drawpmsg($m, $usr, false); if (!$m->read_stamp && $m->pmsg_opt & 16) { q('UPDATE phpgw_fud_pmsg SET read_stamp=' . __request_timestamp__ . ', pmsg_opt=(pmsg_opt & ~ 4) |8 WHERE id=' . $m->id); if ($m->ouser_id != _uid && $m->pmsg_opt & 4 && !isset($_GET['dr'])) { $track_msg = new fud_pmsg(); $track_msg->ouser_id = $track_msg->duser_id = $m->ouser_id; $track_msg->ip_addr = $track_msg->host_name = null; $track_msg->post_stamp = __request_timestamp__; $track_msg->read_stamp = 0; $track_msg->fldr = 1; $track_msg->pmsg_opt = 16 | 32; $track_msg->subject = 'Leggi la notifica per il topic: ' . $m->subject; $track_msg->body = 'Ciao,<br>' . $usr->login . ' ha letto il tuo messaggio personale, "' . $m->subject . '", ' . strftime("%a, %d %B %Y %H:%M", $m->post_stamp) . '<br>'; $track_msg->add(1); } } if ($FUD_OPT_2 & 2) { $page_gen_end = gettimeofday(); $page_gen_time = sprintf('%.5f', $page_gen_end['sec'] - $PAGE_TIME['sec'] + ($page_gen_end['usec'] - $PAGE_TIME['usec']) / 1000000); $page_stats = '<br /><div align="left" class="SmallText">Tempo totale richiesto per generare la pagina: ' . $page_gen_time . ' secondi</div>';
} else { if (filter_ext($_FILES['attach_control']['name'])) { $attach_control_error = '<font class="ErrorText">The file you are trying to upload doesn't match the allowed file types.</font><br>'; } else { if ($attach_count + 1 <= $PRIVATE_ATTACHMENTS) { $val = attach_add($_FILES['attach_control'], _uid, 1); $attach_list[$val] = $val; $attach_count++; } else { $attach_control_error = '<font class="ErrorText">You are trying to upload more files then it is allowed.</font><br>'; } } } } if (isset($_POST['btn_submit']) && !check_ppost_form($_POST['msg_subject']) || isset($_POST['btn_draft'])) { $msg_p = new fud_pmsg(); $msg_p->pmsg_opt = (int) $msg_smiley_disabled | (int) $msg_show_sig | (int) $msg_track; $msg_p->attach_cnt = $attach_count; $msg_p->icon = $msg_icon; $msg_p->body = $msg_body; $msg_p->subject = $msg_subject; $msg_p->fldr = isset($_POST['btn_submit']) ? 3 : 4; $msg_p->to_list = $_POST['msg_to_list']; $msg_p->body = apply_custom_replace($msg_p->body); if ($FUD_OPT_1 & 4096) { $msg_p->body = tags_to_html($msg_p->body, $FUD_OPT_1 & 16384); } else { if ($FUD_OPT_1 & 2048) { $msg_p->body = nl2br(htmlspecialchars($msg_p->body)); } }