//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Entered!');
// Is the array there?
- if ((isSqlsValid()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == FALSE))) {
+ if ((ifSqlsRegistered()) && ((!isset($filterData['dry_run'])) || ($filterData['dry_run'] == FALSE))) {
// Run SQL commands
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, '- Found ' . countSqls() . ' queries to run.');
foreach (getSqls() as $mode => $sqls) {
outputHtml();
}
-// Prepares an SQL statement part for HTML mail and/or holiday dependency
-function FILTER_HTML_INCLUDE_USERS ($mode) {
- // Exclude no users by default
- $MORE = '';
-
- // HTML mail?
- if ($mode == 'html') {
- $MORE = " AND `html`='Y'";
- } // END - if
-
- if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
- // Add something for the holiday extension
- $MORE .= " AND `holiday_active`='N'";
- } // END - if
-
- // Return result
- return $MORE;
-}
-
// Filter for determining what/action/module
function FILTER_DETERMINE_WHAT_ACTION () {
// In installation phase we don't have what/action
// Filter for initializing ext-sql_patches
function FILTER_GENERATE_FILE_SECRET_HASH ($filterData) {
- // Transfer POINTS word
- if (isExtensionInstalledAndNewer('sql_patches', '0.0.3')) {
- // Okay, recent enough, so transfer the word for POINTS
- setConfigEntry('POINTS', getPointsWord());
+ // Is ext-sql_patches installed and transfer POINTS word?
+ if ((!isExtensionInstalled('sql_patches')) || (!isExtensionInstalledAndNewer('sql_patches', '0.9.0'))) {
+ // Extension ext-sql_patches is missing, so better abort here
+ return;
} // END - if
+ // Okay, recent enough, so transfer the word for POINTS
+ setConfigEntry('POINTS', getPointsWord());
+
// Init key
setConfigEntry('secret_key', '');
- // File hash fas generated so we can also file the secret file... hopefully.
- $hashFile = sprintf('%s%s.%s.cache', getPath(), getCachePath(), getFileHash());
+ // File hash was generated so we can also file the secret file... hopefully.
+ $hashFile = getGenericHashFileName();
// Read key from secret file
if ((getFileHash() == '') || (getMasterSalt() == '') || (getPassScramble() == '') || (!isFileReadable($hashFile))) {
// Maybe need setup of secret key!
loadIncludeOnce('inc/gen_sql_patches.php');
+
+ // Generate file name again
+ $hashFile = getGenericHashFileName();
} // END - if
// Test again
if ((getFileHash() != '') && (getMasterSalt() != '') && (getPassScramble() != '')) {
// Is the secret key file readable?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'hashFile=' . $hashFile);
if (isFileReadable($hashFile)) {
// Read file
setConfigEntry('secret_key', readFromFile($hashFile));
// Check required parameters
if ((isGetRequestElementSet('user')) && (isGetRequestElementSet('banner'))) {
// Update clicks counter...
- sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1",
+ sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `clicks`=`clicks`+1 WHERE `id`=%s LIMIT 1',
array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
// A line has been updated?
// Are all required parameters set
if ((isGetRequestElementSet('user')) && (isGetRequestElementSet('banner'))) {
// For later things... ;-)
- $result = sqlQueryEscaped("SELECT `url` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
+ $result = sqlQueryEscaped('SELECT `url` FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1',
array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
// Is there the banner?
$data = sqlFetchArray($result);
// Update counter
- sqlQueryEscaped("UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1",
+ sqlQueryEscaped('UPDATE `{?_MYSQL_PREFIX?}_refbanner` SET `counter`=`counter`+1 WHERE `id`=%s LIMIT 1',
array(bigintval(getRequestElement('banner'))), __FUNCTION__, __LINE__);
// Set header and ...
// Filter for adding hidden session id
function FILTER_ADD_INPUT_HIDDEN_SESSION_ID ($filterData) {
// Is a spider detected?
- if ((!isSpider()) && (!isSessionValid()) && ($filterData['__form_method'] == 'get')) {
+ if ((!isSpider()) && (!isValidSession()) && ($filterData['__form_method'] == 'get')) {
// No, then add the hidden field
$filterData['__replacer'] .= '<input type="hidden" name="' . session_name() . '" value="' . session_id() . '" />';
} // END - if