} else {
// Log invalid request
DEBUG_LOG(__FUNCTION__, __LINE__, " action={$formData['action']},id={$formData['id']},function={$functionName}");
+ ADD_FATAL(sprintf("Invalid member action! action=%s,id=%s,function=%s", $formData['action'], $formData['id'], $functionName));
}
// Return status
// Fetch the new status if found
if ($isValid) {
+ // Load new status
list($SURFBAR_CACHE['new_status']) = SQL_FETCHROW($result);
} // END - if
// Member actions
// -----------------------------------------------------------------------------
//
-// Retreat an URL
+// Retreat a booked URL
function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) {
// Create the data array for next function call
$data = array(
// Simply change the status here
return SURFBAR_CHANGE_STATUS ($urlData['id'], $urlData['status'], $urlData['new_status'], $data);
}
+// Show edit form or do the changes
+function SURFBAR_MEMBER_EDIT_ACTION ($urlData) {
+ // Is the "execute" flag there?
+ if (isset($urlData['execute'])) {
+ // Execute the changes
+ return SURFBAR_MEMBER_EXECUTE_ACTION("edit", $urlData);
+ } // END - if
+
+ // Display form
+ return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("edit", $urlData);
+}
+// Show delete form or do the changes
+function SURFBAR_MEMBER_DELETE_ACTION ($urlData) {
+ // Is the "execute" flag there?
+ if (isset($urlData['execute'])) {
+ // Execute the changes
+ return SURFBAR_MEMBER_EXECUTE_ACTION("del", $urlData);
+ } // END - if
+
+ // Display form
+ return SURFBAR_MEMBER_DISPLAY_ACTION_FORM("del", $urlData);
+}
+// Display selected "action form"
+function SURFBAR_MEMBER_DISPLAY_ACTION_FORM ($action, $urlData) {
+ // Translate some data
+ $urlData['registered'] = MAKE_DATETIME($urlData['registered'], "2");
+ $urlData['views_total'] = TRANSLATE_COMMA($urlData['views_total']);
+
+ // Load the form and display it
+ LOAD_TEMPLATE(sprintf("member_surfbar_%s_action_form", $action), false, $urlData);
+
+ // All fine by default ... ;-)
+ return true;
+}
//
// -----------------------------------------------------------------------------
// Self-maintenance functions
// Set default translated status
$statusTranslated = "!".$constantName."!";
- // Generate eval() command
+ // Is the constant there?
if (defined($constantName)) {
- $eval = "\$statusTranslated = ".$constantName.";";
- eval($eval);
+ // Then get it's value
+ $statusTranslated = constant($constantName);
} // END - if
// Return result
global $_CONFIG;
// Get URL data for status comparison if missing
- if (count($data) == 0) {
+ if ((!is_array($data)) || (count($data) == 0)) {
+ // Fetch missing URL data
$data = SURFBAR_GET_URL_DATA($urlId);
} // END - if
// Update the status now
- // ---------------------- Commented out for debugging member actions! -----------------------
+ // ---------- Comment out for debugging/developing member actions! ---------
//SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_surfbar_urls SET status='%s' WHERE id=%s LIMIT 1",
// array($newStatus, bigintval($urlId)), __FILE__, __LINE__);
- // ---------------------- Commented out for debugging member actions! -----------------------
+ // ---------- Comment out for debugging/developing member actions! ---------
// Was that fine?
if (SQL_AFFECTEDROWS() != 1) {