b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/private_message_new.html.php - 92 lines - 3510 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   * @version $Id: private_message_new.html.php 6136 2014-03-08 07:59:48Z manuel $
  12   */
  13  if( !defined('EVO_MAIN_INIT') ) die( 'Please, do not access this page directly.' );
  14  
  15  // ---------------------------- EMAIL HEADER INCLUDED HERE ----------------------------
  16  emailskin_include( '_email_header.inc.html.php', $params );
  17  // ------------------------------- END OF EMAIL HEADER --------------------------------
  18  
  19  global $current_User, $htsrv_url, $evo_charset;
  20  
  21  // Default params:
  22  $params = array_merge( array(
  23          'recipient_ID'         => 0,
  24          'new_thread'           => '',
  25          'thrd_recipients'      => '',
  26          'Message'              => NULL,
  27          'message_link'         => '',
  28          'other_unread_threads' => '',
  29          'from_User'            => NULL,
  30      ), $params );
  31  
  32  
  33  $Message = $params['Message'];
  34  $UserCache = & get_UserCache();
  35  
  36  $recipient_User = $UserCache->get_by_ID( $params['recipient_ID'] );
  37  $from_User = ( $params['from_User'] == NULL ) ? $current_User : $params['from_User'];
  38  
  39  echo '<p>';
  40  if( $params['new_thread'] )
  41  {
  42      echo sprintf( T_( '%s just sent you a message with the title %s.' ), $from_User->get_colored_login( array( 'mask' => '$avatar$ $login$' ) ), '<b>'.$Message->Thread->title.'</b>' );
  43  }
  44  elseif( count( $params['thrd_recipients'] ) == 1 )
  45  {
  46      echo sprintf( T_( '%s just replied to your message in the %s conversation. ' ), $from_User->get_colored_login( array( 'mask' => '$avatar$ $login$' ) ), '<b>'.$Message->Thread->title.'</b>' );
  47  }
  48  else
  49  {
  50      echo sprintf( T_( '%s just replied to the %s conversation.' ), $from_User->get_colored_login( array( 'mask' => '$avatar$ $login$' ) ), '<b>'.$Message->Thread->title.'</b>' );
  51  }
  52  echo "</p>\n";
  53  
  54  if( $recipient_User->check_perm( 'pm_notif', 'full' ) )
  55  {
  56      echo '<div class="email_ugc">'."\n";
  57      echo '<p>'.nl2br( htmlentities( $Message->get('text'), ENT_COMPAT, $evo_charset ) ).'</p>';
  58      echo "</div>\n";
  59  
  60      // Buttons:
  61      echo '<div class="buttons">'."\n";
  62      echo get_link_tag( $params['message_link'], T_( 'Read full conversation' ), 'button_green' )."\n";
  63      echo "</div>\n";
  64  }
  65  else
  66  {
  67      // Buttons:
  68      echo '<div class="buttons">'."\n";
  69      echo get_link_tag( $params['message_link'], T_( 'Read full message' ), 'button_green' )."\n";
  70      echo "</div>\n";
  71  }
  72  
  73  if( count( $params['other_unread_threads'] ) > 0 )
  74  { // Display other unread threads
  75      echo '<p>'.T_( 'In addition to this new message, you also have unread messages in the following conversations' ).":</p>\n";
  76      echo '<ul>';
  77      foreach( $params['other_unread_threads'] as $unread_thread )
  78      {
  79          echo '<li>'.$unread_thread.'</li>';
  80      }
  81      echo "</ul>\n";
  82  }
  83  
  84  // Footer vars:
  85  $params['unsubscribe_text'] = T_( 'If you don\'t want to receive any more notifications about new private messages, click here:' )
  86              .' <a href="'.$htsrv_url.'quick_unsubscribe.php?type=new_msg&user_ID=$user_ID$&key=$unsubscribe_key$">'
  87              .T_('instant unsubscribe').'</a>.';
  88  
  89  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
  90  emailskin_include( '_email_footer.inc.html.php', $params );
  91  // ------------------------------- END OF EMAIL FOOTER --------------------------------
  92  ?>

title

Description

title

Description

title

Description

title

title

Body