i have edited the cde to read
if ($post['forumid'] != 65) {
$kr_load = array();
$kr_text = array();
if (preg_match_all("/\[quote=([^\\\"\]]*?)\](.*?)\[\/quote\]/is",$post['message'],$matches)>0) {
for ($kr=0;$kr<count($matches[1]);$kr++){
//echo $matches[1][$kr]."<br>";
$matches[1][$kr] = (strpos($matches[1][$kr],";")) ? substr($matches[1][$kr],0,strpos($matches[1][$kr],";")) : $matches[1][$kr];
if (strtolower($matches[1][$kr]) != strtolower($vbulletin->userinfo['username'])) {
if (!in_array($matches[1][$kr], $kr_load)) {
$kr_load[] = $matches[1][$kr];
$kr_text[] = "
Quote:
Originally Posted by .$matches[1][$kr].
".$matches[2][$kr]."
|
";
}
else {
for ($kri=0;$kri<count($kr_load);$kri++) {
if ($kr_load[$kri] == $matches[1][$kr]) {
$kr_text[$kri] .= "
Quote:
Originally Posted by .$matches[1][$kr].
".$matches[2][$kr]."
|
";
break;
}
}
}
}
}
}
if (count($kr_load) > 0) {
for ($kr=0;$kr<count($kr_load);$kr++) {
//echo "<br>" . $kr_load[$kr];
$quotegetfieldquery = $vbulletin->db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$quoteuserquery = $vbulletin->db->query_first("SELECT user_table.userid AS userid, user_table.email AS email, profile_fields.field" . $quotegetfieldquery['profilefieldid'] . " AS wantquotenotify FROM " . TABLE_PREFIX . "user AS user_table LEFT JOIN " . TABLE_PREFIX . "userfield AS profile_fields ON (user_table.userid=profile_fields.userid) WHERE user_table.username='" . $vbulletin->db->escape_string($kr_load[$kr]) . "' GROUP BY user_table.userid");
$theurl = $vbulletin->options['bburl'] . "/showthread.php?p=" . $post['postid'] . "#post" . $post['postid'];
if ($quoteuserquery['wantquotenotify'] == "Private Message") {
// Override a potentially full inbox.
$senderpermissions['adminpermissions'] = 2;
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$qn_fromuserid = $vbulletin->userinfo['userid'];
$qn_fromusername = $vbulletin->userinfo['username'];
if ($vbulletin->options['quotenotify_sender'] > 0) {
$qn_fromuserid = $vbulletin->options['quotenotify_sender'];
$qn_fromtempuser = fetch_userinfo($qn_fromuserid);
$qn_fromusername = $qn_fromtempuser['username'];
}
$pmdm->set('fromuserid', $qn_fromuserid);
$pmdm->set('fromusername', $qn_fromusername);
$pmdm->set('title', $vbphrase['quotenotify_subject']);
$pmdm->set('message', construct_phrase($vbphrase['quotenotify_message'], $kr_load[$kr], $vbulletin->userinfo['username'], $kr_text[$kr], $theurl));
$pmdm->set_recipients($kr_load[$kr], $senderpermissions);
$pmdm->set('dateline', TIMENOW);
$pmdm->save();
//echo "curr url is " . $vbulletin->url;
//echo "send a pm to " . $kr_load[$kr] . "with contents " . $kr_text[$kr];
}
if ($quoteuserquery['wantquotenotify'] == "Email") {
vbmail($quoteuserquery['email'], $vbphrase['quotenotify_subject'], construct_phrase($vbphrase['quotenotify_emailmessage'], $kr_load[$kr], $vbulletin->userinfo['username'], strip_quotes($kr_text[$kr]), $theurl));
}
}
}
}
the alerted posts are still triggering a pm to the alerted person