]> git.mxchange.org Git - mailer.git/commitdiff
Surfbar rewritten from input boxes to selection boxes
authorRoland Häder <roland@mxchange.org>
Sun, 14 Dec 2008 17:02:54 +0000 (17:02 +0000)
committerRoland Häder <roland@mxchange.org>
Sun, 14 Dec 2008 17:02:54 +0000 (17:02 +0000)
inc/databases.php
inc/functions.php
inc/language/surfbar_de.php
inc/modules/admin/what-config_surfbar.php
templates/de/html/admin/admin_config_surfbar.tpl

index 8fb5e3fa42ee34eb2ed2cb954f88af23dca5a0c4..72828697bd4f97b683a38698ddadf43bb423dbee 100644 (file)
@@ -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);
index d5a4f20347509cd0f2b2833ad90ad51290228827..9989ee256ea2982274190876319063b7779d4d78 100644 (file)
@@ -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."*<br />");
 
        // 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}<br />\n");
        // Next months...
-       $M = abs(floor($stamp / 2628000 - $Y * 12));
+       $M = abs(floor($timestamp / 2628000 - $Y * 12));
+       //* DEBUG: */ print("M={$M}<br />\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}<br />\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}<br />\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}<br />\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}<br />\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}<br />\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 .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_se\" size=\"1\">\n";
-                       for ($idx = 0; $idx <= 45; $idx += 15) {
+                       for ($idx = 0; $idx <= 59; $idx++) {
                                $OUT .= "  <OPTION class=\"mini_select\" value=\"".$idx."\"";
                                if ($idx == $s) $OUT .= " selected default";
                                $OUT .= ">".$idx."</OPTION>\n";
@@ -1625,7 +1633,7 @@ function SEND_ADMIN_EMAILS_PRO($subj, $template, $content, $UID) {
        SQL_FREERESULT($result);
 }
 //
-function CREATE_FANCY_TIME($stamp) {
+function CREATE_FANCY_TIME ($stamp) {
        // Get data array with years/months/weeks/days/...
        $data = CREATE_TIME_SELECTIONS($stamp, "", "", "", true);
        $ret = "";
index 7f47e0f2a05aa70563819dedcc55205110c7d296..a44d1df10f030f6a8317e172b7f113532113e342 100644 (file)
@@ -42,7 +42,7 @@ define('ADMIN_CONFIG_SURFBAR_TITLE', "Konfiguration der Surfbar");
 define('ADMIN_CONFIG_SURFBAR_STATIC_REWARD', "Statische Verg&uuml;tung:");
 define('ADMIN_CONFIG_SURFBAR_STATIC_COSTS', "Statische Kosten:");
 define('ADMIN_CONFIG_SURFBAR_STATIC_TIME', "Statische Verweildauer bis n&auml;chste Seite geladen wird in Sekunden:");
-define('ADMIN_CONFIG_SURFBAR_STATIC_LOCK', "Statische Reload-Sperre (oberes Frame oder ges. Surfbar):");
+define('ADMIN_CONFIG_SURFBAR_STATIC_LOCK', "Statische Reload-Sperre:");
 define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL', "Verg&uuml;tungsmodel ausw&auml;hlen:");
 define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_STATIC', "Statische Werte verwenden.");
 define('ADMIN_CONFIG_SURFBAR_PAYMENT_MODEL_DYNAMIC', "Dynamische Werte errechnen.");
@@ -57,12 +57,12 @@ define('ADMIN_CONFIG_SURFBAR_NOTE', "<strong>Hinweise:</strong>&nbsp;Es wird emp
 define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE', "Auf welche Seite soll umgeleitet werden, wenn der User alle gebuchten URLs besucht hat? (Wenn sie also im Reload-Lock sind)");
 define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_INTERNAL', "Auf interne Pausenseite umleiten.");
 define('ADMIN_CONFIG_SURFBAR_PAUSE_MODE_EXTERNAL', "Auf externe Seite umleiten.<br /><span class=\"admin_note\">(Bitte angeben)</span>");
-define('ADMIN_CONFIG_SURFBAR_PAUSE_URL', "Externe Pausenseite (leer lassen, wenn auf interne umgeleitet werden soll)");
+define('ADMIN_CONFIG_SURFBAR_PAUSE_URL', "Externe Pausenseite: (leer lassen, wenn auf interne umgeleitet werden soll)");
 define('ADMIN_CONFIG_SURFBAR_NOTIFY_LIMITS', "Soll das Mitglied per Mail benachrichtigt werden, wenn aufrufbegrenzte URLs abgelaufen und auf &quot;pausierend&quot; gesetzt sind?");
 define('ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS', "Mitglied warnen, wenn {!POINTS!}-Guthaben unterschritten ist: (0=keine Warnung aussenden)");
-define('ADMIN_CONFIG_SURFBAR_MIGRATE_ORDER', "Sollen URLs aus Mailfreischaltungen in die Surfbar migriert werden?");
+define('ADMIN_CONFIG_SURFBAR_MIGRATE_ORDER', "Sollen URLs aus Mailfreischaltungen in die Surfbar migriert werden? (Diese sind nicht sofort freigegeben)");
 define('ADMIN_CONFIG_SURFBAR_LOW_INTERVAL', "Wiederholungsinterval f&uuml;r Nachrichten wegen niedrigem {!POINTS!}-Guthaben:");
-define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE', "Benachrichtigungen sofort oder beim t&auml;g;lichen Reset aussenden? (&quot;Sofort&quot; kann zu Verz&ouml;gerungen und/oder Belastung des Servers f&uuml;hren!");
+define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE', "Benachrichtigungen sofort oder beim t&auml;glichen Reset aussenden? (&quot;Sofort&quot; kann zu Verz&ouml;gerungen und/oder Belastung des Servers f&uuml;hren!");
 define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT', "Sofort aussenden");
 define('ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_RESET', "Beim t&auml;glichen Reset");
 
index 13ab3ce6b77336d78e7c0b63964f602eec50cec6..d481f6a761f0885fa835f17cd57fbbcddd8ebbc6 100644 (file)
@@ -54,23 +54,17 @@ if (isset($_POST['ok'])) {
        $content = array(
                'surfbar_static_reward'   => TRANSLATE_COMMA($_CONFIG['surfbar_static_reward']),
                'surfbar_static_costs'    => TRANSLATE_COMMA($_CONFIG['surfbar_static_costs']),
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_static_time'     => $_CONFIG['surfbar_static_time'],
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_restart_time'    => $_CONFIG['surfbar_restart_time'],
-               'surfbar_static_lock'     => $_CONFIG['surfbar_static_lock'],
+               'surfbar_static_time'     => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_time']   , "surfbar_static_time"   , "ms"),
+               'surfbar_static_lock'     => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_static_lock']   , "surfbar_static_lock"   , "hm"),
+               'surfbar_restart_time'    => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_restart_time']  , "surfbar_restart_time"  , "ms"),
                'surfbar_dynamic_percent' => TRANSLATE_COMMA($_CONFIG['surfbar_dynamic_percent']),
                'surfbar_max_order'       => $_CONFIG['surfbar_max_order'],
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_stats_reload'    => $_CONFIG['surfbar_stats_reload'],
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_purge_deleted'   => $_CONFIG['surfbar_purge_deleted'],
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_purge_migrated'  => $_CONFIG['surfbar_purge_migrated'],
+               'surfbar_stats_reload'    => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_stats_reload']  , "surfbar_stats_reload"  , "ms"),
+               'surfbar_purge_deleted'   => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_deleted'] , "surfbar_purge_deleted" , "WDh"),
+               'surfbar_purge_migrated'  => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_purge_migrated'], "surfbar_purge_migrated", "WDh"),
                'surfbar_pause_url'       => $_CONFIG['surfbar_pause_url'],
                'surfbar_warn_low_points' => $_CONFIG['surfbar_warn_low_points'],
-               // @TODO Rewrite this to tiny selection boxes
-               'surfbar_low_interval'    => $_CONFIG['surfbar_low_interval'],
+               'surfbar_low_interval'    => CREATE_TIME_SELECTIONS($_CONFIG['surfbar_low_interval']  , "surfbar_low_interval"  , "WDh"),
        );
 
        // Prepare payment model for template
index 8a037258f27318beb7d86daa97f2f1819685c443..7a6622c653082723d42f539f0d63059d4a37ed3d 100644 (file)
@@ -29,7 +29,7 @@
                        {--ADMIN_CONFIG_SURFBAR_STATIC_TIME--}
                </td>
                <td>
-                       <input type="text" name="surfbar_static_time" size="6" maxlength="20" value="$content[surfbar_static_time]" />
+                       $content[surfbar_static_time]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
@@ -38,7 +38,7 @@
                        {--ADMIN_CONFIG_SURFBAR_STATIC_LOCK--}
                </td>
                <td>
-                       <input type="text" name="surfbar_static_lock" size="6" maxlength="20" value="$content[surfbar_static_lock]" />
+                       $content[surfbar_static_lock]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
@@ -65,7 +65,7 @@
                        {--ADMIN_CONFIG_SURFBAR_RESTART_TIME--}
                </td>
                <td>
-                       <input type="text" name="surfbar_restart_time" size="6" maxlength="20" value="$content[surfbar_restart_time]" />
+                       $content[surfbar_restart_time]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
@@ -74,7 +74,7 @@
                        {--ADMIN_CONFIG_SURFBAR_STATS_RELOAD--}
                </td>
                <td>
-                       <input type="text" name="surfbar_stats_reload" size="6" maxlength="20" value="$content[surfbar_stats_reload]" />
+                       $content[surfbar_stats_reload]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
@@ -83,7 +83,7 @@
                        {--ADMIN_CONFIG_SURFBAR_PURGE_DELETED--}
                </td>
                <td>
-                       <input type="text" name="surfbar_purge_deleted" size="6" maxlength="20" value="$content[surfbar_purge_deleted]" />
+                       $content[surfbar_purge_deleted]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
@@ -92,7 +92,7 @@
                        {--ADMIN_CONFIG_SURFBAR_PURGE_MIGRATED--}
                </td>
                <td>
-                       <input type="text" name="surfbar_purge_migrated" size="6" maxlength="20" value="$content[surfbar_purge_migrated]" />
+                       $content[surfbar_purge_migrated]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
-       <tr>
-               <td align="center" colspan="2" class="admin_footer bottom2">
-                       {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--}
-               </td>
-       </tr>
-       <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
-       <tr>
-               <td height="30" align="right" style="padding-right:5px">
-                       <select name="surfbar_notification_mode" class="admin_select" size="1">
-                               <option value="INSTANT"{!__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT!}>{--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT--}</option>
-                               <option value="RESET"{!__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET!}>{--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_RESET--}</option>
-                       </select>
-               </td>
-       </tr>
-       <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
-       <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
        <tr>
                <td height="30" align="center" colspan="2" class="admin_footer bottom2">
                        {--ADMIN_CONFIG_SURFBAR_AUTOSTART--}
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
+       <tr>
+               <td align="center" colspan="2" class="admin_footer bottom2">
+                       {--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE--}
+               </td>
+       </tr>
+       <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
+       <tr>
+               <td height="30" align="right" style="padding-right:5px">
+                       <select name="surfbar_notification_mode" class="admin_select" size="1">
+                               <option value="INSTANT"{!__CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT!}>{--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_INSTANT--}</option>
+                               <option value="RESET"{!__CONFIG_SURFBAR_NOTIFICATION_MODE_RESET!}>{--ADMIN_CONFIG_SURFBAR_NOTIFICATION_MODE_RESET--}</option>
+                       </select>
+               </td>
+       </tr>
+       <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>
        <tr><td height="3" colspan="2" class="seperator">&nbsp;</td></tr>
        <tr>
                <td height="30" align="right" style="padding-right:5px">
                        {--ADMIN_CONFIG_SURFBAR_LOW_INTERVAL--}
                </td>
                <td>
-                       <input type="text" name="surfbar_low_interval" size="5" maxlength="20" value="$content[surfbar_low_interval]" />
+                       $content[surfbar_low_interval]
                </td>
        </tr>
        <tr><td height="3" colspan="2" class="seperator bottom2">&nbsp;</td></tr>