本文整理汇总了PHP中message::attachFile方法的典型用法代码示例。如果您正苦于以下问题:PHP message::attachFile方法的具体用法?PHP message::attachFile怎么用?PHP message::attachFile使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类message
的用法示例。
在下文中一共展示了message::attachFile方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: elseif
$template->display("addmessageform.tpl");
} elseif ($action == "add") {
// check if the user is allowed to add messages
if (!$userpermissions["messages"]["add"]) {
$errtxt = $langfile["nopermission"];
$noperm = $langfile["accessdenied"];
$template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
$template->display("error.tpl");
die;
}
// add message
$themsg = $msg->add($id, $title, $message, $userid, $username, 0, $milestone);
if ($themsg) {
if ($thefiles > 0) {
// attach existing file
$msg->attachFile($thefiles, $themsg);
} elseif ($thefiles == 0 and $numfiles > 0) {
// if upload files are set, upload and attach
$msg->attachFile(0, $themsg, $id);
}
if ($settings["mailnotify"]) {
$sendto = getArrayVal($_POST, "sendto");
$usr = (object) new project();
$users = $usr->getProjectMembers($id, 10000);
if ($sendto[0] == "all") {
$sendto = $users;
$sendto = reduceArray($sendto);
} elseif ($sendto[0] == "none") {
$sendto = array();
}
foreach ($users as $user) {