X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=sidebyside;f=inc%2Fextensions%2Fext-surfbar.php;h=d2fc6a8a909578b5b6b59603d4d5ba94a273fc54;hb=84efa4a5cec3298639f2922672fa7407718ad758;hp=1ffc7492ebdc41e037593636093125eaeac8443c;hpb=45c12cfbecbd208dab387834ec8cf462d4fa8994;p=mailer.git
diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php
index 1ffc7492eb..d2fc6a8a90 100644
--- a/inc/extensions/ext-surfbar.php
+++ b/inc/extensions/ext-surfbar.php
@@ -10,7 +10,12 @@
* -------------------------------------------------------------------- *
* Kurzbeschreibung : Eine Surfbar fuer Ihre Mitglieder *
* -------------------------------------------------------------------- *
- * *
+ * $Revision:: 856 $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2008 by Roland Haeder *
* For more information visit: http://www.mxchange.org *
@@ -32,156 +37,207 @@
************************************************************************/
// Some security stuff...
-if ((ereg(basename(__FILE__), $_SERVER['PHP_SELF']))) {
+if (!defined('__SECURITY')) {
$INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php";
require($INC);
}
// Version number
-$EXT_VERSION = "0.0";
-
-// Auto-set extension version
-if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION;
+EXT_SET_VERSION("0.0");
// Version history array (add more with , "0.1" and so on)
-$EXT_VER_HISTORY = array("0.0");
+EXT_SET_VER_HISTORY(array("0.0"));
switch ($EXT_LOAD_MODE)
{
-case "register": // Do stuff when installtion is running (modules.php?module=admin&action=login is called)
+case "register": // Do stuff when installation is running (modules.php?module=admin&action=login is called)
// SQL commands to run (surfbar URLs)
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
- $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_urls` (
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`");
+ ADD_SQL("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 '',
-`reward` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '0.00000',
-`costs` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '0.00000',
-`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`views_total` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`status` ENUM('PENDING','CONFIRMED', 'LOCKED') NOT NULL DEFAULT 'CONFIRMED',
+`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,
+`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`)
-) TYPE=MyISAM COMMENT='Surfbar URLs'";
+UNIQUE KEY `userid_url` (`userid`,`url`),
+INDEX `status_userid` (`status`,`userid`)
+) TYPE={!_TABLE_TYPE!} COMMENT='Surfbar URLs'");
// Reload locks
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
- $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_locks` (
-`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_locks`");
+ ADD_SQL("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,
`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'";
+) TYPE={!_TABLE_TYPE!} COMMENT='Surfbar reload locks'");
// Surfbar salts
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
- $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_salts` (
-`id` BIGINT(20) NOT NULL AUTO_INCREMENT,
-`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
-`url_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`");
+ ADD_SQL("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,
`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'";
+) TYPE={!_TABLE_TYPE!} COMMENT='Surfbar last used salts'");
// Statistics
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
- $SQLs[] = "CREATE TABLE `"._MYSQL_PREFIX."_surfbar_stats` (
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`");
+ ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_stats` (
`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,
`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`)
-) TYPE=MyISAM COMMENT='Surfbar Statistics'";
+UNIQUE KEY `userid_url` (`userid`,`url_id`),
+INDEX (`url_id`)
+) TYPE={!_TABLE_TYPE!} COMMENT='Surfbar Statistics'");
+
+ // Member actions pending on status
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_actions`");
+ ADD_SQL("CREATE TABLE `{!_MYSQL_PREFIX!}_surfbar_actions` (
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`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`),
+UNIQUE KEY `status_action` (`status`,`action`)
+) TYPE={!_TABLE_TYPE!} COMMENT='Surfbar Member Actions'");
+
+ // Member actions
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','RETREAT','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','FRAMETEST',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('PENDING','EDIT',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','EDIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','PAUSE','STOPPED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('ACTIVE','FRAMETEST',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','FRAMETEST',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('LOCKED','RESUBMIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','EDIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('STOPPED','UNPAUSE','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','EDIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('DEPLETED','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','EDIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','FRAMETEST',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('REJECTED','RESUBMIT','PENDING')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','EDIT','MIGRATED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','DELETE','DELETED')");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','FRAMETEST',NULL)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_surfbar_actions` (`status`,`action`,`new_status`) VALUES ('MIGRATED','BOOKNOW','PENDING')");
// Config entries
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5)."";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6)."";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30";
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pay_model` ENUM('STATIC','DYNAMIC') NOT NULL DEFAULT 'STATIC'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.25000");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_costs` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 1.00000");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_time` SMALLINT(6) UNSIGNED NOT NULL DEFAULT 60");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_static_lock` SMALLINT(6) UNSIGNED NOT NULL DEFAULT ".(60*5)."");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT 10.00000");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT 10");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(60*6)."");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_migrate_urls` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_total_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_daily_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_yester_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*7)."");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('one_day')*3)."");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('one_day')."");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'");
+
+ // Extend user data
+ ADD_SQL("ALTER TABLE `{!_MYSQL_PREFIX!}_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'");
//Â Member menus
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',3)";
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_book','URL buchen','Y','Y',2)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_list','URL-Verwaltung','Y','Y',3)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_stats','URL-Statistiken','Y','Y',4)");
// Admin menus
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','','Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzufügen','Fügen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. Vorsicht! Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzufügen.',1)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)";
- $SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergütung und vieles mehr.',4)";
-
- // Load CSS?
- $EXT_CSS = "Y";
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar',NULL,'Surfbar','URLs in der Surfbar verwalten, Einstellungen ändern und vieles mehr.',7)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','add_surfbar_url','URL hinzufügen','Fügen Sie URLs z.B. von Werbenetzwerken hinzu, oder Ihre eigenen Projekte. Vorsicht! Ihnen muss es auch gestattet sein, URLs aus dem Werbenetzwerk in die Surfbar einzufügen.',1)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_urls','URLs verwalten','Verwalten Sie hier alle in der Surfbar befindlichen URLs mit nur wenigen Klicks.',2)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','unlock_surfbar_urls','Wartende URLs freigeben','Geben Sie hier nur direkt in der Surfbar gebuchte URLs frei.',3)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','config_surfbar','Einstellungen','Einstellungen an der Surfbar ändern, wie Festvergütung, prozentuale Ref-Vergütung und vieles mehr.',4)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','surfbar_stats','Statistiken','Detailierte Statistiken zu einer ausgewählten URL anzeigen.',5)");
+ ADD_SQL("INSERT INTO `{!_MYSQL_PREFIX!}_admin_menu` (`action`,`what`,`title`,`descr`,`sort`) VALUES ('surfbar','list_surfbar_actions','Mitgliederaktionen','Listet alle Mitgliederaktionen auf.',6)");
break;
case "remove": // Do stuff when removing extension
// SQL commands to run
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_urls`";
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_locks`";
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_salts`";
- $SQLs[] = "DROP TABLE IF EXISTS `"._MYSQL_PREFIX."_surfbar_stats`";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_member_menu` WHERE `action`='surfbar' LIMIT 4";
- $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE action='surfbar' LIMIT 5";
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_actions`");
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_locks`");
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_salts`");
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_stats`");
+ ADD_SQL("DROP TABLE IF EXISTS `{!_MYSQL_PREFIX!}_surfbar_urls`");
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_member_menu` WHERE `action`='surfbar' LIMIT 5");
+ ADD_SQL("DELETE LOW_PRIORITY FROM `{!_MYSQL_PREFIX!}_admin_menu` WHERE `action`='surfbar' LIMIT 7");
break;
case "activate": // Do stuff when admin activates this extension
// SQL commands to run
- $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='surfbar' LIMIT 3";
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='surfbar' LIMIT 5");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='N', hidden='N', admin_only='N', mem_only='Y' WHERE module='surfbar' LIMIT 1");
break;
case "deactivate": // Do stuff when admin deactivates this extension
// SQL commands to run
- $SQLs[] = "UPDATE `"._MYSQL_PREFIX."_member_menu` SET `locked`='Y' WHERE `action` = 'surfbar' LIMIT 3";
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_member_menu` SET `visible`='N', `locked`='Y' WHERE `action` = 'surfbar' LIMIT 5");
+ ADD_SQL("UPDATE `{!_MYSQL_PREFIX!}_mod_reg` SET `locked`='Y' WHERE module='surfbar' LIMIT 1");
break;
case "update": // Update an extension
- switch ($EXT_VER)
- {
+ switch ($EXT_VER) {
case "0.0.1": // SQL queries for v0.0.1
- $SQLs[] = "";
+ ADD_SQL("");
// Update notes (these will be set as task text!)
- $UPDATE_NOTES = "";
+ EXT_SET_UPDATE_NOTES("");
break;
}
break;
-default: // Do stuff when extension is loaded
- $dummy = LOAD_CONFIG();
- $_CONFIG = merge_array($_CONFIG, $dummy);
- unset($dummy);
+case "modify": // When the extension got modified
break;
-}
-// Language file prefix
-$EXT_LANG_PREFIX = "surfbar";
+case "test": // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
-// Extension is always active?
-$EXT_ALWAYS_ACTIVE = "N";
+default: // Do stuff when extension is loaded
+ // Set some constants we need???
+ define('edit', "edit");
+ break;
+}
//
?>