$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_dynamic_percent` FLOAT(10,5) UNSIGNED NOT NULL DEFAULT '10.00000'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_max_order` INT(7) UNSIGNED NOT NULL DEFAULT '10'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_restart_time` BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(60*6)."'";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_autostart` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
// Member menus
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',5)";
define('ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT', "Prozent auf dynamische Vergütung:");
define('ADMIN_CONFIG_SURFBAR_MAX_ORDER', "Maximal durch Mitglied in Surfbar buchbare URLs:(*)");
define('ADMIN_CONFIG_SURFBAR_RESTART_TIME', "Ruhezeit der Surfbar, wenn alle URLs in Reload-Lock sind:");
+define('ADMIN_CONFIG_SURFBAR_AUTOSTART', "Surfbar soll nach Ruhezeit automatisch starten?");
define('ADMIN_SURFBAR_NOTIFY_UNLOCK_YES', "Ja, Admin(s) informieren.");
define('ADMIN_SURFBAR_NOTIFY_UNLOCK_NO', "Nein, nicht informieren.");
define('ADMIN_SURFBAR_NO_REF_LEVELS_FOUND', "Zur Zeit sind keine Referal-Ebenen für die Surfbar eingestellt.<br />\nBitte installieren Sie die Erweiterung <strong>surfbar</strong> neu.");
define('__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N', " checked=\"checked\"");
}
+ // Prepare auto-sart
+ if ($_CONFIG['surfbar_autostart'] == "Y") {
+ // Yes selected
+ define('__CONFIG_SURFBAR_AUTOSTART_Y' , " checked=\"checked\"");
+ define('__CONFIG_SURFBAR_AUTOSTART_N', "");
+ } else {
+ // No selected
+ define('__CONFIG_SURFBAR_AUTOSTART_Y' , "");
+ define('__CONFIG_SURFBAR_AUTOSTART_N', " checked=\"checked\"");
+ }
+
// Load template
LOAD_TEMPLATE("admin_config_surfbar", false, $content);
}
} else {
// Prepare content
$content = array(
- 'restart' => $_CONFIG['surfbar_restart_time'],
- 'start' => str_repeat("X", strlen($_CONFIG['surfbar_restart_time']))
+ 'restart' => $_CONFIG['surfbar_restart_time'],
+ 'start' => str_repeat("X", strlen($_CONFIG['surfbar_restart_time'])),
+ 'autostart' => ($_CONFIG['surfbar_autostart'] == "Y") ? "true" : "false"
);
// Load template for stopped surfbar
// Update salt (double-call lock!)
SURFBAR_UPDATE_SALT();
- } else {
- // Change template name
- $templateName = "surfbar_stopped";
- }
+ } // END - if
} else {
// Load header in frameset mode
$isFrameset = true;
<INPUT type="radio" name="surfbar_notify_admin_unlock" value="N"{--__CONFIG_SURFBAR_NOTIFY_ADMIN_UNLOCK_N--} /> {--ADMIN_SURFBAR_NOTIFY_UNLOCK_NO--}
</TD>
</TR>
+ <TR><TD height="8" colspan="2" class="seperator"> </TD></TR>
+ <TR><TD height="3" colspan="2" class="seperator bottom2"> </TD></TR>
+ <TR>
+ <TD height="30" align="center" colspan="2" class="admin_footer bottom2">
+ {--ADMIN_CONFIG_SURFBAR_AUTOSTART--}
+ </TD>
+ </TR>
+ <TR><TD height="8" colspan="2" class="seperator"> </TD></TR>
+ <TR>
+ <TD align="center" colspan="2">
+ <INPUT type="radio" name="surfbar_autostart" value="Y"{--__CONFIG_SURFBAR_AUTOSTART_Y--} /> {--YES--}
+ <INPUT type="radio" name="surfbar_autostart" value="N"{--__CONFIG_SURFBAR_AUTOSTART_N--} /> {--NO--}
+ </TD>
+ </TR>
<TR><TD height="8" colspan="2" class="seperator bottom2"> </TD></TR>
<TR>
<TD colspan="2" align="center" class="admin_footer">
<div align="center">
- <div class="member_table dashed" style="width:500px">
+ <div class="member_table dashed" style="width:500px;height:50px">
<div class="member_title2 bottom2">
<strong>Surfbar angehalten!</strong>
</div>
- Keine URLs mehr verfürgbar oder Datenbankfehler liegt vor.<br />
- Neustart in <span id="surfbar_restart">$content[start]</span> Sekunden
+ <div id="surfbar_button">
+ Keine URLs mehr verfürgbar oder Datenbankfehler liegt vor.<br />
+ Neustart in <span id="surfbar_counter">$content[start]</span> Sekunden
+ </div>
</div>
</div>
<script language="JavaScript" type="text/javascript">
<!--
-var counter = "$content[restart]";
-var timer = document.getElementById("surfbar_restart");
+var interval = null;
+var counter = "$content[restart]";
+var timer = document.getElementById("surfbar_counter");
+var buttonDiv = document.getElementById("surfbar_button");
-function Restart() {
+function Restart () {
this.location.reload();
}
+function ShowButton () {
+ buttonDiv.innerHTML = "<form action='{!URL!}/surfbar.php' target='_parent' method='GET'><input type='submit' class='member_submit' value='Surfbar erneut starten' /></form>";
+}
+
function Counter () {
if (counter == 0) {
- Restart();
+ if ($content[autostart] == true) {
+ Restart();
+ } else {
+ ShowButton();
+ }
+ window.clearInterval(interval);
} else {
counter--;
timer.innerHTML = counter;
}
function Init () {
- window.setInterval("Counter()", 1000);
+ interval = window.setInterval("Counter()", 1000);
timer.innerHTML = "$content[restart]";
}
window.setTimeout("Init()", 500);
-
//-->
-</script>
\ No newline at end of file
+</script>