b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/contact_message_new.html.php - 112 lines - 4647 bytes - Text - Print

Description: This is sent to a ((User)) or ((BlogOwner)) when someone sends them a message through a contact form (which is called from a comment, footer of blog, etc.)

   1  <?php
   2  /**
   3   * This is sent to a ((User)) or ((BlogOwner)) when someone sends them a message through a contact form (which is called from a comment, footer of blog, etc.)
   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: contact_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 $htsrv_url, $samedomain_htsrv_url, $evo_charset;
  20  
  21  // Default params:
  22  $params = array_merge( array(
  23          'sender_name'      => '',
  24          'sender_address'   => '',
  25          'message_footer'   => '',
  26          'Blog'             => NULL,
  27          'message'          => '',
  28          'comment_id'       => NULL,
  29          'post_id'          => NULL,
  30          'recipient_User'   => NULL,
  31          'Comment'          => NULL,
  32      ), $params );
  33  
  34  
  35  $Blog = $params['Blog'];
  36  
  37  
  38  // show additional message info
  39  if( !empty( $Blog ) )
  40  {
  41      echo '<p>';
  42      if( !empty( $params['comment_id'] ) )
  43      { // From comment
  44          $CommentCache = & get_CommentCache();
  45          $Comment = & $CommentCache->get_by_ID( $params['comment_id'] );
  46          $Item = & $Comment->get_Item();
  47          echo sprintf( T_('Message sent from your <a %s>comment</a> on %s.'),
  48              'href="'.$Comment->get_permanent_url( '&' ).'"',
  49              '<a href="'.$Item->get_permanent_url( '', '', '&' ).'">'.$Item->get( 'title' ).'</a>' );
  50      }
  51      elseif( !empty( $params['post_id'] ) )
  52      { // From post
  53          $ItemCache = & get_ItemCache();
  54          $Item = & $ItemCache->get_by_ID( $params['post_id'] );
  55          echo sprintf( T_('Message sent from your post: %s.'),
  56              '<a href="'.$Item->get_permanent_url( '', '', '&' ).'">'.$Item->get( 'title' ).'</a>' );
  57      }
  58      else
  59      { // From contact form
  60          echo sprintf( T_('Message sent through the contact form on %s.'), '<b>'.$Blog->get('shortname').'</b>' );
  61      }
  62      echo '</p>';
  63  }
  64  
  65  // show sender name
  66  echo '<p>'.sprintf( T_('%s (%s) has sent you this message:'), '<b>'.$params['sender_name'].'</b>', '<a href="mailto:'.$params['sender_address'].'">'.$params['sender_address'].'</a>' ).'</p>';
  67  
  68  echo '<div class="email_ugc">'."\n";
  69  echo '<p>'.nl2br( htmlentities( $params['message'], ENT_COMPAT, $evo_charset ) ).'</p>';
  70  echo "</div>\n";
  71  
  72  // show sender email address
  73  echo '<p>'.sprintf( T_( 'By replying, your email will go directly to %s.' ), '<a href="mailto:'.$params['sender_address'].'">'.$params['sender_address'].'</a>' ).'</p>';
  74  
  75  
  76  if( !empty( $params['recipient_User'] ) )
  77  { // Member:
  78      global $Settings;
  79      if( $Settings->get( 'emails_msgform' ) == 'userset' )
  80      { // user can allow/deny to receive emails
  81          $edit_preferences_url = NULL;
  82          if( !empty( $Blog ) )
  83          { // go to blog
  84              $edit_preferences_url = url_add_param( str_replace( '&amp;', '&', $Blog->gen_blogurl() ), 'disp=userprefs', '&' );
  85          }
  86          elseif( $params['recipient_User']->check_perm( 'admin', 'restricted' ) )
  87          { // go to admin
  88              $edit_preferences_url = $admin_url.'?ctrl=user&user_tab=userprefs&user_ID='.$params['recipient_User']->ID;
  89          }
  90          if( !empty( $edit_preferences_url ) )
  91          { // add edit preferences link
  92              echo '<p>'.sprintf( T_('You can edit your profile to not receive emails through a <a %s>form</a>'),
  93                  'href="'.$edit_preferences_url.'"' ).'</p>';
  94          }
  95      }
  96  
  97      // Add quick unsubcribe link so users can deny receiving emails through b2evo message form in any circumstances
  98      $params['unsubscribe_text'] = T_( 'If you don\'t want to receive any more emails through a message form, click here:' )
  99              .' <a href="'.$htsrv_url.'quick_unsubscribe.php?type=msgform&user_ID=$user_ID$&key=$unsubscribe_key$">'
 100              .T_('instant unsubscribe').'</a>.';
 101  }
 102  elseif( !empty( $params['Comment'] ) )
 103  { // Visitor:
 104      $params['unsubscribe_text'] = T_( 'If you don\'t want to receive e-mails on your comments for this e-mail address anymore, click here:' )
 105              .' <a href="'.$samedomain_htsrv_url.'anon_unsubscribe.php?type=comment&c='.$params['Comment']->ID.'&anon_email='.rawurlencode( $params['Comment']->author_email ).'">'
 106              .T_('instant unsubscribe').'</a>.';
 107  }
 108  
 109  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
 110  emailskin_include( '_email_footer.inc.html.php', $params );
 111  // ------------------------------- END OF EMAIL FOOTER --------------------------------
 112  ?>

title

Description

title

Description

title

Description

title

title

Body