How to make pm automatically?
Seabody Offline
Member
***
Posts: 54
Joined: Aug 2012
Post: #3
RE: How to make pm automatically?
Well, the basic code for a fuction would be along the lines of this, but I'm not 100% sure it works:

PHP Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
function happybday($to)
  {
      global $mybb
      require_once(MYBB_ROOT . "inc/datahandlers/pm.php");
      $pmhandler = new PMDataHandler();
      $pmhandler->admin_override = true;

      $pm = array(
          "subject" => "Hi",
          "message" => "You've been a member for a year. Have some pie.",
          "icon" => "-1",
          "toid" => array(),
          "fromid" => '1', //Change this to a uid
          "do" => "",
          "pmid" => ""
      );
      $pm["options"] = array(
          "signature" => "0",
          "disablesmilies" => "0",
          "savecopy" => "0",
          "readreceipt" => "0"
      );
      
      if(!is_array($to))
      {
          array_push($pm["toid"], $to);
      }
      else
      {
          foreach($to as $uid)
          {
              array_push($pm["toid"], $uid);
          }
      }

      $pmhandler->set_data($pm);

      if($pmhandler->validate_pm())
      {
          $pmhandler->insert_pm();
          return true;
      }
      else
      {
          return false;
      }
  }

12-01-2012 09:40 PM
Find all posts by this user Quote this message in a reply

« Next Oldest | Next Newest »

Messages In This Thread
How to make pm automatically? - tony - 11-30-2012, 06:20 AM
RE: How to make pm automatically? - tony - 12-02-2012, 04:16 AM
RE: How to make pm automatically? - Seabody - 12-01-2012 09:40 PM
RE: How to make pm automatically? - tony - 12-02-2012, 04:17 AM
RE: How to make pm automatically? - tony - 12-03-2012, 06:27 AM

 Standard Tools
Forum Jump: