UNIQUE INDEX `userid_url` (`url_userid`, `url`),
INDEX `status_userid` (`url_status`, `url_userid`),
INDEX (`url_package_id`)",
- 'Visitor add-on URLs');
+ 'Visitor add-on - URLs');
// Booking packages for members
addDropTableSql('surfbar_packages');
`package_points_reward` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`package_id`),
UNIQUE INDEX `package` (`package_reload`, `package_waiting`)",
- 'Booking packages');
+ 'Vistor-addon - booking packages');
// Reload locks
addDropTableSql('surfbar_locks');
PRIMARY KEY (`locks_id`),
UNIQUE INDEX `userid_url` (`locks_userid`, `locks_url_id`),
INDEX (`locks_url_id`)",
- 'Vistor-addon reload locks');
+ 'Vistor-addon - reload locks');
// Visitor add-on salts
addDropTableSql('surfbar_salts');
PRIMARY KEY (`salts_id`),
UNIQUE INDEX `salts_userid_url` (`salts_userid`, `salts_url_id`),
INDEX (`salts_url_id`)",
- 'Visitor add-on last used salts');
+ 'Visitor add-on - last used salts');
// Statistics
addDropTableSql('surfbar_stats');
PRIMARY KEY (`stats_id`),
UNIQUE INDEX `userid_url` (`stats_userid`, `stats_url_id`),
INDEX (`stats_url_id`)",
- 'Visitor add-on Statistics');
+ 'Visitor add-on - statistics');
// Member actions pending on status
addDropTableSql('surfbar_actions');
`actions_new_status` ENUM('PENDING', 'ACTIVE', 'LOCKED', 'STOPPED', 'REJECTED', 'DELETED', 'MIGRATED', 'DEPLETED') NULL DEFAULT NULL,
PRIMARY KEY (`actions_id`),
UNIQUE INDEX `status_action` (`actions_status`, `actions_action`)",
- 'Visitor add-on Member Actions');
+ 'Visitor add-on - Member Actions');
// Member actions
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_surfbar_actions` (`actions_status`, `actions_action`, `actions_new_status`) VALUES ('PENDING', 'RETREAT', 'DELETED')");
'ADMIN_ADD_SURFBAR_URL_TITLE' => "URL im Besuchertausch hinzufügen",
'ADMIN_LIST_SURFBAR_ACTIONS_TITLE' => "Mitglieder-Aktionen des Besuchertausches auflisten",
'ADMIN_EDIT_SURFBAR_ACTIONS_TITLE' => "Mitglieder-Aktionen ändern",
+ 'ADMIN_ADD_SURFBAR_PACKAGE_TITLE' => "Neues Buchungspaket hinzufügen",
// Admin submit buttons
'ADMIN_SURFBAR_EDIT_URL_SUBMIT' => "URLs ändern",
'ADMIN_SURFBAR_ADD_URL_SUBMIT' => "URL hinzufügen",
'ADMIN_EDIT_SURFBAR_ACTIONS_SUBMIT' => "Mitgliedsaktionen editieren",
'ADMIN_CHANGE_SURFBAR_ACTIONS_SUBMIT' => "Mitglieder-Aktionen ändern",
+ 'ADMIN_SURFBAR_ADD_PACKAGE_SUBMIT' => "Buchungspaket hinzufügen",
// General admin text
'ADMIN_ENTER_SURFBAR_URL' => "URL eingeben:",
'ADMIN_CHANGE_SURFBAR_ACTIONS_ACTION' => "Mitglieder-Aktion ändern:",
'ADMIN_CHANGE_SURFBAR_ACTIONS_NEW_STATUS' => "Neuen URL-Status ändern:",
'ADMIN_SURFBAR_ACTIONS_ID' => "Aktions-Id:",
+ 'ADMIN_SELECT_SURFBAR_PACKAGE_RELOAD' => "Reload-Sperre einstellen:",
+ 'ADMIN_SELECT_SURFBAR_PACKAGE_WAITING' => "Mindestverweildauer einstellen:",
+ 'ADMIN_ENTER_SURFBAR_PACKAGE_POINTS_COSTS' => "Kosten in {?POINTS?} pro Klick:",
+ 'ADMIN_ENTER_SURFBAR_PACKAGE_POINTS_REWARD' => "Vergütung in {?POINTS?} pro Klick:",
+ 'ADMIN_SURFBAR_PACKAGES_NO_SELECTIONS' => "Sie haben keine Auswahlen an Buchungspaketen gemacht.",
// Admin - surfbar packages
'ADMIN_SURFBAR_PACKAGES_404' => "Sie haben noch keine Buchungspakete erstellt. Solange können Ihre Mitglieder keine URLs im Besuchertausch buchen.",
$show = TRUE;
// Check for 'package_id' element
-if ((countRequestPost() > 0) && (!ifPostContainsSelections('package_id'))) {
+if (isFormSent('add')) {
+ // Add new entry
+ die('Unfinished!');
+} elseif ((countRequestPost() > 0) && (!ifPostContainsSelections('package_id'))) {
// Not found so output message
displayMessage('{--ADMIN_SURFBAR_PACKAGES_NO_SELECTIONS--}');
doGenericXmlTemplateCallback('admin_list_surfbar_packages');
// Load 'add' template
-loadTemplate('admin_add_surfbar_package');
+loadTemplate('admin_add_surfbar_package', FALSE, array(
+ 'surfbar_package_reload' => createTimeSelections(60, 'surfbar_package_reload', 'Dhms', 'center', FALSE, TRUE),
+ 'surfbar_package_waiting' => createTimeSelections(10, 'surfbar_package_reload', 'ms' , 'center', FALSE, TRUE),
+));
// [EOF]
?>
}
//
-function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'form_select') {
+function addSelectionBox ($type, $default, $prefix = '', $id = NULL, $class = 'form_select', $allSteps = FALSE) {
$OUT = '';
if ($type == 'yn') {
case 'mi': // Minutes
case 'se': // Seconds
- for ($idx = 0; $idx <= 59; $idx+=5) {
+ // Default is 5 minutes/seconds step
+ $step = 5;
+
+ // All steps?
+ if ($allSteps === TRUE) {
+ // Then all steps
+ $step = 1;
+ } // END - if
+
+ for ($idx = 0; $idx <= 59; $idx += $step) {
$padded = padLeftZero($idx, 2);
$OUT .= '<option value="' . $padded . '"';
if ($default == $padded) $OUT .= ' selected="selected"';
}
// Create selection box or array of splitted timestamp
-function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = FALSE) {
+function createTimeSelections ($timestamp, $prefix = '', $display = '', $align = 'center', $asArray = FALSE, $allSteps = FALSE) {
// Do not continue if ONE_DAY is absend
if (!isConfigEntrySet('ONE_DAY')) {
// Abort here
if (isInString($unit, $display) || (empty($display))) {
// Generate year selection
$OUT .= '<td align="center">';
- $OUT .= addSelectionBox($field, $data[$unit], $prefix, NULL, 'mini_select');
+ $OUT .= addSelectionBox($field, $data[$unit], $prefix, NULL, 'mini_select', $allSteps);
$OUT .= '</td>';
} else {
$OUT .= '<input type="hidden" name="' . $prefix . '_' . $field . '" value="0" />';
--- /dev/null
+<div align="center">
+{%form,formMethodPost=modules.php?module=admin&what=list_surfbar_packages%}
+<div class="table dashed">
+ <div class="table_header bottom">
+ <strong>{--ADMIN_ADD_SURFBAR_PACKAGE_TITLE--}</strong>
+ </div>
+
+ <div class="admin_input" align="center">
+ <label for="url">{--ADMIN_SELECT_SURFBAR_PACKAGE_RELOAD--}</label>
+ $content[surfbar_package_reload]
+ </div>
+
+ <div class="admin_input" align="center">
+ <label for="url">{--ADMIN_SELECT_SURFBAR_PACKAGE_WAITING--}</label>
+ $content[surfbar_package_waiting]
+ </div>
+
+ <div class="admin_input" align="center">
+ <label for="url">{--ADMIN_ENTER_SURFBAR_PACKAGE_POINTS_COSTS--}</label>
+ <input type="text" class="form_field" name="package_points_costs" size="10" maxlength="20" value="0" /> ({?POINTS?})
+ </div>
+
+ <div class="admin_input bottom" align="center">
+ <label for="url">{--ADMIN_ENTER_SURFBAR_PACKAGE_POINTS_REWARD--}</label>
+ <input type="text" class="form_field" name="package_points_reward" size="10" maxlength="20" value="0" /> ({?POINTS?})
+ </div>
+
+ <div align="center" class="table_footer">
+ <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" class="form_submit" name="add" value="{--ADMIN_SURFBAR_ADD_PACKAGE_SUBMIT--}" />
+ </div>
+</div>
+{%form_close%}
+</div>