Naming convention applied: is outdated, use (not shortended word), fixed missing...
authorRoland Häder <roland@mxchange.org>
Sat, 6 Nov 2010 19:12:51 +0000 (19:12 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 6 Nov 2010 19:12:51 +0000 (19:12 +0000)
32 files changed:
inc/filters.php
inc/libs/doubler_functions.php
inc/libs/rallye_functions.php
inc/libs/surfbar_functions.php
inc/libs/yoomedia_functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-config_bonus.php
inc/modules/admin/what-config_register.php
inc/modules/admin/what-del_email.php
inc/modules/admin/what-del_holiday.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-list_beg.php
inc/modules/admin/what-list_bonus.php
inc/modules/admin/what-list_cats.php
inc/modules/admin/what-list_doubler.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-memedit.php
inc/modules/admin/what-repair_amnu.php
inc/modules/admin/what-repair_gmnu.php
inc/modules/admin/what-repair_mmnu.php
inc/modules/admin/what-surfbar_stats.php
inc/modules/guest/what-stats.php
inc/modules/guest/what-top10.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-order.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/template-functions.php

index 73828d0..5c538af 100644 (file)
@@ -109,10 +109,10 @@ function FILTER_FLUSH_FILTERS () {
                // Update all counters
                foreach ($GLOBALS['cache_array']['filter']['counter'] as $filterName => $filterArray) {
                        // Walk through all filters
-                       foreach ($filterArray as $filterFunction => $cnt) {
+                       foreach ($filterArray as $filterFunction => $count) {
                                // Construct and add the query
                                addSql(sprintf("UPDATE `{?_MYSQL_PREFIX?}_filters` SET `filter_counter`=%s WHERE `filter_name`='%s' AND `filter_function`='%s' LIMIT 1",
-                                       bigintval($cnt),
+                                       bigintval($count),
                                        $filterName,
                                        $filterFunction
                                ));
index 48b7668..979f3fe 100644 (file)
@@ -43,7 +43,6 @@ if (!defined('__SECURITY')) {
 // Generates a HTML table based on given data
 // @TODO Lame description
 function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
-       if (empty($cnt)) $cnt = '0';
        $add = ''; $DT_MODE = '0';
        if (isValidUserId($userid)) {
                // Load entries only from a single user
index a3f5957..40e601a 100644 (file)
@@ -91,8 +91,8 @@ ORDER BY
                $un = false;
 
                // Get refs by userid
-               $cnt = getReferalRallyeRefsCount($content['userid']);
-               if (empty($cnt)) $cnt = '0'; // Added prevent some unknown troubles... :-?
+               $count = getReferalRallyeRefsCount($content['userid']);
+               if (empty($count)) $count = '0'; // Added prevent some unknown troubles... :-?
 
                // Check if line is already included...
                $result_ref = SQL_QUERY_ESC("SELECT
@@ -143,14 +143,14 @@ WHERE
                                array(
                                        bigintval($id),
                                        bigintval($content['userid']),
-                                       bigintval($cnt),
+                                       bigintval($count),
                                        $cpoints
                                ), __FUNCTION__, __LINE__);
                        $un = true;
                } // END - if
 
                // Ignored but for the template required refs (made before start of rallye)
-               $content['refs']  = $cnt;
+               $content['refs']  = $count;
 
                // Shall I notify this member?
                if (($notify == 'Y') && ($un)) {
@@ -258,7 +258,7 @@ ORDER BY
        // Load all users
        while ($content = SQL_FETCHARRAY($result)) {
                // Get current refs
-               $cnt = getReferalRallyeRefsCount($content['userid'], $content['refs']);
+               $count = getReferalRallyeRefsCount($content['userid'], $content['refs']);
 
                // Points of ref's
                $result_ref = SQL_QUERY_ESC("SELECT
@@ -290,16 +290,16 @@ LIMIT 1",
                $userid = '---';
 
                // List only users with at least one ref!
-               //* DEBUG: */ debugOutput('*'.$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints.'*');
-               if (($cnt > 0) && ($refpoints > $content['curr_points'])) {
+               //* DEBUG: */ debugOutput('*'.$count.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints.'*');
+               if (($count > 0) && ($refpoints > $content['curr_points'])) {
                        $userid = $content['userid'];
                } else {
-                       $cnt = '';
+                       $count = '';
                }
 
                // Save values to array
                $DATA['userid'][]   = $userid;
-               $DATA['ref'][]      = $cnt;
+               $DATA['ref'][]      = $count;
                $DATA['cpoints'][]  = $content['curr_points'];
                $min_users  = $content['min_users'];
                $min_prices = $content['min_prices'];
@@ -448,7 +448,7 @@ function markReferalRallyesAsExpired ($result) {
 
        // Init array
        $DATA = array();
-       $cnt = '0';
+       $count = '0';
        $users = array();
        $DATA['title']  = $title;
        $DATA['start']  = generateDateTime($start, 1);
@@ -530,7 +530,7 @@ function markReferalRallyesAsExpired ($result) {
                        } // END - if
 
                        // Count userid
-                       $cnt++;
+                       $count++;
                        $users['userid'][$userid] = $userid;
                        $users['poi'][$userid] = $DATA['infos'];
                } // END - if
@@ -541,11 +541,11 @@ function markReferalRallyesAsExpired ($result) {
                $templ = 'admin_rallye_expired';
        } elseif (is_array($users['userid'])) {
                $templ = 'admin_rallye_expired_no';
-               $cnt = getReferalRallyeUserDataFromArray($users);
+               $count = getReferalRallyeUserDataFromArray($users);
        }
 
        // Send mail to admin
-       sendAdminNotification(getMaskedMessage('RALLYE_ADMIN_EXPIRED_SUBJECT', $title), $templ, $cnt);
+       sendAdminNotification(getMaskedMessage('RALLYE_ADMIN_EXPIRED_SUBJECT', $title), $templ, $count);
 
        // Add task (we ignore the task id here)
        createNewTask('{--RALLYE_ADMIN_EXPIRED--}: ' . $title, '{--RALLYE_ADMIN_EXPIRED_TEXT--}', 'RALLYE_EXPIRED');
@@ -640,7 +640,7 @@ function getArrayFromReferalRallyeUsers ($rallye) {
                array(bigintval($rallye)), __FUNCTION__, __LINE__);
        while ($content = SQL_FETCHARRAY($result_user)) {
                // Load current ref count
-               $cnt = getReferalRallyeRefsCount($content['userid'], $content['refs']);
+               $count = getReferalRallyeRefsCount($content['userid'], $content['refs']);
 
                // Points of ref's
                $result_ref = SQL_QUERY_ESC("SELECT
@@ -672,7 +672,7 @@ LIMIT 1",
 
                // Store calculated new refs to array
                $users['userid'][]  = $content['userid'];
-               $users['ref'][]     = abs($cnt - $content['refs']);
+               $users['ref'][]     = abs($count - $content['refs']);
                $users['cpoints'][] = $refpoints - $content['curr_points'];
        } // END - while
 
@@ -855,7 +855,7 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
        // Check current refs
        if (isExtensionInstalledAndNewer('cache', '0.1.2')) {
                // Get refs from cache
-               $cnt = '0';
+               $count = '0';
                foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
                        // Do we have a ref for this user?
                        //* DEBUG: */ debugOutput('id='.$id.',userid='.$userid.',userid='.$userid.',old='.$old.',level='.$GLOBALS['cache_array']['refsystem']['level'][$id]);
@@ -864,8 +864,8 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                                foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
                                        if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
                                                // Level does exist so abort here
-                                               $cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
-                                               //* DEBUG: */ debugOutput('*'.$userid.'/'.$cnt.'*');
+                                               $count = $GLOBALS['cache_array']['refsystem']['counter'][$id];
+                                               //* DEBUG: */ debugOutput('*'.$userid.'/'.$count.'*');
                                                break;
                                        } elseif ($level > 1) {
                                                // Not interesting here...
@@ -874,20 +874,20 @@ function getReferalRallyeRefsCount ($currUserid, $old = '0') {
                                } // END - foreach
 
                                // Abort also here!
-                               if ($cnt > 0) break;
+                               if ($count > 0) break;
                        } // END - if
                } // END - foreach
 
                //* DEBUG: */ debugOutput('<pre>'.print_r($GLOBALS['cache_array']['refsystem'], true).'</pre>');
                //* DEBUG: */ shutdown();
 
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Count cache hits
                        incrementStatsEntry('cache_hits');
 
                        // Remove old refs
-                       //* DEBUG: */ debugOutput('+'.$cnt.'/'.$old.'+');
-                       $cnt -= $old;
+                       //* DEBUG: */ debugOutput('+'.$count.'/'.$old.'+');
+                       $count -= $old;
                } // END - if
        } else {
                // Load current refs from database
@@ -907,20 +907,20 @@ WHERE
                        ), __FUNCTION__, __LINE__);
 
                // Load count @TODO Can't we rewrite this to our API?
-               list($cnt) = SQL_FETCHROW($result_ref);
+               list($count) = SQL_FETCHROW($result_ref);
 
                // Free result
                SQL_FREERESULT($result_ref);
-               if (empty($cnt)) {
-                       $cnt = '0';
+               if (empty($count)) {
+                       $count = '0';
                } else {
-                       $cnt -= $old;
+                       $count -= $old;
                }
        }
 
        // Return count
-       //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$cnt.'*');
-       return $cnt;
+       //* DEBUG: */ debugOutput('*'.$userid.'/'.$old.'/'.$count.'*');
+       return $count;
 }
 
 // Determines the right language string for min_users
index ee77841..3bd2526 100644 (file)
@@ -892,16 +892,16 @@ LIMIT 1",
        );
 
        // Fetch row
-       list($cnt) = SQL_FETCHROW($result);
+       list($count) = SQL_FETCHROW($result);
 
        // Free result
        SQL_FREERESULT($result);
 
        // Debug message
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $cnt);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $count);
 
        // Return result
-       return $cnt;
+       return $count;
 }
 
 // Check wether the user is allowed to book more URLs
@@ -940,10 +940,10 @@ function SURFBAR_GET_TOTAL_USER_URLS ($userid = '0', $status = '', $exclude = ''
        }
 
        // Get amount from database
-       $cnt = countSumTotalData($userid, 'surfbar_urls', 'url_id', 'url_userid', true, $add);
+       $count = countSumTotalData($userid, 'surfbar_urls', 'url_id', 'url_userid', true, $add);
 
        // Return result
-       return $cnt;
+       return $count;
 }
 
 // Generate a validation code for the given id number
@@ -1126,14 +1126,14 @@ LIMIT 1",
        );
 
        // Fetch counter
-       list($cnt) = SQL_FETCHROW($result);
+       list($count) = SQL_FETCHROW($result);
 
        // Free result
        SQL_FREERESULT($result);
 
        // Return check
-       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $cnt . ',' . SURFBAR_GET_SURF_LOCK() . '', false);
-       return ($cnt == 1);
+       //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'cnt=' . $count . ',' . SURFBAR_GET_SURF_LOCK() . '', false);
+       return ($count == 1);
 }
 
 // Determine which user hash no more points left
@@ -1225,13 +1225,13 @@ GROUP BY
        `stats_userid` ASC', __FUNCTION__, __LINE__);
 
        // Fetch count
-       $cnt = SQL_NUMROWS($result);
+       $count = SQL_NUMROWS($result);
 
        // Free result
        SQL_FREERESULT($result);
 
        // Return result
-       return $cnt;
+       return $count;
 }
 
 // Determine waiting time for one URL
index 5c5d437..5ee18e1 100644 (file)
@@ -189,19 +189,19 @@ function YOOMEDIA_PARSE_RESPONSE ($response, $type) {
        $dataArray = explode('|', $responseLine);
 
        // Now make the result array with two dimensions
-       $cnt = '0'; $entry = '0';
+       $count = '0'; $entry = '0';
        foreach ($dataArray as $line) {
                // Add the line
-               $result[$entry][yoomediaTranslateIndex($type, $cnt)] = $line;
+               $result[$entry][yoomediaTranslateIndex($type, $count)] = $line;
 
                // End of data of first entry reached?
-               if ($cnt == 6) {
+               if ($count == 6) {
                        // Then advance to next entry and reset counter
                        $entry++;
-                       $cnt = '0';
+                       $count = '0';
                } else {
                        // Count up
-                       $cnt++;
+                       $count++;
                }
        } // END - foreach
 
index 0f7b489..083d62b 100644 (file)
@@ -685,7 +685,7 @@ function adminGetMenuMode () {
 
 // Change activation status
 function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
-       $cnt = '0'; $newStatus = 'Y';
+       $count = '0'; $newStatus = 'Y';
        if ((is_array($IDs)) && (count($IDs) > 0)) {
                // "Walk" all through and count them
                foreach ($IDs as $id => $selected) {
@@ -711,7 +711,7 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                                        array($table, $row, $newStatus, $idRow, $id), __FUNCTION__, __LINE__);
 
                                        // Count up affected rows
-                                       $cnt += SQL_AFFECTEDROWS();
+                                       $count += SQL_AFFECTEDROWS();
                                } // END - if
 
                                // Free the result
@@ -720,7 +720,7 @@ function adminChangeActivationStatus ($IDs, $table, $row, $idRow = 'id') {
                } // END - foreach
 
                // Output status
-               loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_STATUS_CHANGED'), $cnt, count($IDs)));
+               loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_STATUS_CHANGED'), $count, count($IDs)));
        } else {
                // Nothing selected!
                loadTemplate('admin_settings_saved', false, '{--ADMIN_NOTHING_SELECTED_CHANGE--}');
index 3e7c968..45d42bc 100644 (file)
@@ -56,10 +56,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        // @TODO Kill all constants in this file
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what`, `descr` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
@@ -73,7 +73,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                                        'sel'    => $sel,
                                        'menu'   => $data['title'],
                                        'descr'  => $data['descr'],
-                                       'cnt'    => $cnt,
+                                       'cnt'    => $count,
                                );
 
                                // Load row template
@@ -94,7 +94,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        } // END - foreach
 
        $content['rows'] = $OUT;
-       $content['cnt'] = $cnt;
+       $content['cnt'] = $count;
 
        // Load template
        loadTemplate('admin_edit_admin_menu_form', false, $content);
@@ -104,10 +104,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        $content['chk'] = countPostSelection();
 
        // Del menu entries with or without confirmation
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
@@ -117,7 +117,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                                // Prepare data for the row template
                                $data = array(
                                        'menu' => $data['title'],
-                                       'cnt'  => $cnt,
+                                       'cnt'  => $count,
                                        'sel'  => $sel,
                                );
                                $OUT .= loadTemplate('admin_delete_admin_menu_row', true, $data);
@@ -132,7 +132,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                } // END - if
        } // END - switch
        $content['rows'] = $OUT;
-       $content['cnt'] = $cnt;
+       $content['cnt'] = $count;
 
        // Load template
        loadTemplate('admin_delete_admin_menu', false, $content);
@@ -197,19 +197,19 @@ LIMIT 1",
                $content['sub'] = $SUB;
 
                // Init variables
-               $OUT = ''; $cnt = '0';
+               $OUT = ''; $count = '0';
 
                // Process all entries
                while ($data = SQL_FETCHARRAY($result)) {
                        // Count this entry
-                       $cnt++;
+                       $count++;
 
                        // Init navigation variable
                        $data['navi'] = '';
                        if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($SUB)))) {
                                // Is highest position
                                $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
-                       } elseif ($cnt == SQL_NUMROWS($result)) {
+                       } elseif ($count == SQL_NUMROWS($result)) {
                                // Is lowest position
                                $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($data['sort'] > 0) {
index ba00189..0274e01 100644 (file)
@@ -83,21 +83,21 @@ if (isFormSent()) {
 
        // Generate list
        $OUT = '<ol start="2">';
-       $cnt = '0';
+       $count = '0';
        foreach ($RANKS as $k => $rate) {
                if (!empty($rate)) {
                        // Print only when something is in
                        $OUT .= '<li><input type="text" name="rate[' . ($k + 2) . ']" class="form_field" size="4" maxlength="7" value="' . $rate . '" /> <div class="notice">({?POINTS?})</div></li>';
                } // END - if
-               $cnt++;
+               $count++;
        } // END - foreach
 
        // Maxmium entries
        $max = 10;
-       if ($cnt >= 8) $max = $cnt+3;
+       if ($count >= 8) $max = $count+3;
 
        // Add more empty fields
-       for ($i = $cnt; $i < $max; $i++) {
+       for ($i = $count; $i < $max; $i++) {
                $OUT .= '  <li><input type="text" name="rate[' . ($i+2) . ']" class="form_field" size="4" maxlength="7" /> <div class="notice">({?POINTS?})</div></li>';
        } // END - for
        $OUT .= '</ol>';
index 31775b8..3cce559 100644 (file)
@@ -46,7 +46,7 @@ addMenuDescription('admin', __FILE__);
 // Do we want to save changes?
 if (isFormSent()) {
        // Begin counting
-       $cnt = 0;
+       $count = 0;
 
        // Update all entries
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -55,11 +55,11 @@ if (isFormSent()) {
                        array($value, bigintval($id), $value),__FILE__, __LINE__);
 
                // Get affected rows
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
        } // END - foreach
 
        // Output message for updated entries
-       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_REGISTER_CHANGES_SAVED', $cnt));
+       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_REGISTER_CHANGES_SAVED', $count));
 } // END - if
 
 // List all register values
index 1b8996f..d64478c 100644 (file)
@@ -44,7 +44,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addMenuDescription('admin', __FILE__);
 
 // Init counter for deleted mails
-$cnt = '0';
+$count = '0';
 
 if (isGetRequestParameterSet('mid')) {
        // Load email data
@@ -132,7 +132,7 @@ LIMIT 1",
                        // Remove links from DB
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `stats_id`=%s",
                                array(bigintval($stats_id)), __FILE__, __LINE__);
-                       $cnt += SQL_AFFECTEDROWS();
+                       $count += SQL_AFFECTEDROWS();
 
                        // Load template for link
                        loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&amp;what=del_email&amp;pid=' . bigintval(getRequestParameter('mid')) . '%}">{--ADMIN_REMOVE_STATS_ENTRY--}</a>');
@@ -144,10 +144,10 @@ LIMIT 1",
                // Delete mail from queue
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
                        array(bigintval(getRequestParameter('mid'))), __FILE__, __LINE__);
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
 
                // Output link for manually removing stats entry
-               outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $cnt));
+               outputHtml(getMaskedMessage('ADMIN_DELETED_MAILS_COUNT', $count));
        } else {
                // Mail already deleted!
                loadTemplate('admin_settings_saved', false, '{--ADMIN_NORMAL_MAIL_ALREADY_DELETED--}');
@@ -176,19 +176,19 @@ LIMIT 1",
                reduceRecipientReceivedMails('bonus_id', getRequestParameter('bid'), $content['mails_sent']);
 
                // Init counter for deleted mails
-               $cnt = '0';
+               $count = '0';
 
                // Delete bonus mail entirely from database
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
                        array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                        array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
 
                // Prepare data for the template
                $content['timestamp'] = generateDateTime($content['timestamp'], 0);
-               $content['cnt']       = $cnt;
+               $content['cnt']       = $count;
 
                // Load template
                loadTemplate('admin_delete_email_bonus', false, $content);
@@ -210,19 +210,19 @@ LIMIT 1",
                $content = SQL_FETCHARRAY($result);
 
                // Init counter for deleted mails
-               $cnt = '0';
+               $count = '0';
 
                // Delete bonus mail entirely from database
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
                        array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                        array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
-               $cnt += SQL_AFFECTEDROWS();
+               $count += SQL_AFFECTEDROWS();
 
                // Prepare data for the template
                $content['timestamp'] = generateDateTime($content['timestamp'], 0);
-               $content['cnt']       = $cnt;
+               $content['cnt']       = $count;
 
                // Load template
                loadTemplate('admin_delete_email_notify', false, $content);
index ed25e6d..d38a768 100644 (file)
@@ -46,7 +46,7 @@ addMenuDescription('admin', __FILE__);
 // Shall I delete selected holidays???
 if (ifPostContainsSelections()) {
        // Delete multiple holiday requests (for list_holiday)
-       $cnt = '0';
+       $count = '0';
        foreach (postRequestParameter('sel') as $id => $sel) {
                // Get the userid
                $result = SQL_QUERY_ESC("SELECT
@@ -83,13 +83,13 @@ LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
                        // Send email to user
                        $message = loadEmailTemplate('member_holiday_removed', $content, $content['userid']);
                        sendEmail($content['userid'], '{--ADMIN_HOLIDAY_REMOVED_SUBJECT--}', $message);
-                       $cnt++;
+                       $count++;
                } // END - if
 
                // Free result
                SQL_FREERESULT($result);
        } // END - foreach
-       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_HOLIDAY_MULTI_DELETE', $cnt));
+       loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_HOLIDAY_MULTI_DELETE', $count));
 } elseif (isGetRequestParameterSet('userid')) {
        // Set default message
        $message = '{--ADMIN_HOLIDAY_SINGLE_404--}';
index 2a9d15f..69c5b0a 100644 (file)
@@ -57,10 +57,10 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
 
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
@@ -69,7 +69,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
 
                                // Prepapre content
                                $DATA = array(
-                                       'cnt'    => $cnt,
+                                       'cnt'    => $count,
                                        'sel'    => $sel,
                                        'action' => adminAddMenuSelectionBox('guest', 'action', 'sel_action[' . $sel . ']', $DATA['action']),
                                        'what'   => adminAddMenuSelectionBox('guest', 'what'  , 'sel_what['   . $sel . ']', $DATA['what']),
@@ -92,7 +92,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        } // END - foreach
 
        $content['rows'] = $OUT;
-       $content['cnt']  = $cnt;
+       $content['cnt']  = $count;
 
        // Load template
        loadTemplate('admin_edit_guest_menu_form', false, $content);
@@ -101,19 +101,19 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
 
-       $cnt = '0';
+       $count = '0';
        $OUT = '';
 
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                $DATA = SQL_FETCHARRAY($result);
                                $DATA = array(
-                                       'cnt'  => $cnt,
+                                       'cnt'  => $count,
                                        'menu' => $DATA['title'],
                                        'sel'  => $sel,
                                );
@@ -129,7 +129,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                } // END - if
        } // END - foreach
        $content['rows'] = $OUT;
-       $content['cnt']  = $cnt;
+       $content['cnt']  = $count;
 
        // Load template
        loadTemplate('admin_delete_guest_menu', false, $content);
@@ -139,17 +139,17 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        $content['chk'] = countPostSelection();
 
        // Load template
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                $data = SQL_FETCHARRAY($result);
                                $data = array(
-                                       'cnt'     => $cnt,
+                                       'cnt'     => $count,
                                        'menu'    => $data['title'],
                                        'sel'     => $sel,
                                        'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel),
@@ -169,7 +169,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                        SQL_FREERESULT($result);
                } // END - if
        } // END - foreach
-       $content['cnt']  = $cnt;
+       $content['cnt']  = $count;
        $content['rows'] = $OUT;
 
        // Load template
@@ -197,16 +197,16 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                $content['sub'] = $subMenu;
 
                // Init variables
-               $cnt = '0';
+               $count = '0';
                $OUT = '';
 
                // Process all menu entries
                while ($data = SQL_FETCHARRAY($result)) {
-                       $cnt++;
+                       $count++;
                        if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) {
                                // Is highest position
                                $NAVI = '<a href="{%url=modules.php?module=admin&amp;what=guestedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
-                       } elseif ($cnt == SQL_NUMROWS($result)) {
+                       } elseif ($count == SQL_NUMROWS($result)) {
                                // Is lowest position
                                $NAVI = '<a href="{%url=modules.php?module=admin&amp;what=guestedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($data['sort'] > 0) {
index 65711bc..2f2aece 100644 (file)
@@ -75,13 +75,13 @@ ORDER BY
 
        if (!SQL_HASZERONUMS($result)) {
                // List users
-               $OUT = ''; $cnt = 1; $total = '0';
+               $OUT = ''; $count = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Init variables
                        $WIN1 = ''; $WIN2 = '';
 
                        // Maybe he can win his active beg?
-                       if ($cnt <= getConfig('beg_ranks')) {
+                       if ($count <= getConfig('beg_ranks')) {
                                // Mark him
                                $WIN1 = '<strong>';
                                $WIN2 = '</strong>';
@@ -96,12 +96,12 @@ ORDER BY
                                'last_online' => generateDateTime($content['last_online'], 2),
                                'win1'        => $WIN1,
                                'win2'        => $WIN2,
-                               'cnt'         => $cnt,
+                               'cnt'         => $count,
                        );
 
                        // Load template and add it
                        $OUT .= loadTemplate('admin_list_beg_rows', true, $content);
-                       $cnt++; $total += $content['beg_points'];
+                       $count++; $total += $content['beg_points'];
                } // END - while
 
                $content['rows']  = $OUT;
index ef9631c..37d9fe1 100644 (file)
@@ -91,14 +91,14 @@ ORDER BY
 
        if (!SQL_HASZERONUMS($result)) {
                // List users
-               $OUT = ''; $cnt = 1; $total = '0';
+               $OUT = ''; $count = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Add total points
                        $total += $content['points'];
 
                        // Generate array fore the dynamic template
                        $WIN1 = ''; $WIN2 = '';
-                       if ($cnt <= getConfig('bonus_ranks')) {
+                       if ($count <= getConfig('bonus_ranks')) {
                                // Maybe he can win his active bonus?
                                $WIN1 = '<strong>';
                                $WIN2 = '</strong>';
@@ -109,11 +109,11 @@ ORDER BY
                        $content['last_online'] = generateDateTime($content['last_online'], 2);
                        $content['win1']   = $WIN1;
                        $content['win2']   = $WIN2;
-                       $content['cnt']    = $cnt;
+                       $content['cnt']    = $count;
 
                        // Load template and add it
                        $OUT .= loadTemplate('admin_list_bonus_rows', true, $content);
-                       $cnt++;
+                       $count++;
                } // END - while
 
                $content['rows']  = $OUT;
index 5ddb110..ab42a2f 100644 (file)
@@ -60,7 +60,7 @@ if (isGetRequestParameterSet('userid')) {
 
                if (!SQL_HASZERONUMS($result_cats)) {
                        // List categories
-                       $cnt = 1; $OUT = '';
+                       $count = 1; $OUT = '';
                        while ($row = SQL_FETCHARRAY($result_cats)) {
                                // Merge both arrays
                                $content = merge_array($content, $row);
@@ -75,12 +75,12 @@ if (isGetRequestParameterSet('userid')) {
                                if (SQL_NUMROWS($result_user) == 1) $selection = '<font color="#00ee00">{--YES--}</div>';
 
                                // Add more elements
-                               $content['cnt'] = $cnt;
+                               $content['cnt'] = $count;
                                $content['sel'] = $selection;
 
                                // Load row template and count up
                                $OUT .= loadTemplate('admin_list_cats_row', true, $content);
-                               $cnt++;
+                               $count++;
                        } // END - while
 
                        // Free memory
index 0304160..b17abeb 100644 (file)
@@ -71,37 +71,37 @@ switch (getRequestParameter('mode')) {
                $sumAlready = '0'; $sumWaiting = '0';
 
                // Number of direct already payouts and referal
-               $cnt = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='N'");
+               $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='N'");
 
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Something was payed out
-                       $sumAlready += $cnt;
-                       $content['already_direct_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=direct%}">' . $cnt . '</a>';
+                       $sumAlready += $count;
+                       $content['already_direct_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=direct%}">' . $count . '</a>';
                } // END - if
 
-               $cnt = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='Y'");
+               $count = countSumTotalData('Y','doubler','id','completed',true, " AND `is_ref`='Y'");
 
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Something was payed out
-                       $sumAlready += $cnt;
-                       $content['already_ref_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=ref%}">' . $cnt . '</a>';
+                       $sumAlready += $count;
+                       $content['already_ref_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=already&amp;select=ref%}">' . $count . '</a>';
                } // END - if
 
                // And the same for waiting pouts (direct and referal)
-               $cnt = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='N'");
+               $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='N'");
 
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Something was payed out
-                       $sumWaiting += $cnt;
-                       $content['waiting_direct_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=direct%}">' . $cnt . '</a>';
+                       $sumWaiting += $count;
+                       $content['waiting_direct_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=direct%}">' . $count . '</a>';
                } // END - if
 
-               $cnt = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='Y'");
+               $count = countSumTotalData('N','doubler','id','completed',true, " AND `is_ref`='Y'");
 
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Something was payed out
-                       $sumWaiting += $cnt;
-                       $content['waiting_ref_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=ref%}">' . $cnt . '</a>';
+                       $sumWaiting += $count;
+                       $content['waiting_ref_link'] = '<a href="{%url=modules.php?module=admin&amp;what=list_doubler&amp;mode=waiting&amp;select=ref%}">' . $count . '</a>';
                } // END - if
 
                // Links for all
index 393b026..2ff2088 100644 (file)
@@ -242,14 +242,14 @@ ORDER BY
                $content['rallye'] = getRequestParameter('rallye');
                while ($row = SQL_FETCHARRAY($result)) {
                        // Check for referal count
-                       $cnt = getReferalRallyeRefsCount($row['userid'], $row['refs']);
+                       $count = getReferalRallyeRefsCount($row['userid'], $row['refs']);
 
                        // Init variables
                        $bl = '';
                        $br = '';
 
                        // Output row
-                       if (($row['curr_points'] > 0) && ($cnt > 0)) {
+                       if (($row['curr_points'] > 0) && ($count > 0)) {
                                $bl = '<strong>';
                                $br = '</strong>';
                        } // END - if
@@ -264,7 +264,7 @@ ORDER BY
                                'bold_l'  => $bl ,
                                'bold_r'  => $br ,
                                'refs'    => $row['refs'],
-                               'cnt'     => $cnt,
+                               'cnt'     => $count,
                                'opoints' => ($points - $row['curr_points']),
                        );
 
index 6e3405d..b7f294f 100644 (file)
@@ -56,17 +56,17 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        // Edit menu entries
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`, `action`, `what` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                $data = SQL_FETCHARRAY($result);
                                $data = array(
-                                       'cnt'    => $cnt,
+                                       'cnt'    => $count,
                                        'sel'    => $sel,
                                        'menu'   => $data['title'],
                                        'action' => adminAddMenuSelectionBox('member', 'action', 'sel_action[' . $sel . ']', $data['action']),
@@ -90,7 +90,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
 
        // Add row content and current counter
        $content['rows'] = $OUT;
-       $content['cnt'] = $cnt;
+       $content['cnt'] = $count;
 
        // Load template
        loadTemplate('admin_edit_member_menu', false, $content);
@@ -98,17 +98,17 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        // Del menu entries with or without confirmation
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                list($title) = SQL_FETCHROW($result);
                                $content = array(
-                                       'cnt'   => $cnt,
+                                       'cnt'   => $count,
                                        'sel'   => $sel,
                                        'title' => $title
                                );
@@ -128,7 +128,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                } // END - if
        } // END - foreach
        $content['rows'] = $OUT;
-       $content['cnt'] = $cnt;
+       $content['cnt'] = $count;
 
        // Load template
        loadTemplate('admin_delete_member_menu', false, $content);
@@ -136,17 +136,17 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        // Change status (visible / locked)
        $content['sub'] = $subMenu;
        $content['chk'] = countPostSelection();
-       $cnt = '0'; $OUT = '';
+       $count = '0'; $OUT = '';
        foreach (postRequestParameter('sel') as $sel => $confirm) {
                if ($confirm == 1) {
-                       $cnt++;
+                       $count++;
                        $result = SQL_QUERY_ESC("SELECT `title`, `visible`, `locked` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE ".$AND." AND `id`=%s LIMIT 1",
                                array(bigintval($sel)), __FILE__, __LINE__);
                        if (SQL_NUMROWS($result) == 1) {
                                // Entry found so we load the stuff...
                                $data = SQL_FETCHARRAY($result);
                                $data = array(
-                                       'cnt'     => $cnt,
+                                       'cnt'     => $count,
                                        'menu'    => $data['title'],
                                        'sel'     => $sel,
                                        'visible' => addSelectionBox('yn', $data['visible'], 'visible', $sel),
@@ -168,7 +168,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                } // END - if
        } // END - foreach
        $content['rows'] = $OUT;
-       $content['cnt'] = $cnt;
+       $content['cnt'] = $count;
 
        // Load template
        loadTemplate('admin_member_menu_status', false, $content);
@@ -192,15 +192,15 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
                // Set sub value
                $content['sub'] = $subMenu;
 
-               $cnt = '0'; $OUT = '';
+               $count = '0'; $OUT = '';
                while ($data = SQL_FETCHARRAY($result)) {
                        // Init navigation
                        $data['navi'] = '';
-                       $cnt++;
+                       $count++;
                        if (($data['sort'] == '0') || (($data['sort'] == 1) && (!empty($subMenu)))) {
                                // Is highest position
                                $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']+1) . '&amp;fid=' . $data['sort'] . '%}">{--LOWER--}</a>';
-                       } elseif ($cnt == SQL_NUMROWS($result)) {
+                       } elseif ($count == SQL_NUMROWS($result)) {
                                // Is lowest position
                                $data['navi'] = '<a href="{%url=modules.php?module=admin&amp;what=adminedit&amp;sub=' . $content['sub'] . '&amp;act=' . $data['action'] . '&amp;w=' . $data['what'] . '&amp;tid=' . ($data['sort']-1) . '&amp;fid=' . $data['sort'] . '%}">{--HIGHER--}</a>';
                        } elseif ($data['sort'] > 0) {
index 4017842..6aa9f0c 100644 (file)
@@ -47,18 +47,18 @@ $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'; $repairedWeights = '0';
+$count = '0'; $repairedWeights = '0';
 while ($content = SQL_FETCHARRAY($result_fix)) {
        // Store act value for later usage in sorting sub menus
        $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__);
+               array($count, $content['id']), __FILE__, __LINE__);
        $repairedWeights += SQL_AFFECTEDROWS();
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
 // Set logout weight to 999
@@ -68,15 +68,15 @@ SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_admin_menu` SET `sort`='999' WHERE `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;
+       $count = 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__);
+                       array($count, $content['id']), __FILE__, __LINE__);
                $repairedWeights += SQL_AFFECTEDROWS();
 
                // Count one up
-               $cnt++;
+               $count++;
        } // END - while
 } // END - foreach
 
index 71c833c..030fb91 100644 (file)
@@ -47,20 +47,20 @@ $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'; $repairedWeights = '0';
+$count = '0'; $repairedWeights = '0';
 while ($content = SQL_FETCHARRAY($result_fix)) {
        // Store act value for later usage in sorting sub menus
        $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__);
+               array($count, $content['id']), __FILE__, __LINE__);
 
        // Get updated rows
        $repairedWeights += SQL_AFFECTEDROWS();
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
 // Set logout weight to 999
@@ -70,15 +70,15 @@ $result_sort = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET sort='999' W
 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;
+       $count = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_guest_menu` SET `sort`=%s WHERE `id`=%s LIMIT 1",
-               array($cnt, $content['id']), __FILE__, __LINE__);
+                       array($count, $content['id']), __FILE__, __LINE__);
                $repairedWeights += SQL_AFFECTEDROWS();
 
                // Count one up
-               $cnt++;
+               $count++;
        } // END - while
 } // END - foreach
 
index 17b2f93..42dd10a 100644 (file)
@@ -47,18 +47,18 @@ $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'; $repairedWeights = '0';
+$count = '0'; $repairedWeights = '0';
 while ($content = SQL_FETCHARRAY($result_fix)) {
        // Store action value for later usage in sorting sub menus
        $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__);
+       array($count, $content['id']), __FILE__, __LINE__);
        $repairedWeights += SQL_AFFECTEDROWS();
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
 // Set logout weight to 999
@@ -68,15 +68,15 @@ SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET sort='999' WHERE `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;
+       $count = 1;
        while ($content = SQL_FETCHARRAY($result_fix)) {
                // Fix weight
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET sort=%s WHERE `id`=%s LIMIT 1",
-               array($cnt, $content['id']), __FILE__, __LINE__);
+               array($count, $content['id']), __FILE__, __LINE__);
                $repairedWeights += SQL_AFFECTEDROWS();
 
                // Count one up
-               $cnt++;
+               $count++;
        } // END - while
 } // END - foreach
 
index ed2f4fd..6d1f64d 100644 (file)
@@ -61,7 +61,7 @@ ORDER BY
        // Entries found?
        if (!SQL_HASZERONUMS($result)) {
                // Get all rows
-               $OUT = ''; $cnt = '0'; $visits = '0';
+               $OUT = ''; $count = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                        // Count totals
                        $visits += $content['total_visits'];
@@ -71,13 +71,13 @@ ORDER BY
 
                        // Load row template
                        $OUT .= loadTemplate('admin_surfbar_url_stats_row', true, $content);
-                       $cnt++;;
+                       $count++;;
                } // END - while
 
                // Prepare content
                $content = array(
                        'rows'    => $OUT,
-                       'userids' => $cnt,
+                       'userids' => $count,
                        'visits'  => $visits
                );
 
index a9fa152..31a56e8 100644 (file)
@@ -123,7 +123,7 @@ switch (getConfig('guest_stats')) {
 
                // Generate monthly stats
                $SW = 2; $r2 = ' right'; $l = 'll'; $r = 'lr'; $OUT = '';
-               foreach ($months as $month => $cnt) {
+               foreach ($months as $month => $count) {
                        if ($SW == 2) $OUT .= '<tr>';
 
                        // Prepare data for template
@@ -132,7 +132,7 @@ switch (getConfig('guest_stats')) {
                                'm_descr'  => $GLOBALS['month_descr'][$month],
                                'r_class'  => $r,
                                'r2_class' => $r2,
-                               'cnt'      => $cnt
+                               'cnt'      => $count
                        );
 
                        // Load row template
@@ -152,11 +152,11 @@ switch (getConfig('guest_stats')) {
 
                // Generate category stats
                $OUT = '';
-               foreach ($cat_cnt as $id => $cnt) {
+               foreach ($cat_cnt as $id => $count) {
                        // Prepare data for the template
                        $data = array(
                                'cat' => $cats[$id],
-                               'cnt' => $cnt,
+                               'cnt' => $count,
                        );
 
                        // Load row template and switch colors
index 55a275c..335be6b 100644 (file)
@@ -63,7 +63,7 @@ ORDER BY
        `total_logins` DESC
 LIMIT {?top10_max?}", __FILE__, __LINE__);
 
-$OUT = ''; $cnt = 1;
+$OUT = ''; $count = 1;
 while ($content = SQL_FETCHARRAY($result)) {
        // Init nickname
        $content['nickname'] = '';
@@ -73,7 +73,7 @@ while ($content = SQL_FETCHARRAY($result)) {
 
        // Prepare data for template
        $content = array(
-               'cnt'          => $cnt,
+               'cnt'          => $count,
                'userid'       => $content['userid'],
                'nickname'     => $content['nickname'],
                'total_logins' => $content['total_logins'],
@@ -85,12 +85,12 @@ while ($content = SQL_FETCHARRAY($result)) {
        $OUT .= loadTemplate('guest_top10_row_login', true, $content);
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
-if ($cnt < getConfig('top10_max')) {
+if ($count < getConfig('top10_max')) {
        // Add more "blank" rows
-       for ($i = $cnt; $i <= getConfig('top10_max'); $i++) {
+       for ($i = $count; $i <= getConfig('top10_max'); $i++) {
                // Prepare data for template
                $content = array(
                        'index' => $i
@@ -128,7 +128,7 @@ ORDER BY
        d.last_online DESC
 LIMIT {?top10_max?}", __FILE__, __LINE__);
 
-$OUT = ''; $cnt = 1;
+$OUT = ''; $count = 1;
 while ($content = SQL_FETCHARRAY($result)) {
        // Init nickname
        $content['nickname'] = '';
@@ -138,7 +138,7 @@ while ($content = SQL_FETCHARRAY($result)) {
 
        // Prepare data for template
        $content = array(
-               'cnt'         => $cnt,
+               'cnt'         => $count,
                'userid'      => $content['userid'],
                'nickname'    => $content['nickname'],
                'points'      => $content['points'],
@@ -149,12 +149,12 @@ while ($content = SQL_FETCHARRAY($result)) {
        $OUT .= loadTemplate('guest_top10_row_earner', true, $content);
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
-if ($cnt < getConfig('top10_max')) {
+if ($count < getConfig('top10_max')) {
        // Add more "blank" rows
-       for ($i = $cnt; $i <= getConfig('top10_max'); $i++) {
+       for ($i = $count; $i <= getConfig('top10_max'); $i++) {
                // Prepare data for template
                $content = array(
                        'index' => $i
@@ -192,7 +192,7 @@ ORDER BY
        d.last_online DESC
 LIMIT {?top10_max?}", __FILE__, __LINE__);
 
-$OUT = ''; $cnt = 1;
+$OUT = ''; $count = 1;
 while ($content = SQL_FETCHARRAY($result)) {
        // Init nickname
        $content['nickname'] = '';
@@ -202,7 +202,7 @@ while ($content = SQL_FETCHARRAY($result)) {
 
        // Prepare data for template
        $content = array(
-               'cnt'         => $cnt,
+               'cnt'         => $count,
                'userid'      => $content['userid'],
                'refs'        => $content['refs'],
                'nickname'    => $content['nickname'],
@@ -214,12 +214,12 @@ while ($content = SQL_FETCHARRAY($result)) {
        $OUT .= loadTemplate('guest_top10_row_refs', true, $content);
 
        // Count one up
-       $cnt++;
+       $count++;
 } // END - while
 
-if ($cnt < getConfig('top10_max')) {
+if ($count < getConfig('top10_max')) {
        // Add more "blank" rows
-       for ($i = $cnt; $i <= getConfig('top10_max'); $i++) {
+       for ($i = $count; $i <= getConfig('top10_max'); $i++) {
                // Prepare data for template
                $content = array(
                        'index' => $i
index aff0de7..3b8db5b 100644 (file)
@@ -81,11 +81,11 @@ LIMIT {?beg_ranks?}",
 $OUT = '';
 if (!SQL_HASZERONUMS($result)) {
        // Load our winners...
-       $cnt = 1;
+       $count = 1;
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
                $content = array(
-                       'cnt'         => $cnt,
+                       'cnt'         => $count,
                        'userid'      => $content['userid'],
                        'points'      => $content['points'],
                        'last_online' => generateDateTime($content['last_online'], 2),
@@ -95,7 +95,7 @@ if (!SQL_HASZERONUMS($result)) {
                $OUT .= loadTemplate('member_list_beg_row', true, $content);
 
                // Count one up
-               $cnt++;
+               $count++;
        } // END - while
 } else {
        // No one is interested in our "active rallye" ! :-(
index 7d878dc..870c367 100644 (file)
@@ -94,17 +94,17 @@ LIMIT {?bonus_ranks?}",
 $OUT = '';
 if (!SQL_HASZERONUMS($result)) {
        // Load our winners...
-       $cnt = 1;
+       $count = 1;
        while ($content = SQL_FETCHARRAY($result)) {
                // Prepare data for the template
-               $content['cnt']         = $cnt;
+               $content['cnt']         = $count;
                $content['last_online'] = generateDateTime($content['last_online'], 2);
 
                // Load row template
                $OUT .= loadTemplate('member_bonus_row', true, $content);
 
                // Count one up
-               $cnt++;
+               $count++;
        } // END - while
 } else {
        // No one is interested in our "active rallye" ! :-(
index 134384b..debdd3b 100644 (file)
@@ -55,12 +55,12 @@ $result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`".$whereSta
 if (SQL_NUMROWS($result) > 0) {
        $LEAST = false;
        if (isFormSent()) {
-               $cnt = '0';
+               $count = '0';
                foreach (postRequestParameter('cat') as $cat => $joined) {
-                       if ($joined != 'Y') $cnt++;
+                       if ($joined != 'Y') $count++;
                } // END - foreach
 
-               if ((SQL_NUMROWS($result) - $cnt) < getConfig('least_cats')) {
+               if ((SQL_NUMROWS($result) - $count) < getConfig('least_cats')) {
                        unsetPostRequestParameter('ok');
                        $LEAST = true;
                } // END - if
@@ -69,7 +69,7 @@ if (SQL_NUMROWS($result) > 0) {
        // Is the form sent?
        if (isFormSent()) {
                // Start counting all
-               $cnt = '0';
+               $count = '0';
 
                // Go through all entries
                foreach (postRequestParameter('cat') as $cat => $joined) {
@@ -100,12 +100,12 @@ if (SQL_NUMROWS($result) > 0) {
                                SQL_QUERY_ESC(trim($sql), array(getMemberId(), bigintval($cat)), __FILE__, __LINE__);
 
                                // Count this row
-                               $cnt += SQL_AFFECTEDROWS();
+                               $count += SQL_AFFECTEDROWS();
                        } // END - if
                } // END - foreach
 
                // Categories saved?
-               if ($cnt > 0) {
+               if ($count > 0) {
                        // Output message
                        loadTemplate('admin_settings_saved', false, '{--MEMBER_CATEGORIES_SAVED--}');
                } else {
index 2dff54b..21b6909 100644 (file)
@@ -210,7 +210,7 @@ ORDER BY
                // Do we enougth receivers left?
                if (SQL_NUMROWS($result) >= postRequestParameter('receiver')) {
                        // Load receivers from database
-                       $TEST = array(); $cnt = '0';
+                       $TEST = array(); $count = '0';
                        while ($holidayContent = SQL_FETCHARRAY($result)) {
                                if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
                                        // Check for his holiday status
@@ -231,7 +231,7 @@ LIMIT 1",
                                if ($holidayContent['userid'] > 0) {
                                        // Add receiver
                                        $TEST[] = $holidayContent['userid'];
-                                       $cnt++;
+                                       $count++;
                                } // END - if
                        } // END - while
 
@@ -441,7 +441,7 @@ ORDER BY
                                        array(bigintval($categoriesContent['id']), getMemberId()), __FILE__, __LINE__);
 
                                $userid_cnt = '0';
-                               while (list($ucat) = SQL_FETCHROW($result_userids)) {
+                               while (list($userid) = SQL_FETCHROW($result_userids)) {
                                        // Check for holiday system
                                        $isHolidayActive = false;
                                        if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
@@ -462,28 +462,28 @@ WHERE
        h.holiday_start < UNIX_TIMESTAMP() AND
        h.holiday_end > UNIX_TIMESTAMP()
 LIMIT 1",
-                                                       array(bigintval($ucat)), __FILE__, __LINE__);
+                                                       array(bigintval($userid)), __FILE__, __LINE__);
 
                                                // Fetch entry
-                                               list($cnt) = SQL_FETCHROW($result_holiday);
+                                               list($count) = SQL_FETCHROW($result_holiday);
 
                                                // Free memory
                                                SQL_FREERESULT($result_holiday);
 
                                                // Is holiday is active?
-                                               $isHolidayActive = ($cont == 1);
+                                               $isHolidayActive = ($count == 1);
                                        } // END - if
 
                                        if ($isHolidayActive === false) {
                                                // Check if the user want's to receive mails?
                                                $result_ver = SQL_QUERY_ESC("SELECT `zip` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s".$HTML." AND `receive_mails` > 0 AND `status`='CONFIRMED' LIMIT 1",
-                                                       array(bigintval($ucat)), __FILE__, __LINE__);
+                                                       array(bigintval($userid)), __FILE__, __LINE__);
 
                                                if ((SQL_NUMROWS($result_ver) == 1) && (isPostRequestParameterSet('zip')) && (getConfig('order_multi_page') == 'Y')) {
                                                        // Get zip code
                                                        list($zip) = SQL_FETCHROW($result_ver);
                                                        if (substr($zip, 0, strlen(postRequestParameter('zip'))) == postRequestParameter('zip')) {
-                                                               // Ok, ZIP part is found
+                                                               // Ok, ZIP code part is found
                                                                $userid_cnt++;
                                                        } // END - if
                                                } else {
index e1be266..4017146 100644 (file)
@@ -237,7 +237,7 @@ ORDER BY
                        // Do we have some entries?
                        if (!SQL_HASZERONUMS($result_sub)) {
                                // Init counter
-                               $cnt = '0';
+                               $count = '0';
 
                                // Load all sub menus
                                while ($content2 = SQL_FETCHARRAY($result_sub)) {
@@ -279,7 +279,7 @@ ORDER BY
                                        }
 
                                        // Cunt it up
-                                       $cnt++;
+                                       $count++;
 
                                        // Rewrite array
                                        $content = array(
@@ -290,7 +290,7 @@ ORDER BY
                                        );
 
                                        // Add regular menu row or bottom row?
-                                       if ($cnt < SQL_NUMROWS($result_sub)) {
+                                       if ($count < SQL_NUMROWS($result_sub)) {
                                                $GLOBALS['rows'] .= loadTemplate($mode . '_menu_row', true, $content);
                                        } else {
                                                $GLOBALS['rows'] .= loadTemplate($mode . '_menu_bottom', true, $content);
index 385dcce..139f1f5 100644 (file)
@@ -63,7 +63,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
 
        if (SQL_NUMROWS($result_bonus) > 0) {
                // Send these mails away...
-               $cnt2 = '';
+               $count2 = '';
                while ($DATA = SQL_FETCHARRAY($result_bonus)) {
                        // Message is active in queue
                        SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='QUEUE' WHERE `id`=%s LIMIT 1",
@@ -132,7 +132,7 @@ if ($GLOBALS['pool_cnt'] < getConfig('max_send')) {
                        if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
                                // Update entry (or add missing
                                $P = $GLOBALS['pool_cnt'];
-                               if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
+                               if (!empty($count2) && empty($GLOBALS['pool_cnt'])) $P = $count2;
                                //* DEBUG: */ debugOutput('+MEDIA/L:'.__LINE__.'/'.$P.'+');
                                updateMediadataEntry(array('total_send', 'bonus_send'), 'add', $P);
                        } // END - if
index 35797cc..5ac55c5 100644 (file)
@@ -60,7 +60,7 @@ if (isExtensionActive('html_mail')) {
 }
 
 // Reset variables
-$cnt2 = '0'; $lastSentId = '0'; $cnt_back = array(0); $pointsBack = array(0);
+$count2 = '0'; $lastSentId = '0'; $count_back = array(0); $pointsBack = array(0);
 if (!SQL_HASZERONUMS($result_main)) {
        // Parse all mails
        while ($DATA = SQL_FETCHARRAY($result_main, 0, false)) {
@@ -199,7 +199,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                        array(bigintval($DATA['id'])), __FILE__, __LINE__);
 
                                                $lastSentId = $DATA['id']; $GLOBALS['pool_cnt'] = '0';
-                                               $cnt2 += $GLOBALS['pool_cnt'];
+                                               $count2 += $GLOBALS['pool_cnt'];
 
                                                // Update mediadata if version is 0.0.4 or higher
                                                if (isExtensionInstalledAndNewer('mediadata', '0.0.4')) {
@@ -212,7 +212,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                break;
                                        }
                                        // Do we have send maximum mails?
-                                       elseif (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || ($cnt2 >= getConfig('max_send'))) {
+                                       elseif (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || ($count2 >= getConfig('max_send'))) {
                                                // There are some mails left to send for next round, so we reset the status back to NEW (=still not fully delivered)
                                                $add = '';
                                                if ($GLOBALS['pool_cnt'] <= $DATA['target_send']) $add = ", target_send=target_send-".$GLOBALS['pool_cnt'];
@@ -246,7 +246,7 @@ if (!SQL_HASZERONUMS($result_main)) {
                                                } // END - if
 
                                                // Count up
-                                               $cnt_back[$DATA['sender']]++;
+                                               $count_back[$DATA['sender']]++;
                                        }
 
                                        // Remove entry from list
index 0c364ef..beb7f68 100644 (file)
@@ -213,10 +213,10 @@ function doFinalCompilation ($code, $insertComments = true, $enableCodes = true)
        enableTemplateHtml($insertComments);
 
        // Init counter
-       $cnt = 0;
+       $count = 0;
 
        // Compile all out
-       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 5)) {
+       while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($count < 5)) {
                // Init common variables
                $content = array();
                $newContent = '';
@@ -239,7 +239,7 @@ function doFinalCompilation ($code, $insertComments = true, $enableCodes = true)
                $code = $newContent;
 
                // Count round
-               $cnt++;
+               $count++;
        } // END - while
 
        // Return the compiled code