PDA

View Full Version : Quote Notification


Krofh
04-07-2006, 10:00 PM
Quote Notification

Note: This hack does not work in vBulletin 3.6. If someone would like to port it, that's fine with me, but I don't feel like updating this particular hack.

Description: This plugin will add a "Quote Notification" option for users to select. If selected, they will receive a notification by PM whenever someone quotes them in a post.

Installation:
Import the product XML file
Go to your User CP > Edit Options and select "Quote Notification" if you like
If you want to change the content of the PM that gets sent, the phrases are quotenotify_subject and quotenotify_message
The email notification has a separate phrase, quotenotify_emailmessage
If you want to change the Profile Field options, find the "Quote Notification" field in your User Profile Field Manager in the ACP.
If you want to set a default user for the notification PMs to be sent through, go to ACP > vBulletin Options > Message Posting and Editing Options > Quote Notification Sender; set it to 0 for the sender to be whoever did the quoting

Warning: DO NOT change the title of the Profile Field from "Quote Notification", or the values from "Private Message", "Email", and "No" or this hack will not work. :(

Contains:
1 Plugin
1 Profile Field
2 Phrases

This hack is somewhat similar to Who quoted me? (https://vborg.vbsupport.ru/showthread.php?t=103768), but still considerably different, and if your forum is concerned about quotes then both could probably go rather nicely together.

Version History:
1.0.2
- Fixed compatibility issues with Backlink For Quotes (https://vborg.vbsupport.ru/showthread.php?t=91282)
- Added option for notification by Email or Private Message
- Added ACP option for one specific PM sender or for the PMs to be sent by the user who did the quoting (original functionality)
1.0.1
- Fix for users with apostrophes
1.0
- Original version


Please click install. :)

Krofh
04-08-2006, 09:55 PM
First post, one moment while I upload files... done.

Barakat
04-09-2006, 12:33 AM
thanks ...installed i will try it

Desihunk
04-09-2006, 12:48 AM
Nice hack actually :)

Might use it in the future

* Desihunk says thanks.

NiTRoN
04-09-2006, 04:02 AM
How do I make it so its enabled by default for every user, untill they decide to turn it off?.. possible make a global seting option somewhere in USERGROUPS or ACP? :) Otherwise spelendit hack...

Krofh
04-09-2006, 04:15 AM
^ That's a good idea, but it'd be tricky to do since this isn't done through normal ACP options/bitfields but the Profile Field Manager. I suppose you could go into phpMyAdmin to your "userfield" table, and set the default value of whatever column that field ended up at to "Yes" :p I'll have to think about how to do that.

mholtum
04-09-2006, 06:37 AM
I dont see the option to turn it on.. Hmm

mholtum
04-09-2006, 06:38 AM
Found it

ryancooper
04-09-2006, 02:37 PM
This looks promising.. .

ForYou
04-09-2006, 06:49 PM
Hello ,

how can i set option enabled by default for every user ,

Is there some qeury to do it ,

Regards

Krofh
04-10-2006, 04:48 AM
Since everyone seems to want to be able to set this enabled by default...


Log into your Admin Control Panel
Go to User Profile Fields > User Profile Field Manager
Locate the "Quote Notification" field, and click "Edit"
In the big "Options" textbox, switch "Yes" and "No" so that "Yes" is first. This will make "Yes" the default option.
Make sure the "Set Default" option is set to "Yes" as well
Save your changes

Snake
04-10-2006, 06:38 PM
Thanks, I'll give this a shot!

hambil
04-12-2006, 03:19 AM
Nice hack.

*clicks install*

SpankMe
04-16-2006, 04:44 AM
Got the following SQL error

Invalid SQL:
SELECT user_table.userid AS userid, profile_fields.field21 AS wantquotenotify FROM user AS user_table LEFT JOIN userfield AS profile_fields ON (user_table.userid=profile_fields.userid) WHERE user_table.username='Brian d'marge' GROUP BY user_table.userid;

Need to change:
$quoteuserquery = $vbulletin->db->query_first("SELECT user_table.userid AS userid, 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='" . $kr_load[$kr] . "' GROUP BY user_table.userid");

to:
$quoteuserquery = $vbulletin->db->query_first("SELECT user_table.userid AS userid, 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");

so as to escape the username as it contained a single quote in above error.

Krofh
04-17-2006, 04:09 AM
Ahh, indeed. Thanks for noticing and fixing that, I'll go post an updated version now.

... done.

sinaluna
04-17-2006, 10:19 PM
I really like the sound of this. But I haven't been able to get it to work. Was there supposed to be a php file to download also?

I don't get any error messages. But I don't get any PM's either. The setting is turned on in the User CP.

Krofh
04-18-2006, 04:24 AM
Is the product enabled? There's no PHP, it's just the XML file... Is the profile field's name still "Quote Notification", and the values "Yes" and "No"? (sorry, this hack breaks if those are changed). I just tried installing this on a completely clean forum and it worked fine.

sinaluna
06-28-2006, 11:54 PM
I finally figured out the problem, though I am still working on finding a solution. I am also using the Back-Link for Quotes hack

https://vborg.vbsupport.ru/showthread.php?t=91282

and the link is interferring with this hack.

Example: [quote=testuser;326157]

Any ideas?

Krofh
06-29-2006, 04:43 AM
Ahhh, I see what's causing it... obviously, there will be no user called "username;1324" :p anyways, I'm really tired right now and don't have the patience to test it thoroughly, but this should work...
1) Go to your Plugin Manager in the ACP
2) Edit the plugin "Quote Notification" under newpost_complete
Add the highlighted code:
$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'])) {
I did some testing on my boards, and it worked fine, though like I said it wasn't very extensive. Let me know if that doesn't work.

COBRAws
06-30-2006, 01:46 PM
This works great! Any way i can specify the sender?

I have an username for massive pm's and moderation reports i would lik to use for sending these pm's.

Thank you Jesse

Krofh
07-01-2006, 04:48 AM
Hmmm, it's not currently an option but it's something I can consider adding. Right now, the sender is the person who quoted you.

dan35
07-01-2006, 06:11 PM
How about email notifications instead of pm notifications? :)

Krofh
07-02-2006, 04:10 AM
I suppose that's a good idea too... though can't you turn email notification on for when you get a PM, then it'll PM and email you? :p haha jk. I'll probably add all this stuff from the last several posts in about a week or so (this next week is crazy for me, no time for programming whatsoever) and release an updated version of the script.

Krofh
07-07-2006, 09:22 PM
Updated as promised, with the above suggestions... Email/PM notification choice, and the ability to set what user sent the notification in the case of PMs.

dan35
07-08-2006, 01:55 AM
Thank you, Krofh! Installed ;)

VietPirates
10-01-2006, 07:42 AM
Any update for 3.6?



Invalid SQL:
SELECT profilefieldid FROM profilefield WHERE title='Quote Notification';

MySQL Error : Unknown column 'title' in 'where clause'
Error Number : 1054
Date : Sunday, October 1st 2006 @ 03:43:35 AM
Script : http://www.domain.com/admincp/plugin.php?do=productkill
Referrer : http://www.domain.com/admincp/plugin.php?do=productdelete&productid=quotenotify&s=





can't unisntall it.

Database error in vBulletin 3.6.0:

Invalid SQL:
SELECT profilefieldid FROM profilefield WHERE title='Quote Notification';

MySQL Error : Unknown column 'title' in 'where clause'
Error Number : 1054
Date : Sunday, October 1st 2006 @ 03:44:29 AM
Script : http://www.domain.com/admincp/plugin.php?do=productkill
Referrer : http://www.domain.com/admincp/plugin.php?do=productdelete&productid=quotenotify&s=

Krofh
10-02-2006, 04:57 AM
^ Huh, that's not cool... they apparently removed the "title" column from the profilefield table in 3.6, and I can't seem to figure out where they moved it to :-/ try adding this at the very beginning of the uninstall code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)");
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[insert profilefieldid here]'");

and this at the end

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

That should add the title field, put "quote notification" in the one row, then find it and delete that row, then drop the title field again. Definitely don't use this on anything besides 3.6 though, otherwise it'll drop your title field in 3.5, which you actually kinda need.

Weiiiiirrrdddd, I wonder where they put those titles... I saw something about the datastore table, but I couldn't find them in there :-/ if anyone else knows, that'd be cool to know

VietPirates
10-03-2006, 09:16 AM
Thank you, Krofh!

But got this error:

Invalid SQL:
UPDATE TABLE profilefield SET title='Quote Notification' where profilefieldid='[insert profilefieldid here]';

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE profilefield SET title='Quote Notification' where profilefieldid='[insert ' at line 1
Error Number : 1064


Tried again:

Invalid SQL:
ALTER TABLE profilefield ADD title VARCHAR (255);

MySQL Error : Duplicate column name 'title'
Error Number : 1060


Uninstall Code:

$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)");
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[insert profilefieldid here]'");
$gettheid = $db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid='" . $gettheid['profilefieldid'] . "' LIMIT 1");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP field" . $gettheid['profilefieldid']);
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

Krofh
10-04-2006, 04:11 AM
Where it says {insert profileid here}, I meant for you to put the number of the profileid... since vB3.6 kinda broke this, you'll have to look it up yourself. Go to the User Profile Field Manager, look at the links on things, at the end it has profilefieldid={number}, the number on Quote Notification should be that one.

Btw, now that you added the TITLE field, take the
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)");
line out of it, and try again after fixing the number like I just said.

VietPirates
10-05-2006, 04:37 AM
My profilefield is field21

Error:

Invalid SQL:
UPDATE TABLE profilefield SET title='Quote Notification' where profilefieldid='[field21]';

MySQL Error : You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'TABLE profilefield SET title='Quote Notification' where profilefieldid='[field21' at line 1
Error Number : 1064


Unisntall Code:
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[field21]'");
$gettheid = $db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid='" . $gettheid['profilefieldid'] . "' LIMIT 1");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP field" . $gettheid['profilefieldid']);
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

or

$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[21]'");
$gettheid = $db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid='" . $gettheid['profilefieldid'] . "' LIMIT 1");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP field" . $gettheid['profilefieldid']);
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

or

$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='field21'");
$gettheid = $db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid='" . $gettheid['profilefieldid'] . "' LIMIT 1");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP field" . $gettheid['profilefieldid']);
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

or

$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='21'");
$gettheid = $db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");
$db->query_write("DELETE FROM " . TABLE_PREFIX . "profilefield WHERE profilefieldid='" . $gettheid['profilefieldid'] . "' LIMIT 1");
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "userfield DROP field" . $gettheid['profilefieldid']);
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title");

Krofh
10-06-2006, 04:48 AM
The last one... just the number itself.

VietPirates
10-06-2006, 05:13 AM
Already tried all, Krofh! But didn't work.

Or can I drop its tables manually in phpmyadmin?

Krofh
10-06-2006, 06:29 PM
Yes, I suppose you could do that... just drop the row with the quote notification, which seems to be #21 in your case. Argh, 'tis strange that they would remove some of these things in 3.6, I don't like it :( it doesn't help that this was one of my first hacks though, and I didn't code it very well :-/ sorry about the trouble.

distractme
10-08-2006, 07:15 PM
Updated as promised, with the above suggestions... Email/PM notification choice, and the ability to set what user sent the notification in the case of PMs.


We love your hack but we have run into a conflict with our alert system. We have 'alerts' set up to display as posts in a separate, staff only forum. The alerts include a quote of the post of the alerted post. Quote notifier rightly so. views it as any other quote and sends a PM to the person quoted, or in this case, alerted on. Since the text includes the name of the person who quoted them and the link refers them to a "no permissions" private forum, this basically tells them who alerted on their post.

Jim has recently quoted you in a post he made. This user's quotes of you are:

Is there a way to drop the ID action from the text itself? Someway to change the text to a generic "Someone has recently quoted you" and retain the link to the post containing the quote?

Thank you.

Krofh
10-10-2006, 12:58 AM
We love your hack but we have run into a conflict with our alert system. We have 'alerts' set up to display as posts in a separate, staff only forum. The alerts include a quote of the post of the alerted post. Quote notifier rightly so. views it as any other quote and sends a PM to the person quoted, or in this case, alerted on. Since the text includes the name of the person who quoted them and the link refers them to a "no permissions" private forum, this basically tells them who alerted on their post.
Cripe, I can't believe I didn't think of that when I made this. In your Plugin Manager in the ACP, edit the plugin "Quote Notification" under newpost_complete. Add this code at the very top and bottom of the plugin, changing the number 25 to whatever id your private forum is.
if ($post['forumid'] != 25) {
... all current code here ...
}
Is there a way to drop the ID action from the text itself? Someway to change the text to a generic "Someone has recently quoted you" and retain the link to the post containing the quote?
In the Phrase Manager of the ACP, look for the GLOBAL phrases "quotenotify_message" and "quotenotify_emailmessage". Those phrases are the PM and email phrases (respectively) that get sent to the quoted user, and you could easily modify those for your needs.

distractme
10-10-2006, 11:19 AM
Cripe, I can't believe I didn't think of that when I made this. In your Plugin Manager in the ACP, edit the plugin "Quote Notification" under newpost_complete. Add this code at the very top and bottom of the plugin, changing the number 25 to whatever id your private forum is.
if ($post['forumid'] != 25) {
... all current code here ...
}

In the Phrase Manager of the ACP, look for the GLOBAL phrases "quotenotify_message" and "quotenotify_emailmessage". Those phrases are the PM and email phrases (respectively) that get sent to the quoted user, and you could easily modify those for your needs.


thank you!!!. we will try that.

distractme
10-10-2006, 09:27 PM
i have edited the cde to read

if ($post['forumid'] != 65) {


$kr_load = array();
$kr_text = array();
if (preg_match_all("/\]*?)\](.*?)\[\/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=".$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] .= "[$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

Krofh
10-11-2006, 05:20 AM
Ahhh, my mistake. Looking into it, it turns out the $post variable doesn't have the forumid... change the first line I had you put in:
if ($post['forumid'] != 65) {
To the following:
if ($threadinfo['forumid'] != 65) {
When I did that on my server, it worked fine.

distractme
10-11-2006, 10:40 AM
Ahhh, my mistake. Looking into it, it turns out the $post variable doesn't have the forumid... change the first line I had you put in:
if ($post['forumid'] != 65) {
To the following:
if ($threadinfo['forumid'] != 65) {
When I did that on my server, it worked fine.


Thank you! That did it. GREAT NEW FEATURE !

vbreal
11-15-2006, 07:51 PM
is there a version for 3.6

vbreal
11-20-2006, 08:59 PM
can anyone port this over to 3.6

Konstantinos
12-18-2006, 05:40 PM
it doesnt work for 3.6.4 Database error in vBulletin 3.6.4:

Invalid SQL:
SELECT profilefieldid FROM vbprofilefield WHERE title='Quote Notification';

MySQL Error : Unknown column 'title' in 'where clause'
Error Number : 1054

SpankMe
12-19-2006, 12:42 AM
I got it working in 3.6 ok. I'll dig up what I did and post it soon.

Konstantinos
12-21-2006, 12:28 PM
I got it working in 3.6 ok. I'll dig up what I did and post it soon.
di u have the fix ?

SpankMe
12-24-2006, 01:06 AM
Remove the following line from the newpost_complete Quote Notification plugin as it's not needed.

$quotegetfieldquery = $vbulletin->db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");

and modify the following line...
$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");

replacing " . $quotegetfieldquery['profilefieldid'] . " with the Quote Notification profile field id number.

HPIA
12-27-2006, 05:27 AM
I would love someone to port this to 3.6 :D

Konstantinos
12-27-2006, 06:55 AM
Remove the following line from the newpost_complete Quote Notification plugin as it's not needed.

$quotegetfieldquery = $vbulletin->db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");

and modify the following line...
$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");

replacing " . $quotegetfieldquery['profilefieldid'] . " with the Quote Notification profile field id number.
great it works by the way do u have a fix for this https://vborg.vbsupport.ru/showthread.php?t=93138 or if u can make one i ll send u some cash

PoetJA-1975
01-22-2007, 05:33 PM
Remove the following line from the newpost_complete Quote Notification plugin as it's not needed.

$quotegetfieldquery = $vbulletin->db->query_first("SELECT profilefieldid FROM " . TABLE_PREFIX . "profilefield WHERE title='Quote Notification'");

and modify the following line...
$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");

replacing " . $quotegetfieldquery['profilefieldid'] . " with the Quote Notification profile field id number.

I'm not quite understanding those instructions...
the 2nd edit... How do you modify? And the last edit... What is the "profile field id number"?

Trying to get this to work for 3.6.4

Thanx

JAcquii.

PoetJA-1975
01-26-2007, 06:09 PM
hello?

SpankMe
02-23-2007, 09:21 PM
the instructions (https://vborg.vbsupport.ru/showpost.php?p=1144251&postcount=45) you gave for upgrading the quote notification hack are a teeny bit sparse for me.

our real tech admin quit and that means i am the one stuck with upgrading out plugins to 3.6 and i am struggling. could you look at this and tell me what i have done wrong?

based on the first line of code, i assumed that forum id number was 65.

if ($threadinfo['forumid'] != 65) {

so i substitued as per instruction

$quoteuserquery = $vbulletin->db->query_first("SELECT user_table.userid AS userid,

user_table.email AS email, profile_fields.field 65 AS wantquotenotify

but i am obviously wrong:( . can you help? i only have a three day pass here... from the owner to try and get all this stuff figured out.


Not forum id, field id.

From the Admin interface, User Profile Fields -> User Profile Field Manager. Look for "Quote Notification". Under the name column is the field number.

Mine is field number 21 so I have "profile_fields.field21".

SpankMe
02-23-2007, 09:27 PM
Also everyone should put.

$pmdm->overridequota = true;

below

$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);

in the plugin. This will prevent the user getting an error when quoting a member who has disabled PMs in his profile, but has quote PMs turned on.

Renada
02-24-2007, 02:08 AM
Also everyone should put.

$pmdm->overridequota = true;below

$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);in the plugin. This will prevent the user getting an error when quoting a member who has disabled PMs in his profile, but has quote PMs turned on.

Hi,

Do you know what changes would need to be made to install this from scratch on a 3.6 board?

Regards,
Renada

distractme
02-25-2007, 05:38 PM
Not forum id, field id.

From the Admin interface, User Profile Fields -> User Profile Field Manager. Look for "Quote Notification". Under the name column is the field number.

Mine is field number 21 so I have "profile_fields.field21".


Thank you! It worked and I will be a hero. :)

Follie Folli
03-23-2007, 11:57 AM
i have installed this modification some months ago but now i can't remove it .

i have a database error when i try to delete this modification

can you help me?

vbreal
03-26-2007, 07:52 PM
i looked for this for 3.6, was tihs done?

provedel
06-20-2007, 03:27 PM
Same problem here, can't uninstall... :(

And this plugin cause errors on my admincp.

Please, any person can tell me how I can remove this plugin manually?


Here is error I get when tried to remove:

Database error in vBulletin 3.6.7:

Invalid SQL:
SELECT profilefieldid FROM profilefield WHERE title='Quote Notification';

MySQL Error : Unknown column 'title' in 'where clause'
Error Number : 1054
Date : Wednesday, June 20th 2007 @ 12:26:39 PM
Script : http://forum.plurall.org/admincp/plugin.php?do=productkill
Referrer : http://forum.plurall.org/admincp/plugin.php?do=productdelete&productid=quotenotify&s=
IP Address : 201.37.210.158
Username : Sauron
Classname : vb_database

i have installed this modification some months ago but now i can't remove it .

i have a database error when i try to delete this modification

can you help me?

vbreal
01-29-2008, 05:19 PM
I have the same issue. i can't remove it. i would love to see this in 3.6 though.

does anyone know how to remove it?

Breathex
05-02-2008, 06:36 PM
How can we use it for 3.7.x?

Konstantinos
05-03-2008, 09:06 AM
u can delete the plugin via plugin manager

AcidX
05-17-2008, 05:22 PM
Still no port for 3.6? :(

Breathex
05-30-2008, 11:37 PM
How can we use it for 3.7.x?
Any answers? This is a great plugin, but not working in 3.7 :(

SpankMe
05-31-2008, 12:39 AM
This is what I have in my Quote Notification newpost_complete plugin. Works fine in 3.7 and worked in 3.6 to. You just need to change the field id number "profile_fields.field21" to whatever your custom profile field number is on your forums.

$kr_load = array();
$kr_text = array();
if (preg_match_all("/\]*?)\](.*?)\[\/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=".$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] .= "[$kr]."]".$matches[2][$kr]."";
break;
}
}
}
}
}
}
if (count($kr_load) > 0) {
for ($kr=0;$kr<count($kr_load);$kr++) {
//echo "<br>" . $kr_load[$kr];
$quoteuserquery = $vbulletin->db->query_first("SELECT user_table.userid AS userid, profile_fields.field21 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'] == "Yes") {
// Override a potentially full inbox.
$senderpermissions['adminpermissions'] = 2;
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);

$pmdm->overridequota = true;
$pmdm->set('fromuserid', $vbulletin->userinfo['userid']);
$pmdm->set('fromusername', $vbulletin->userinfo['username']);
$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];
}
}
}

Breathex
06-08-2008, 01:53 AM
Thanks for the reply, and how will i install it? Any updated xml file?

SpankMe
06-08-2008, 03:34 AM
The only thing I have changed since I installed it in 3.5, is the above plugin. I have no idea if the original xml will install in 3.7. But the three things you need to install (phrases, custom profile field & plugin) can be installed manually through the admincp.

Konstantinos
06-25-2008, 08:22 PM
this is very usefull hack. however i need to stop it sending quote notification that comes from users that are added to tachy goes to conventry.

meaning when users who are added to coventry when quoting normail members.

anyway for this SpankMe?

Breathex
06-30-2008, 02:02 PM
The only thing I have changed since I installed it in 3.5, is the above plugin. I have no idea if the original xml will install in 3.7. But the three things you need to install (phrases, custom profile field & plugin) can be installed manually through the admincp.
...and also i tried to install it manually but it gives database error in 3.7.2 :/

SpankMe
06-30-2008, 10:57 PM
...and also i tried to install it manually but it gives database error in 3.7.2 :/

What gives you a database error? and whats the error?

Breathex
07-01-2008, 10:12 PM
It gives this error;

Database error in vBulletin 3.7.2:

Invalid SQL:
INSERT INTO vb3_profilefield (title, description, required, hidden, maxlength, size, displayorder, editable, type, data, height, def, optional, searchable, memberlist, regex, form, html) VALUES ('Quote Notification', 'Would you like to be notified by PM when someone quotes something you said in a post?', '0', '1', '250', '25', '100', '1', 'radio', 'a:2:{i:0;s:2:"No";i:1;s:3:"Yes";}', '0', '1', '0', '0', '0', '', '2', '0');

MySQL Error : Unknown column 'title' in 'field list'
Error Number : 1054
Request Date : Wednesday, July 2nd 2008 @ 01:09:19 AM
Error Date : Wednesday, July 2nd 2008 @ 01:09:19 AM
Script : http://xxxxxx/admincp/plugin.php?do=productimport
Referrer : http://xxxxxx/admincp/plugin.php?do=productadd
IP Address : 85.108.150.135
Username : xxxxxx
Classname : vB_Database
MySQL Version : 5.0.58

SpankMe
07-02-2008, 05:24 AM
It gives this error;

Looks like you tried to import the product instead of installing it manually.

Breathex
07-02-2008, 10:05 PM
(phrases, custom profile field & plugin)

*** How will i install phrases?
*** what will i enter to the boxes in "Add New Plugin" and "Add a Profile Field" menu?

I think i need a guidance :o I didn't add an add-on in this way before, sorry.

Breathex
08-06-2008, 02:45 AM
Any suggestions?

SpankMe
08-06-2008, 04:31 AM
Any suggestions?

Make a copy of your site for testing, and start playing. :)

Konstantinos
09-27-2008, 06:25 AM
The only thing I have changed since I installed it in 3.5, is the above plugin. I have no idea if the original xml will install in 3.7. But the three things you need to install (phrases, custom profile field & plugin) can be installed manually through the admincp.

it doesnt install in 3.7 and if added manually u dont have the setting who's gonna send the pm from

SpankMe
09-27-2008, 07:44 AM
Just noticed the AdminCP options are no longer there. I guess the settings in the database must be still there from when I installed it in vB 3.5.

Konstantinos
09-27-2008, 09:17 AM
yeah happens in my old forum as well but i want to install it in a new forum now, it shouldnt be hard to be fixed and this mod is great cause it really boosts discussion

SpankMe
09-30-2008, 11:51 PM
It's a simple mod, so I will look at updating the product install to work on 3.7 as soon as I have some spare time.

SpankMe
10-17-2008, 11:41 PM
ok, here's the product install for 3.7.

If you already have this mod installed, first delete the existing Quote Notification Profile Field.

Then just install this product. Click Allow Overwrite if you have the old version installed.

Let me know how it goes. I've only tested on vB 3.7.2.

Renada
10-17-2008, 11:53 PM
Thank you very much :)

SpankMe
10-18-2008, 12:23 AM
Previous product attachment didn't work in 3.7.1, so have modified and updated attachment in previous post.

Konstantinos
11-08-2008, 06:00 AM
ok, here's the product install for 3.7.

If you already have this mod installed, first delete the existing Quote Notification Profile Field.

Then just install this product. Click Allow Overwrite if you have the old version installed.

Let me know how it goes. I've only tested on vB 3.7.2.

Quote Notification Sender option doest show in vbsettings

Renada
11-14-2008, 07:29 AM
Previous product attachment didn't work in 3.7.1, so have modified and updated attachment in previous post.

Hi SpankMe,

Do you think you could find time to take a look at this for 3.8 please? It won't install on this version.

Thank you :)
Regards,
Renada

Breathex
03-02-2009, 10:35 AM
Hi SpankMe,

Do you think you could find time to take a look at this for 3.8 please? It won't install on this version.

Thank you :)
Regards,
Renada
That would be really great :)

SpankMe
03-03-2009, 07:21 AM
Hi SpankMe,

Do you think you could find time to take a look at this for 3.8 please? It won't install on this version.

Thank you :)
Regards,
Renada

I just tried the above attachment on a clean install of 3.8.1 and it works fine.

cSh
05-21-2009, 10:56 PM
Quote Notification Sender option doest show in vbsettings

yes not work
please 3.8.x work xml file :(

ToNetU
06-21-2009, 03:27 PM
that's what am looking for, i made a thread and asked about this product :P but finally i found it! link: https://vborg.vbsupport.ru/showthread.php?t=216694

and it works fine with 3.8.2

thanks

eXoOutsider
07-23-2009, 04:11 PM
hmm doesnt work for me, any news?

choccyclaire
08-10-2009, 10:29 PM
It does not work on my 3.8.1 forum. *sigh*

rollerman
11-16-2009, 11:54 PM
It does not work on my 3.8.1 forum. *sigh*Seems to work like a charm on a fresh install in v3.8.4.

d0zer
11-20-2009, 10:54 AM
thanks..

rollerman
12-09-2009, 12:59 PM
Weird error.
Fatal error:
XXXXXXX has chosen not to receive private messages or may not be allowed to receive private messages. Therefore you may not send your message to him/her.

If you are trying to send this message to multiple recipients, remove XXXXXXX from the recipient list and send the message again.
Unable to proceed with save while $errors array is not empty in class vB_DataManager_PM in [path]/includes/class_dm.php on line 810This seems to be happening only with one account, though I'm running tests with others who have the same permissions. In this case, the account in question is a Super Moderator and a registered user, and this error only appears when another registered user quotes him. Other moderators or admin do not get this error on quoting him.

Any suggestions?


ETA: PM's are indeed enabled on the account in question, and he has more than enough room in his PM inbox to accept new PMs.

SpankMe
01-03-2010, 12:35 AM
My previously attached mods work in vB 4.0.

11133
01-25-2010, 06:05 PM
its work perfect on 3.8.4
i have one question
is it posible to add feature to notify me like notify me when someone post comment on my profile, etc
not to notify me over pm

TundraSoul
02-11-2010, 08:07 PM
It does not import on fresh installs of vB 3.84.

AcidX
05-10-2010, 05:17 AM
vb 4 compatible?

NLPLegacy
09-05-2010, 04:11 AM
How does this work with 3.8.6, can't get it to work

NLPLegacy
09-05-2010, 05:23 AM
Ugh now I can't uninstall it. Comes up as DB Error

FreshFroot
02-05-2011, 11:40 PM
Ugh now I can't uninstall it. Comes up as DB Error
maybe you should've read the announcement where it says IT DOES NOT work with 3.6+

You should've tried it on a test board!

HFB
02-08-2011, 05:16 PM
My previously attached mods work in vB 4.0.

Thanks for working on it. We have this installed on several forums running various versions of vB (3.6.8 through 3.8.4) with no issues.

Ahhh, my mistake. Looking into it, it turns out the $post variable doesn't have the forumid... change the first line I had you put in:
if ($post['forumid'] != 65) {
To the following:
if ($threadinfo['forumid'] != 65) {
When I did that on my server, it worked fine.

This needs to be updated for ajax. It causes a 'duplicate post' message with ajax quick reply. If you multiple forums to exclude and you don't use ajax, this code will work too:
if !in_array($threadinfo['forumid'], array(X,Y,Z)) {

6impy
08-18-2011, 05:22 PM
ok, here's the product install for 3.7.

If you already have this mod installed, first delete the existing Quote Notification Profile Field.

Then just install this product. Click Allow Overwrite if you have the old version installed.

Let me know how it goes. I've only tested on vB 3.7.2.

Thank you for releasing this update SpankMe.

For everyone else reading this:

I can confirm the attachment in the above post (Go here to download the attachment: https://vborg.vbsupport.ru/showpost.php?p=1647364&postcount=77) is working on 3.8.6 Patch Level 2, but there are a couple things to keep in mind:

I can't see the option to set a default user for the notification PMs to be sent through under Admin Control Panel > vBulletin Options > Message Posting and Editing Options. In my case, I don't care about this, because I want the PM to come from the user doing the quoting, which works fine.
If you want to make the default option be that the user gets a private message, instead of no notification, then go to Admin Control Panel > User Profile Fields > User Profile Field Manager > Click the Edit link for Quote Notification (at bottom of page), then change the order of the listed fields putting whatever you want the default to be as the top option. It's making the decision to Email/PM/Not based on the text content of this field, not the position selection.
If you make the change in step 2 above, and want all your current users to get PM or email notifications by default, then run one of the two MySQL queries (BACKUP THE TABLE BEFORE YOU DO THIS, JUST IN CASE):
update `vb_userfield` set field[#]='Private Message';
update `vb_userfield` set field[#]='Email';
(where [#] is the number of the field that can be seen in Admin Control Panel > User Profile Fields > User Profile Field Manager)
Finally, you'll want to make the change suggested by SpankMe in this post. Otherwise, users will see a Fatal Error if they quote the post of a user that has quote notification turned on, but PMs turned off, PMs contacts only, or PM quota is full. https://vborg.vbsupport.ru/showpost.php?p=1189370&postcount=51

You'll want to do a phrase search for "Kiwi Biker forums" and replace it with the name of your forums, as it is hard coded into the email that goes out (when users choose to be notified by email)


Good luck and thanks again to both SpankMe (want a spanking? ;)) and Krofh.

Konstantinos
08-20-2011, 08:38 PM
Thank you for releasing this update SpankMe.

For everyone else reading this:

I can confirm the attachment in the above post (Go here to download the attachment: https://vborg.vbsupport.ru/showpost.php?p=1647364&postcount=77) is working on 3.8.6 Patch Level 2, but there are a couple things to keep in mind:

I can't see the option to set a default user for the notification PMs to be sent through under Admin Control Panel > vBulletin Options > Message Posting and Editing Options. In my case, I don't care about this, because I want the PM to come from the user doing the quoting, which works fine.
If you want to make the default option be that the user gets a private message, instead of no notification, then go to Admin Control Panel > User Profile Fields > User Profile Field Manager > Click the Edit link for Quote Notification (at bottom of page), then change the order of the listed fields putting whatever you want the default to be as the top option. It's making the decision to Email/PM/Not based on the text content of this field, not the position selection.
If you make the change in step 2 above, and want all your current users to get PM or email notifications by default, then run one of the two MySQL queries (BACKUP THE TABLE BEFORE YOU DO THIS, JUST IN CASE):
update `vb_userfield` set field[#]='Private Message';
update `vb_userfield` set field[#]='Email';
(where [#] is the number of the field that can be seen in Admin Control Panel > User Profile Fields > User Profile Field Manager)
Finally, you'll want to make the change suggested by SpankMe in this post. Otherwise, users will see a Fatal Error if they quote the post of a user that has quote notification turned on, but PMs turned off, PMs contacts only, or PM quota is full. https://vborg.vbsupport.ru/showpost.php?p=1189370&postcount=51

You'll want to do a phrase search for "Kiwi Biker forums" and replace it with the name of your forums, as it is hard coded into the email that goes out (when users choose to be notified by email)


Good luck and thanks again to both SpankMe (want a spanking? ;)) and Krofh.

u need to edit the plugin to set a default user to send the pm

$qn_fromuserid = $vbulletin->userinfo['userid'];
$qn_fromusername = $vbulletin->userinfo['username'];

to

$qn_fromuserid = $vbulletin->3345;
$qn_fromusername = $vbulletin->Johny;

6impy
08-20-2011, 08:44 PM
u need to edit the plugin to set a default user to send the pm

$qn_fromuserid = $vbulletin->userinfo['userid'];
$qn_fromusername = $vbulletin->userinfo['username'];

to

$qn_fromuserid = $vbulletin->3345;
$qn_fromusername = $vbulletin->Johny;

Thanks for the addition! I actually prefer it the other way, but I'm sure this will be useful for others!