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)

paul41598 12-20-2006 11:49 PM

least urs might be working..mine keeps sending multiple PM's to the same person. argh

jwocky 12-20-2006 11:54 PM

Quote:

Originally Posted by paul41598 (Post 1142544)
least urs might be working..mine keeps sending multiple PM's to the same person. argh

If its doubling up the name like that without the semicolon it shouldnt be sending multiple pms? try doing the same thing I did (put the pmdm->errors into the implode and then echo that variable and see what the exact error is thats being stored ?

paul41598 12-21-2006 12:07 AM

Ok here is my code in my cron...stripped down to show the basic idea.

Code:

        $userpointsqry = $vbulletin->db->query_read("
                SELECT vbbux, userid, username
                FROM " . TABLE_PREFIX . "user
                WHERE post_groan_times > 0
        ");

        $pmto_users = array();
while($pquery = $vbulletin->db->fetch_array($userpointsqry))
{
                $pmto_users[] = $pquery['username']; }
                $pmtousernames = implode( '; ', $pmto_users);
                echo "$pmtousernames";
               
                //Took Out PM Datamanager Code HERE for time Being
}

WHen I run my CRON job manually, it echo's out this: (keeping in mind there are 2 users who have a post_groan_time greater than 0...

PHP Code:

CMURickCMURickPepsico

Done 


I got it, Im an idiot

sp00fer 12-21-2006 06:24 PM

i get an mySQL sytax error if i use this to send a PM to a user with an apostrophe in his name........any help?

Edit: Manually Escaping the apostrophe also doesnt work (generates a vbulletin error: cant find user)

nevermind, its not a problem after all :D

jwocky 02-12-2007 03:12 AM

Any ideas how to override a full PM box in vb 3.6? the $pmdm->overridequota = true; doesn't seem to be working at all :(

Antivirus 02-17-2007 10:59 PM

$pmdm->overridequota = true; works fine for me. Although I think it needs to be right after you initialize the class like this:
$pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
$pmdm->overridequota = true;

You might also need to set $botpermissions in set recipients like this:
$pmdm->set_recipients($recipient, $botpermissions);

cashpath 03-07-2007 03:50 PM

Quote:

$pmdm->set_recipients($recipient, $botpermissions);
Quick question.. is there a way to send the PM to a recipient by userid instead of by username???

Thanks.

fly 03-07-2007 04:15 PM

Quote:

Originally Posted by cashpath (Post 1198097)
Quick question.. is there a way to send the PM to a recipient by userid instead of by username???

Thanks.

Can't you just get the name from the id? Why do you have one but not the other?

cashpath 03-07-2007 04:23 PM

Well.. I have stored the userid into another custom table..and it is not the userid that is currently accessing the page. I didn't store the username..

If there is no way to send to the userid using the functions then I guess I can always just store the username also... Good point.

fly 03-07-2007 04:37 PM

Quote:

Originally Posted by cashpath (Post 1198131)
Well.. I have stored the userid into another custom table..and it is not the userid that is currently accessing the page. I didn't store the username..

If there is no way to send to the userid using the functions then I guess I can always just store the username also... Good point.

You could always just do a query to get the name. There is likely a better solution that is beyond me though...


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

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.01378 seconds
  • Memory Usage 1,743KB
  • 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
  • (1)bbcode_code_printable
  • (1)bbcode_php_printable
  • (4)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