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)

mferguson 12-14-2006 06:43 PM

Are you wanting to bulk email members based on a cron? If so the only thing I believe you need to do would be to figure out what you needed to populate when the cron is run (ie - subject, body, etc.)

Mark

Blaine0002 12-14-2006 06:54 PM

no, only want it to send 2 pms, but its not sending any, and the cron IS being run correctly.

mferguson 12-14-2006 07:16 PM

I guess I'm confused as to why you are doing this with a cron. If you can provide some background it will give me a better idea of how it might be done.

As to the cron itself. How are you verifying that it is being run correctly? Is there some type of output being generated?

Thanks

Mark

Blaine0002 12-15-2006 12:05 AM

in my auction modification, a cron runs every 10 minutes which closes auctions and notifies buyer and seller of who won.

paul41598 12-20-2006 05:27 PM

Um I have the below code in a cron job, and when it runs Im getting this error:

PHP Code:

Fatal errorUnable to proceed with save while $errors array is not empty in class vb_datamanager_pm in /includes/class_dm.php on line 758 


Code:

      // Fetch the PM message 
        if ($vbulletin->options['ptp_pm_on_off'] == '1')
        {
                    $ptp_pm =
          construct_phrase(
            $vbphrase['ptp_alertpm'],
            $pquery['username'],
          );
     
      // Send a PM to user(s)
      $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
      $pmdm->set('fromuserid', 6);
      $pmdm->set('fromusername', 'JonB');
      $pmdm->set('title', 'Crap');
      $pmdm->overridequota = true;
      $pmdm->set('message', 'test');
      $pmdm->set_recipients($pquery['username'], $botpermissions);
      $pmdm->set('dateline', TIMENOW);
      $pmdm->save();
        }

Whats wrong here? I think it worked before now all of a sudden doesnt... (I think) :cross-eyed:

jwocky 12-20-2006 09:06 PM

Quote:

Originally Posted by paul41598 (Post 1142336)
Um I have the below code in a cron job, and when it runs Im getting this error:

PHP Code:

Fatal errorUnable to proceed with save while $errors array is not empty in class vb_datamanager_pm in /includes/class_dm.php on line 758 


Code:

      // Fetch the PM message 
        if ($vbulletin->options['ptp_pm_on_off'] == '1')
        {
                    $ptp_pm =
          construct_phrase(
            $vbphrase['ptp_alertpm'],
            $pquery['username'],
          );
     
      // Send a PM to user(s)
      $pmdm =& datamanager_init('PM', $vbulletin, ERRTYPE_ARRAY);
      $pmdm->set('fromuserid', 6);
      $pmdm->set('fromusername', 'JonB');
      $pmdm->set('title', 'Crap');
      $pmdm->overridequota = true;
      $pmdm->set('message', 'test');
      $pmdm->set_recipients($pquery['username'], $botpermissions);
      $pmdm->set('dateline', TIMENOW);
      $pmdm->save();
        }

Whats wrong here? I think it worked before now all of a sudden doesnt... (I think) :cross-eyed:

Wow, i'm having the identical error message which just started today as well, I wonder whats going on here... and I mean identical Is there a way to get the script to echo the error? return $pmdm->errors; ? I have that in my cron script, but when i run it in the task manager i get no text echoed, maybee another way so that we can diagnose this problem

Blaine0002 12-20-2006 09:41 PM

PHP Code:

echo $pmdm->errors

When i did a cron i actually made a seperate function and ran the function from the cron.

jwocky 12-20-2006 09:44 PM

Quote:

Originally Posted by Blaine0002 (Post 1142487)
PHP Code:

echo $pmdm->errors

When i did a cron i actually made a seperate function and ran the function from the cron.

That just prints out the word "Array" .. dont know how to parse that pmdm->errors to give us some valuable data on diagnosing the problem

paul41598 12-20-2006 10:27 PM

actually if I take out the PM datamanager code temporarily...and replace with this:

Code:

      $pmto_users[] = $pquery['username'];

      $pmtousernames = implode(';', $pmto_users);
                        echo "$pmtousernames";

I get CMUrickCMUrick;Pepsico

Its printing out CMUrick twice and I have no idea why. But its working kinda...

jwocky: You need the code in this post I think to grab names and put em in an array, then you will get a different output in your tests.

jwocky 12-20-2006 11:43 PM

Quote:

Originally Posted by paul41598 (Post 1142513)
actually if I take out the PM datamanager code temporarily...and replace with this:

Code:

      $pmto_users[] = $pquery['username'];

      $pmtousernames = implode(';', $pmto_users);
                        echo "$pmtousernames";

I get CMUrickCMUrick;Pepsico

Its printing out CMUrick twice and I have no idea why. But its working kinda...

jwocky: You need the code in this post I think to grab names and put em in an array, then you will get a different output in your tests.


Ok, i imploded the array $pmdm->errors in the same way you did above and got it to spit out the error code, turns out in my case, the user set to recieve the PM had his inbox full! argh.


All times are GMT. The time now is 12:44 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.01419 seconds
  • Memory Usage 1,754KB
  • 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
  • (4)bbcode_code_printable
  • (4)bbcode_php_printable
  • (3)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