./inc/functions.php:1577: // @TODO Are these convertions still required?
./inc/functions.php:1595:// @TODO Rewrite this function to use readFromFile() and writeToFile()
./inc/functions.php:178:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:2248: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2251: // @TODO This is still very static, rewrite it somehow
./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter
./inc/install-functions.php:63: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
./inc/language/de.php:1127:// @TODO Rewrite these two constants
./inc/libs/doubler_functions.php:46:// @TODO Lame description
./inc/libs/doubler_functions.php:94: // @TODO Can't this be moved into EL?
./inc/libs/mailid_functions.php:49: // @TODO Rewrite this to a dynamic include or so
-./inc/libs/rallye_functions.php:700:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
-./inc/libs/rallye_functions.php:765: $EXPIRE = 3; // @TODO The hard-coded value...
-./inc/libs/rallye_functions.php:851:// @TODO Please document this function
-./inc/libs/rallye_functions.php:907: // Load count @TODO Can't we rewrite this to our API?
+./inc/libs/rallye_functions.php:704:// @TODO This function does not load min_users, min_prices, please encapsulate loading rallye data with e.g. getRallyeDataFromId()
+./inc/libs/rallye_functions.php:769: $EXPIRE = 3; // @TODO The hard-coded value...
+./inc/libs/rallye_functions.php:855:// @TODO Please document this function
+./inc/libs/rallye_functions.php:911: // Load count @TODO Can't we rewrite this to our API?
./inc/libs/refback_functions.php:61: // @TODO Try to rewrite the following unset()
./inc/libs/register_functions.php:292: // @TODO Rewrite these all to a single filter
./inc/libs/register_functions.php:365: // @TODO Rewrite this to a filter
./inc/modules/admin/what-del_email.php:61: // @TODO Unused: cat_id, payment_id
./inc/modules/admin/what-edit_user.php:20: * @TODO Add support for ext-country *
./inc/modules/admin/what-email_stats.php:48:// @TODO Unused at the moment
-./inc/modules/admin/what-extensions.php:359: // @TODO Rewrite this to a filter
+./inc/modules/admin/what-extensions.php:364: // @TODO Rewrite this to a filter
./inc/modules/admin/what-guest_add.php:131: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-guest_add.php:69: // @TODO Cant this be rewritten?
./inc/modules/admin/what-guest_add.php:82: // @TODO This can be somehow rewritten to a function
./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/order.php:76: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:69: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1168: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1415: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1513: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1880: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1924:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1171: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1418: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1516: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1883: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1927:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:370: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:46:// @TODO Can we cache this?
./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `beg_rallye` ENUM('Y','N') NOT NULL DEFAULT 'N'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `beg_points` FLOAT(21,5) UNSIGNED NOT NULL DEFAULT 0.00000");
- $VIS = 'N'; $LOCKED = 'Y';
- if (isExtensionActive('beg')) { $VIS = 'Y'; $LOCKED = 'N'; }
+ $visible = 'N'; $locked = 'Y';
+ if (isExtensionActive('beg')) {
+ $visible = 'Y';
+ $locked = 'N';
+ } // END - if
- addMemberMenuSql('main','beg2','Bettel-Rallye',$VIS,$LOCKED,7);
+ addMemberMenuSql('main','beg2','Bettel-Rallye', $visible, $locked, 7);
addAdminMenuSql('user','list_beg','Bettel-Rallye','Listet alle Teilnehmer der monatlichen Bettel-Rallye auf.','12');
// Update notes (these will be set as task text!)
// Read from source file
$line = fgets ($fp, 1024);
- if (strpos($line, $search) > -1) { $next = '0'; $found = true; }
+ if (strpos($line, $search) > -1) {
+ $next = '0';
+ $found = true;
+ } // END - if
if ($next > -1) {
if ($next === $seek) {
// List only users with at least one ref!
//* DEBUG: */ debugOutput('*'.$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints.'*');
- if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $userid = $content['userid']; } else { $cnt = ''; }
+ if (($cnt > 0) && ($refpoints > $content['curr_points'])) {
+ $userid = $content['userid'];
+ } else {
+ $cnt = '';
+ }
// Save values to array
$DATA['userid'][] = $userid;
loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_EXTENSION_ALWAYS_ACTIVE', getExtensionName($taskId)));
} else {
// De/activate extension
- $ACT = 'N'; setExtensionMode('deactivate');
- if ($active != 'Y') { $ACT = 'Y'; setExtensionMode('activate'); }
+ $active = 'N'; setExtensionMode('deactivate');
+ if ($active != 'Y') {
+ $active = 'Y';
+ setExtensionMode('activate');
+ } // END - if
+
+ // Update database
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_extensions` SET `ext_active`='%s' WHERE `id`=%s AND `ext_active`='%s' LIMIT 1",
- array($ACT, bigintval($taskId), $active), __FILE__, __LINE__);
+ array($active, bigintval($taskId), $active), __FILE__, __LINE__);
// Run embeded SQL commands
doExtensionSqls($taskId, getExtensionMode());
$br = '';
// Output row
- if (($row['curr_points'] > 0) && ($cnt > 0)) { $bl = '<strong>'; $br = '</strong>'; }
+ if (($row['curr_points'] > 0) && ($cnt > 0)) {
+ $bl = '<strong>';
+ $br = '</strong>';
+ } // END - if
// Get user points
$points = countSumTotalData($row['userid'], 'user_points', 'points', 'userid', false, " AND `ref_depth`=1 LIMIT 1");
// Is a userid set?
if (isGetRequestParameterSet('userid')) {
// Action not performed by default
- $ACT = false;
+ $isActive = false;
// Load user's data
if (fetchUserData(getRequestParameter('userid'))) {
// Prepare message
$message = getMaskedMessage('USER_ACCOUNT_LOCKED', bigintval(getRequestParameter('userid')));
- $ACT = true;
+ $isActive = true;
} elseif ((isPostRequestParameterSet('unlock')) && (getUserData('status') == 'LOCKED')) {
// Ok, unlock the account!
if (isExtensionInstalledAndNewer('user', '0.3.5')) {
// Prepare message
$message = getMaskedMessage('USER_ACCOUNT_UNLOCKED', bigintval(getRequestParameter('userid')));
- $ACT = true;
+ $isActive = true;
} elseif (isFormSent('del')) {
// Delete the account
- $ACT = true;
+ $isActive = true;
loadIncludeOnce('inc/modules/admin/what-del_user.php');
} elseif (isPostRequestParameterSet('no')) {
// Do not lock him...
if (!empty($url)) {
// Reload and die...
redirectToUrl($url);
- } elseif ($ACT) {
+ } elseif ($isActive) {
// An action was performed...
if (!empty($message)) {
loadTemplate('admin_settings_saved', false, '<div class="admin_failed">' . $message . '</div>');
// Fixes a bug which causes a parser error on eval'd code
if (empty($row_array[1])) $row_array[1] = 'NONE';
- // Get optimization status
- $REP = '{--OPTIMIZE_STATUS_' . str_replace('__', '_', str_replace(',', '', str_replace('+', '', str_replace("'", '', str_replace(' ', '_', strtoupper($row_array[1])))))) . '--}';
-
- $OPT = '{--OPTIMIZE_STATUS_UNSUPPORTED--}';
+ // Get repair/optimization status
+ $repairStatus = '{--OPTIMIZE_STATUS_' . str_replace('__', '_', str_replace(',', '', str_replace('+', '', str_replace("'", '', str_replace(' ', '_', strtoupper($row_array[1])))))) . '--}';
+ $optimizeStatus = '{--OPTIMIZE_STATUS_UNSUPPORTED--}';
if ($row_array[4] > 0) {
- $OPT = '{--OPTIMIZE_STATUS_OPTIMIZED--}';
+ $optimizeStatus = '{--OPTIMIZE_STATUS_OPTIMIZED--}';
$B1 = '<strong>'; $B2 = '<strong>';
$gain_tabs++;
} elseif (count(explode(' ', $row_array[2])) == 0) {
- $OPT = '{--OPTIMIZE_STATUS_' . strtoupper($row_array[2]) . '--}';
+ $optimizeStatus = '{--OPTIMIZE_STATUS_' . strtoupper($row_array[2]) . '--}';
}
// Prepare data for the row template
'b1' => $B1,
'b2' => $B2,
'tpl' => $row_array[0],
- 'rep' => $REP,
- 'opt' => $OPT,
+ 'rep' => $repairStatus,
+ 'opt' => $optimizeStatus,
'sum' => $row_array[3],
'sav' => $row_array[4],
);
$OUT .= loadTemplate('admin_optimize_row', true, $content);
} // END - foreach
+// Transfer main data
+$content = $DATA;
+
// Remember rows
$content['rows'] = $OUT;
// Transfer data to $content for template
-$content = merge_array($content, $DATA);
-$content['now_optimized'] = $gain_tabs;
+$content['now_optimized'] = $gain_tabs;
// Load main template
loadTemplate('admin_optimize', false, $content);
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-$ACTIONS = array();
+$actions = array();
// First fix all main menus (what = '')...
$result_fix = SQL_QUERY("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
-$cnt = '0'; $REP = '0';
+$cnt = '0'; $repairedWeights = '0';
while ($content = SQL_FETCHARRAY($result_fix)) {
// Store act value for later usage in sorting sub menus
- $ACTIONS[] = $content['action'];
+ $actions[] = $content['action'];
// Fix weight
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
- array($cnt, $content['id']), __FILE__, __LINE__);
- $REP += SQL_AFFECTEDROWS();
+ array($cnt, $content['id']), __FILE__, __LINE__);
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
-}
+} // END - while
// Set logout weight to 999
SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='999' WHERE `action`='logout' AND (`what`='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
-foreach ($ACTIONS as $action) {
+foreach ($actions as $action) {
$result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
array($action), __FILE__, __LINE__);
$cnt = 1;
while ($content = SQL_FETCHARRAY($result_fix)) {
// Fix weight
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`=%s WHERE `id`=%s LIMIT 1",
- array($cnt, $content['id']), __FILE__, __LINE__);
- $REP += SQL_AFFECTEDROWS();
+ array($cnt, $content['id']), __FILE__, __LINE__);
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
- }
-}
+ } // END - while
+} // END - foreach
// Repair finished
-if ($REP > 0) {
- $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
+if ($repairedWeights > 0) {
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $repairedWeights);
} else {
$message = '{--ADMIN_REPAIR_NOTHING_FIXED--}';
}
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-$ACTIONS = array();
+$actions = array();
+
// First fix all main menus (what = '')...
$result_fix = SQL_QUERY("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
-$cnt = '0'; $REP = '0';
+$cnt = '0'; $repairedWeights = '0';
while ($content = SQL_FETCHARRAY($result_fix)) {
// Store act value for later usage in sorting sub menus
- $ACTIONS[] = $content['action'];
+ $actions[] = $content['action'];
// Fix weight
$result_sort = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`='%s WHERE `id`=%s' LIMIT 1",
array($cnt, $content['id']), __FILE__, __LINE__);
// Get updated rows
- $REP += SQL_AFFECTEDROWS();
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
$result_sort = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET sort='999' WHERE `action`='logout' AND (`what`='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
-foreach ($ACTIONS as $action) {
+foreach ($actions as $action) {
$result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
array($action), __FILE__, __LINE__);
$cnt = 1;
// Fix weight
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`=%s WHERE `id`=%s LIMIT 1",
array($cnt, $content['id']), __FILE__, __LINE__);
- $REP += SQL_AFFECTEDROWS();
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
- }
-}
+ } // END - while
+} // END - foreach
// Repair finished
-if ($REP > 0) {
- $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
+if ($repairedWeights > 0) {
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $repairedWeights);
} else {
$message = '{--ADMIN_REPAIR_NOTHING_FIXED--}';
}
// Add description as navigation point
addMenuDescription('admin', __FILE__);
-$ACTIONS = array();
+$actions = array();
// First fix all main menus (what = '')...
$result_fix = SQL_QUERY("SELECT `id`, `action` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) AND `action` != 'logout' ORDER BY `sort` ASC", __FILE__, __LINE__);
-$cnt = '0'; $REP = '0';
+$cnt = '0'; $repairedWeights = '0';
while ($content = SQL_FETCHARRAY($result_fix)) {
// Store action value for later usage in sorting sub menus
- $ACTIONS[] = $content['action'];
+ $actions[] = $content['action'];
// Fix weight
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `sort`=%s WHERE `id`=%s LIMIT 1",
array($cnt, $content['id']), __FILE__, __LINE__);
- $REP += SQL_AFFECTEDROWS();
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
-}
+} // END - while
// Set logout weight to 999
SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET sort='999' WHERE `action`='logout' AND (`what`='' OR `what` IS NULL) LIMIT 1", __FILE__, __LINE__);
// Now sort every each menu
-foreach ($ACTIONS as $action) {
+foreach ($actions as $action) {
$result_fix = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
array($action), __FILE__, __LINE__);
$cnt = 1;
// Fix weight
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
array($cnt, $content['id']), __FILE__, __LINE__);
- $REP += SQL_AFFECTEDROWS();
+ $repairedWeights += SQL_AFFECTEDROWS();
// Count one up
$cnt++;
- }
-}
+ } // END - while
+} // END - foreach
// Repair finished
-if ($REP > 0) {
- $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $REP);
+if ($repairedWeights > 0) {
+ $message = getMaskedMessage('ADMIN_REPAIR_ENTRIES_FIXED', $repairedWeights);
} else {
$message = '{--ADMIN_REPAIR_NOTHING_FIXED--}';
}
if ($stats_id > 0) {
// Only when we got a real stats id continue searching for the entry
$type = 'NORMAL'; $rowName = 'stats_id';
- if ($bonus) { $type = 'BONUS'; $rowName = 'bonus_id'; }
+ if ($bonus) {
+ $type = 'BONUS';
+ $rowName = 'bonus_id';
+ } // END - if
// Try to look the entry up
$result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE %s='%s' AND `userid`=%s AND link_type='%s' LIMIT 1",
// Free memory
SQL_FREERESULT($result);
- }
- }
+ } // END - if
+ } // END - if
// Return status for sending routine
return $ret;