Exemple #1
0
                 $msg["recipients"][$rcpt["user_id"]] = array("display_name" => $rcpt["display_name"], "user_id" => $rcpt["user_id"]);
             }
         }
         $hide_userselect = 1;
         // Setup data for replying privately to a forum post.
     } elseif (isset($PHORUM["args"]["message_id"])) {
         $message = $PHORUM['DB']->get_message($PHORUM["args"]["message_id"], "message_id", true);
         if (phorum_api_user_check_access(PHORUM_USER_ALLOW_READ) && ($PHORUM["forum_id"] == $message["forum_id"] || $message["forum_id"] == 0)) {
             // get url to the message board thread
             $origurl = phorum_api_url(PHORUM_READ_URL, $message["thread"], $message["message_id"]);
             // Get the data for the user that we reply to.
             $user = phorum_api_user_get($message["user_id"]);
             $msg["subject"] = $message["subject"];
             $msg["message"] = $message["body"];
             $msg["recipients"][$message["user_id"]] = array('display_name' => $user["display_name"], 'user_id' => $user["user_id"]);
             $msg = phorum_pm_quoteformat($user["display_name"], $user["user_id"], $msg, $origurl);
         }
         $hide_userselect = 1;
     }
 }
 /**
  * [hook]
  *     pm_send_init
  *
  * [availability]
  *     Phorum 5 >= 5.2.15
  *
  * [description]
  *     This hook can be used for doing modifications to the
  *     PM message data that is used for sending a PM at an
  *     early stage in the request.
Exemple #2
0
                    // get url to the message board thread
                    $origurl = phorum_get_url(PHORUM_READ_URL, $message["thread"], $message["message_id"]);

                    // Find the real username, because some mods rewrite the
                    // username in the message table. There will be a better solution
                    // for selecting recipients, but for now this will fix some
                    // of the problems.
                    $user = phorum_user_get($message["user_id"], false);

                    $msg["subject"] = $message["subject"];
                    $msg["message"] = $message["body"];
                    $msg["recipients"][$message["user_id"]] = array(
                        'username' => $user["username"],
                        'user_id'  => $user["user_id"]
                    );
                    $msg = phorum_pm_quoteformat($user["username"], $msg, $origurl);
                }

                $hide_userselect = 1;
            }
        }

        // Setup data for previewing a message.
        if ($msg["preview"]) {
            list($preview) = phorum_pm_format(array($msg));
            $PHORUM["DATA"]["PREVIEW"] = $preview;
        }

        // XSS prevention.
        foreach ($msg as $key => $val) {
            switch ($key) {