[ Index ]

MailPress 544

[ Index ]     [ Classes ]     [ Functions ]     [ Variables ]     [ Constants ]     [ Statistics ]    

title

Body

[close]

/mp-includes/class/options/tracking/metaboxes/user/ -> u001all.php (source)

   1  <?php
   2  class MP_Tracking_metabox_u001all extends MP_tracking_metabox_
   3  {
   4      var $id    = 'u001all';
   5      var $context= 'side';
   6      var $file     = __FILE__;
   7  
   8  	function __construct($title)
   9      {
  10          add_filter('MailPress_scripts', array($this, 'scripts'), 8, 2);
  11          add_filter('MailPress_styles',  array($this, 'styles'),  8, 2);
  12          parent::__construct($title);
  13      }
  14  
  15  	function styles($styles) 
  16      {
  17          $styles[] = 'thickbox';
  18          return $styles;
  19      }
  20  
  21  	function scripts($scripts)
  22      {
  23          wp_register_script( 'mp-thickbox',         '/' . MP_PATH . 'mp-includes/js/mp_thickbox.js', array('thickbox'), false, 1);
  24          $scripts[] = 'mp-thickbox';
  25          return $scripts;
  26      }
  27  
  28  	function meta_box($mp_user)
  29      {
  30          global $wpdb;
  31          $x = new MP_Mail();
  32  
  33          $tracks = $wpdb->get_results( $wpdb->prepare( "SELECT * FROM $wpdb->mp_tracks WHERE user_id = %d ORDER BY tmstp DESC;", $mp_user->id) );
  34          if ($tracks) 
  35          {
  36              echo '<div class="mp_scroll"><table>';
  37              foreach($tracks as $track) 
  38              {
  39                  $view_url    = esc_url(add_query_arg( array('action' => 'iview', 'id' => $track->mail_id, 'mp_user_id' => $mp_user->id, 'key' => $mp_user->confkey, 'preview_iframe' => 1, 'TB_iframe' => 'true'), MP_Action_url ));
  40                  $subject    = $wpdb->get_var($wpdb->prepare( "SELECT subject FROM $wpdb->mp_mails WHERE id = %d ;", $track->mail_id));
  41                  if ($subject)
  42                  {
  43                      $subject     = $x->viewsubject($subject, $track->mail_id, $track->mail_id, $mp_user->id);
  44                      $action     = "<a href='$view_url' class='thickbox thickbox-preview'  title=\"" . esc_attr(sprintf( __('View "%1$s"', MP_TXTDOM) , ($subject) ? $subject : $track->mail_id )) . "\">" . $track->mail_id . '</a>';
  45                  }
  46                  else
  47                  {    
  48                      $action     = $track->mail_id;
  49                  }
  50                  echo '<tr><td><abbr title="' . $track->tmstp . '">' . substr($track->tmstp, 0, 10) . '</abbr></td><td>&#160;' . (($track->mail_id) ? ' (' . $action . ') ' : ' ') . '</td><td>&#160;' . MailPress_tracking::translate_track($track->track, $track->mail_id) . '</td></tr>';
  51              }
  52              echo '</table></div>';
  53          }
  54      }
  55  }
  56  new MP_Tracking_metabox_u001all(__('All actions', MP_TXTDOM));


Generated: Thu Apr 28 18:38:52 2016 Cross-referenced by PHPXref 0.7.1