// Shall we add numbers or strings?
if ('' . $val . '' == '' . $test . '') {
// Add numbers
- array_push($tableData, sprintf("`%s`=%s", $id, $test));
+ array_push($tableData, sprintf('`%s`=%s', $id, $test));
} elseif (is_null($val)) {
// Add NULL
- array_push($tableData, sprintf("`%s`=NULL", $id));
+ array_push($tableData, sprintf('`%s`=NULL', $id));
} else {
// Add strings
array_push($tableData, sprintf("`%s`='%s'", $id, trim($val)));
reportBug(__FUNCTION__, __LINE__, 'id=' . $id . ',row=' . $row . ',data=' . $data . ' - isAdmin()=false');
} elseif ($id <= 0) {
// Initiate backtrace
- reportBug(__FUNCTION__, __LINE__, sprintf("id is invalid: %s. row=%s, data=%s",
+ reportBug(__FUNCTION__, __LINE__, sprintf('id is invalid: %s. row=%s, data=%s',
$id,
$row,
$data
break;
default: // Unexpected action
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+ logDebugMessage(__FUNCTION__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok')));
displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
break;
} // END - switch
default:
// Any other kind will be logged
- $errorMessage = sprintf("Unknown return code %s from ifAdminLoginDataIsValid().", $ret);
+ $errorMessage = sprintf('Unknown return code %s from ifAdminLoginDataIsValid().', $ret);
logDebugMessage(__FUNCTION__, __LINE__, $errorMessage);
// Set this to have our error message displayed
// @TODO This may also be rewritten to include files
switch ($mode) {
default: // @TODO Unknown support mode
- logDebugMessage(__FILE__, __LINE__, sprintf("Unknown support mode %s detected. This part is under construction.", $mode));
+ logDebugMessage(__FILE__, __LINE__, sprintf('Unknown support mode %s detected. This part is under construction.', $mode));
$OUT .= '<div class="notice medium">{%message,ADMIN_UNKNOWN_SUPPORT_MODE=' . $mode . '%}</div>';
break;
} // END - switch
break;
default: // Unknown task type
- logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", $taskData['task_type']));
+ logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', $taskData['task_type']));
$OUT .= '<div class="notice medium">' . sprintf(getMessage('ADMIN_UNKNOWN_TASK_TYPE'), $taskData['task_type'], $taskId) . '</div>';
break;
}
} // END - foreach
} else {
// Unknown action
- reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r($postData, TRUE)));
+ reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=<pre>%s</pre>', print_r($postData, TRUE)));
}
// Update query
break;
default: // Unexpected action
- logDebugMessage(__FILE__, __LINE__, sprintf("Unsupported action %s detected.", postRequestElement('ok')));
+ logDebugMessage(__FILE__, __LINE__, sprintf('Unsupported action %s detected.', postRequestElement('ok')));
displayMessage('{%message,ADMIN_UNKNOWN_OKAY=' . postRequestElement('ok') . '%}');
break;
} // END - switch
);
if ((getRefPayout() == '0') && (postRequestElement('ref_payout') > 0)) {
// Update account's ref_payout for "must-confirm"
- addSql(sprintf("UPDATE
+ addSql(sprintf('UPDATE
`{?_MYSQL_PREFIX?}_user_data`
SET
`ref_payout`=(%s - `mails_confirmed`)
WHERE
- `mails_confirmed` < %s", $REF, $REF));
+ `mails_confirmed` < %s', $REF, $REF));
} elseif ((getRefPayout() > 0) && (postRequestElement('ref_payout') == '0')) {
// Update account's ref_payout for "not-must-confirm"
addSql("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_payout`=0 WHERE `ref_payout` > 0");
$content['warning_interval'] = createTimeSelections($content['warning_interval'], 'warning_interval', 'MWDh');
// Init variables here
- $TPL = sprintf("admin_edit_sponsor_%s", getRequestElement('do'));
+ $TPL = sprintf('admin_edit_sponsor_%s', getRequestElement('do'));
initSqls();
// Sponsor was found
// Add points to account
sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET `points_amount`=`points_amount`+%s WHERE `id`=%s LIMIT 1",
- array($points, bigintval(getRequestElement('id'))), __FILE__, __LINE__);
+ array(
+ $points,
+ bigintval(getRequestElement('id'))
+ ), __FILE__, __LINE__
+ );
// Remember points /reason for the template
$content['points'] = $points;
break;
default: // Unknown mode
- logDebugMessage(__FILE__, __LINE__, sprintf("Unknown mode %s detected.", getRequestElement('do')));
+ logDebugMessage(__FILE__, __LINE__, sprintf('Unknown mode %s detected.', getRequestElement('do')));
$message = '{%message,ADMIN_SPONSOR_INVALID_MODE=' . getRequestElement('do') . '%}';
break;
- }
+ } // END - switch
if (!empty($message)) {
// Output message
if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
// Only a specific mail shall be displayed
- $sql = sprintf("SELECT
+ $sql = sprintf('SELECT
`id`,
`sender`,
`subject`,
`{?_MYSQL_PREFIX?}_pool`
WHERE
`id`=%s
-LIMIT 1",
+LIMIT 1',
bigintval(getRequestElement('id'))
);
$WHO = '{--MAIL_ID--}' . ': ' . getRequestElement('id');
} elseif (isGetRequestElementSet('userid')) {
// All mails by a specific member shall be displayed
- $sql = sprintf("SELECT
+ $sql = sprintf('SELECT
`id`,
`sender`,
`subject`,
WHERE
`sender`=%s
ORDER BY
- `timestamp` DESC",
+ `timestamp` DESC',
bigintval(getRequestElement('userid'))
);
$WHO = '{--USER_ID--}' . ': ' . getRequestElement('userid');
break;
default: // Problem in application detected!
- reportBug(__FILE__, __LINE__, sprintf("Invalid email type %s detected.", $linkData['link_type']));
+ reportBug(__FILE__, __LINE__, sprintf('Invalid email type %s detected.', $linkData['link_type']));
break;
} // END - switch
$ADD = '';
if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) {
// Only show from current type handler
- $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id')));
+ $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id')));
// Overwrite type
$networkData['network_type_id'] = bigintval(postRequestElement('network_type_id'));
} // END - if
// Load all advert codes for given network
- $result = sqlQueryEscaped("SELECT
+ $result = sqlQueryEscaped('SELECT
`p`.`network_array_id`,
`t`.`network_type_id`,
`t`.`network_type_handler`,
`p`.`network_type_id`=`t`.`network_type_id`
WHERE
`p`.`network_id`=%s
- ".$ADD."
+ ' . $ADD . '
ORDER BY
`t`.`network_type_handler` ASC,
- `p`.`network_array_sort` ASC",
+ `p`.`network_array_sort` ASC',
array(
bigintval(getRequestElement('network_id'))
), __FILE__, __LINE__);
$ADD = '';
if ((isPostRequestElementSet('network_type_id')) && (!is_array(postRequestElement('network_type_id')))) {
// Only show from current type handler
- $ADD = sprintf(" AND `p`.`network_type_id`=%s", bigintval(postRequestElement('network_type_id')));
+ $ADD = sprintf(' AND `p`.`network_type_id`=%s', bigintval(postRequestElement('network_type_id')));
// Overwrite type id
$networkData['network_type_id'] = bigintval(postRequestElement('network_type_id'));
break;
default: // Unknown type
- logDebugMessage(__FILE__, __LINE__, sprintf("Unknown task type %s detected.", getRequestElement('type')));
+ logDebugMessage(__FILE__, __LINE__, sprintf('Unknown task type %s detected.', getRequestElement('type')));
displayMessage('{%message,ADMIN_TASK_UNKNOWN_MODE' . getRequestElement('type') . '%}');
break;
} // END - switch
} // END - foreach
} else {
// Unknown action performed
- reportBug(__FILE__, __LINE__, sprintf("Unknown task action performed. data=<pre>%s</pre>", print_r(postRequestArray(), TRUE)));
+ reportBug(__FILE__, __LINE__, sprintf('Unknown task action performed. data=<pre>%s</pre>', print_r(postRequestArray(), TRUE)));
}
// Update query
// List confirmation links from normal or bonus mails
if ((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'normal')) {
// SQL query for mail data
- $sql = sprintf("SELECT
+ $sql = sprintf('SELECT
`s`.`id`,
`p`.`sender`,
`p`.`subject`,
`p`.`id`=`s`.`pool_id`
WHERE
`s`.`pool_id`=%s
-LIMIT 1",
+LIMIT 1',
bigintval(getRequestElement('id'))
);
$DATA = getRequestElement('id');
} elseif (((isPostRequestElementSet('id')) && (isGetRequestElementSet('type')) && (postRequestElement('type') == 'bonus')) && (isExtensionActive('bonus'))) {
// SQL query for mail data (both ids are required for compatiblity to above normal mail
- $sql = sprintf("SELECT
+ $sql = sprintf('SELECT
`id`,
NULL AS `sender`,
`subject`,
`{?_MYSQL_PREFIX?}_bonus`
WHERE
`id`=%s
-LIMIT 1",
+LIMIT 1',
bigintval(getRequestElement('id'))
);
if (isPostRequestElementSet('theme')) {
// Check if theme is there
if (!ifThemeExists(postRequestElement('theme'))) {
- // Import theme
- $inc = sprintf("theme/%s/theme.php", sqlEscapeString(postRequestElement('theme')));
-
// Is the theme readable?
- if (isIncludeReadable($inc)) {
+ if (isThemeReadable(postRequestElement('theme'))) {
// Load the theme header file
- loadInclude($inc);
+ loadInclude(sprintf('theme/%s/theme.php', sqlEscapeString(postRequestElement('theme'))));
// Register it ith the exchange
sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_themes` (`theme_path`, `theme_active`, `theme_ver`, `theme_name`)