59 parent::__construct(
$db,
"priv_msgs",
'PmMessage',
'msg_id',
'subject');
75 return $this->
updateAll(
'read_msg', intval($val),
new Criteria(
'msg_id', $pm->getVar(
'msg_id')),
true);
85 if ($pm->getVar(
'to_delete') == 0) {
86 return $this->
updateAll(
'from_delete', intval($val),
new Criteria(
'msg_id', $pm->getVar(
'msg_id')));
88 return parent::delete($pm);
99 if ($pm->getVar(
'from_delete') == 0 || $pm->getVar(
'from_userid') == 0) {
100 return $this->
updateAll(
'to_delete', intval($val),
new Criteria(
'msg_id', $pm->getVar(
'msg_id')));
102 return parent::delete($pm);
113 return $this->
updateAll(
'from_save', intval($val),
new Criteria(
'msg_id', $pm->getVar(
'msg_id')));
123 return $this->
updateAll(
'to_save', intval($val),
new Criteria(
'msg_id', $pm->getVar(
'msg_id')));
133 if (!is_object(
$user)) {
137 $crit_to->add(
new Criteria(
'to_save', 1));
138 $crit_to->add(
new Criteria(
'to_userid',
$user->getVar(
'uid')));
140 $crit_from->add(
new Criteria(
'from_save', 1));
141 $crit_from->add(
new Criteria(
'from_userid',
$user->getVar(
'uid')));
157 if (!is_object(
$user)) {
164 $from =
new XoopsUser($pm->getVar(
"from_userid"));
165 $to =
new XoopsUser($pm->getVar(
"to_userid"));
166 $msg .= sprintf(
_PM_EMAIL_FROM, $from->getVar(
"uname") .
" (" . XOOPS_URL .
"/userinfo.php?uid=" . $pm->getVar(
"from_userid") .
")");
168 $msg .= sprintf(
_PM_EMAIL_TO, $to->
getVar(
"uname") .
" (" . XOOPS_URL .
"/userinfo.php?uid=" . $pm->getVar(
"to_userid") .
")");
171 $msg .=
"\n" . $pm->getVar(
"subject") .
"\n";
172 $msg .=
"\n" . strip_tags( str_replace(array(
"<p>",
"</p>",
"<br />",
"<br />"),
"\n", $pm->getVar(
"msg_text")) ) .
"\n\n";
173 $msg .=
"--------------\n";
174 $msg .= $xoopsConfig[
'sitename'] .
": ". XOOPS_URL .
"\n";
177 $xoopsMailer->useMail();
178 $xoopsMailer->setToEmails(
$user->getVar(
"email"));
179 $xoopsMailer->setFromEmail($xoopsConfig[
'adminmail']);
180 $xoopsMailer->setFromName($xoopsConfig[
'sitename']);
182 $xoopsMailer->setBody(
$msg);
183 return $xoopsMailer->send();
193 include_once XOOPS_ROOT_PATH .
"/class/xoopsformloader.php";