vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3.5 Add-ons (https://vborg.vbsupport.ru/forumdisplay.php?f=113)
-   -   Quote Notification (https://vborg.vbsupport.ru/showthread.php?t=112498)

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

Quote:

Originally Posted by Krofh
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.

Quote:

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

Quote:

Originally Posted by distractme
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.
Code:

if ($post['forumid'] != 25) {
... all current code here ...
}

Quote:

Originally Posted by distractme
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

Quote:

Originally Posted by Krofh
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.
Code:

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=([^\\\"\]]*?)\](.*?)\[\/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

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:
Code:

if ($post['forumid'] != 65) {
To the following:
Code:

if ($threadinfo['forumid'] != 65) {
When I did that on my server, it worked fine.

distractme 10-11-2006 10:40 AM

Quote:

Originally Posted by Krofh
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) {
To the following:
Code:

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


All times are GMT. The time now is 04:47 AM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.03033 seconds
  • Memory Usage 1,761KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (6)bbcode_code_printable
  • (8)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (4)pagenav_pagelink
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • pagenav_page
  • pagenav_complete
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete