Version 3.4.6
This commit is contained in:
1 parent
e4478369d8
commit
b45ea0dffb
1568 files changed
+155104
-161665
No files matched your search
@@ -4,11 +4,11 @@
|
||||
*~TERABYTE_DOC_READY~
|
||||
* $Copyright: (c) 2001 - 2011 Invision Power Services, Inc.$
|
||||
* $License: http://www.invisionpower.com/company/standards.php#license$
|
||||
* $Author: bfarber $
|
||||
* $Author: mmecham $
|
||||
* @since 11th October 2010
|
||||
* $LastChangedDate: 2013-05-17 19:05:15 -0400 (Fri, 17 May 2013) $
|
||||
* @version v3.4.5
|
||||
* $Revision: 12259 $
|
||||
* $LastChangedDate: 2013-08-14 06:45:49 -0400 (Wed, 14 Aug 2013) $
|
||||
* @version v3.4.6
|
||||
* $Revision: 12334 $
|
||||
*
|
||||
* <b>Example Usage:</b>
|
||||
* @code
|
||||
@@ -658,6 +658,9 @@ abstract class classes_like_composite
|
||||
$classToLoad = IPSLib::loadLibrary( IPS_ROOT_PATH . '/sources/classes/member/notifications.php', 'notifications' );
|
||||
$notifyLibrary = new $classToLoad( $this->registry );
|
||||
|
||||
$htmlMessage = array();
|
||||
$textMessage = array();
|
||||
|
||||
foreach( $data as $row )
|
||||
{
|
||||
if ( ! $row['like_notify_freq'] OR ! in_array( $row['like_notify_freq'], $type ) )
|
||||
@@ -689,44 +692,71 @@ abstract class classes_like_composite
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Expensively process HTML/Text versions once per language.. <#NAME#> is converted to -members:members_display_name- for processing later */
|
||||
if ( ! isset( $htmlMessage[ $row['language'] ] ) )
|
||||
{
|
||||
$buildMessage = array();
|
||||
|
||||
if ( is_array( $notificationOpts['build_message_array'] ) and count( $notificationOpts['build_message_array'] ) )
|
||||
{
|
||||
foreach( $notificationOpts['build_message_array'] as $k => $v )
|
||||
{
|
||||
$buildMessage[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$buildMessage = array();
|
||||
$buildMessage['UNSUBCRIBE_URL'] = '-member:unsubscribe_url-';
|
||||
$notificationOpts['build_message_array']['UNSUBCRIBE_URL'] = '-member:unsubscribe_url-';
|
||||
|
||||
IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( $notificationOpts['email_template'], $row['language'], trim($notificationOpts['email_lang_file']), trim($notificationOpts['email_lang_app']) ) );
|
||||
|
||||
$textMessage[ $row['language'] ] = IPSText::getTextClass('email')->buildPlainTextContent( $buildMessage );
|
||||
$htmlMessage[ $row['language'] ] = IPSText::getTextClass('email')->buildHtmlContent( $buildMessage );
|
||||
}
|
||||
|
||||
$thisTextMessage = $textMessage[ $row['language'] ];
|
||||
$thisHtmlMessage = $htmlMessage[ $row['language'] ];
|
||||
|
||||
/* Add in unsubscribe link */
|
||||
$unsubKey = $row['like_app'] . ';' . $row['like_area'] . ';' . $row['like_rel_id'] . ';' . $row['like_member_id'] . ';' . $row['member_id'] . ';' . $row['email'];
|
||||
$unsubUrl = $this->registry->output->buildSEOUrl( 'app=core&module=global&section=like&do=unsubscribe&key=' . IPSText::base64_encode_urlSafe( $unsubKey ), 'publicNoSession', 'unsubscribe', 'likeunsubscribe' );
|
||||
|
||||
/* Now process the dynamic replacements */
|
||||
if ( is_array( $notificationOpts['build_message_array'] ) and count( $notificationOpts['build_message_array'] ) )
|
||||
{
|
||||
foreach( $notificationOpts['build_message_array'] as $k => $v )
|
||||
{
|
||||
if ( preg_match( '/\-member:(.+?)\-/', $v, $_matches ) )
|
||||
{
|
||||
$v = str_replace( $_matches[0], $row[$_matches[1]], $v );
|
||||
if ( $_matches[1] == 'unsubscribe_url' )
|
||||
{
|
||||
$thisHtmlMessage = str_replace( $_matches[0], $unsubUrl, $thisHtmlMessage );
|
||||
$thisTextMessage = str_replace( $_matches[0], $unsubUrl, $thisTextMessage );
|
||||
}
|
||||
else
|
||||
{
|
||||
$thisHtmlMessage = str_replace( $_matches[0], $row[ $_matches[1] ], $thisHtmlMessage );
|
||||
$thisTextMessage = str_replace( $_matches[0], $row[ $_matches[1] ], $thisTextMessage );
|
||||
}
|
||||
}
|
||||
|
||||
$buildMessage[ $k ] = $v;
|
||||
}
|
||||
}
|
||||
|
||||
$sentToIds[] = $row['like_member_id'];
|
||||
|
||||
/* Add in unsubscribe link */
|
||||
$key = $row['like_app'] . ';' . $row['like_area'] . ';' . $row['like_rel_id'] . ';' . $row['like_member_id'] . ';' . $row['member_id'] . ';' . $row['email'];
|
||||
$buildMessage['UNSUBCRIBE_URL'] = $this->registry->output->buildSEOUrl( 'app=core&module=global&section=like&do=unsubscribe&key=' . IPSText::base64_encode_urlSafe( $key ), 'publicNoSession', 'unsubscribe', 'likeunsubscribe' );
|
||||
|
||||
IPSText::getTextClass('email')->setPlainTextTemplate( IPSText::getTextClass('email')->getTemplate( $notificationOpts['email_template'], $row['language'], trim($notificationOpts['email_lang_file']), trim($notificationOpts['email_lang_app']) ) );
|
||||
IPSText::getTextClass('email')->buildPlainTextContent( $buildMessage );
|
||||
|
||||
$notifyLibrary->setMember( $row );
|
||||
$notifyLibrary->setFrom( $notificationOpts['from'] ? $notificationOpts['from'] : $this->memberData );
|
||||
$notifyLibrary->setNotificationKey( $notificationOpts['notification_key'] );
|
||||
$notifyLibrary->setNotificationUrl( $notificationOpts['notification_url'] );
|
||||
$notifyLibrary->setNotificationText( IPSText::getTextClass('email')->getPlainTextContent() );
|
||||
$notifyLibrary->setNotificationTitle( $notificationOpts['email_subject'] ? $notificationOpts['email_subject'] : IPSText::getTextClass('email')->subject );
|
||||
$notifyLibrary->setNotificationHtml( IPSText::getTextClass('email')->buildHtmlContent( $buildMessage ) );
|
||||
$notifyLibrary->setNotificationText( $thisTextMessage );
|
||||
$notifyLibrary->setNotificationHtml( $thisHtmlMessage );
|
||||
|
||||
if ( ! empty( $notificationOpts['email_only_subject'] ) && $notificationOpts['email_only_subject'] != IPSText::getTextClass('email')->subject )
|
||||
{
|
||||
$notifyLibrary->setEmailSubject( $notificationOpts['email_only_subject'], $row['language'], trim($notificationOpts['email_lang_file']), trim($notificationOpts['email_lang_app']) );
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
$notifyLibrary->sendNotification();
|
||||
@@ -1455,10 +1485,7 @@ abstract class classes_like_composite
|
||||
/* Need to apply secondary groups and grab g_perm_id if $parseMembers is false (default)
|
||||
@link http://community.invisionpower.com/tracker/issue-34691-digest-notifications-not-going-out/ */
|
||||
$row['mgroup_others'] = ($row['mgroup_others'] != '') ? IPSText::cleanPermString($row['mgroup_others']) : '';
|
||||
//by denchu
|
||||
if (is_array($this->caches['group_cache'][ $row['member_group_id'] ])){
|
||||
$row = array_merge( $row, $this->caches['group_cache'][ $row['member_group_id'] ] );
|
||||
}
|
||||
$row = $this->registry->member()->setUpSecondaryGroups( $row );
|
||||
|
||||
if( $row['topic_last_post'] )
|
||||
|
||||
Reference in new issue
Block a user