}
// Do the member form request
-function SURFBAR_MEMBER_DO_FORM ($formData, $URLs) {
+function SURFBAR_MEMBER_DO_FORM ($formData, $urlArray) {
// By default no action is performed
$performed = false;
} elseif ((!isset($formData['id'])) || (!isset($formData['action']))) {
// Important form elements are missing!
return false;
- } elseif (!isset($URLs[$formData['id']])) {
+ } elseif (!isset($urlArray[$formData['id']])) {
// id not found in cache
return false;
- } elseif (!SURFBAR_VALIDATE_MEMBER_ACTION_STATUS($formData['action'], $URLs[$formData['id']]['url_status'])) {
+ } elseif (!SURFBAR_VALIDATE_MEMBER_ACTION_STATUS($formData['action'], $urlArray[$formData['id']]['url_status'])) {
// Action not allowed for current URL status
return false;
}
// Is the function there?
if (function_exists($functionName)) {
// Add new status
- $URLs[$formData['id']]['new_status'] = SURFBAR_GET_NEW_STATUS('new_status');
+ $urlArray[$formData['id']]['new_status'] = SURFBAR_GET_NEW_STATUS('new_status');
// Extract URL data for call-back
- $urlData = array(merge_array($URLs[$formData['id']], array($action => $formData)));
+ $urlData = array(merge_array($urlArray[$formData['id']], array($action => $formData)));
// Action found so execute it
$performed = call_user_func_array($functionName, $urlData);
function SURFBAR_MEMBER_RETREAT_ACTION ($urlData) {
// Create the data array for next function call
$data = array(
- $urlData['id'] => $urlData
+ $urlData['id'] => $urlData
);
// Simply change the status here
if ((time() - $userids['notified'][$userid]) >= getConfig('surfbar_low_interval')) {
// Prepare content
$content = array(
- 'userid' => $userid,
+ 'userid' => $userid,
'low' => translateComma(getConfig('surfbar_warn_low_points')),
'points' => translateComma($userids['points'][$userid]),
'notified' => generateDateTime($userids['notified'][$userid]),
FROM
`{?_MYSQL_PREFIX?}_surfbar_urls`
WHERE
- `%s`='%s'".$add."
+ `%s`='%s'" . $add . "
ORDER BY
`%s` %s
%s",
return false;
} // END - if
- // Translate status and limit
- $content['limit'] = translateSurfbarLimit($content['limit']);
-
// If in reg-mode we notify admin
if (($addMode == 'reg') || (getConfig('surfbar_notify_admin_unlock') == 'Y')) {
// Notify admin even when he as unlocked an email
// @TODO Can't we use our new expression language instead of this ugly code?
function SURFBAR_PREPARE_CONTENT_FOR_TEMPLATE ($content) {
// Prepare some code
- if (isset($content['url_status'])) $content['url_status'] = translateSurfbarUrlStatus($content['url_status']);
if (isset($content['url_registered'])) $content['url_registered'] = generateDateTime($content['url_registered'], 2);
if (isset($content['url_last_locked'])) $content['url_last_locked'] = generateDateTime($content['url_last_locked'], 2);
- if (isset($content['url_views_total'])) $content['url_views_total'] = translateComma($content['url_views_total']);
- if (isset($content['url_views_allowed'])) $content['url_views_allowed'] = translateComma($content['url_views_allowed']);
- if (isset($content['views_max'])) $content['views_max'] = translateComma($content['views_max']);
// Return translated content
return $content;
if (isGetRequestParameterSet('frame')) {
// Use the frame as a template name part... ;-)
$templateName = sprintf("surfbar_frame_%s",
- getRequestParameter('frame')
+ getRequestParameter('frame')
);
} // END - if
// Load all URLs of the current user and return it as an array
function SURFBAR_GET_USER_URLS () {
// Init array
- $URLs = array();
+ $urlArray = array();
// Begin the query
$result = SQL_QUERY_ESC("SELECT
// Load all rows
while ($row = SQL_FETCHARRAY($result)) {
// Add the row
- $URLs[$row['id']] = $row;
+ $urlArray[$row['id']] = $row;
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return the array
- return $URLs;
+ return $urlArray;
}
// "Getter" for member action array for given status
// Then take it
$data = $GLOBALS['surfbar_cache'][$element];
} else { // END - if
- print("<pre>");
+ print('<pre>');
print_r($GLOBALS['surfbar_cache']);
- print("</pre>");
- debug_report_bug();
+ print('</pre>');
+ debug_report_bug('Element ' . $element . ' not found.');
}
// Return result
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "element[$element]={$data}", false);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element[' . $element . ']=[' . gettype($data) . ']' . $data, false);
return $data;
}