本文整理汇总了PHP中BxDolEmailTemplates类的典型用法代码示例。如果您正苦于以下问题:PHP BxDolEmailTemplates类的具体用法?PHP BxDolEmailTemplates怎么用?PHP BxDolEmailTemplates使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了BxDolEmailTemplates类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: onPostReply
function onPostReply($aTopic, $sPostText, $sUser)
{
$oProfile = new BxDolProfile($sUser);
$iProfileId = $oProfile->getID();
if (BX_ORCA_INTEGRATION == 'dolphin' && !isAdmin($iProfileId)) {
defineForumActions();
$iActionId = BX_FORUM_PUBLIC_POST;
if (isset($aTopic['forum_type']) && 'private' == $aTopic['forum_type']) {
$iActionId = BX_FORUM_PRIVATE_POST;
}
checkAction($iProfileId, $iActionId, true);
// perform action
}
$aPlusOriginal = array('PosterUrl' => $iProfileId ? getProfileLink($iProfileId) : 'javascript:void(0);', 'PosterNickName' => $iProfileId ? getNickName($iProfileId) : $sUser, 'TopicTitle' => $aTopic['topic_title'], 'ReplyText' => $sPostText);
$oEmailTemplate = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplate->getTemplate('bx_forum_notifier');
$fdb = new DbForum();
$a = $fdb->getSubscribersToTopic($aTopic['topic_id']);
foreach ($a as $r) {
if ($r['user'] == $sUser) {
continue;
}
$oRecipient = new BxDolProfile($r['user']);
$aRecipient = getProfileInfo($oRecipient->_iProfileID);
$aPlus = array_merge(array('Recipient' => ' ' . getNickName($aRecipient['ID'])), $aPlusOriginal);
sendMail(trim($aRecipient['Email']), $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus);
}
forumAlert('reply', $aTopic['topic_id'], $iProfileId);
}
示例2: _checkProfileMatch
function _checkProfileMatch($iProfileId, $sAction)
{
$aProfile = getProfileInfo($iProfileId);
if ($aProfile['Status'] == 'Active' && ($aProfile['UpdateMatch'] || $sAction == 'join')) {
$oDb = new BxDolDb();
// clear field "UpdateMatch"
$oDb->query("UPDATE `Profiles` SET `UpdateMatch` = 0 WHERE `ID`= {$iProfileId}");
// clear cache
$oDb->query("DELETE FROM `sys_profiles_match`");
// get send mails
$aSendMails = $oDb->getRow("SELECT `profiles_match` FROM `sys_profiles_match_mails` WHERE `profile_id` = {$iProfileId}");
$aSend = !empty($aSendMails) ? unserialize($aSendMails['profiles_match']) : array();
$aProfiles = getMatchProfiles($iProfileId);
foreach ($aProfiles as $iProfId) {
if (!isset($aSend[(int) $iProfId])) {
$oEmailTemplate = new BxDolEmailTemplates();
$aMessage = $oEmailTemplate->parseTemplate('t_CupidMail', array('StrID' => $iProfId, 'MatchProfileLink' => getProfileLink($iProfileId)), $iProfId);
$aProfile = getProfileInfo($iProfId);
if (!empty($aProfile) && $aProfile['Status'] == 'Active') {
$oDb->query("INSERT INTO `sys_sbs_queue`(`email`, `subject`, `body`) VALUES('" . $aProfile['Email'] . "', '" . process_db_input($aMessage['subject'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "', '" . process_db_input($aMessage['body'], BX_TAGS_NO_ACTION, BX_SLASHES_NO_ACTION) . "')");
}
$aSend[(int) $iProfId] = 0;
}
}
if (empty($aSendMails)) {
$oDb->query("INSERT INTO `sys_profiles_match_mails`(`profile_id`, `profiles_match`) VALUES({$iProfileId}, '" . serialize($aSend) . "')");
} else {
$oDb->query("UPDATE `sys_profiles_match_mails` SET `profiles_match` = '" . serialize($aSend) . "' WHERE `profile_id` = {$iProfileId}");
}
}
}
示例3: SendTellFriend
/**
* send "tell a friend" email
*/
function SendTellFriend($iSenderID = 0)
{
global $profileID;
$sRecipient = clear_xss($_POST['friends_emails']);
$sSenderName = clear_xss($_POST['name']);
$sSenderEmail = clear_xss($_POST['email']);
if (strlen(trim($sRecipient)) <= 0) {
return 0;
}
if (strlen(trim($sSenderEmail)) <= 0) {
return 0;
}
$sLinkAdd = $iSenderID > 0 ? 'idFriend=' . $iSenderID : '';
$rEmailTemplate = new BxDolEmailTemplates();
if ($profileID) {
$aTemplate = $rEmailTemplate->getTemplate('t_TellFriendProfile', $profileID);
$Link = getProfileLink($profileID, $sLinkAdd);
} else {
$aTemplate = $rEmailTemplate->getTemplate('t_TellFriend');
$Link = BX_DOL_URL_ROOT;
if (strlen($sLinkAdd) > 0) {
$Link .= '?' . $sLinkAdd;
}
}
$aPlus = array('Link' => $Link, 'FromName' => $sSenderName);
return sendMail($sRecipient, $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus);
}
示例4: SendTellFriend
/**
* send "tell a friend" email
*/
function SendTellFriend($iSenderID = 0)
{
global $profileID;
$sSenderEmail = clear_xss(bx_get('sender_email'));
if (strlen(trim($sSenderEmail)) <= 0) {
return 0;
}
$sSenderName = clear_xss(bx_get('sender_name'));
$sSenderLink = $iSenderID != 0 ? getProfileLink($iSenderID) : BX_DOL_URL_ROOT;
$sRecipientEmail = clear_xss(bx_get('recipient_email'));
if (strlen(trim($sRecipientEmail)) <= 0) {
return 0;
}
$sLinkAdd = $iSenderID > 0 ? 'idFriend=' . $iSenderID : '';
$rEmailTemplate = new BxDolEmailTemplates();
if ($profileID) {
$aTemplate = $rEmailTemplate->getTemplate('t_TellFriendProfile', getLoggedId());
$Link = getProfileLink($profileID, $sLinkAdd);
} else {
$aTemplate = $rEmailTemplate->getTemplate('t_TellFriend', getLoggedId());
$Link = BX_DOL_URL_ROOT;
if (strlen($sLinkAdd) > 0) {
$Link .= '?' . $sLinkAdd;
}
}
return sendMail($sRecipientEmail, $aTemplate['Subject'], $aTemplate['Body'], '', array('Link' => $Link, 'SenderName' => $sSenderName, 'SenderLink' => $sSenderLink));
}
示例5: processing
function processing()
{
$oModules = new BxDolModuleDb();
$aModules = $oModules->getModules();
$aResult = array();
foreach ($aModules as $aModule) {
$aCheckInfo = BxDolInstallerUi::checkForUpdates($aModule);
if (isset($aCheckInfo['version'])) {
$aResult[] = _t('_adm_txt_modules_update_text_ext', $aModule['title'], $aCheckInfo['version']);
}
}
if (empty($aResult)) {
return;
}
$aAdmins = $GLOBALS['MySQL']->getAll("SELECT * FROM `Profiles` WHERE `Role`&" . BX_DOL_ROLE_ADMIN . "<>0 AND `EmailNotify`='1'");
if (empty($aAdmins)) {
return;
}
$oEmailTemplate = new BxDolEmailTemplates();
$sMessage = implode('<br />', $aResult);
foreach ($aAdmins as $aAdmin) {
$aTemplate = $oEmailTemplate->getTemplate('t_ModulesUpdates', $aAdmin['ID']);
sendMail($aAdmin['Email'], $aTemplate['Subject'], $aTemplate['Body'], $aAdmin['ID'], array('MessageText' => $sMessage));
}
}
示例6: PageCompPageMainCode
/**
* page code function
*/
function PageCompPageMainCode($iID, $sConfCode)
{
global $site;
$ID = (int) $iID;
$ConfCode = clear_xss($sConfCode);
$p_arr = getProfileInfo($ID);
if (!$p_arr) {
$_page['header'] = _t("_Error");
$_page['header_text'] = _t("_Profile Not found");
return MsgBox(_t('_Profile Not found Ex'));
}
$aCode = array('message_status' => '', 'message_info' => '', 'bx_if:form' => array('condition' => false, 'content' => array('form' => '')), 'bx_if:next' => array('condtion' => false, 'content' => array('next_url' => '')));
if ($p_arr['Status'] == 'Unconfirmed') {
$ConfCodeReal = base64_encode(base64_encode(crypt($p_arr[Email], CRYPT_EXT_DES ? "secret_co" : "se")));
if (strcmp($ConfCode, $ConfCodeReal) != 0) {
$aForm = array('form_attrs' => array('action' => BX_DOL_URL_ROOT . 'profile_activate.php', 'method' => 'post', 'name' => 'form_change_status'), 'inputs' => array('conf_id' => array('type' => 'hidden', 'name' => 'ConfID', 'value' => $ID), 'conf_code' => array('type' => 'text', 'name' => 'ConfCode', 'value' => '', 'caption' => _t("_Confirmation code")), 'submit' => array('type' => 'submit', 'name' => 'submit', 'value' => _t("_Submit"))));
$oForm = new BxTemplFormView($aForm);
$aCode['message_status'] = _t("_Profile activation failed");
$aCode['message_info'] = _t("_EMAIL_CONF_FAILED_EX");
$aCode['bx_if:form']['condition'] = true;
$aCode['bx_if:form']['content']['form'] = $oForm->getCode();
} else {
$aCode['bx_if:next']['condition'] = true;
$aCode['bx_if:next']['content']['next_url'] = BX_DOL_URL_ROOT . 'member.php';
$send_act_mail = false;
if (getParam('autoApproval_ifJoin') == 'on' && !(getParam('sys_dnsbl_enable') && 'approval' == getParam('sys_dnsbl_behaviour') && bx_is_ip_dns_blacklisted('', 'join'))) {
$status = 'Active';
$send_act_mail = true;
$aCode['message_info'] = _t("_PROFILE_CONFIRM");
} else {
$status = 'Approval';
$aCode['message_info'] = _t("_EMAIL_CONF_SUCCEEDED", $site['title']);
}
$update = bx_admin_profile_change_status($ID, $status, $send_act_mail);
// Promotional membership
if (getParam('enable_promotion_membership') == 'on') {
$memership_days = getParam('promotion_membership_days');
setMembership($p_arr['ID'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
}
// check couple profile;
if ($p_arr['Couple']) {
$update = bx_admin_profile_change_status($p_arr['Couple'], $status);
//Promotional membership
if (getParam('enable_promotion_membership') == 'on') {
$memership_days = getParam('promotion_membership_days');
setMembership($p_arr['Couple'], MEMBERSHIP_ID_PROMOTION, $memership_days, true);
}
}
if (getParam('newusernotify')) {
$oEmailTemplates = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplates->getTemplate('t_UserConfirmed', $p_arr['ID']);
sendMail($site['email_notify'], $aTemplate['Subject'], $aTemplate['Body'], $p_arr['ID']);
}
}
} else {
$aCode['message_info'] = _t('_ALREADY_ACTIVATED');
}
return $GLOBALS['oSysTemplate']->parseHtmlByName('profile_activate.html', $aCode);
}
示例7: finish
protected function finish()
{
bx_alert('system', 'pruning', 0);
if (!($sOutput = ob_get_clean())) {
return;
}
$aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('t_Pruning', array('pruning_output' => $sOutput, 'site_title' => getParam('site_title')), 0, 0);
if ($aTemplate) {
sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body'], 0, array(), BX_EMAIL_NOTIFY);
}
}
示例8: onPostReply
function onPostReply($aTopic, $sPostText, $sUser)
{
$oProfile = new BxDolProfile($sUser);
$aPlusOriginal = array('PosterUrl' => $oProfile->_iProfileID ? getProfileLink($oProfile->_iProfileID) : 'javascript:void(0);', 'PosterNickName' => $sUser, 'TopicTitle' => $aTopic['topic_title'], 'ReplyText' => $sPostText);
$oEmailTemplate = new BxDolEmailTemplates();
$aTemplate = $oEmailTemplate->getTemplate('bx_forum_notifier');
$fdb = new DbForum();
$a = $fdb->getSubscribersToTopic($aTopic['topic_id']);
foreach ($a as $r) {
if ($r['user'] == $sUser) {
continue;
}
$oRecipient = new BxDolProfile($r['user']);
$aRecipient = getProfileInfo($oRecipient->_iProfileID);
$aPlus = array_merge(array('Recipient' => ' ' . $aRecipient['NickName']), $aPlusOriginal);
sendMail(trim($aRecipient['Email']), $aTemplate['Subject'], $aTemplate['Body'], '', $aPlus);
}
$oAlert = new BxDolAlerts('bx_forum', 'reply', $aTopic['topic_id']);
$oAlert->alert();
}
示例9: serviceIsSpam
/**
* Check text for spam.
* First it check if IP is whitelisted(or under cron execution or user is admin) - for whitelisted IPs check for spam isn't performed,
* then it checks URLs found in text for DNSURI black lists (@see BxAntispamDNSURIBlacklists),
* then it checks text in Akismet service (@see BxAntispamAkismet).
* It can send report if spam is found or tries to inform caller to block the content (depending on configuration).
*
* @param $sContent content to check for spam
* @param $sIp IP address of content poster
* @param $isStripSlashes slashes parameter:
* BX_SLASHES_AUTO - automatically detect magic_quotes_gpc setting
* BX_SLASHES_NO_ACTION - do not perform any action with slashes
* @return true if spam detected and content shouln't be recorded, false if content should be processed as usual.
*/
public function serviceIsSpam($sContent, $sIp = '', $isStripSlashes = BX_SLASHES_AUTO)
{
if (defined('BX_DOL_CRON_EXECUTE') || isAdmin()) {
return false;
}
if ($this->serviceIsIpWhitelisted($sIp)) {
return false;
}
if (get_magic_quotes_gpc() && $isStripSlashes == BX_SLASHES_AUTO) {
$sContent = stripslashes($sContent);
}
$bRet = false;
if ('on' == $this->_oConfig->getAntispamOption('uridnsbl_enable')) {
$oDNSURIBlacklists = bx_instance('BxAntispamDNSURIBlacklists', array(), $this->_aModule);
if ($oDNSURIBlacklists->isSpam($sContent)) {
$oDNSURIBlacklists->onPositiveDetection($sContent);
$bRet = true;
}
}
if (!$bRet && 'on' == $this->_oConfig->getAntispamOption('akismet_enable')) {
$oAkismet = bx_instance('BxAntispamAkismet', array(), $this->_aModule);
if ($oAkismet->isSpam($sContent)) {
$oAkismet->onPositiveDetection($sContent);
$bRet = true;
}
}
if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_report')) {
$oProfile = BxDolProfile::getInstance();
$aPlus = array('SpammerUrl' => $oProfile->getUrl(), 'SpammerNickName' => $oProfile->getDisplayName(), 'Page' => htmlspecialchars_adv($_SERVER['PHP_SELF']), 'Get' => print_r($_GET, true), 'Post' => print_r($_POST, true), 'SpamContent' => htmlspecialchars_adv($sContent));
bx_import('BxDolEmailTemplates');
$aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('bx_antispam_spam_report', $aPlus);
if (!$aTemplate) {
trigger_error('Email template or translation missing: bx_antispam_spam_report', E_USER_ERROR);
}
sendMail(getParam('site_email'), $aTemplate['Subject'], $aTemplate['Body']);
}
if ($bRet && 'on' == $this->_oConfig->getAntispamOption('antispam_block')) {
return true;
}
return false;
}
示例10: serviceGetBlockForm
/**
* SERVICE METHODS
*/
public function serviceGetBlockForm()
{
$aDefaultFields = array('name', 'email', 'subject', 'body', 'do_submit');
$mixedAllowed = $this->isAllowedContact();
if ($mixedAllowed !== true) {
return array('content' => MsgBox($mixedAllowed));
}
$sResult = '';
bx_import('BxDolForm');
$oForm = BxDolForm::getObjectInstance($this->_oConfig->getObject('form_contact'), $this->_oConfig->getObject('form_display_contact_send'), $this->_oTemplate);
$oForm->initChecker();
if ($oForm->isSubmittedAndValid()) {
$iId = $oForm->insert(array('uri' => $oForm->generateUri(), 'date' => time()));
if ($iId !== false) {
$sCustomFields = '';
$aCustomFields = array();
foreach ($oForm->aInputs as $aInput) {
if (in_array($aInput['name'], $aDefaultFields)) {
continue;
}
$aCustomFields[$aInput['name']] = bx_process_output($oForm->getCleanValue($aInput['name']));
$sCustomFields .= $aInput['caption'] . ': ' . $aCustomFields[$aInput['name']] . '<br />';
}
$aTemplateKeys = array('SenderName' => bx_process_output($oForm->getCleanValue('name')), 'SenderEmail' => bx_process_output($oForm->getCleanValue('email')), 'MessageSubject' => bx_process_output($oForm->getCleanValue('subject')), 'MessageBody' => bx_process_output(nl2br($oForm->getCleanValue('body')), BX_DATA_TEXT_MULTILINE), 'CustomFields' => $sCustomFields);
$aTemplateKeys = array_merge($aTemplateKeys, $aCustomFields);
bx_import('BxDolEmailTemplates');
$aMessage = BxDolEmailTemplates::getInstance()->parseTemplate('bx_contact_contact_form_message', $aTemplateKeys);
$sResult = '';
$sRecipientEmail = $this->_oConfig->getEmail();
if (sendMail($sRecipientEmail, $aMessage['Subject'], $aMessage['Body'], 0, array(), BX_EMAIL_SYSTEM)) {
$this->onContact();
$sResult = '_ADM_PROFILE_SEND_MSG';
} else {
$sResult = '_Email sent failed';
}
$sResult = MsgBox(_t($sResult));
}
}
return array('content' => $sResult . $oForm->getCode());
}
示例11: checkModulesPendingUninstall
/**
* Check all pending for uninstallation modules and uninstall them if no pending for deletion files are found
*/
public static function checkModulesPendingUninstall()
{
$a = BxDolModuleQuery::getInstance()->getModules();
foreach ($a as $aModule) {
// after we make sure that all pending for deletion files are deleted
if (!$aModule['pending_uninstall'] || BxDolStorage::isQueuedFilesForDeletion($aModule['name'])) {
continue;
}
// remove pending uninstall flag
self::setModulePendingUninstall($aModule['uri'], false);
// perform uninstallation
$aResult = BxDolStudioInstallerUtils::getInstance()->perform($aModule['path'], 'uninstall');
// send email nofitication
$aTemplateKeys = array('Module' => $aModule['title'], 'Result' => _t('_Success'), 'Message' => '');
if ($aResult['code'] > 0) {
$aTemplateKeys['Result'] = _t('_Failed');
$aTemplateKeys['Message'] = $aResult['message'];
}
$aMessage = BxDolEmailTemplates::getInstance()->parseTemplate('t_DelayedModuleUninstall', $aTemplateKeys);
sendMail(getParam('site_email'), $aMessage['Subject'], $aMessage['Body'], 0, array(), BX_EMAIL_SYSTEM);
}
}
示例12: resetPassword
/**
* Reset password procedure
*/
public function resetPassword()
{
$sKey = bx_process_input(bx_get('key'));
// get link to forgot password page for error message
$sUrlForgotPassword = BX_DOL_URL_ROOT . BxDolPermalinks::getInstance()->permalink('page.php?i=forgot-password');
// check if key exists
$oKey = BxDolKey::getInstance();
if (!$oKey || !$oKey->isKeyExists($sKey)) {
return _t("_sys_txt_reset_pasword_error_occured", $sUrlForgotPassword);
}
// check if key data exists
$aData = $oKey->getKeyData($sKey);
if (!isset($aData['email'])) {
return _t("_sys_txt_reset_pasword_error_occured", $sUrlForgotPassword);
}
// check if account with such email exists
$iAccountId = $this->_oAccountQuery->getIdByEmail($aData['email']);
if (!$iAccountId) {
return _t("_sys_txt_reset_pasword_error_occured", $sUrlForgotPassword);
}
// generate new password
$sPassword = $this->generateUserNewPwd($iAccountId);
// remove key
$oKey->removeKey($sKey);
// send email with new password and display result message
$aPlus = array('password' => $sPassword);
$aTemplate = BxDolEmailTemplates::getInstance()->parseTemplate('t_PasswordReset', $aPlus, $iAccountId);
if ($aTemplate && sendMail($aData['email'], $aTemplate['Subject'], $aTemplate['Body'], 0, $aPlus, BX_EMAIL_SYSTEM)) {
return _t("_sys_txt_reset_pasword_email_sent", $sPassword);
} else {
return _t("_sys_txt_reset_pasword_email_send_failed", $sPassword);
}
}
示例13: MemberSendVKiss
/**
* Send virtual kiss
*/
function MemberSendVKiss($member, $recipient, $isCheckVisitorGreeting = true)
{
global $logged;
// Check if recipient is active
if ('Active' != $recipient['Status']) {
return 7;
}
// block members
if ($recipient['ID'] && $member['ID'] && isBlocked((int) $recipient['ID'], (int) $member['ID'])) {
return 24;
}
// Get sender info
$sender = getProfileInfo($member['ID']);
// Send email notification
$rEmailTemplate = new BxDolEmailTemplates();
if ($logged['member'] || !$isCheckVisitorGreeting) {
$aTemplate = $rEmailTemplate->getTemplate('t_VKiss', $_COOKIE['memberID']);
} else {
$aTemplate = $rEmailTemplate->getTemplate('t_VKiss_visitor');
}
$sConfCode = urlencode(base64_encode(base64_encode(crypt($recipient['ID'], CRYPT_EXT_DES ? "vkiss_sec" : "vk"))));
// parse the email template ;
$sProfileLink = $sender ? '<a href="' . getProfileLink($member['ID']) . '">' . getNickName($sender['ID']) . '</a>' : '<b>' . _t("_Visitor") . '</b>';
$sKissLink = $sender ? '<a href="' . BX_DOL_URL_ROOT . 'greet.php?fullpage=1&sendto=' . $member['ID'] . '&from=' . $recipient['ID'] . '&ConfCode=' . $sConfCode . '">' . BX_DOL_URL_ROOT . 'greet.php?sendto=' . $member['ID'] . '&from=' . $recipient['ID'] . '&ConfCode=' . $sConfCode . '</a>' : '<a href="' . BX_DOL_URL_ROOT . 'communicator.php">' . BX_DOL_URL_ROOT . 'communicator.php</a>';
$aRepl = array('<ConfCode>' => $sConfCode, '<ProfileReference>' => $sProfileLink, '<VKissLink>' => $sKissLink, '<RealName>' => getNickName($recipient['ID']), '<SiteName>' => BX_DOL_URL_ROOT);
$aTemplate['Body'] = str_replace(array_keys($aRepl), array_values($aRepl), $aTemplate['Body']);
$mail_ret = sendMail($recipient['Email'], $aTemplate['Subject'], $aTemplate['Body'], $recipient['ID']);
// Send message into the member's site personal mailbox;
$aTemplate['Subject'] = process_db_input($aTemplate['Subject'], BX_TAGS_NO_ACTION);
$aTemplate['Body'] = process_db_input($aTemplate['Body'], BX_TAGS_NO_ACTION);
$sender['ID'] = !$sender['ID'] ? 0 : $sender['ID'];
$sQuery = "\n INSERT INTO\n `sys_messages`\n SET\n `Date` = NOW(),\n `Sender` = '{$sender['ID']}',\n `Recipient` = '{$recipient['ID']}',\n `Subject` = '{$aTemplate['Subject']}',\n `Text` = '{$aTemplate['Body']}',\n `New` = '1',\n `Type` = 'greeting'\n ";
db_res($sQuery);
if (!$mail_ret) {
return 10;
}
// Insert kiss into database
$kiss_arr = db_arr("SELECT `ID` FROM `sys_greetings` WHERE `ID` = {$member['ID']} AND `Profile` = {$recipient['ID']} LIMIT 1", 0);
if (!$kiss_arr) {
$result = db_res("INSERT INTO `sys_greetings` ( `ID`, `Profile`, `Number`, `When`, `New` ) VALUES ( {$member['ID']}, {$recipient['ID']}, 1, NOW(), '1' )", 0);
} else {
$result = db_res("UPDATE `sys_greetings` SET `Number` = `Number` + 1, `New` = '1' WHERE `ID` = {$member['ID']} AND `Profile` = {$recipient['ID']}", 0);
}
if (!$result) {
return 1;
}
// If success then perform actions
checkAction($member['ID'], ACTION_ID_SEND_VKISS, true);
$oAlert = new BxDolAlerts('greeting', 'add', 0, $member['ID'], array('Recipient' => $recipient['ID']));
$oAlert->alert();
return 0;
}
示例14: bx_admin_profile_change_status
/**
* Perform change of status with clearing profile(s) cache and sending mail about activation
*
* @param mixed $mixedIds - array of IDs or single int ID of profile(s)
* @param string $sStatus - given status
* @param boolean $bSendActMail - send email about activation or not (works with 'Active' status only
* @return boolean - TRUE on success / FALSE on failure
*/
function bx_admin_profile_change_status($mixedIds, $sStatus, $bSendActMail = FALSE)
{
if (!$mixedIds || is_array($mixedIds) && empty($mixedIds)) {
return FALSE;
}
if (!is_array($mixedIds)) {
$mixedIds = array((int) $mixedIds);
}
$sStatus = strip_tags($sStatus);
$oEmailTemplate = new BxDolEmailTemplates();
foreach ($mixedIds as $iId) {
$iId = (int) $iId;
if (!$GLOBALS['MySQL']->query("UPDATE `Profiles` SET `Status` = '{$sStatus}' WHERE `ID` = {$iId}")) {
break;
}
createUserDataFile($iId);
reparseObjTags('profile', $iId);
if ($sStatus == 'Active' && $bSendActMail) {
if (BxDolModule::getInstance('BxWmapModule')) {
BxDolService::call('wmap', 'response_entry_add', array('profiles', $iId));
}
$aProfile = getProfileInfo($iId);
$aMail = $oEmailTemplate->parseTemplate('t_Activation', array(), $iId);
sendMail($aProfile['Email'], $aMail['subject'], $aMail['body'], $iId, array(), 'html', FALSE, TRUE);
}
$oAlert = new BxDolAlerts('profile', 'change_status', $iId, 0, array('status' => $sStatus));
$oAlert->alert();
}
return TRUE;
}
示例15: invite
public function invite($sType, $sEmails, $sText, $mixedLimit = false, $oForm = null)
{
$iProfileId = $this->getProfileId();
$iAccountId = $this->getAccountId($iProfileId);
$oKeys = BxDolKey::getInstance();
if (!$oKeys || !in_array($sType, array(BX_INV_TYPE_FROM_MEMBER, BX_INV_TYPE_FROM_SYSTEM))) {
return false;
}
$iKeyLifetime = $this->_oConfig->getKeyLifetime();
$sEmailTemplate = '';
switch ($sType) {
case BX_INV_TYPE_FROM_MEMBER:
$sEmailTemplate = 'bx_invites_invite_form_message';
break;
case BX_INV_TYPE_FROM_SYSTEM:
$sEmailTemplate = 'bx_invites_invite_by_request_message';
break;
}
if (empty($oForm)) {
$oForm = $this->getFormObjectInvite();
}
$aMessage = BxDolEmailTemplates::getInstance()->parseTemplate($sEmailTemplate, array('text' => $sText), $iAccountId, $iProfileId);
$iSent = 0;
$iDate = time();
$aEmails = preg_split("/[\\s\n,;]+/", $sEmails);
if (is_array($aEmails) && !empty($aEmails)) {
foreach ($aEmails as $sEmail) {
if ($mixedLimit !== false && (int) $mixedLimit <= 0) {
break;
}
$sEmail = trim($sEmail);
if (empty($sEmail)) {
continue;
}
$sKey = $oKeys->getNewKey(false, $iKeyLifetime);
if (sendMail($sEmail, $aMessage['Subject'], $aMessage['Body'], 0, array('join_url' => $this->getJoinLink($sKey)), BX_EMAIL_SYSTEM)) {
$oForm->insert(array('account_id' => $iAccountId, 'profile_id' => $iProfileId, 'key' => $sKey, 'email' => $sEmail, 'date' => $iDate));
$this->onInvite($iAccountId, $iProfileId);
$iSent += 1;
if ($mixedLimit !== false) {
$mixedLimit -= 1;
}
}
}
}
return $iSent;
}