pmpro_report_login_widget

The Paid Memberships Pro pmpro report login widget function.

Description

pmpro_report_login_widget(); 

Usage

  1. if ( !function_exists( 'pmpro_report_login_widget' ) ) { 
  2. require_once ABSPATH . PLUGINDIR . 'paid-memberships-pro/adminpages/reports/login.php'; 
  3.  
  4.  
  5. // NOTICE! Understand what this does before running. 
  6. $result = pmpro_report_login_widget(); 
  7.  

Defined (1)

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

/adminpages/reports/login.php  
  1. function pmpro_report_login_widget() 
  2. global $wpdb; 
  3. $now = current_time('timestamp'); 
  4. $visits = get_option("pmpro_visits", array("today"=>0, "thisday"=>date_i18n("Y-m-d", $now), "alltime"=>0, "month"=>0, "thismonth"=>date_i18n("n", $now))); 
  5. $views = get_option("pmpro_views", array("today"=>0, "thisday"=>date_i18n("Y-m-d", $now), "alltime"=>0, "month"=>0, "thismonth"=>date_i18n("n", $now))); 
  6. $logins = get_option("pmpro_logins", array("today"=>0, "thisday"=>date_i18n("Y-m-d", $now), "alltime"=>0, "month"=>0, "thismonth"=>date_i18n("n", $now))); 
  7. ?> 
  8. <span id="pmpro_report_login"> 
  9. <table class="wp-list-table widefat fixed striped"> 
  10. <thead> 
  11. <tr> 
  12. <th scope="col"> </th> 
  13. <th scope="col"><?php _e('Visits', 'paid-memberships-pro' ); ?></th> 
  14. <th scope="col"><?php _e('Views', 'paid-memberships-pro' ); ?></th> 
  15. <th scope="col"><?php _e('Logins', 'paid-memberships-pro' ); ?></th> 
  16. </tr> 
  17. </thead> 
  18. <tbody> 
  19. <tr> 
  20. <th scope="row"><?php _e('Today', 'paid-memberships-pro' ); ?></th> 
  21. <td><?php echo number_format_i18n($visits['today']); ?></td> 
  22. <td><?php echo number_format_i18n($views['today']); ?></td> 
  23. <td><?php echo number_format_i18n($logins['today']);?></td> 
  24. </tr> 
  25. <tr> 
  26. <th scope="row"><?php _e('This Month', 'paid-memberships-pro' ); ?></th> 
  27. <td><?php echo number_format_i18n($visits['month']); ?></td> 
  28. <td><?php echo number_format_i18n($views['month']); ?></td> 
  29. <td><?php echo number_format_i18n($logins['month']); ?></td> 
  30. </tr> 
  31. <tr> 
  32. <th scope="row"><?php _e('All Time', 'paid-memberships-pro' ); ?></th> 
  33. <td><?php echo number_format_i18n($visits['alltime']); ?></td> 
  34. <td><?php echo number_format_i18n($views['alltime']);?></td> 
  35. <td><?php echo number_format_i18n($logins['alltime']); ?></td> 
  36. </tr> 
  37. </tbody> 
  38. </table>  
  39. </span> 
  40. <?php