# Autodetect text files
* text=auto
-# Force the following filetypes to have unix eols, so Windows does not break them
-*.* text eol=lf
-
# Force images/fonts to be handled as binaries
*.jpg filter=lfs diff=lfs merge=lfs -text
*.jpeg filter=lfs diff=lfs merge=lfs -text
*.otf filter=lfs diff=lfs merge=lfs -text
*.z filter=lfs diff=lfs merge=lfs -text
*.docx filter=lfs diff=lfs merge=lfs -text
+
+# Force the following filetypes to have unix eols, so Windows does not break them
+*.* text eol=lf
//* DEBUG: */ debugOutput("userid=".$userid.",chk=".$chk." (".strlen($chk).'/'.strlen(getRequestElement('check')).'/'.sqlNumRows($result) . ')');
// Prepare content
-$content = array();
+$content = [];
// Is an entry there?
if (sqlNumRows($result) == 1) {
$result = mysql_query("SELECT ID,user,vorname,nachname,land,plz,strasse,ort,email,pwd,session,guthaben,refpunkte,bonuspunkte,extrapunkte,mailpunkte,mailsamtag,punkteabzug,geworbenvon,popuppunkte,jackpotpunkte,refpunkte1,refpunkte2,refpunkte3,refpunkte4,refpunkte5,refpunkte6,refpunkte7,refpunkte8,refpunkte9,refpunkte10,lastaction FROM mt_user ORDER BY ID")
or exit(__FILE__." (".__LINE__."): ".mysql_error());
while ($DATA = mysql_fetch_array($result)) {
- $data_k = array(); $data_v = array();
- $points_k = array(); $points_v = array();
+ $data_k = []; $data_v = [];
+ $points_k = []; $points_v = [];
foreach ($DATA as $key=>$value) {
if ((intval($key) == "0") && ($key != "0")) {
switch ($key) {
} // END - if
// Init array for footer navigation
- $enabledNavigations = array();
+ $enabledNavigations = [];
// "Detect" the 'tab' value
switch (postRequestElement('tab')) {
'message' => '{--INSTALLER_SAVE_CHANGES_FAILED--}',
// Don't set this to false, or else it will be returned as 'failed' but is saved
'is_saved' => TRUE,
- 'failed_fields' => array()
+ 'failed_fields' => []
);
// Init overall status
// Don't set this to false, or else it will be returned as 'failed' but is saved
'is_valid' => TRUE,
// Failed fields
- 'failed_fields' => array()
+ 'failed_fields' => []
);
// Init overall status and final output
// Add the function name and no attributes by default
$GLOBALS['__XML_CALLBACKS']['callbacks'][] = __FUNCTION__;
$GLOBALS['__XML_CALLBACKS']['functions'][__FUNCTION__][] = $attributes['VALUE'];
- $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = array();
+ $GLOBALS['__XML_ARGUMENTS'][__FUNCTION__] = [];
$GLOBALS['__COLUMN_INDEX'][__FUNCTION__] = 'column';
}
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_list'] = [];
}
// Handles the XML node 'database-column-list-entry'
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['callback_list'] = [];
}
// Handles the XML node 'callback-function-list-entry'
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list'] = [];
}
// Handles the XML node 'extra-parameter-list-entry'
} // END - if
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['time_columns'] = [];
}
// Handles the XML node 'time-columns-list-entry'
}
// Add the entry to the list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'][$attributes['VALUE']] = [];
}
// Handles the XML node 'status-change-list'
}
// Add the entry to the list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['status_list'] = [];
}
// Handles the XML node 'status-change-list-entry'
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_table'] = [];
// Add the entry to the array
addXmlValueToCallbackAttributes('data_table', $attributes);
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_type'] = [];
// Add the entry to the array
addXmlValueToCallbackAttributes('table_join_type', $attributes);
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['table_join_name'] = [];
// Add the entry to the array
addXmlValueToCallbackAttributes('table_join_name', $attributes);
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_left_table'] = [];
// Add the entry to the array
addXmlValueToCallbackAttributes('join_on_left_table', $attributes);
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_right_table'] = [];
// Add the entry to the array
addXmlValueToCallbackAttributes('join_on_right_table', $attributes);
}
// Init array
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['join_on_condition'] = [];
// Add the entry to the array
//die('<pre>'.print_r($attributes,true).'</pre>');
}
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['data_column_list'] = [];
}
// Handles the XML node 'select-data-from-list-entry'
}
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['where_select_list'] = [];
}
// Handles the XML node 'where-select-from-list-entry'
}
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['order_by_list'] = [];
}
// Handles the XML node 'order-by-list-entry'
}
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_callback_list'] = [];
}
// Handles the XML node 'column-callback-list-entry'
}
// Add an empty list
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['__EXTRA_PARAMETER'] = [];
}
// Handles the XML node 'callback-extra-parameter-list-entry'
if ((isset($attributes['TYPE'])) && ($attributes['TYPE'] == 'array')) {
// Another nested array
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'TYPE=' . $attributes['TYPE'] . ',element=' . $element);
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['VALUE'] . '_list'] = [];
} elseif (!empty($extraKey)) {
// Sub-array (one level only)
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ' - ANALYSING...');
// Numerical index
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$extraKey])] = $attributes['VALUE'];
} elseif (!empty($key)) {
// Add the entry
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',ALIAS[' . gettype($attributes['ALIAS']) . ']=' . $attributes['ALIAS'] . ',FUNCTION[' . gettype($attributes['FUNCTION']) . ']=' . $attributes['FUNCTION'] . ' - FUNCTION! (VALUE=' . $attributes['VALUE'] . ')');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
} elseif ((isset($attributes['NAME'])) && (isset($attributes['ALIAS']))) {
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',extraKey=' . $extraKey . ',TYPE=' . $attributes['TYPE'] . ',CONDITION[' . gettype($attributes['CONDITION']) . ']=' . $attributes['CONDITION'] . ',LOOK-FOR[' . gettype($attributes['LOOK-FOR']) . ']=' . $attributes['LOOK-FOR'] . ' - CONDITION! (VALUE=' . $attributes['VALUE'] . ')');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $array;
} elseif ((isset($attributes['CONDITION'])) && (isset($attributes['NAME']))) {
// COLUMN/VALUE detected
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN/VALUE!');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE'];
} elseif ((isset($attributes['COLUMN'])) && (isset($attributes['DATA']))) {
// COLUMN/DATA detected
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',DATA[' . gettype($attributes['DATA']) . ']=' . $attributes['DATA'] . ',COLUMN[' . gettype($attributes['COLUMN']) . ']=' . $attributes['COLUMN'] . ' - COLUMN/DATA!');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][$attributes['COLUMN']])] = $attributes['VALUE'];
} elseif (((!isset($attributes['NAME'])) || (trim($attributes['NAME']) == '')) && (isset($attributes['VALUE']))) {
// Numerical index
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'element=' . $element . ',VALUE[' . gettype($attributes['VALUE']) . ']=' . $attributes['VALUE'] . ' - NUMERICAL!');
if (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])) {
- $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = array();
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element] = [];
} // END - if
$GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element][count($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction'][$element])] = $attributes['VALUE'];
} elseif ((count($attributes) == 1) && (isset($attributes['TYPE']))) {
public $pointer = FALSE;
// Data array from cache
- public $data = array();
+ public $data = [];
// Version data from cache
- public $version = array();
+ public $version = [];
// Cache name
public $name = '';
- public $rebuilt = array();
+ public $rebuilt = [];
// File extension
public $extension = '';
- public $status = array();
- public $readable = array();
+ public $status = [];
+ public $readable = [];
public $fullPath = '';
// Constructor
}
// Always return an empty array if we have trouble or no data
- return array();
+ return [];
}
// Destroy an existing cache file
// Getter for whole $GLOBALS['config'] array
function getConfigArray () {
// Default is null
- $return = array();
+ $return = [];
// Is the config set?
if (isset($GLOBALS['config'])) {
$oldConfig = explode(PHP_EOL, readFromFile(getPath() . 'inc/config.php'));
// Now, analyze every entry
- $done = array();
+ $done = [];
foreach ($oldConfig as $line) {
// Check all watch lines
foreach ($watchLines as $old => $new) {
// "Getter" for configuration entries
function getConfigEntries ($configEntries, $value) {
// Init content
- $content = array();
+ $content = [];
// "Walk" through all entries
foreach ($configEntries as $entry) {
// Fix missing 'last_online' array, damn stupid code :(((
// @TODO Try to rewrite this to one or more functions
if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) {
- $GLOBALS['last_online'] = array();
+ $GLOBALS['last_online'] = [];
} // END - if
// Is the cache entry there?
}
// Generates an option list from various parameters
-function generateOptions ($table, $key, $value, $default = '', $extra = '', $whereStatement = '', $disabled = array(), $callback = '', $allowNone = FALSE) {
+function generateOptions ($table, $key, $value, $default = '', $extra = '', $whereStatement = '', $disabled = [], $callback = '', $allowNone = FALSE) {
$ret = '';
// Allow none?
// Initialize array...
$categories = array(
- 'id' => array(),
- 'name' => array(),
- 'userids' => array()
+ 'id' => [],
+ 'name' => [],
+ 'userids' => []
);
// Get categories
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
// Now load all userids for one big query!
- $userids = array();
+ $userids = [];
while ($data = sqlFetchArray($result)) {
// By default reduce and found no emails
$num = 0;
}
// List all given joined rows (callback function from XML)
-function doGenericJoinedListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $tableJoinType, $tableJoinName, $joinOnLeftTable, $joinOnCondition, $joinOnRightTable, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array(), $content = array()) {
+function doGenericJoinedListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $tableJoinType, $tableJoinName, $joinOnLeftTable, $joinOnCondition, $joinOnRightTable, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = [], $conditions = [], $content = []) {
// Verify that tableName and columns are not empty
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// List all given rows (callback function from XML)
-function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array(), $content = array()) {
+function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = [], $conditions = [], $content = []) {
// Verify that tableName and columns are not empty
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Do the listing of entries
-function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array(), $content = array()) {
+function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = [], $content = []) {
// Run the SQL query
$result = sqlQuery($sql, __FUNCTION__, __LINE__);
// Call the callback-function
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=<pre>'.print_r($args, TRUE).'</pre>');
- // @TODO If the EL sub-system can support more than one parameter, this call_user_func_array() can be avoided
+ // @TODO If the EL sub-system can support more than one parameter, this call_user_func_[] can be avoided
$row[$columnName] = call_user_func_array($callbackName, $args);
} // END - foreach
}
// Adds a given entry to the database
-function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
+function doGenericAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) {
//* DEBUG: */ die(__FUNCTION__.':columns=<pre>'.print_r($columns,TRUE).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,TRUE).'</pre>,extraValues=<pre>'.print_r($extraValues,TRUE).'</pre>,timeColumns=<pre>'.print_r($timeColumns,TRUE).'</pre>,columnIndex=<pre>'.print_r($columnIndex,TRUE).'</pre>,POST=<pre>'.print_r($_POST,TRUE).'</pre>');
// Verify that tableName and columns are not empty
if ((!is_array($tableName)) || (count($tableName) != 1)) {
}
// Init columns and value elements
- $sqlColumns = array();
- $sqlValues = array();
+ $sqlColumns = [];
+ $sqlValues = [];
// Default is that all went fine
$GLOBALS['__XML_PARSE_RESULT'] = TRUE;
$search = key(search_array($columns, 'column', $columnName));
// Try to handle call-back functions and/or extra values on the list
- //* DEBUG: */ outputHtml($key . '/' . $columnName . '=<pre>'.print_r($columns,true).'</pre>search_array()=<pre>'.print_r(search_array($columns, 'column', $columnName), TRUE).'</pre>');
+ //* DEBUG: */ outputHtml($key . '/' . $columnName . '=<pre>'.print_r($columns,true).'</pre>search_[]=<pre>'.print_r(search_array($columns, 'column', $columnName), TRUE).'</pre>');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '(' . gettype($key) . ')][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
if (is_string($key)) {
// Key is a string
}
// Edit rows by given id numbers
-function doGenericEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $subject = '') {
+function doGenericEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $subject = '') {
// Is there "time columns"?
if (isFilledArray($timeColumns)) {
// Then "walk" through all entries
$id = bigintval($id);
// Prepare content array (new values)
- $content = array();
+ $content = [];
// Prepare SQL for this row
$sql = sprintf('UPDATE `{?_MYSQL_PREFIX?}_%s` SET',
}
// Delete rows by given id numbers
-function doGenericDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array()) {
+function doGenericDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = []) {
// The base SQL command:
$sql = "DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_%s` WHERE `%s` IN (%s)";
// Build a special template list
// @TODO cacheFiles is not yet supported
-function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) {
+function doGenericListBuilder ($prefix, $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) {
// $tableName and $idColumn must bove be arrays!
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// $tableName is no array
);
// Init array
- $rows = array();
+ $rows = [];
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
}
// Send notification to admin
-function sendAdminNotification ($subject, $templateName, $content = array(), $userid = NULL) {
+function sendAdminNotification ($subject, $templateName, $content = [], $userid = NULL) {
if ((isExtensionInstalledAndNewer('admins', '0.4.1')) && (function_exists('sendAdminsEmails'))) {
// Send new way
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'admins=Y,subject=' . $subject . ',templateName=' . $templateName . ' - OKAY!');
function addExtensionNotes ($ext_ver) {
// Init notes/content
$out = '';
- $content = array();
+ $content = [];
// Is do we have verbose output enabled?
if ((!isExtensionActive('sql_patches')) || (isVerboseSqlEnabled())) {
// Getter for CSS files array
function getExtensionCssFiles () {
// By default no additional CSS files are found
- $cssFiles = array();
+ $cssFiles = [];
// Is the array there?
if (isset($GLOBALS['css_files'])) {
// Init CSS files array
function initExtensionCssFiles () {
// Simply init it
- $GLOBALS['css_files'] = array();
+ $GLOBALS['css_files'] = [];
}
// Add new entry
// Init array
if ((!isset($GLOBALS['ext_running_updates'][getCurrentExtensionName()])) || (!is_array($GLOBALS['ext_running_updates'][getCurrentExtensionName()]))) {
- $GLOBALS['ext_running_updates'][getCurrentExtensionName()] = array();
+ $GLOBALS['ext_running_updates'][getCurrentExtensionName()] = [];
} // END - if
// Remember it in the list of running updates
reportBug(__FUNCTION__, __LINE__, '() is called twice: currName=' . getCurrentExtensionName());
} // END - if
- $GLOBALS['ext_update_depends'][getCurrentExtensionName()] = array();
+ $GLOBALS['ext_update_depends'][getCurrentExtensionName()] = [];
// Init running updates array
initExtensionRuningUpdates();
function initExtensionRuningUpdates () {
// Auto-init ext_running_updates
if (!isset($GLOBALS['ext_running_updates'])) {
- $GLOBALS['ext_running_updates'] = array();
- $GLOBALS['ext_register_running'] = array();
+ $GLOBALS['ext_running_updates'] = [];
+ $GLOBALS['ext_register_running'] = [];
} // END - if
}
// Auto-init the array or if forced
if (($force === TRUE) || (!isset($GLOBALS['ext_sqls'][getCurrentExtensionName()]))) {
// Set the array
- $GLOBALS['ext_sqls'][getCurrentExtensionName()] = array();
+ $GLOBALS['ext_sqls'][getCurrentExtensionName()] = [];
// Initialize the generic array
initSqls();
// Is is the array there?
if ((!isset($GLOBALS['ext_sqls'][$currentName][$currentVersion])) || (!is_array($GLOBALS['ext_sqls'][$currentName][$currentVersion]))) {
// Init array
- $GLOBALS['ext_sqls'][$currentName][$currentVersion] = array();
+ $GLOBALS['ext_sqls'][$currentName][$currentVersion] = [];
} // END - if
// Is the SQL statement empty?
// Is the remove list there?
if (!isset($GLOBALS['ext_update_remove'])) {
// Then create it
- $GLOBALS['ext_update_remove'] = array();
+ $GLOBALS['ext_update_remove'] = [];
} // END - if
}
case 'init': // Do stuff when extension is initialized
// Init array
- $GLOBALS['wernis_data'] = array();
+ $GLOBALS['wernis_data'] = [];
break;
default: // Unknown extension mode
// Init dummy array
$filterArray = array(
- 'chains' => array(),
- 'loaded' => array(),
- 'counter' => array()
+ 'chains' => [],
+ 'loaded' => [],
+ 'counter' => []
);
// Found in cache so rewrite the array
}
// Filter to add exclusion SQL for configured userid
-function FILTER_EXCLUDE_BEG_USERID ($filterData = array()) {
+function FILTER_EXCLUDE_BEG_USERID ($filterData = []) {
// Is it valid?
if (isValidId(getBegUserid())) {
// Exclude it
}
// Filter to add exclusion SQL for configured userid
-function FILTER_EXLCUDE_BONUS_USERID ($filterData = array()) {
+function FILTER_EXLCUDE_BONUS_USERID ($filterData = []) {
// Is it valid?
if (isValidId(getBonusUserid())) {
// Exclude it
} // END - if
// Filter to add exclusion SQL for configured userid
-function FILTER_EXLCUDE_DOUBLER_USERID ($filterData = array()) {
+function FILTER_EXLCUDE_DOUBLER_USERID ($filterData = []) {
// Is it valid?
if (isValidId(getDoublerUserid())) {
// Exclude it
function FILTER_UPDATE_LOGIN_DATA () {
// Add missing array
if ((!isset($GLOBALS['last_online'])) || (!is_array($GLOBALS['last_online']))) {
- $GLOBALS['last_online'] = array();
+ $GLOBALS['last_online'] = [];
} // END - if
// Recheck if logged in
}
// Filter to exclude default referral id
-function FILTER_EXCLUDE_DEFAULT_REFID ($filterData = array()) {
+function FILTER_EXCLUDE_DEFAULT_REFID ($filterData = []) {
// Is it valid?
if (isValidId(getDefRefid())) {
// Exclude it
array($menu), __FILE__, __LINE__);
// Init array
- $menus = array();
+ $menus = [];
// Load all entries
while ($entry = sqlFetchArray($result)) {
// Loads additional libraries
function loadLibraries () {
// Init arrays
- $__functions = array();
+ $__functions = [];
$__libs = array(
'stats',
'xml',
// Init fatal message array
function initFatalMessages () {
- $GLOBALS['fatal_messages'] = array();
+ $GLOBALS['fatal_messages'] = [];
}
// Getter for whole fatal error messages
}
// Generate a password in a specified length or use default password length
-function generatePassword ($length = '0', $exclude = array()) {
+function generatePassword ($length = '0', $exclude = []) {
// Auto-fix invalid length of zero
if ($length == '0') {
$length = getMinPasswordLength();
// Generated a "string" for scrambling
function genScrambleString ($len) {
// Prepare array for the numbers
- $scrambleNumbers = array();
+ $scrambleNumbers = [];
// First we need to setup randomized numbers from 0 to 31
for ($idx = 0; $idx < $len; $idx++) {
foreach ($backtraceArray as $key => $trace) {
if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
if (!isset($trace['line'])) $trace['line'] = __LINE__;
- if (!isset($trace['args'])) $trace['args'] = array();
+ if (!isset($trace['args'])) $trace['args'] = [];
$backtrace .= '<li class="debug_list"><span class="backtrace_file">' . basename($trace['file']) . '</span>:' . $trace['line'] . ', <span class="backtrace_function">' . $trace['function'] . '(' . count($trace['args']) . ')</span></li>';
} // END - foreach
foreach ($backtraceArray as $key => $trace) {
if (!isset($trace['file'])) $trace['file'] = __FUNCTION__;
if (!isset($trace['line'])) $trace['line'] = __LINE__;
- if (!isset($trace['args'])) $trace['args'] = array();
+ if (!isset($trace['args'])) $trace['args'] = [];
$backtrace .= ($key+1) . '.:' . basename($trace['file']) . ':' . $trace['line'] . ', ' . $trace['function'] . '(' . count($trace['args']) . ")\n";
} // END - foreach
* @param $withPrefixSuffix Whether to include prefix/suffix in found entries
* @return $foundMatches All found positive matches for above criteria
*/
-function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $addBaseDir = TRUE, $excludeArray = array(), $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = TRUE, $suffix = '', $withPrefixSuffix = TRUE) {
+function getArrayFromDirectory ($baseDir, $prefix, $fileIncludeDirs = FALSE, $addBaseDir = TRUE, $excludeArray = [], $extension = '.php', $excludePattern = '@(\.|\.\.)$@', $recursive = TRUE, $suffix = '', $withPrefixSuffix = TRUE) {
// Add default entries we should always exclude
array_unshift($excludeArray, '.', '..', '.svn', '.htaccess');
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'baseDir=' . $baseDir . ',prefix=' . $prefix . ' - Entered!');
// Init found includes
- $foundMatches = array();
+ $foundMatches = [];
// Open directory
$dirPointer = opendir(getPath() . $baseDir) or reportBug(__FUNCTION__, __LINE__, 'Cannot read directory ' . basename($baseDir) . '.');
// explode(), but appending the delimiter again
function stringToArray ($delimiter, $string) {
// Init array
- $strArray = array();
+ $strArray = [];
// "Walk" through all entries
foreach (explode($delimiter, $string) as $split) {
// Searches given array for a sub-string match and returns all found keys in an array
function getArrayKeysFromSubStrArray ($heystack, $needles, $offset = 0) {
// Init array for all found keys
- $keys = array();
+ $keys = [];
// Now check all entries
foreach ($needles as $key => $needle) {
}
// Adds a given entry to the database
-function memberAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
+function memberAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) {
// Is it a member?
if (!isMember()) {
// Then abort here
}
// Edit rows by given id numbers
-function memberEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
+function memberEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Delete rows by given id numbers
-function memberDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
+function memberDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
// Do this only for members
assert(isMember());
// Build a special template list
// @TODO cacheFiles is not yet supported
-function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) {
+function memberListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) {
// Do this only for logged in member
assert(isMember());
assert(isset($array[0][$key]));
// Init new array
- $newArray = array();
+ $newArray = [];
// "Walk" through all elements
foreach ($array as $element) {
// Initialize HTTP handling
function initHttp () {
// Initialize array
- $GLOBALS['http_header'] = array();
+ $GLOBALS['http_header'] = [];
}
// Sends out all headers required for HTTP/1.1 reply
}
// Generates the full GET URL from given base URL and data array
-function generateGetUrlFromBaseUrlData ($baseUrl, $requestData = array()) {
+function generateGetUrlFromBaseUrlData ($baseUrl, $requestData = []) {
// Init URL
$getUrl = $baseUrl;
}
// Sends a HTTP request (GET, POST, HEAD are currently supported)
-function sendHttpRequest ($requestType, $baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
+function sendHttpRequest ($requestType, $baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
// Init response
- $response = array();
+ $response = [];
// Start "detecting" the request type
switch ($requestType) {
}
// Sends a HEAD request
-function sendHttpHeadRequest ($baseUrl, $requestData = array(), $allowOnlyHttpOkay = TRUE) {
+function sendHttpHeadRequest ($baseUrl, $requestData = [], $allowOnlyHttpOkay = TRUE) {
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getUrl=' . $getUrl);
}
// Send a GET request
-function sendHttpGetRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
+function sendHttpGetRequest ($baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
// Generate full GET URL
$getUrl = generateGetUrlFromBaseUrlData($baseUrl, $requestData);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getUrl=' . $getUrl);
}
// Send a POST request, sometimes even POST requests have no parameters
-function sendHttpPostRequest ($baseUrl, $requestData = array(), $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
+function sendHttpPostRequest ($baseUrl, $requestData = [], $removeHeader = FALSE, $allowOnlyHttpOkay = TRUE) {
// Copy baseUrl to getUrl
$getUrl = $baseUrl;
$port = 80;
// Initialize array
- $response = array();
+ $response = [];
// Default is non-broken HTTP server implementation
$GLOBALS['is_http_server_broken'] = FALSE;
// Removes HTTP header lines from a response array (e.g. output from send<Get|Post>Request() )
function removeHttpHeaderFromResponse ($response) {
// Save headers for later usage
- $GLOBALS['http_headers'] = array();
+ $GLOBALS['http_headers'] = [];
// The first array element has to contain HTTP
if ((isset($response[0])) && (substr(strtoupper($response[0]), 0, 5) == 'HTTP/')) {
} // END - foreach
// Mark them as flushed
- $GLOBALS['http_header'] = array();
+ $GLOBALS['http_header'] = [];
}
//-----------------------------------------------------------------------------
if (!function_exists('http_build_query')) {
// Taken from documentation on www.php.net, credits to Marco K. (Germany) and some light mods by R.Haeder
function http_build_query($requestData, $prefix = '', $sep = '', $key = '') {
- $ret = array();
+ $ret = [];
foreach ((array) $requestData as $k => $v) {
if (is_int($k) && !is_null($prefix)) {
$k = urlencode($prefix . $k);
// Init INC_POOL
function initIncludePool ($poolName) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'poolName=' . $poolName);
- $GLOBALS['inc_pool'][$poolName] = array();
+ $GLOBALS['inc_pool'][$poolName] = [];
}
// Setter for INC_POOL
function getIncludePool ($poolName) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'poolName=' . $poolName);
// Default is empty pool
- $poolArray = array();
+ $poolArray = [];
// Is it set?
if (isset($GLOBALS['inc_pool'][$poolName])) {
}
// Adds a given template with content to install output stream
-function addTemplateToInstallContent ($template, $content = array()) {
+function addTemplateToInstallContent ($template, $content = []) {
// Load the template
$out = loadTemplate($template, TRUE, $content);
// Generate an option list for database extensions for given default value
function generateInstallerDatabaseExtensionOptions () {
// Init all arrays
- $keys = array();
- $values = array();
- $foundExtensions = array();
+ $keys = [];
+ $values = [];
+ $foundExtensions = [];
// Scan directory
$drivers = getArrayFromDirectory('inc/db/', 'lib-', FALSE, FALSE);
// Init 'tab-specific error message'
$GLOBALS['installer_post_error'][$currentTab] = '';
- $GLOBALS['installer_failed_fields'][$currentTab] = array();
+ $GLOBALS['installer_failed_fields'][$currentTab] = [];
// Debug message
//* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Calling function ' . $callbackName . ',currentTab=' . $currentTab . ',saveStatus[status]=' . $saveStatus['status']);
setConfigEntry('timezone', 'Europe/Berlin');
// Init some things
-FILTER_INIT_TIMEZONE(array());
+FILTER_INIT_TIMEZONE([]);
FILTER_INIT_RANDOMIZER();
FILTER_INIT_RANDOM_NUMBER();
// Init variables
-$GLOBALS['install_mysql'] = array();
+$GLOBALS['install_mysql'] = [];
if ((isPostRequestElementSet('mysql')) && (ifPostContainsSelections('mysql'))) {
// Transfer 'mysql' array
$GLOBALS['install_mysql'] = postRequestElement('mysql');
// Init messages
function initMessages () {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'getLanguage()=' . getLanguage());
- $GLOBALS['messages'][getLanguage()] = array();
+ $GLOBALS['messages'][getLanguage()] = [];
}
// Add messages
// Compares two language files
function ifLanguageFilesCompares ($source, $target, $targetLanguage) {
// Init differences
- $GLOBALS['lang_diff'][$target] = array();
+ $GLOBALS['lang_diff'][$target] = [];
$GLOBALS['lang_diff_count'][$target] = 0;
if (!isset($GLOBALS['lang_diff_count']['total'])) {
$GLOBALS['lang_diff_count']['total'] = 0;
// Backup current messages/language
$backupLang = getCurrentLanguage();
$messages[$backupLang] = $GLOBALS['messages'][$backupLang];
- $GLOBALS['messages'][$backupLang] = array();
+ $GLOBALS['messages'][$backupLang] = [];
// Both are readable so include current language file
$GLOBALS['count'] = FALSE;
// Is there an array?
if (!isset($GLOBALS['messages'][$targetLanguage])) {
// Then create it to avoid notice
- $GLOBALS['messages'][$targetLanguage] = array();
+ $GLOBALS['messages'][$targetLanguage] = [];
$GLOBALS['msg_count'][$targetLanguage] = 0;
} // END - if
} else {
// Load admin ids...
// @TODO This can be, somehow, rewritten
- $adminIds = array();
+ $adminIds = [];
while ($content = sqlFetchArray($result)) {
array_push($adminIds, $content['admin_id']);
} // END - while
// Init variables
$self = FALSE;
$OUT = '';
- $GLOBALS['ranking_content'] = array();
+ $GLOBALS['ranking_content'] = [];
// Clear rankings by default
$GLOBALS['ranking_content']['rankings'] = '';
'TEXTLINK',
'POPUP',
),
- array(),
+ [],
$type,
'', '',
- array(),
+ [],
'translateForcedAdsType'
);
} // END - if
'SPONSOR',
'NONE'
),
- array(),
+ [],
$visibility,
'', '',
- array(),
+ [],
'translateForcedCostsVisibility'
);
} // END - if
// "Getter" for an array of all given forced ads
function getArrayFromForcedAdsByType ($forcedType = NULL) {
// Init array
- $forcedAds = array();
+ $forcedAds = [];
// Init WHERE (default)
$where = '';
// "Getter" for an array of all forced costs from given visibility or all
function getArrayFromForcedCostsByVisibility ($visibility = NULL) {
// Init array
- $forcedCosts = array();
+ $forcedCosts = [];
$where = '';
// Is visibility not NULL?
// "Getter" for an array of all forced campaigns from given array and status
function getArrayFromForcedCampaignsByArray ($ids, $status) {
// Init array
- $forcedCampaigns = array();
+ $forcedCampaigns = [];
// Search all given types
$result = sqlQueryEscaped("SELECT
// Template helper function to create selection box for all forced-ad types
function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = FALSE, $default = NULL) {
// Add all types through the filter
- $forcedAdTypes = runFilterChain('add_forced_ads_types', array());
+ $forcedAdTypes = runFilterChain('add_forced_ads_types', []);
// Handle it over to generateSelectionBoxFromArray()
$content = generateSelectionBoxFromArray($forcedAdTypes, 'forced_ads_type', 'type', '', '', '', $default);
$grades = getArrayFromTable('grade_data', array('grade_id', 'grade_name'), 'grade_id');
// Init entries arrays
- $gradeKeys = array();
- $gradeValues = array();
+ $gradeKeys = [];
+ $gradeValues = [];
// Load all entries
foreach ($grades as $grade) {
$defaultId,
'',
'',
- array(),
+ [],
'',
TRUE,
FALSE
$grades = getArrayFromTable('grade_data', array('grade_id', 'grade_name'), 'grade_id', 'ASC', $whereStatement);
// Init entries arrays
- $gradeKeys = array();
- $gradeValues = array();
+ $gradeKeys = [];
+ $gradeValues = [];
// Are there entries?
foreach ($grades as $grade) {
$test = $text;
// ... what will the email address be out the @... ;-)
- $PARTS = array();
+ $PARTS = [];
while (isInString('@', $test)) {
$pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
} // END - if
// Init global arrays
- $GLOBALS['network_types_disabled'] = array();
+ $GLOBALS['network_types_disabled'] = [];
// Call-back the method handling our request
call_user_func($functionName);
// Is it cached?
if (!isset($GLOBALS['network_data'][$networkId])) {
// By default there is no data
- $GLOBALS['network_data'][$networkId] = array();
+ $GLOBALS['network_data'][$networkId] = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
// Is it cached?
if (!isset($GLOBALS['network_type_data'][$networkTypeId])) {
// By default there is no data
- $GLOBALS['network_type_data'][$networkTypeId] = array();
+ $GLOBALS['network_type_data'][$networkTypeId] = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
// Is it set?
if (!isset($GLOBALS['network_type_data'][$networkTypeId])) {
// By default there is no data
- $GLOBALS['network_type_data'][$networkTypeId] = array();
+ $GLOBALS['network_type_data'][$networkTypeId] = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
// Is it set?
if (!isset($GLOBALS['network_types'][$networkId])) {
// By default there is no data
- $GLOBALS['network_types'][$networkId] = array();
+ $GLOBALS['network_types'][$networkId] = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
} // END - if
// By default there is no data
- $networkRequestData = array();
+ $networkRequestData = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
} // END - if
// By default there is no data
- $networkTranslationData = array();
+ $networkTranslationData = [];
// Query for the network data
$result = sqlQueryEscaped('SELECT
// Is it cached?
if (!isset($GLOBALS['network_request_parameters'][$networkTypeId])) {
// By default there is no data
- $GLOBALS['network_request_parameters'][$networkTypeId] = array();
+ $GLOBALS['network_request_parameters'][$networkTypeId] = [];
// Search for all
$result = sqlQueryEscaped('SELECT
// Is it cached?
if (!isset($GLOBALS['network_full_config'][$networkTypeId])) {
// By default there is no data
- $GLOBALS['network_full_config'][$networkTypeId] = array();
+ $GLOBALS['network_full_config'][$networkTypeId] = [];
// Search for all
$result = sqlQueryEscaped('SELECT
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
// List all entries
- $rows = array();
+ $rows = [];
while ($row = sqlFetchArray($result)) {
// Is this valid, then add it
if ((is_array($row)) && (isset($row['network_id']))) {
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
// List all entries
- $rows = array();
+ $rows = [];
while ($row = sqlFetchArray($result)) {
// Is this valid, then add it
if ((is_array($row)) && (isset($row['network_type_id']))) {
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
// List all entries
- $rows = array();
+ $rows = [];
while ($row = sqlFetchArray($result)) {
// Is this valid, then add it
if ((is_array($row)) && (isset($row['network_type_id']))) {
'signature_click',
'signature_view',
),
- array(),
+ [],
$defaultType,
'', '',
$GLOBALS['network_types_disabled'],
'NONE',
'BASE64',
),
- array(),
+ [],
$defaultEncoding,
'', '',
- array(),
+ [],
'translateNetworkTextEncoding'
);
} // END - if
'extra',
'country'
),
- array(),
+ [],
'',
'', '',
$GLOBALS['network_request_params_disabled'],
// Is there cache?
if (!isset($GLOBALS['network_array_index'])) {
// Get an array of all API array indexes
- $GLOBALS['network_array_index'] = array();
+ $GLOBALS['network_array_index'] = [];
// Get all entries
$result = sqlQuery('SELECT
} // END - if
// Just call our inner method
- return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), array(), FALSE, FALSE);
+ return adminSaveSettings($networkData, '_network_data', sprintf("`network_id`=%s", bigintval($networkId)), [], FALSE, FALSE);
}
// Updates given network type handler (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), array(), FALSE, FALSE);
+ return adminSaveSettings($networkTypeData, '_network_types', sprintf("`network_type_id`=%s", bigintval($networkTypeId)), [], FALSE, FALSE);
}
// Updates given network request parameters (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), array(), FALSE, FALSE);
+ return adminSaveSettings($networkParamsData, '_network_request_params', sprintf("`network_request_param_id`=%s", bigintval($networkParamsId)), [], FALSE, FALSE);
}
// Updates given network array translations (id) with data from array
} // END - if
// Just call our inner method
- return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), array(), FALSE, FALSE);
+ return adminSaveSettings($networkTranslationsData, '_network_array_translation', sprintf("`network_array_id`=%s", bigintval($networkTranslationsId)), [], FALSE, FALSE);
}
//------------------------------------------------------------------------------
// Is there selections?
if (ifPostContainsSelections()) {
// Init cache array
- $GLOBALS['network_request_params_disabled'] = array();
+ $GLOBALS['network_request_params_disabled'] = [];
// Load network data
$networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Update this entry?
if ($sel == 1) {
// Init data array
- $networkData = array();
+ $networkData = [];
// Transfer whole array, except 'sel'
foreach (postRequestArray() as $key => $entry) {
// Update this entry?
if ($sel == 1) {
// Init data array
- $networkTypeData = array();
+ $networkTypeData = [];
// Transfer whole array, except 'sel'
foreach (postRequestArray() as $key => $entry) {
// Update this entry?
if ($sel == 1) {
// Init data array
- $networkParamsData = array();
+ $networkParamsData = [];
// Transfer whole array, except 'sel'
foreach (postRequestArray() as $key => $entry) {
// Update this entry?
if ($sel == 1) {
// Init data array
- $networkTranslationsData = array();
+ $networkTranslationsData = [];
// Transfer whole array, except 'sel'
foreach (postRequestArray() as $key => $entry) {
// Is there selections?
if (ifPostContainsSelections()) {
// Init cache array
- $GLOBALS['network_array_translation_disabled'] = array();
+ $GLOBALS['network_array_translation_disabled'] = [];
// Load network data
$networkData = getNetworkDataFromId(getRequestElement('network_id'));
* keys, network_request_param_default contains values. Now the request can
* be build.
*/
- $requestData = array();
+ $requestData = [];
foreach ($requestParams as $key => $params) {
// Add id
$requestData[$params['network_request_param_value']] = $params['network_request_param_default'];
$test = $text;
// ... what will the email address be out the @... ;-)
- $PARTS = array();
+ $PARTS = [];
while (isInString('@', $test)) {
$pos = strpos($test, '@');
$test2 = substr($test, 0, $pos);
// Part taken from admin optimize module of PHPNuke (http://www.phpnuke.org)
function repairOptimizeDatabase () {
- $ret = array();
+ $ret = [];
$tot_data = '0';
$opts = '0';
$tot_idx = '0';
// Init array
$ret['total_size'] = '0';
$ret['total_tabs'] = sqlNumRows($result);
- $ret['tables'] = array();
+ $ret['tables'] = [];
// Are there entries?
if (!ifSqlHasZeroNumRows($result)) {
// Load users
$content = array(
- 'userid' => array(),
- 'ref' => array(),
- 'cpoints' => array()
+ 'userid' => [],
+ 'ref' => [],
+ 'cpoints' => []
);
// Load all users
}
// Run this function only when a new member has confirmed his email address!
-function addUserToReferralRallye ($userid, $content = array()) {
+function addUserToReferralRallye ($userid, $content = []) {
$add = '';
// Updated extension?
// Init array
$count = '0';
- $users = array();
+ $users = [];
$content['start_time'] = generateDateTime($content['start_time'], 1);
$content['end_time'] = generateDateTime($content['end_time'] , 1);
$content['now_time'] = generateDateTime(time(), 1);
function getArrayFromReferralRallyePrices ($rallye) {
// Init multi array
$prices = array(
- 'level' => array(),
- 'points' => array(),
- 'info' => array()
+ 'level' => [],
+ 'points' => [],
+ 'info' => []
);
// Load prices
// Init multi array
$users = array(
- 'userid' => array(),
- 'ref' => array(),
- 'cpoints' => array(),
+ 'userid' => [],
+ 'ref' => [],
+ 'cpoints' => [],
);
/*
function addReferralRallyeTemplateSelection ($name = 'template', $default = '') {
// Init variables
$OUT = '';
- $ral = array();
+ $ral = [];
// Check templates directory
$basePath = sprintf('templates/%s/html/rallye/', getLanguage());
// Read the directory
- $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, array(), '.tpl');
+ $templates = getArrayFromDirectory($basePath, 'rallye_', FALSE, TRUE, [], '.tpl');
// And walk through
foreach ($templates as $read) {
function getArrayFromRefbackLevel ($refid, $level) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ' - ENTERED!');
// Init userids
- $userIds = array();
+ $userIds = [];
// Look for all
$result = sqlQueryEscaped("SELECT
function getArrayFromRefbackUserRefs ($userid, $level) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!');
// Default is no refs and no nickname
- $refs = array();
+ $refs = [];
// Get refs from database
$result = sqlQueryEscaped("SELECT
function getArrayFromUserRefbackData ($id) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'id=' . $id . ' - ENTERED!');
// Default data is nothing
- $data = array();
+ $data = [];
// Secure id number
$id = bigintval($id);
} // END - if
//
-function handleSponsorRequest ($postData, $update=false, $messageArray = array(), $RET_STATUS=false) {
+function handleSponsorRequest ($postData, $update=false, $messageArray = [], $RET_STATUS=false) {
// Init a lot variables
$SAVE = TRUE;
$UPDATE = FALSE;
// Save sponsor data
$DATA = array(
- 'keys' => array(),
- 'values' => array()
+ 'keys' => [],
+ 'values' => []
);
// Check if sponsor already exists
// This array is for the submitted data which we will use with the sqlQueryEscaped() function to
// secure the data
- $DATA = array();
+ $DATA = [];
// Prepare SQL string
$sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET";
}
// Processes a sponsor request and handles it
-function doProcessSponsorFormRequest ($messageArray = array()) {
+function doProcessSponsorFormRequest ($messageArray = []) {
// Default message
$message = '';
// Load URL data by given search term and column
function getSurfbarUrlData ($searchTerm, $column = 'url_id', $order = 'url_id', $sort = 'ASC', $group = 'url_id', $add = '') {
// By default nothing is found
- $GLOBALS['last_url_data'] = array();
+ $GLOBALS['last_url_data'] = [];
// Is the column an id number?
if (($column == 'url_id') || ($column == 'url_userid')) {
}
// Registers an URL with the surfbar. You should have called ifSurfbarHasUrlUserId() first!
-function doSurfbarRegisterUrl ($url, $userid, $status = 'PENDING', $addMode = 'reg', $extraFields = array()) {
+function doSurfbarRegisterUrl ($url, $userid, $status = 'PENDING', $addMode = 'reg', $extraFields = []) {
// Make sure by the user registered URLs are always pending
if ($addMode == 'reg') {
$status = 'PENDING';
function determineSurfbarDepletedUserids ($limit=0) {
// Init array
$userids = array(
- 'url_userid' => array(),
- 'points' => array(),
- 'notified' => array(),
+ 'url_userid' => [],
+ 'points' => [],
+ 'notified' => [],
);
// Is there a current user id?
}
// Changes the status of an URL from given to other
-function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = array()) {
+function changeSurfbarUrlStatus ($urlId, $prevStatus, $newStatus, $data = []) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'urlId=' . $urlId . ',prevStatus=' . $prevStatus . ',data[]=' . gettype($data) . ',newStatus=' . $newStatus . ' - ENTERED!');
// Make new status always lower-case
$newStatus = strtolower($newStatus);
// "Getter" for lock ids array
function getSurfbarLockIdsArray () {
// Prepare some arrays
- $IDs = array();
- $USE = array();
- $ignored = array();
+ $IDs = [];
+ $USE = [];
+ $ignored = [];
// Get all id from locks within the timestamp
$result = sqlQueryEscaped("SELECT
// Load all URLs of the current user and return it as an array
function getSurfbarUserUrls () {
// Init array
- $urlArray = array();
+ $urlArray = [];
// Begin the query
$result = sqlQueryEscaped("SELECT
// "Getter" for member action array for given status
function getSurfbarArrayFromStatus ($status) {
// Init array
- $returnArray = array();
+ $returnArray = [];
// Get all assigned actions
$result = sqlQueryEscaped("SELECT `actions_action` FROM `{?_MYSQL_PREFIX?}_surfbar_actions` WHERE `actions_status`='%s' ORDER BY `actions_id` ASC",
// Initializes the surfbar
function initSurfbar () {
// Init cache array
- $GLOBALS['surfbar_cache'] = array();
+ $GLOBALS['surfbar_cache'] = [];
}
// Private getter for data elements
// Init variables/arrays
$EXTRAS = '';
$OUT = '';
- $WHATs = array();
- $DESCRs = array();
- $TITLEs = array();
+ $WHATs = [];
+ $DESCRs = [];
+ $TITLEs = [];
// Chheck for new extensions and updates
$jobsDone = outputStandardOverview($result_main);
if ((isExtensionActive('autopurge')) && (isExtensionActive('user'))) {
// Start finding them...
$userExclusionSql = ' ';
- $excludedUserids = runFilterChain('config_userid_exclusion_sql', array());
+ $excludedUserids = runFilterChain('config_userid_exclusion_sql', []);
if (count($excludedUserids) > 0) {
// Exclude all
$userExclusionSql .= ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
// Initialize array
$themesArray = array(
- 'theme_unix' => array(), // Unix name from filesystem
- 'theme_name' => array() // Title
+ 'theme_unix' => [], // Unix name from filesystem
+ 'theme_name' => [] // Title
);
// Only activated themes for the user
$confirmed = FALSE;
// Init arrays/variables
- $confirmedIds = array();
- $failedIds = array();
+ $confirmedIds = [];
+ $failedIds = [];
$points = 0;
// "Walk" through all transaction ids
}
// Init data array
- $data = array();
+ $data = [];
// Try to load more transaction data
$result = sqlQueryEscaped("SELECT
// Is the account unconfirmed?
if ($content['status'] == 'UNCONFIRMED') {
// Load email template
- $message = loadEmailTemplate('guest_request_confirm', array(), $content['userid']);
+ $message = loadEmailTemplate('guest_request_confirm', [], $content['userid']);
// Send email
sendEmail($content['userid'], '{--GUEST_REQUEST_CONFIRM_LINK_SUBJECT--}', $message);
}
// Sends out a request to the API and returns it's result
-function sendWernisApiRequest ($scriptName, $requestData = array()) {
+function sendWernisApiRequest ($scriptName, $requestData = []) {
// Debug call
//* DEBUG */ reportBug(__FUNCTION__, __LINE__, 'scriptName=' . $scriptName . ',requestData=<pre>' . print_r($requestData, TRUE) . '</pre>');
$data = explode('=', $responseLine);
// Default return array (should not stay empty)
- $return = array();
+ $return = [];
// We use only the first two entries (which shall be fine)
if ($data[0] === 'error') {
// Display form
loadTemplate('guest_wernis_registration_rpc_form');
- return array();
+ return [];
} // END - if
// Init array
$return = array(
// Mapped data
- 'mapped_data' => array(),
+ 'mapped_data' => [],
// Any error message from API
'message' => ''
);
// "Getter" for Wernis registration data by given key and value
function getWernisRegistrationDataByKey ($key, $value, $limit = 1) {
// Init array
- $rows = array();
+ $rows = [];
// Now search for it
$result = sqlQueryEscaped("SELECT
//* DEBUG-DIE */ die('algorithms=<pre>' . print_r($algorithms, TRUE) . '</pre>');
// Init array
- $options = array();
+ $options = [];
// And fill it
foreach ($algorithms as $key => $dummy) {
$modes = getSupportedEncryptionModes();
// Init array
- $options = array();
+ $options = [];
// And fill it
foreach ($modes as $key => $dummy) {
// Queries the given Yoo!Media API 2.0 script
function YOOMEDIA_QUERY_API ($script, $countQuery = TRUE) {
// Init response array
- $response = array();
+ $response = [];
// Enougth queries left?
if ((getConfig('yoomedia_requests_remain') > 0) || ($countQuery === FALSE)) {
$response = YOOMEDIA_QUERY_API('out_textmail.php');
// By default an empty result is returned
- $result = array();
+ $result = [];
// Parse the response
if (isFilledArray($response)) {
// Parser function for Yoo!Media API responses
function YOOMEDIA_PARSE_RESPONSE ($response, $type) {
// Init result
- $result = array();
+ $result = [];
// Cut off the header
$dummy = removeHttpHeaderFromResponse($response);
if (!isFilledArray($dummy)) {
// Empty response from API
reportBug(__FUNCTION__, __LINE__, 'Empty result from API received. response()=' . count($response) . ',type=' . $type);
- return array();
+ return [];
} // END - if
// The result is now still raw, so we must split it up and trim spaces away
initExtensionCssFiles();
// Initialize array for "always keep active extensions"
-$GLOBALS['cache_array']['always_active'] = array();
+$GLOBALS['cache_array']['always_active'] = [];
// Init & set the INC_POOL
initIncludePool('cache');
// Check count
if (count($GLOBALS['cache_array']['admin']['login']) == count($GLOBALS['cache_array']['admin']['admin_id'])) {
// Rewrite the cache
- $admins = array();
+ $admins = [];
foreach ($GLOBALS['cache_array']['admin']['login'] as $idx => $admin) {
// Rewrite all entries
foreach ($GLOBALS['cache_array']['admin'] as $key => $entry) {
// Check count
if (count($GLOBALS['cache_array']['admin_acls']['admin_id']) == count($GLOBALS['cache_array']['admin_acls']['access_mode'])) {
// Rewrite the cache
- $admins = array();
+ $admins = [];
foreach ($GLOBALS['cache_array']['admin_acls']['admin_id'] as $idx => $admin) {
// Rewrite all entries
foreach ($GLOBALS['cache_array']['admin_acls'] as $key => $entry) {
$EXT_DUMMY = $GLOBALS['cache_instance']->getArrayFromCache();
// Init extension inc-pool
- $EXT_POOL = array();
+ $EXT_POOL = [];
// Are there entries?
if (count($EXT_DUMMY) > 0) {
// Init arrays
- $EXT_NAMES = array();
+ $EXT_NAMES = [];
// Loop through all
foreach ($EXT_DUMMY['ext_name'] as $k => $ext_name) {
$GLOBALS['cache_array']['payments'] = $GLOBALS['cache_instance']->getArrayFromCache();
// Init temporary array
- $paymentsData = array();
+ $paymentsData = [];
// Rewrite all to id
foreach ($GLOBALS['cache_array']['payments']['id'] as $key => $id) {
} // END - if
// Init temporary array
- $pointsData = array();
+ $pointsData = [];
// Rewrite all to subject
foreach ($GLOBALS['cache_array']['points_data']['subject'] as $key => $subject) {
$cache = $GLOBALS['cache_instance']->getArrayFromCache();
// Restructure the array
- $GLOBALS['cache_array']['themes'] = array();
+ $GLOBALS['cache_array']['themes'] = [];
foreach ($cache as $key => $content) {
// Skip 'theme_path' because we don't need to rebuild it
if ($key == 'theme_path') {
// Load message body for bonus mails
$message = loadEmailTemplate('beg_enable_notify_body', '', '{PER}userid{PER}');
- $receiver = ''; $userids = array();
+ $receiver = ''; $userids = [];
// Okay lets notify all users!
while ($row = sqlFetchArray($result_main)) {
// Load message body for bonus mails
$message = loadEmailTemplate('bonus_enable_notify_body', '', '{PER}userid{PER}');
- $receiver = ''; $userids = array();
+ $receiver = ''; $userids = [];
// Check for accounts to be notified
$result_main = sqlQuery($sql, __FILE__, __LINE__);
$OUT = '';
// Menu descriptions
- $GLOBALS['menu']['description'] = array();
- $GLOBALS['menu']['title'] = array();
+ $GLOBALS['menu']['description'] = [];
+ $GLOBALS['menu']['title'] = [];
// Build main menu
$result_main = sqlQuery("SELECT
}
// Wrapper for $_POST and adminSaveSettings
-function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) {
+function adminSaveSettingsFromPostData ($tableName = '_config', $whereStatement = '`config`=0', $translateComma = [], $alwaysAdd = FALSE, $displayMessage = TRUE) {
// Get the array
$postData = postRequestArray();
}
// Save settings to the database
-function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = array(), $alwaysAdd = FALSE, $displayMessage = TRUE) {
+function adminSaveSettings (&$postData, $tableName = '_config', $whereStatement = '`config`=0', $translateComma = [], $alwaysAdd = FALSE, $displayMessage = TRUE) {
// Prepare all arrays, variables
- $tableData = array();
+ $tableData = [];
$skip = FALSE;
// Now, walk through all entries and prepare them for saving
);
} else {
// Add Line (does only work with AUTO_INCREMENT!
- $keys = array(); $values = array();
+ $keys = []; $values = [];
foreach ($tableData as $entry) {
// Split up
$line = explode('=', $entry);
// Build a special template list
// @TODO cacheFiles is not yet supported
-function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = array()) {
+function adminListBuilder ($listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId = array('userid'), $content = []) {
// Call inner (general) function
doGenericListBuilder('admin', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId, $content);
}
// Change status of "build" list
-function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $rawUserId = array('userid'), $cacheFiles = array()) {
+function adminBuilderStatusHandler ($mode, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $statusArray, $rawUserId = array('userid'), $cacheFiles = []) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Delete rows by given id numbers
-function adminDeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
+function adminDeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $deleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Edit rows by given id numbers
-function adminEditEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = array(), $content = array()) {
+function adminEditEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $editNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid'), $rawUserId = array('userid'), $cacheFiles = [], $content = []) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
// Un-/lock rows by given id numbers
// @TODO rawUserId/content is not yet supported
-function adminLockEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
+function adminLockEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $statusArray = [], $lockNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
// Undelete rows by given id numbers
// @TODO rawUserId/cacheFiles/content is not yet supported
-function adminUndeleteEntriesConfirm ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $statusArray = array(), $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
+function adminUndeleteEntriesConfirm ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $statusArray = [], $undeleteNow = array(FALSE), $idColumn = array('id'), $userIdColumn = array('userid')) {
// $tableName must be an array
if ((!is_array($tableName)) || (count($tableName) != 1)) {
// No tableName specified
}
// Adds a given entry to the database
-function adminAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
+function adminAddEntries ($tableName, $columns = [], $filterFunctions = [], $extraValues = [], $timeColumns = [], $columnIndex = NULL) {
// Is the userid set?
if (!isPostRequestElementSet('userid')) {
// Then set NULL here
if (!isFormSent()) {
// Create arrays
- $menus = array();
- $titles = array();
- $below = array();
+ $menus = [];
+ $titles = [];
+ $below = [];
// Get all available main menus
$result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC", __FILE__, __LINE__);
array($value_main), __FILE__, __LINE__);
if (!ifSqlHasZeroNumRows($result)) {
// Init arrays
- $menus[$value_main] = array();
- $titles[$value_main] = array();
- $below[$value_main] = array();
+ $menus[$value_main] = [];
+ $titles[$value_main] = [];
+ $below[$value_main] = [];
// Read menu structure
while ($content = sqlFetchArray($result)) {
// Set selection data to empty array when it is empty
if (!isPostRequestElementSet('sel')) {
- setPostRequestElement('sel', array());
+ setPostRequestElement('sel', []);
} // END - if
// Check if direct admin account was selected
// Generate string for saving ranks
setPostRequestElement('turbo_rates', '');
- $RATES = array();
+ $RATES = [];
foreach (postRequestElement('rate') as $rate) {
// Convert German comma to dot
$rate = trim(convertCommaToDot($rate));
if (isFormSent('save_config')) {
// Generate string
- $MODs = array();
+ $MODs = [];
foreach (postRequestElement('mod') as $mod => $sel) {
// Now you can never deselect the admin module, bah!!! ;-)
if (($sel == 'Y') || ($mod == 'admin')) {
adminSaveSettingsFromPostData();
} else {
// Prepare content
- $content = array();
+ $content = [];
// Loop all scores
for ($idx = 0; $idx <= 5; $idx++) {
if (!isFormSent()) {
// Create arrays
- $menus = array(); $titles = array(); $below = array();
+ $menus = []; $titles = []; $below = [];
// Get all available main menus
$result_menu = sqlQuery("SELECT
if (!ifSqlHasZeroNumRows($result)) {
// Initialize arrays
- $menus[$value_main] = array();
- $titles[$value_main] = array();
- $below[$value_main] = array();
+ $menus[$value_main] = [];
+ $titles[$value_main] = [];
+ $below[$value_main] = [];
// Read menu structure
while ($content = sqlFetchArray($result)) {
// Exclude default referral id if set
$userExcludeSql = ' ';
-$excludedUserids = runFilterChain('config_userid_exclusion_sql', array());
+$excludedUserids = runFilterChain('config_userid_exclusion_sql', []);
if (isFilledArray($excludedUserids)) {
// Exclude all
$userExcludeSql = ' AND `d`.`userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
array('id'),
array('bank_packages'),
postRequestElement('id'),
- array(),
- array(),
- array(),
+ [],
+ [],
+ [],
array(TRUE)
);
} elseif (isFormSent('delete')) {
array('id'),
array('bank_packages'),
postRequestElement('id'),
- array(),
- array(),
- array(),
+ [],
+ [],
+ [],
array(TRUE)
);
}
$networkData['network_type_id'] = 0;
// Init disabled list
- $GLOBALS['network_array_translation_disabled'] = array();
+ $GLOBALS['network_array_translation_disabled'] = [];
// Only show params from given type handler if choosen
$ADD = '';
$networkData['network_type_id'] = 0;
// Init disabled list
- $GLOBALS['network_request_params_disabled'] = array();
+ $GLOBALS['network_request_params_disabled'] = [];
// Only show params from given type handler if choosen
$ADD = '';
$networkData = getNetworkDataFromId(getRequestElement('network_id'));
// Init disabled list
- $GLOBALS['network_types_disabled'] = array();
+ $GLOBALS['network_types_disabled'] = [];
// Load all advert types for given network
$result = sqlQueryEscaped('SELECT
$numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5);
// List emails
- $OUT = ''; $content = array();
+ $OUT = ''; $content = [];
while ($content = sqlFetchArray($result_bonus)) {
// Add "unconfirmed-link"
$content['unconfirmed_content'] = generateUnconfirmedAdminLink($content['id'], $content['unconfirmed'], 'bonus');
if (!ifSqlHasZeroNumRows($result)) {
// Init amounts and points
$totalPoints = '0';
- $amounts = array();
+ $amounts = [];
// Then load all
while ($row = sqlFetchArray($result)) {
if (!isFormSent()) {
// Create arrays
- $menus = array();
- $titles = array();
- $below = array();
+ $menus = [];
+ $titles = [];
+ $below = [];
// Get all available main menus
$result = sqlQuery("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC",
array($value_main), __FILE__, __LINE__);
if (!ifSqlHasZeroNumRows($result)) {
// Initialize arrays
- $menus[$value_main] = array();
- $titles[$value_main] = array();
- $below[$value_main] = array();
+ $menus[$value_main] = [];
+ $titles[$value_main] = [];
+ $below[$value_main] = [];
// Read menu structure
while ($content = sqlFetchArray($result)) {
// Add description as navigation point
addYouAreHereLink('admin', __FILE__);
-$actions = array();
+$actions = [];
// First fix all main menus (what = '')...
$result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
// Add description as navigation point
addYouAreHereLink('admin', __FILE__);
-$actions = array();
+$actions = [];
// First fix all main menus (what = '')...
$result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
// Add description as navigation point
addYouAreHereLink('admin', __FILE__);
-$actions = array();
+$actions = [];
// First fix all main menus (what = '')...
$result_fix = sqlQuery("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
$couponId = getSqlInsertId();
// Init userid array
- $adminUserids = array();
+ $adminUserids = [];
// Load entry
while (list($userid) = sqlFetchRow($result)) {
// Initialize array
$themes = array(
- 'theme_unix' => array(), // Unix name from filesystem
- 'theme_name' => array(), // Title
- 'theme_author' => array(), // Theme author's name
- 'theme_email' => array(), // Author's email address
- 'theme_url' => array(), // URL were you can download it from
- 'theme_version' => array(), // Version number of theme
+ 'theme_unix' => [], // Unix name from filesystem
+ 'theme_name' => [], // Title
+ 'theme_author' => [], // Theme author's name
+ 'theme_email' => [], // Author's email address
+ 'theme_url' => [], // URL were you can download it from
+ 'theme_version' => [], // Version number of theme
);
// Read directory "themes"
} // END - if
// Create array for form errors (= missing data)
-$formErrors = array();
+$formErrors = [];
if (isFormSent()) {
//
$female = countSumTotalData('F', 'user_data', 'userid', 'gender', TRUE, runFilterChain('user_exclusion_sql', " AND `status`='CONFIRMED'"));
// List every month
- $months = array();
+ $months = [];
for ($idx = 1; $idx < 13; $idx++) {
// Copy it so we don't touch the for() loop index
$month = $idx;
$result = sqlQuery("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `visible`='Y' ORDER BY `id` ASC", __FILE__, __LINE__);
// Load categories first
- $cats = array(); $cat_cnt = array();
+ $cats = []; $cat_cnt = [];
// @TODO This can be somehow rewritten
while ($content = sqlFetchArray($result)) {
} // END - if
// Init array
-$rows = array();
+$rows = [];
// TOP logins
$result = sqlQuery("SELECT
} // END - if
// Init content array
-$content = array();
+$content = [];
// Check for running mail orders in pool
$result1 = sqlQueryEscaped("SELECT
} // END - if
// Add userid
-$content = array();
+$content = [];
// Init variable to prevent notices
$url = '';
// Are there still receivers left?
if (sqlNumRows($result) >= postRequestElement('receiver')) {
// Load receivers from database
- $receiverArray = array(); $count = '0';
+ $receiverArray = []; $count = '0';
while ($holidayContent = sqlFetchArray($result)) {
// Run fetched data through pre filter chain
$holidayContent = runFilterChain('pre_mail_recipient_check', $holidayContent);
if ($totalPoints > 0) {
// Initialize array...
$categories = array(
- 'id' => array(),
- 'name' => array(),
- 'userids' => array()
+ 'id' => [],
+ 'name' => [],
+ 'userids' => []
);
// Enable HTML checking
// Now we need to load the mail types...
$result = sqlQuery("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `price` > 0 AND `payment` > 0 ORDER BY `payment` ASC", __FILE__, __LINE__);
- $payments = array();
+ $payments = [];
if (!ifSqlHasZeroNumRows($result)) {
// Is the error code set?
if (isGetRequestElementSet('code')) {
addYouAreHereLink('member', __FILE__);
// Init output
-$main_content = array();
+$main_content = [];
// Load waiting/pending orders
$result = sqlQueryEscaped("SELECT
// Initialize array
$themes = array(
- 'theme_unix' => array(), // Unix name from filesystem
- 'theme_name' => array(), // Title
- 'theme_author' => array(), // Theme author's name
- 'theme_email' => array(), // Author's email address
- 'theme_url' => array(), // URL were you can download it from
- 'theme_version' => array(), // Version number of theme
+ 'theme_unix' => [], // Unix name from filesystem
+ 'theme_name' => [], // Title
+ 'theme_author' => [], // Theme author's name
+ 'theme_email' => [], // Author's email address
+ 'theme_url' => [], // URL were you can download it from
+ 'theme_version' => [], // Version number of theme
);
// Read directory "themes"
$sum = '0'; $OUT = '';
// Init content
- $content = array();
+ $content = [];
// @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
while ($row = sqlFetchArray($result)) {
} // END - if
// Init the content array and points
-$content = array(); $points = FALSE;
+$content = [];
+$points = FALSE;
// Is the mode set (withdraw or payout)
if ((!isGetRequestElementSet('do')) || (getRequestElement('do') == 'choose')) {
// @TODO "Hook" ext-html_mail into this to allow column `html_msg`
function getPoolDataFromId ($poolId) {
// Init content array
- $content = array();
+ $content = [];
// Search for pool data
$result = sqlQueryEscaped('SELECT
array(bigintval($mailData['id'])), __FILE__, __LINE__);
// Default is no users left
- $receivers = array();
+ $receivers = [];
// "Explode" all receivers into an array
if (isInString(';', $mailData['receivers'])) {
if (sqlNumRows($result) > 0) {
// Init variables
$out = '';
- $ids = array();
+ $ids = [];
// Start purging all
while ($content = sqlFetchArray($result)) {
// Init userid exclusion
$excludeSql = '';
- $excludedUserids = runFilterChain('config_userid_exclusion_sql', array());
+ $excludedUserids = runFilterChain('config_userid_exclusion_sql', []);
if (isFilledArray($excludedUserids)) {
// Exclude all
$excludeSql = ' AND `userid` NOT IN (' . implode(', ', $excludedUserids) . ')';
if (!ifSqlHasZeroNumRows($result_inactive)) {
// Prepare variables and constants...
- $userids = array();
+ $userids = [];
$content['since'] = (getApInactiveSince() / 60 / 60);
$content['time'] = (getApInactiveTime() / 60 / 60);
if (!ifSqlHasZeroNumRows($result_inactive)) {
// Prepare userid array for admin...
- $userids = array();
+ $userids = [];
// Delete inactive accounts
while ($content = sqlFetchArray($result_inactive)) {
// Send out a notification?
if (!ifSqlHasZeroNumRows($result)) {
// Init output and load all rows
- $output = ''; $ids = array();
+ $output = ''; $ids = [];
while ($row = sqlFetchArray($result)) {
// "Translate" creation timestamp
$row['task_created'] = generateDateTime($row['task_created'], '1');
function getUserReferralPoints ($userid, $level) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ' - ENTERED!');
// Default is no refs and no nickname
- $refs = array();
+ $refs = [];
// Get refs from database
$result = sqlQueryEscaped('SELECT
function loadReferralTable ($userid) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ' - ENTERED!');
// Init array
- $GLOBALS['referral_refid'][$userid] = array();
+ $GLOBALS['referral_refid'][$userid] = [];
// Get all level entries from the refsystem table
$GLOBALS['referral_result'][$userid] = sqlQueryEscaped('SELECT `level` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `userid`=%s ORDER BY `level` ASC',
while (list($level) = sqlFetchRow($GLOBALS['referral_result'][$userid])) {
// Init array
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level);
- $GLOBALS['referral_refid'][$userid][$level] = array();
+ $GLOBALS['referral_refid'][$userid][$level] = [];
// Level is = 1?
if ($level == 1) {
'LOCKED',
'UNLOCKED'
),
- array(),
+ [],
$lockedMode,
'', '',
- array(),
+ [],
'translatePointsLockedMode'
);
} // END - if
'DIRECT',
'REFERRAL'
),
- array(),
+ [],
$paymentMethod,
'', '',
- array(),
+ [],
'translatePointsPaymentMethod'
);
} // END - if
'Y',
'N'
),
- array(),
+ [],
$notifyRecipient,
'', '',
- array(),
+ [],
'translatePointsNotifyRecipient'
);
} // END - if
// Init SQLs array
function initSqls () {
// Init generic array
- setSqlsArray(array('generic' => array()));
+ setSqlsArray(array('generic' => []));
}
// Checks whether the sqls array is initialized
// Gets an array (or false if none is found) from all supported engines
function getArrayFromSupportedSqlEngines ($requestedEngine = 'ALL') {
// Init array
- $engines = array();
+ $engines = [];
// This also worked, now we need to check if the selected database type is supported
$result = sqlQuery('SHOW ENGINES', __FUNCTION__, __LINE__);
// Is stats cache loaded?
if ((!isset($GLOBALS['stats_loaded'])) && (ifInternalStatsEnabled())) {
// Init statistics array
- $GLOBALS['stats'] = array();
+ $GLOBALS['stats'] = [];
// Load statistics entry from temporary table
loadStatsTable();
// Compile all out
while (((isInString('{--', $code)) || (isInString('{DQUOTE}', $code)) || (isInString('{?', $code)) || (isInString('{%', $code) !== FALSE)) && ($totalCompilations < 7)) {
// Init common variables
- $content = array();
+ $content = [];
$newContent = '';
// Compile it
}
// Load a template file and return it's content (only it's name; do not use ' or ")
-function loadTemplate ($template, $return = FALSE, $content = array(), $compileCode = TRUE) {
+function loadTemplate ($template, $return = FALSE, $content = [], $compileCode = TRUE) {
// @TODO Remove these sanity checks if all is fine
if (!is_bool($return)) {
// $return has to be boolean
}
// Loads an email template and compiles it
-function loadEmailTemplate ($template, $content = array(), $userid = NULL, $loadUserData = TRUE) {
+function loadEmailTemplate ($template, $content = [], $userid = NULL, $loadUserData = TRUE) {
// Make sure all template names are lowercase!
$template = strtolower($template);
// Are some matches found?
if ((isFilledArray($matches)) && (isFilledArray($matches[0]))) {
// Replace all matches
- $matchesFound = array();
+ $matchesFound = [];
foreach ($matches[0] as $key => $match) {
// Fuzzy look has failed by default
$fuzzyFound = FALSE;
// Generates a selection box for given default value
function generateTimeUnitSelectionBox ($defaultUnit, $fieldName, $unitArray) {
// Init variables
- $messageIds = array();
+ $messageIds = [];
// Generate message id array
foreach ($unitArray as $unit) {
// Name of used template
'template' => $templateName,
// Target array for gathered data
- '__data' => array(),
+ '__data' => [],
// Where the HTML output will go
'__output' => '',
);
// Name of used template
'template' => $templateName,
// Target array for gathered data
- '__data' => array(),
+ '__data' => [],
// Where the HTML output will go
'__output' => '',
);
}
// Load another template and return its content
-function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = array()) {
+function doTemplateLoadTemplate ($templateName, $clear = FALSE, $theTemplate, $content = []) {
// Load "the" template
return loadTemplate($theTemplate, TRUE, $content);
}
// Init the user
unset($GLOBALS['is_userdata_valid'][getCurrentUserId()]);
- $GLOBALS['user_data'][getCurrentUserId()] = array();
+ $GLOBALS['user_data'][getCurrentUserId()] = [];
}
// Getter for user data
return $GLOBALS['user_data'][$userid];
} else {
// Return empty array
- return array();
+ return [];
}
}
function search_array ($array, $key, $value, $parentIndex = NULL) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'array(' . count($array) . ')=' . print_r($array, TRUE) . ',key=' . $key . ',value=' . $value . ',parentIndex[' . gettype($parentIndex) . '=' . $parentIndex . ' - ENTERED!');
// Init array result
- $results = array();
+ $results = [];
// Is $array really an array?
if (is_array($array)) {
// Wraps convertSelectionsToEpocheTime()
function convertSelectionsToEpocheTimeInPostData ($id) {
// Init variables
- $content = array();
+ $content = [];
$skip = FALSE;
// Get all POST data
'ext_',
false,
false,
- array(),
+ [],
'.tpl',
'@(\.|\.\.)$@',
false
$keys = explode($keyDelimiter, $responseString);
// Init returned array and "walk" through all entries
- $returned = array();
+ $returned = [];
foreach ($keys as $keyValue) {
// Explode it
$parts = explode($valueDelimiter, $keyValue);
}
// Calls back a function based on given XML template data
-function doGenericXmlTemplateCallback ($template, $content = array(), $compileCode = TRUE) {
+function doGenericXmlTemplateCallback ($template, $content = [], $compileCode = TRUE) {
// Init XML system as sch calls will be only used once per run
initXml();
// Init main arrays
$GLOBALS['__XML_CALLBACKS'] = array(
- 'callbacks' => array(),
- 'functions' => array()
+ 'callbacks' => [],
+ 'functions' => []
);
- $GLOBALS['__XML_ARGUMENTS'] = array();
- $GLOBALS['__COLUMN_INDEX'] = array();
+ $GLOBALS['__XML_ARGUMENTS'] = [];
+ $GLOBALS['__COLUMN_INDEX'] = [];
$GLOBALS['__XML_CONTENT'] = $content;
// Handle it over to the parser