plug_mail.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. <?php
  2. if (!class_exists("plug_mail")) {
  3. class plug_mail {
  4. function __construct($ns) {
  5. $this->title = __("mail", "dagsopt");
  6. $this->pluginname = $ns->pluginname;
  7. $this->file = $ns->file;
  8. $this->ns = $ns;
  9. }
  10. function start() {
  11. $this->logfile = fopen(ABSPATH . "/wp-content/uploads/maillog.log", 'a');
  12. add_filter('wp_mail', array(&$this, 'mail_logger'), 10, 1);
  13. }
  14. function mail_logger($args) {
  15. $str = date("Y-m-d");
  16. $str .= " | " . date("H:i:s");
  17. $str .= " | " . $args['to'];
  18. $str .= " | " . $args['subject'];
  19. fwrite($this->logfile, $str . "\n");
  20. return $args;
  21. }
  22. function help() {
  23. ?>
  24. <?php echo (__("Adds mail log functions", "dagsopt")) ?>
  25. <?php
  26. }
  27. function Option($pre) {
  28. // update_option($pre . '_support_splash', $_POST[$pre . '_support_splash']);
  29. }
  30. function admin_line($pre) {
  31. ?>
  32. <hr>
  33. <?php
  34. $data = file_get_contents(ABSPATH . "/wp-content/uploads/maillog.log");
  35. ?>
  36. <textarea class="" rows="8" style="width: 100%; font-size: 11px;">
  37. <?php echo ($data) ?>
  38. </textarea>
  39. <?php
  40. }
  41. }
  42. global $plug_mail;
  43. $plug_mail = new plug_mail($this);
  44. $this->dagsopt['plug_mail'] = $plug_mail;
  45. }