]> git.mxchange.org Git - mailer.git/blobdiff - inc/extensions/ext-surfbar.php
Templates rewritten/fixed, surfbar extended with per-entry reload lock
[mailer.git] / inc / extensions / ext-surfbar.php
index e9bc3d7f792fa66fd566c35492c3ac416b33822a..d1db394b534219768376eba771842371ab4a895b 100644 (file)
@@ -53,17 +53,18 @@ case "register": // Do stuff when installation is running (modules.php?module=ad
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
 `id` BIGINT(20) UNSIGNED  NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
 `url` VARCHAR(255) NOT NULL DEFAULT '',
 `last_salt` VARCHAR(255) NOT NULL DEFAULT '',
-`views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
-`views_max` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
-`views_allowed` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`views_total` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
+`views_max` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
+`views_allowed` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
 `status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
 `registered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 `last_locked` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
 `lock_reason` VARCHAR(255) NOT NULL DEFAULT '',
 `reject_reason` VARCHAR(255) NOT NULL DEFAULT '',
+`fixed_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 PRIMARY KEY(`id`),
 UNIQUE KEY `userid_url` (`userid`,`url`),
 INDEX `status_userid` (`status`,`userid`),
@@ -73,11 +74,11 @@ INDEX `status_userid` (`status`,`userid`),
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
 `last_surfed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY(`id`),
-INDEX (`userid`),
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
 INDEX (`url_id`)
 ) TYPE=MyISAM COMMENT='Surfbar reload locks'";
 
@@ -85,11 +86,11 @@ INDEX (`url_id`)
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_salts` (
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT '0',
+`userid` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
+`url_id` BIGINT(20) UNSIGNED  NOT NULL DEFAULT 0,
 `last_salt` VARCHAR(255) NOT NULL DEFAULT '',
 PRIMARY KEY(`id`),
-INDEX (`userid`),
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
 INDEX (`url_id`)
 ) TYPE=MyISAM COMMENT='Surfbar last used salts'";
 
@@ -102,18 +103,19 @@ INDEX (`url_id`)
 `count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
 `last_online` TIMESTAMP ON UPDATE CURRENT_TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
 PRIMARY KEY (`id`),
-INDEX (`userid`,`url_id`)
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
+INDEX (`url_id`)
 ) TYPE=MyISAM COMMENT='Surfbar Statistics'";
 
        // Member actions pending on status
        $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_actions`";
        $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_actions` (
 `id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NOT NULL DEFAULT 'PENDING',
+`status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
 `action` ENUM('EDIT','DELETE','PAUSE','UNPAUSE','FRAMETEST','RETREAT','RESUBMIT','BOOKNOW') NULL DEFAULT NULL,
 `new_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
 PRIMARY KEY (`id`),
-INDEX (`status`)
+UNIQUE KEY `status_action` (`status`,`action`)
 ) TYPE=MyISAM COMMENT='Surfbar Member Actions'";
 
        // Member actions