b2evolution PHP Cross Reference Blogging Systems

Source: /skins_email/post_new.html.php - 101 lines - 4092 bytes - Text - Print

Description: This is sent to ((Users)) and/or ((Moderators)) to notify them that a new post has been posted.

   1  <?php
   2  /**
   3   * This is sent to ((Users)) and/or ((Moderators)) to notify them that a new post has been posted.
   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: post_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 $admin_url, $baseurl, $htsrv_url;
  20  
  21  // Default params:
  22  $params = array_merge( array(
  23          'notify_full'    => false,
  24          'Item'           => NULL,
  25          'recipient_User' => NULL,
  26          'notify_type'    => '',
  27      ), $params );
  28  
  29  
  30  $recipient_User = $params['recipient_User'];
  31  $Item = $params['Item'];
  32  $Blog = & $Item->get_Blog();
  33  
  34  if( $params['notify_full'] )
  35  {    /* Full notification */
  36      echo '<p>'.T_('Blog').': '.get_link_tag( $Blog->gen_blogurl(), $Blog->get('shortname') )."</p>\n";
  37  
  38      echo '<p>'.T_('Author').': '.$Item->creator_User->get_colored_login( array( 'mask' => '$avatar$ $login$' ) ).' ('.$Item->creator_User->get('login').")</p>\n";
  39  
  40      echo '<p>'.T_('Title').': '.$Item->get('title')."</p>\n";
  41  
  42      // linked URL or "-" if empty:
  43      echo '<p>'.T_('Url').': '.( empty( $Item->url ) ? '-' : get_link_tag( $Item->get('url') ) )."</p>\n";
  44  
  45      if( $params['notify_type'] == 'moderator' )
  46      {
  47          echo '<p>'.T_('Status').': '.$Item->get( 't_status' )."</p>\n";
  48      }
  49  
  50      // Content:
  51      echo '<div class="email_ugc">'."\n";
  52      echo '<p>'.nl2br( $Item->get('content') ).'</p>';
  53      echo "</div>\n";
  54  
  55  }
  56  else
  57  { /* Short notification */
  58      echo '<p>'.sprintf( T_( '%s created a new post on %s with title %s.' ), $Item->creator_User->get_colored_login( array( 'mask' => '$avatar$ $login$' ) ), '<b>'.$Blog->get('shortname').'</b>', '<b>'.$Item->get('title').'</b>' )."</p>\n";
  59  
  60      if( $params['notify_type'] == 'moderator' )
  61      {
  62          echo '<p>'.T_('Status').': '.$Item->get( 't_status' )."</p>\n";
  63  
  64          echo '<div class="email_ugc">'."\n";
  65          echo '<p><i class="note">'.T_( 'This is a short form moderation message. To make these emails more useful for quick moderation, ask the administrator to send you long form moderation messages instead.' ).'</i></p>';
  66          echo "</div>\n";
  67      }
  68  }
  69  
  70  // Buttons:
  71  
  72  echo '<div class="buttons">'."\n";
  73  
  74  echo get_link_tag( $Item->get_permanent_url( '', '', '&' ), T_( 'View post' ), 'button_green' )."\n";
  75  
  76  if( $recipient_User->check_perm( 'item_post!CURSTATUS', 'edit', false, $Item ) )
  77  { // User has permission to edit this post
  78      echo get_link_tag( $admin_url.'?ctrl=items&blog='.$Item->get_blog_ID().'&p='.$Item->ID, T_('Edit post'), 'button_yellow' )."\n";
  79  }
  80  
  81  echo "</div>\n";
  82  
  83  // Footer vars:
  84  if( $params['notify_type'] == 'moderator' )
  85  { // moderation email
  86      $params['unsubscribe_text'] = T_( 'You are a moderator in this blog, and you are receiving notifications when a post may need moderation.' ).'<br />';
  87      $params['unsubscribe_text'] .= T_( 'If you don\'t want to receive any more notifications about post moderation, click here' ).': '
  88              .'<a href="'.$htsrv_url.'quick_unsubscribe.php?type=post_moderator&user_ID=$user_ID$&key=$unsubscribe_key$">'
  89              .T_('instant unsubscribe').'</a>.';
  90  }
  91  else
  92  { // subscription email
  93      $params['unsubscribe_text'] = T_( 'If you don\'t want to receive any more notifications about new posts on this blog, click here:' )
  94              .' <a href="'.$htsrv_url.'quick_unsubscribe.php?type=coll_post&user_ID=$user_ID$&coll_ID='.$Blog->ID.'&key=$unsubscribe_key$">'
  95              .T_('instant unsubscribe').'</a>.';
  96  }
  97  
  98  // ---------------------------- EMAIL FOOTER INCLUDED HERE ----------------------------
  99  emailskin_include( '_email_footer.inc.html.php', $params );
 100  // ------------------------------- END OF EMAIL FOOTER --------------------------------
 101  ?>

title

Description

title

Description

title

Description

title

title

Body