From 8de8b629e44e395877e196ebbb163c98030b35bd Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Sun, 14 Dec 2008 17:02:54 +0000 Subject: [PATCH] Surfbar rewritten from input boxes to selection boxes --- inc/databases.php | 2 +- inc/functions.php | 32 ++++++++----- inc/language/surfbar_de.php | 8 ++-- inc/modules/admin/what-config_surfbar.php | 20 +++------ .../de/html/admin/admin_config_surfbar.tpl | 45 +++++++++---------- 5 files changed, 54 insertions(+), 53 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 8fb5e3fa42..72828697bd 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', "629"); +define('CURR_SVN_REVISION', "630"); // Take a prime number which is long (if you know a longer one please try it out!) define('_PRIME', 591623); diff --git a/inc/functions.php b/inc/functions.php index d5a4f20347..9989ee256e 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1357,38 +1357,46 @@ function GENERATE_IMAGE($img_code, $header=true) { imagedestroy($image); } // Create selection box or array of splitted timestamp -function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="center", $return_array=false) { +function CREATE_TIME_SELECTIONS ($timestamp, $prefix="", $display="", $align="center", $return_array=false) { global $_CONFIG; // Calculate 2-seconds timestamp $stamp = round($timestamp); + //* DEBUG: */ print("*".$stamp."/".$timestamp."*
"); // Do we have a leap year? $SWITCH = 0; $TEST = date('Y', time()) / 4; $M1 = date("m", time()); - $M2 = date("m", (time() + $stamp)); + $M2 = date("m", (time() + $timestamp)); // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day) if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = $_CONFIG['one_day']; // First of all years... - $Y = abs(floor($stamp / (31536000 + $SWITCH))); + $Y = abs(floor($timestamp / (31536000 + $SWITCH))); + //* DEBUG: */ print("Y={$Y}
\n"); // Next months... - $M = abs(floor($stamp / 2628000 - $Y * 12)); + $M = abs(floor($timestamp / 2628000 - $Y * 12)); + //* DEBUG: */ print("M={$M}
\n"); // Next weeks - $W = abs(floor($stamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7))); + $W = abs(floor($timestamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7))); + //* DEBUG: */ print("W={$W}
\n"); // Next days... - $D = abs(floor($stamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7)); + $D = abs(floor($timestamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7)); + //* DEBUG: */ print("D={$D}
\n"); // Next hours... - $h = abs(floor($stamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24)); + $h = abs(floor($timestamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24)); + //* DEBUG: */ print("h={$h}
\n"); // Next minutes.. - $m = abs(floor($stamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); + $m = abs(floor($timestamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60)); + //* DEBUG: */ print("m={$m}
\n"); // And at last seconds... - $s = abs(floor($stamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); + $s = abs(floor($timestamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60)); + //* DEBUG: */ print("s={$s}
\n"); // Is seconds zero and time is < 60 seconds? - if (($s == 0) && ($stamp < 60)) { + if (($s == 0) && ($timestamp < 60)) { // Fix seconds $s = round($timestamp); } // END - if @@ -1526,7 +1534,7 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen if (ereg("s", $display) || (empty($display))) { // Generate second selection $OUT .= " + $content[surfbar_static_time]   @@ -38,7 +38,7 @@ {--ADMIN_CONFIG_SURFBAR_STATIC_LOCK--} - + $content[surfbar_static_lock]   @@ -65,7 +65,7 @@ {--ADMIN_CONFIG_SURFBAR_RESTART_TIME--} - + $content[surfbar_restart_time]   @@ -74,7 +74,7 @@ {--ADMIN_CONFIG_SURFBAR_STATS_RELOAD--} - + $content[surfbar_stats_reload]   @@ -83,7 +83,7 @@ {--ADMIN_CONFIG_SURFBAR_PURGE_DELETED--} - + $content[surfbar_purge_deleted]   @@ -92,7 +92,7 @@ {--ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED--} - + $content[surfbar_purge_migrated]   @@ -151,22 +151,6 @@   - - - {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--} - - -   - - - - - -   -   {--ADMIN_CONFIG_SURFBAR_AUTOSTART--} @@ -194,6 +178,21 @@   + + + {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--} + + +   + + + + + +     @@ -209,7 +208,7 @@ {--ADMIN_CONFIG_SURFBAR_LOW_INTERVAL--} - + $content[surfbar_low_interval]   -- 2.39.5