vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vBulletin 3 Articles (https://vborg.vbsupport.ru/forumdisplay.php?f=187)
-   -   Send PMs (automatically) (https://vborg.vbsupport.ru/showthread.php?t=82786)

Rich 07-18-2008 01:51 PM

Quote:

Originally Posted by Jase2 (Post 1576264)
Hi Andreas,

The following bit:

PHP Code:

$pmdm->set('message'"Hello\nI am a Bot and would like to give you a warm welcome :)"); 

How would I go about changing this to a phrase, so that users can have the message however they like. Is it possible?

Thanks.

-- Jason

Thats actually pretty easy Jason. You need to set 2 things.

First you need this BEFORE the message is called to be sent:

$message = $vbphrase[your_phrase];

Then change the line you have posted above to read:

$pmdm->set('message', $message);

squishi 09-03-2008 08:40 PM

Does this work with 3.7.3?
And if so, wkhat file do I need to include in the php file?

veenuisthebest 09-09-2008 02:03 PM

Quote:

Originally Posted by squishi (Post 1613915)
Does this work with 3.7.3?
And if so, wkhat file do I need to include in the php file?

yes it would work in all versions of vb

no file to include.

Excalibur82 04-07-2009 04:53 AM

Since my code deals with PM's I need to exclude myself from receiving a PM as I am the one making the new comment.

PHP Code:

            $useri $db->query_read("
                SELECT * FROM " 
TABLE_PREFIX "threadcomment
                WHERE threadid = 
$threadinfo[threadid]
            "
); 

Now what I am trying to do is this (I know this won't work but an example of what I need:
PHP Code:

            $useri $db->query_read("
                SELECT * FROM " 
TABLE_PREFIX "threadcomment
                WHERE threadid = 
$threadinfo[threadid]
                IGNORE userid = 
$vbulletin->userinfo['userid']
            "
); 

I couldn't find anything to exclude my id, does anyone know how to do this?

Thanks

mferguson 04-07-2009 03:58 PM

You should be able to exclude yourself using the following query given that userid is a column in the threadcomment table.

PHP Code:

$useri $db->query_read("
       SELECT * FROM " 
TABLE_PREFIX "threadcomment
                WHERE threadid = 
$threadinfo[threadid]
                AND userid != 
$vbulletin->userinfo['userid']
"
); 


Excalibur82 04-07-2009 05:52 PM

Thank you very much, thats what I needed.

Had to change it:
PHP Code:

$useri $db->query_read("
       SELECT * FROM " 
TABLE_PREFIX "threadcomment
                WHERE threadid = 
$threadinfo[threadid]
                AND userid != " 
$vbulletin->userinfo['userid'] . "
"
); 

Works like a charm.

mferguson 04-07-2009 08:22 PM

Glad to help!

bpr 05-02-2010 11:58 PM

Is it possible to transfer it for the vb 4.0. x ?

steveheinsch 05-13-2010 07:22 PM

I am sending to a lot of recipients at once. Its in a loop sending to 20 recipients at a time (user1;user2;etc)

Occasionally Ill get the following error when checking $pmdm->errors:

Quote:

XXXX 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 XXXX from the recipient list and send the message again.
How does one check to see if someone is allowed to receive a PM before its sent so I can exclude them from the recipients?

I am using $botpermissions['adminpermissions'] = 2; to override if their mailbox is full, but don't want to send a PM to people who aren't allowed by way of permissions to receive them.

Can this be checked in the query I am using to select names from the user table? Or is there code that can be used to check to see if the user is able to receive PM's?

I appreciate any insight.
Thanks,
Steve

Easy5s.net 12-13-2012 01:51 AM

hello, I want send a content to two people, but different title, how to?


All times are GMT. The time now is 07:01 PM.

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

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01434 seconds
  • Memory Usage 1,751KB
  • 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
  • (5)bbcode_php_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)pagenav
  • (1)pagenav_curpage
  • (2)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