function send_pmsg() { $this->pmsg_opt |= 16 | 32; $this->pmsg_opt &= 16 | 32 | 1 | 2 | 4; foreach ($GLOBALS['recv_user_id'] as $v) { $id = db_qid("INSERT INTO phpgw_fud_pmsg (\n\t\t\t\tto_list,\n\t\t\t\touser_id,\n\t\t\t\tip_addr,\n\t\t\t\thost_name,\n\t\t\t\tpost_stamp,\n\t\t\t\ticon,\n\t\t\t\tfldr,\n\t\t\t\tsubject,\n\t\t\t\tattach_cnt,\n\t\t\t\tfoff,\n\t\t\t\tlength,\n\t\t\t\tduser_id,\n\t\t\t\tref_msg_id,\n\t\t\t\tpmsg_opt\n\t\t\t) VALUES (\n\t\t\t\t" . strnull(addslashes($this->to_list)) . ",\n\t\t\t\t" . $this->ouser_id . ",\n\t\t\t\t'" . $this->ip_addr . "',\n\t\t\t\t" . $this->host_name . ",\n\t\t\t\t" . $this->post_stamp . ",\n\t\t\t\t" . strnull($this->icon) . ",\n\t\t\t\t1,\n\t\t\t\t'" . addslashes($this->subject) . "',\n\t\t\t\t" . intzero($this->attach_cnt) . ",\n\t\t\t\t" . $this->foff . ",\n\t\t\t\t" . $this->length . ",\n\t\t\t\t" . $v . ",\n\t\t\t\t" . strnull($this->ref_msg_id) . ",\n\t\t\t\t" . $this->pmsg_opt . ")"); $GLOBALS['send_to_array'][] = array($v, $id); $um[$v] = $id; } $c = uq('SELECT id, email, users_opt, icq FROM phpgw_fud_users WHERE id IN(' . implode(',', $GLOBALS['recv_user_id']) . ') AND users_opt>=64 AND (users_opt & 64) > 0'); $from = $GLOBALS['usr']->alias; reverse_fmt($from); $subject = $this->subject; reverse_fmt($subject); while ($r = db_rowarr($c)) { /* do not send notifications about messages sent to self */ if ($r[0] == $this->ouser_id) { continue; } if (!($r[2] & 4)) { $r[1] = $r[3] . '@pager.icq.com'; } send_pm_notification($r[1], $um[$r[0]], $subject, $from, $r[2]); } }
function poll_add($name, $max_votes, $expiry) { return db_qid("INSERT INTO phpgw_fud_poll (name, owner, creation_date, expiry_date, max_votes) VALUES ('" . addslashes(htmlspecialchars($name)) . "', " . _uid . ", " . __request_timestamp__ . ", " . intzero($expiry) . ", " . intzero($max_votes) . ")"); }