[ Index ]

MailPress 544

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

title

Body

[close]

/mp-admin/includes/install/ -> tracking.php (source)

   1  <?php
   2  
   3  /* Tracking install */
   4  
   5  global $wpdb;
   6  
   7  //////////////////////////////////
   8  //// Install                  ////
   9  //////////////////////////////////
  10  
  11  $charset_collate = '';
  12  if ( $wpdb->supports_collation() ) 
  13  {
  14      if ( ! empty($wpdb->charset) ) $charset_collate  = "DEFAULT CHARACTER SET $wpdb->charset";
  15      if ( ! empty($wpdb->collate) ) $charset_collate .= " COLLATE $wpdb->collate";
  16  }
  17  
  18  $queries = array();
  19  
  20  $queries[] =
  21  "CREATE TABLE $wpdb->mp_tracks (
  22   id                bigint(20)      UNSIGNED NOT NULL AUTO_INCREMENT,
  23   user_id           bigint(20)      NOT NULL default '0',
  24   mail_id           bigint(20)      NOT NULL default '0',
  25   tmstp             timestamp       NOT NULL default '0000-00-00 00:00:00',
  26   mmeta_id          bigint(20)      NOT NULL default '0',
  27   context           varchar(20)     NOT NULL default 'html',
  28   ip                varchar(100)    NOT NULL default '',
  29   agent             varchar(255)    NOT NULL default '',
  30   track             longtext,
  31   referrer          longtext,
  32   PRIMARY KEY (id),
  33   UNIQUE KEY id (id),
  34   KEY user_id  (user_id),
  35   KEY mail_id  (mail_id),
  36   KEY mmeta_id (mmeta_id)
  37  ) $charset_collate;";
  38  
  39  require_once(ABSPATH . 'wp-admin/includes/upgrade.php');
  40  dbDelta($queries);
  41  
  42  
  43  
  44  // some clean up
  45  $wpdb->query( "DELETE FROM $wpdb->mp_tracks WHERE mail_id NOT IN ( SELECT id FROM $wpdb->mp_mails );" );


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