From 3375ab36b02f87009fe814b5b55d5c4da06f8f30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Thu, 18 Dec 2008 21:36:11 +0000 Subject: [PATCH] Extension 'active' now depends on 'online' because of a filter for the 'Who is online' block --- .gitattributes | 1 + inc/databases.php | 2 +- inc/extensions/ext-active.php | 18 ++++++++-- inc/libs/active_functions.php | 56 +++++++++++++++++++++++++++++ inc/modules/guest/action-online.php | 12 ++----- 5 files changed, 76 insertions(+), 13 deletions(-) create mode 100644 inc/libs/active_functions.php diff --git a/.gitattributes b/.gitattributes index 7e9f6da89c..684360a573 100644 --- a/.gitattributes +++ b/.gitattributes @@ -210,6 +210,7 @@ inc/language/user_de.php -text inc/language/wernis_de.php -text inc/language/yoomedia_de.php -text inc/libs/.htaccess -text +inc/libs/active_functions.php -text inc/libs/admins_functions.php -text inc/libs/autopurge_functions.php -text inc/libs/beg_functions.php -text diff --git a/inc/databases.php b/inc/databases.php index fd18e36899..1cb01137c7 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -114,7 +114,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // Current SVN revision -define('CURR_SVN_REVISION', "653"); +define('CURR_SVN_REVISION', "654"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/extensions/ext-active.php b/inc/extensions/ext-active.php index b357a96a52..eaeec47073 100644 --- a/inc/extensions/ext-active.php +++ b/inc/extensions/ext-active.php @@ -38,13 +38,13 @@ if (!defined('__SECURITY')) { } // Version number -$EXT_VERSION = "0.0.8"; +$EXT_VERSION = "0.0.9"; // Auto-set extension version if (empty($EXT_VER)) $EXT_VER = $EXT_VERSION; // Version history array (add more with , "0.1" and so on) -$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8"); +$EXT_VER_HISTORY = array("0.0", "0.0.1", "0.0.2", "0.0.3", "0.0.4", "0.0.5", "0.0.6", "0.0.7", "0.0.8", "0.0.9"); switch ($EXT_LOAD_MODE) { @@ -60,6 +60,9 @@ case "remove": // Do stuff when removing extension // SQL commands to run $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_guest_menu` WHERE what='active' LIMIT 1"; $SQLs[] = "DELETE LOW_PRIORITY FROM `"._MYSQL_PREFIX."_admin_menu` WHERE what='config_active' LIMIT 1"; + + // Unregister filter + UNREGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', true, $dry_run); break; case "activate": // Do stuff when admin activates this extension @@ -117,6 +120,17 @@ case "update": // Update an extension // Update notes (these will be set as task text!) $UPDATE_NOTES = "Fehlerhinweis bei deaktivierter Erweiterung verbessert."; break; + + case "0.0.9": // SQL queries for v0.0.9 + // Make update depending on "online" + $EXT_UPDATE_DEPENDS = "online"; + + // Register filter + REGISTER_FILTER('online_extra_links', 'ADD_LINK_ACTIVE_LIST', false, true, $dry_run); + + // Update notes (these will be set as task text!) + $UPDATE_NOTES = "Filter für den "Wer ist Online" Block hinzugefügt und ist von online abhängig."; + break; } break; diff --git a/inc/libs/active_functions.php b/inc/libs/active_functions.php new file mode 100644 index 0000000000..d35364216f --- /dev/null +++ b/inc/libs/active_functions.php @@ -0,0 +1,56 @@ + "".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."", + 'what' => "active" + ); + + // Add link to "we were active today" page + LOAD_TEMPLATE("guest_menu_bottom", false, $content); + } // END - if +} + +// +?> diff --git a/inc/modules/guest/action-online.php b/inc/modules/guest/action-online.php index 37e623e572..0dea4fa956 100644 --- a/inc/modules/guest/action-online.php +++ b/inc/modules/guest/action-online.php @@ -61,16 +61,8 @@ define('ADMINS_ONLINE_CNT' , SQL_NUMROWS($result_admins)); // Output table LOAD_TEMPLATE("online_now"); -if (EXT_IS_ACTIVE("active")) { - // Init content - $content = array( - 'menu' => "".getConfig('menu_blur_spacer').GUEST_ACTIVE_LINK."", - 'what' => "active" - ); - - // Add link to "we were active today" page - LOAD_TEMPLATE("guest_menu_bottom", false, $content); -} // END - if +// Add more links in this block +RUN_FILTER('online_extra_links'); // ?> -- 2.39.5