![]() |
Quote Notification
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:
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:
This hack is somewhat similar to Who quoted me?, 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 - 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. :) |
First post, one moment while I upload files... done.
|
thanks ...installed i will try it
|
Nice hack actually :)
Might use it in the future [high]* Desihunk says thanks.[/high] |
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...
|
^ 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.
|
I dont see the option to turn it on.. Hmm
|
Found it
|
This looks promising.. .
|
Hello ,
how can i set option enabled by default for every user , Is there some qeury to do it , Regards |
Since everyone seems to want to be able to set this enabled by default...
|
Thanks, I'll give this a shot!
|
Nice hack.
*clicks install* |
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: PHP Code:
PHP Code:
|
Ahh, indeed. Thanks for noticing and fixing that, I'll go post an updated version now.
... done. |
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. |
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.
|
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? |
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: Code:
$kr_load = array(); |
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 |
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.
|
How about email notifications instead of pm notifications? :)
|
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.
|
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.
|
Thank you, Krofh! Installed ;)
|
Any update for 3.6?
Code:
Invalid SQL: can't unisntall it. Code:
Database error in vBulletin 3.6.0: |
^ 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:
Code:
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)"); Code:
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield DROP title"); 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 |
Thank you, Krofh!
But got this error: Code:
Invalid SQL: Tried again: Code:
Invalid SQL: Uninstall Code: Code:
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)"); |
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 Code:
$db->query_write("ALTER TABLE " . TABLE_PREFIX . "profilefield ADD title VARCHAR (255)"); |
My profilefield is field21
Error: Code:
Invalid SQL: Unisntall Code: Code:
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[field21]'"); Code:
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='[21]'"); Code:
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='field21'"); Code:
$db->query_write("UPDATE TABLE " . TABLE_PREFIX . "profilefield SET title='Quote Notification' where profilefieldid='21'"); |
The last one... just the number itself.
|
Already tried all, Krofh! But didn't work.
Or can I drop its tables manually in phpmyadmin? |
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.
|
Quote:
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. Quote:
Thank you. |
Quote:
Code:
if ($post['forumid'] != 25) { Quote:
|
Quote:
thank you!!!. we will try that. |
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:
} else { for ($kri=0;$kri<count($kr_load);$kri++) { if ($kr_load[$kri] == $matches[1][$kr]) { $kr_text[$kri] .= " Quote:
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 |
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:
Code:
if ($post['forumid'] != 65) { Code:
if ($threadinfo['forumid'] != 65) { |
Quote:
Thank you! That did it. GREAT NEW FEATURE ! |
is there a version for 3.6
|
All times are GMT. The time now is 05:31 PM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|