WYSIJA_module_view_stats_subscribers_std_view

The MailPoet Newsletters WYSIJA module view stats subscribers std class.

Defined (1)

The class is defined in the following location(s).

/modules/stats_subscribers_std/stats_subscribers_std_view.php  
  1. class WYSIJA_module_view_stats_subscribers_std_view extends WYSIJA_view_back { 
  2.  
  3. public function hook_subscriber_bottom($data) { 
  4. if (empty($data['opened_newsletters']['stats'])) 
  5. return; 
  6. ?> 
  7. <div class="container-stats-subscribers_std container" rel="<?php echo $data['module_name']; ?>"> 
  8. <h3 class="title"> 
  9. <?php 
  10. if ($data['opened_newsletters']['stats']['emails_count'] > 1) 
  11. echo sprintf(__('Subscriber opened %1$s of %2$s emails', WYSIJA), $data['opened_newsletters']['stats']['opened_emails_count'], $data['opened_newsletters']['stats']['emails_count']); 
  12. else 
  13. echo sprintf(__('Subscriber opened %1$s of %2$s email', WYSIJA), $data['opened_newsletters']['stats']['opened_emails_count'], $data['opened_newsletters']['stats']['emails_count']); 
  14. ?> 
  15. </h3> 
  16. <?php if (empty($data['opened_newsletters']['emails'])) { ?> 
  17. <div class="notice-msg updated inline"><ul><li><?php echo $data['messages']['data_not_available']; ?></li></ul></div> 
  18. <?php } 
  19. else { ?> 
  20. <table class="widefat fixed"> 
  21. <thead> 
  22. <th class="check-column"> </th> 
  23. <th class="newsletter"><?php echo esc_attr__('Newsletter', WYSIJA); ?></th> 
  24. <th class="link"><?php echo esc_attr__('Link', WYSIJA); ?></th> 
  25. <th class="click sortable sort-filter <?php echo $data['order_direction']['clicks']; ?>" rel="click"><a href="javascript:void(0);" class="orderlink"><span><?php echo esc_attr__('Clicks'); ?></span><span class="sorting-indicator"></span></a></th> 
  26. <!--th><?php echo esc_attr__('Device', WYSIJA); ?></th--> 
  27. <!--th class="date"><?php echo esc_attr__('Opened date', WYSIJA); ?></th--> 
  28. <th class="date"><?php echo esc_attr__('Date sent', WYSIJA); ?></th> 
  29. </thead> 
  30. <tbody class="list:user user-list"> 
  31. <?php 
  32. $i = 1; 
  33. $alt = false; 
  34. $email_helper = WYSIJA::get('email', 'helper'); 
  35. foreach ($data['opened_newsletters']['emails'] as $email) { 
  36. $full_url = $email_helper->getVIB($email); 
  37. if (empty($email['urls'])) { 
  38. ?> 
  39. <tr class="<?php 
  40. echo $alt ? 'alternate' : ''; 
  41. $alt = !$alt; 
  42. ?>"> 
  43. <td><?php 
  44. echo $i; 
  45. $i++; 
  46. ?></td> 
  47. <td> 
  48. <a href="<?php echo $full_url ?>" target="_blank" class="viewnews" title="<?php _e('Preview in new tab', WYSIJA) ?>"> 
  49. <?php echo $email['subject']; ?> 
  50. </a> 
  51. </td> 
  52. <td> </td> 
  53. <td> </td> 
  54. <!--td><?php echo esc_attr__('N/A', WYSIJA); ?></td--> 
  55. <!--td><?php echo $this->fieldListHTML_created_at($email['opened_at']); ?></td--> 
  56. <td><?php echo $this->fieldListHTML_created_at($email['sent_at']); ?></td> 
  57. </tr> 
  58. <?php 
  59. else { 
  60. $link_helper = WYSIJA::get('links', 'helper'); 
  61. add_filter('wysija_link', array( $link_helper, 'render_link' ), 1, 6); 
  62. foreach ($email['urls'] as $url) { 
  63. if ($i === 1) { 
  64. $wysija_link = apply_filters('wysija_link', '', $url['url'], 50, 15, false); 
  65. else { 
  66. $wysija_link = apply_filters('wysija_link', '', $url['url'], 50, 15, false, '...'); 
  67. ?> 
  68. <tr class="<?php 
  69. echo $alt ? 'alternate' : ''; 
  70. $alt = !$alt; 
  71. ?>"> 
  72. <td><?php 
  73. echo $i; 
  74. $i++; 
  75. ?></td> 
  76. <td> 
  77. <a href="<?php echo $full_url ?>" target="_blank" class="viewnews" title="<?php _e('Preview in new tab', WYSIJA) ?>"> 
  78. <?php echo $email['subject']; ?> 
  79. </a> 
  80. </td> 
  81. <td><?php echo $wysija_link; ?></td> 
  82. <td><?php echo $url['number_clicked']; ?></td> 
  83. <!--td><?php echo esc_attr__('N/A', WYSIJA); ?></td--> 
  84. <!--td><?php echo $this->fieldListHTML_created_at($email['opened_at']); ?></td--> 
  85. <td><?php echo $this->fieldListHTML_created_at($email['sent_at']); ?></td> 
  86. </tr> 
  87. <?php 
  88. ?> 
  89. </tbody> 
  90. </table> 
  91. <?php } ?> 
  92. <?php 
  93. //$this->model->countRows = 103;//$data['top_subscribers']['count']; 
  94. // if (empty($this->viewObj)) $this->viewObj = new stdClass(); 
  95. // $this->viewObj->msgPerPage = esc_attr__('Show', WYSIJA).':'; 
  96. // $this->viewObj->title = ''; 
  97. //$this->limitPerPage(); // not implemented yet 
  98. ?> 
  99. <div class="cl"></div> 
  100. </div> 
  101. <?php 
  102.