From 23f39916099dad094d2d2b0fe54d335bddc986db Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 17 Sep 2008 13:07:55 +0000 Subject: [PATCH] Surfbar now has start/stop button --- inc/databases.php | 2 +- inc/extensions.php | 12 ++++++++++++ inc/extensions/ext-safe.php | 2 +- inc/modules/admin/overview-inc.php | 18 ++++-------------- .../de/html/surfbar/surfbar_frame_top.tpl | 14 ++++++++++++++ 5 files changed, 32 insertions(+), 16 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index aaa158a63b..516745515b 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); define('SERVER_URL', "http://www.mxchange.org"); // This current patch level -define('CURR_SVN_REVISION', "350"); +define('CURR_SVN_REVISION', "351"); // 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.php b/inc/extensions.php index 168a3ae9cc..50820f5948 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -595,5 +595,17 @@ function GET_EXT_ID($name) { // Return value return $ret; } +// Activate given extension +function ACTIVATE_EXTENSION($ext_name) { + // Activate the extension + $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='Y' WHERE ext_name='%s' LIMIT 1", + array($ext_name), __FILE__, __LINE__); + + // Extension has been activated? + if (SQL_AFFECTEDROWS() == 1) { + // Then run all queries + EXTENSION_RUN_SQLS(GET_EXT_ID($ext_name), "activate"); + } // END - if +} // ?> diff --git a/inc/extensions/ext-safe.php b/inc/extensions/ext-safe.php index 4a02e0f4e8..378bb109cd 100644 --- a/inc/extensions/ext-safe.php +++ b/inc/extensions/ext-safe.php @@ -9,7 +9,7 @@ * Short description : A safe for storing points on a "safe" place * * -------------------------------------------------------------------- * * Kurzbeschreibung : Ein Tresor zum Ablegen der Punkte an einem * - * sicheren Ort * + * "sicheren Ort" * * -------------------------------------------------------------------- * * * * -------------------------------------------------------------------- * diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 57d77aa258..0cc18dbc7b 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -72,9 +72,6 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) // Extension is not installed so no version number was found $ext_ver = ""; } - - // Disable load from database - $result = false; } elseif (!EXT_IS_ACTIVE("cache")) { // Load data from database $result = SQL_QUERY_ESC("SELECT id, ext_version FROM "._MYSQL_PREFIX."_extensions WHERE ext_name='%s' LIMIT 1", @@ -105,19 +102,12 @@ function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) // Maybe we want to keept the current extension active? if (($cacheArray['active_extensions'][$ext] == "Y") && (!EXT_IS_ACTIVE($ext))) { // Reactivate this extension! - $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_extensions SET ext_active='Y' WHERE ext_name='%s' LIMIT 1", - array($ext), __FILE__, __LINE__); - - // Extension has been activated? - if (SQL_AFFECTEDROWS() == 1) { - // Then run all queries - EXTENSION_RUN_SQLS(GET_EXT_ID($ext), "activate"); - } // END - if + ACTIVATE_EXTENSION($ext); } // END - if - } + } // END - if } - } - } + } // END - if + } // END - while // Close directory handle closedir($handle); diff --git a/templates/de/html/surfbar/surfbar_frame_top.tpl b/templates/de/html/surfbar/surfbar_frame_top.tpl index 7c6f3abbc3..13377cde2e 100644 --- a/templates/de/html/surfbar/surfbar_frame_top.tpl +++ b/templates/de/html/surfbar/surfbar_frame_top.tpl @@ -9,6 +9,7 @@ »Aktuelle Seite in neuem Fenster öffnen« [Anhalten|Loginbereich|Ausloggen|Schliessen]
@@ -24,6 +25,19 @@ var maxCounter = "$content[reload]"; var counter = document.getElementById("surfbar_counter"); var countDown = null; +function StartStopCounter () { + if (countDown == null) { + // Start counter + document.getElementById("start").innerHTML = "Anhalten"; + countDown = window.setInterval("StartCounter()", 1000); + } else { + document.getElementById("start").innerHTML = "Weiter"; + window.clearInterval(countDown); + countDown = null; + } + return false; +} + function Init() { countDown = window.setInterval("StartCounter()", 1000); window.setTimeout("InitCounter()", 500); -- 2.39.5