b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/private_message_new.txt.php - 81 lines - 2982 bytes - Text - Print

Description: This is sent to a ((User)) to notify them when someone sends them a private message on the site.

   1  <?php
   2  /**
   3   * This is sent to a ((User)) to notify them when someone sends them a private message on the site.
   4   *
   5   * For more info about email skins, see: http://b2evolution.net/man/themes-templates-skins/email-skins/
   6   *
   7   * b2evolution - {@link http://b2evolution.net/}
   8   * Released under GNU GPL License - {@link http://b2evolution.net/about/license.html}
   9   * @copyright (c)2003-2014 by Francois Planque - {@link http://fplanque.com/}
  10   */
  11  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  12  
  13  // ---------------------------- EMAIL HEADER INCLUDED HERE ----------------------------
  14  emailskin_include( '_email_header.inc.txt.php', $params );
  15  // ------------------------------- END OF EMAIL HEADER --------------------------------
  16  
  17  global $current_User, $htsrv_url, $evo_charset;
  18  
  19  // Default params:
  20  $params = array_merge( array(
  21          'recipient_ID'         => 0,
  22          'new_thread'           => '',
  23          'thrd_recipients'      => '',
  24          'Message'              => NULL,
  25          'message_link'         => '',
  26          'other_unread_threads' => '',
  27          'from_User'            => NULL,
  28      ), $params );
  29  
  30  
  31  $Message = $params['Message'];
  32  $UserCache = & get_UserCache();
  33  
  34  $recipient_User = $UserCache->get_by_ID( $params['recipient_ID'] );
  35  $from_User = ( $params['from_User'] == NULL ) ? $current_User : $params['from_User'];
  36  
  37  if( $params['new_thread'] )
  38  {
  39      echo sprintf( T_( '%s just sent you a message with the title %s.' ), $from_User->login, '"'.$Message->Thread->title.'"' );
  40  }
  41  elseif( count( $params['thrd_recipients'] ) == 1 )
  42  {
  43      echo sprintf( T_( '%s just replied to your message in the %s conversation. ' ), $from_User->login, '"'.$Message->Thread->title.'"' );
  44  }
  45  else
  46  {
  47      echo sprintf( T_( '%s just replied to the %s conversation.' ), $from_User->login, '"'.$Message->Thread->title.'"' );
  48  }
  49  
  50  echo "\n\n";
  51  
  52  if( $recipient_User->check_perm( 'pm_notif', 'full' ) )
  53  {
  54      echo T_( 'To read the full conversation, click here:' )."\n".$params['message_link']."\n";
  55      echo T_( 'Message content:' ).' '.htmlentities( $Message->get('text'), ENT_COMPAT, $evo_charset );
  56  }
  57  else
  58  {
  59      echo T_( 'To read the full message, click here:' )."\n".$params['message_link'];
  60  }
  61  
  62  echo "\n";
  63  
  64  if( count( $params['other_unread_threads'] ) > 0 )
  65  { // Display other unread threads
  66      echo "\n".T_( 'In addition to this new message, you also have unread messages in the following conversations' ).":\n";
  67      foreach( $params['other_unread_threads'] as $unread_thread )
  68      {
  69          echo "\t - ".strip_tags( $unread_thread )."\n";
  70      }
  71      echo "\n";
  72  }
  73  
  74  // Footer vars:
  75  $params['unsubscribe_text'] = T_( 'If you don\'t want to receive any more notifications about new private messages, click here:' ).' '.
  76          $htsrv_url.'quick_unsubscribe.php?type=new_msg&user_ID=$user_ID$&key=$unsubscribe_key$';
  77  
  78  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
  79  emailskin_include( '_email_footer.inc.txt.php', $params );
  80  // ------------------------------- END OF EMAIL FOOTER --------------------------------
  81  ?>

title

Description

title

Description

title

Description

title

title

Body