Surfbar now has start/stop button
authorRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 13:07:55 +0000 (13:07 +0000)
committerRoland Häder <roland@mxchange.org>
Wed, 17 Sep 2008 13:07:55 +0000 (13:07 +0000)
inc/databases.php
inc/extensions.php
inc/extensions/ext-safe.php
inc/modules/admin/overview-inc.php
templates/de/html/surfbar/surfbar_frame_top.tpl

index aaa158a..5167455 100644 (file)
@@ -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);
index 168a3ae..50820f5 100644 (file)
@@ -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
+}
 //
 ?>
index 4a02e0f..378bb10 100644 (file)
@@ -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"                                   *
  * -------------------------------------------------------------------- *
  *                                                                      *
  * -------------------------------------------------------------------- *
index 57d77aa..0cc18db 100644 (file)
@@ -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);
index 7c6f3ab..13377cd 100644 (file)
@@ -9,6 +9,7 @@
 
                &raquo;<a href="$content[url]" target="_blank">Aktuelle Seite in neuem
                Fenster &ouml;ffnen</a>&laquo;&nbsp;<span class="surfbar_navi">[<a
+                href="#" onclick="return StartStopCounter();" id="start">Anhalten</a>|<a
                 target="_parent" href="{!URL!}/login.php">Loginbereich</a>|<a
                 target="_parent" href="{!URL!}/modules.php?module=login&amp;what=logout">Ausloggen</a>|<a
                 href="javascript:window.close()">Schliessen</a>]</span><br />
@@ -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);