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)

Breathex 05-30-2008 11:37 PM

Quote:

Originally Posted by Breathex (Post 1506026)
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.

PHP 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'])) {
            if (!
in_array($matches[1][$kr], $kr_load)) {
                
$kr_load[] = $matches[1][$kr];
                
$kr_text[] = "[quote=".$matches[1][$kr]."]".$matches[2][$kr]."[/quote]";
            }
            else {
                for (
$kri=0;$kri<count($kr_load);$kri++) {
                    if (
$kr_load[$kri] == $matches[1][$kr]) {
                        
$kr_text[$kri] .= "[quote=".$matches[1][$kr]."]".$matches[2][$kr]."[/quote]";
                        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'$vbulletinERRTYPE_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

Quote:

Originally Posted by SpankMe (Post 1543716)
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

Quote:

Originally Posted by Breathex (Post 1563042)
...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;

PHP Code:

Database error in vBulletin 3.7.2:

Invalid SQL:
INSERT INTO vb3_profilefield (titledescriptionrequiredhiddenmaxlengthsizedisplayordereditabletypedataheightdefoptionalsearchablememberlistregexformhtmlVALUES ('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  
WednesdayJuly 2nd 2008 01:09:19 AM
Error Date    
WednesdayJuly 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

Quote:

Originally Posted by Breathex (Post 1564317)
It gives this error;

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

Breathex 07-02-2008 10:05 PM

Quote:

(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.


All times are GMT. The time now is 07:58 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.02073 seconds
  • Memory Usage 1,791KB
  • 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
  • (2)bbcode_php_printable
  • (5)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