Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries.
authorRoland Haeder <roland@mxchange.org>
Mon, 28 Mar 2016 13:24:33 +0000 (15:24 +0200)
committerRoland Haeder <roland@mxchange.org>
Mon, 28 Mar 2016 13:24:33 +0000 (15:24 +0200)
Signed-off-by: Roland Haeder <roland@mxchange.org>
117 files changed:
beg.php
inc/daily/daily_100_bonus.php
inc/daily/daily_birthday.php
inc/daily/daily_holiday.php
inc/daily/daily_profile.php
inc/daily/daily_user.php
inc/filter-functions.php
inc/filter/earning_filter.php
inc/filter/user_filter.php
inc/fix_filters.php
inc/fix_refsystem.php
inc/fix_user_points.php
inc/libs/admins_functions.php
inc/libs/bonus_functions.php
inc/libs/doubler_functions.php
inc/libs/forced_functions.php
inc/libs/holiday_functions.php
inc/libs/jackpot_functions.php
inc/libs/network_functions.php
inc/libs/optimize_functions.php
inc/libs/payout_functions.php
inc/libs/rallye_functions.php
inc/libs/refback_functions.php
inc/libs/register_functions.php
inc/libs/sponsor_functions.php
inc/libs/surfbar_functions.php
inc/libs/task_functions.php
inc/libs/user_functions.php
inc/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/module-functions.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-add_rallye.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-config_imprint.php
inc/modules/admin/what-config_network_types.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-del_transfer.php
inc/modules/admin/what-edit_emails.php
inc/modules/admin/what-email_archiv.php
inc/modules/admin/what-email_details.php
inc/modules/admin/what-extensions.php
inc/modules/admin/what-guest_add.php
inc/modules/admin/what-guestedit.php
inc/modules/admin/what-list_admins_acls.php
inc/modules/admin/what-list_autopurge.php
inc/modules/admin/what-list_bank_package.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_country.php
inc/modules/admin/what-list_coupon.php
inc/modules/admin/what-list_email_max_rec.php
inc/modules/admin/what-list_holiday.php
inc/modules/admin/what-list_links.php
inc/modules/admin/what-list_network_array_translation.php
inc/modules/admin/what-list_network_data.php
inc/modules/admin/what-list_network_request_params.php
inc/modules/admin/what-list_network_types.php
inc/modules/admin/what-list_notifications.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_rallye_prices.php
inc/modules/admin/what-list_rallyes.php
inc/modules/admin/what-list_refs.php
inc/modules/admin/what-list_sponsor.php
inc/modules/admin/what-list_sponsor_pay.php
inc/modules/admin/what-list_transfer.php
inc/modules/admin/what-list_unconfirmed.php
inc/modules/admin/what-list_user.php
inc/modules/admin/what-list_user_amounts.php
inc/modules/admin/what-list_user_cats.php
inc/modules/admin/what-list_wernis.php
inc/modules/admin/what-mem_add.php
inc/modules/admin/what-memedit.php
inc/modules/admin/what-payments.php
inc/modules/admin/what-refbanner.php
inc/modules/admin/what-repair_cats.php
inc/modules/admin/what-send_coupon.php
inc/modules/admin/what-send_newsletter.php
inc/modules/admin/what-surfbar_stats.php
inc/modules/admin/what-theme_edit.php
inc/modules/admin/what-unlock_emails.php
inc/modules/admin/what-unlock_sponsor.php
inc/modules/admin/what-usr_online.php
inc/modules/guest/what-active.php
inc/modules/guest/what-sponsor_infos.php
inc/modules/guest/what-sponsor_reg.php
inc/modules/guest/what-stats.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.php
inc/modules/member/what-categories.php
inc/modules/member/what-earning.php
inc/modules/member/what-list_coupon.php
inc/modules/member/what-nickname.php
inc/modules/member/what-order.php
inc/modules/member/what-payout.php
inc/modules/member/what-refback.php
inc/modules/member/what-reflinks.php
inc/modules/member/what-reflist.php
inc/modules/member/what-stats.php
inc/modules/member/what-transfer.php
inc/modules/member/what-unconfirmed.php
inc/monthly/monthly_beg.php
inc/monthly/monthly_bonus.php
inc/mysql-manager.php
inc/pool/pool-bonus.php
inc/pool/pool-user.php
inc/purge/purge-general.php
inc/purge/purge-inact.php
inc/purge/purge-mails.php
inc/purge/purge-tasks.php
inc/purge/purge-unconfirmed.php
inc/referral-functions.php
inc/sql-functions.php

diff --git a/beg.php b/beg.php
index 8870c2ed174ac0fb56442ed39ca6bfeaf5d196b8..1ef706f9af6c3f5ccc12986b3a1e1b60efbf9499 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -104,7 +104,7 @@ if (isGetRequestElementSet('userid')) {
 
                // Entry not found, points set and not logged in?
                //* DEBUG: */ logDebugMessage(__FILE__, __LINE__, 'SQL_HASZERONUMS()=' . intval(SQL_HASZERONUMS($result)) . ',isAdmin()=' . intval(isAdmin()) . ',points=' . $points . ',isMember()=' . intval(isMember()) . ',getBegPayMode()=' . getBegPayMode());
-               if ((ifSqlHasZeroNums($result)) && ($points > 0) && (getBegPayMode() == 'NONE') && ((!isMember()) || (isAdmin()))) {
+               if ((ifSqlHasZeroNumRows($result)) && ($points > 0) && (getBegPayMode() == 'NONE') && ((!isMember()) || (isAdmin()))) {
                        // Default is result from isAdmin(), mostly false
                        $isPayed = isAdmin();
 
index 4a326f4352a7bf3177383927e0f94ade968751c3..82cfbd612d1e2053f41deb18116d29e9a08e4ebf 100644 (file)
@@ -61,7 +61,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result_bonus)) {
+if (!ifSqlHasZeroNumRows($result_bonus)) {
        // We found some mail orders...
        while ($content = sqlFetchArray($result_bonus)) {
                // Add points
index 64e8df40ec11b9259cdf695be51c732e25df6c4c..2b6bcc195215858acb3717086b5d9cacd50dbe58 100644 (file)
@@ -78,7 +78,7 @@ ORDER BY
        `d`.`userid` ASC",
        array($day, $month), __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result_birthday)) {
+if (!ifSqlHasZeroNumRows($result_birthday)) {
        // Start sending out birthday mails
        while ($content = sqlFetchArray($result_birthday)) {
                // Calculate own timestamp for birthday and today
index 81e392aa1d5ad834ee563a9ab9dc0d338c88cb68..10a7253bb7a975ca5bf1428d50801fe6d430dee3 100644 (file)
@@ -59,7 +59,7 @@ ORDER BY
 __FILE__, __LINE__);
 
 // Entries found?
-if (!ifSqlHasZeroNums($result_main)) {
+if (!ifSqlHasZeroNumRows($result_main)) {
        // Init SQLs
        initSqls();
 
index 48e736f3759fe90555be965a26b32bb1989c489f..c68794916347a996153811fc6e620ed4a38e4c06 100644 (file)
@@ -71,7 +71,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
        // Are there some notifications to sent?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // We need to send-out notifications...
                while ($content = sqlFetchArray($result)) {
                        // Translate timestamp
index 1922b584b68991b2c2459631e8abc74c923b3897..e09ff4213f5163857b0b97666df4f9ec39157036 100644 (file)
@@ -79,7 +79,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 //* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;daily|numRows=' . sqlNumRows($result_daily));
-if (!ifSqlHasZeroNums($result_daily)) {
+if (!ifSqlHasZeroNumRows($result_daily)) {
        // Init SQLs
        initSqls();
 
@@ -105,7 +105,7 @@ ORDER BY
                                ), __FILE__, __LINE__);
 
                        //* DEBUG: */ debugOutput(basename(__FILE__) . ':payout=0;points|numRows=' . sqlNumRows($result_points));
-                       if (!ifSqlHasZeroNums($result_points)) {
+                       if (!ifSqlHasZeroNumRows($result_points)) {
                                // Ok transfer points
                                while ($content2 = sqlFetchArray($result_points)) {
                                        // Merge both arrays
index 27a7b607c0f749c23e5ad7525da85cf7e6616c3b..e0c383009ae046ef68b8bc995fcdedc92132ec98 100644 (file)
@@ -69,7 +69,7 @@ ORDER BY
        `filter_id` ASC', __FUNCTION__, __LINE__);
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Load all filters
                        while ($filterArray = sqlFetchArray($result)) {
                                // Get filter name and function
index 0ed6f68969c4dc0823e498431b65d27f63415e43..a658857f59ee9d76152260bac66cbe21f1e932a9 100644 (file)
@@ -77,7 +77,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there entries left?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all names
                while ($content = sqlFetchArray($result)) {
                        // Merge the $filterData array in
index d282448ba421b5adc1c9d56ef1d3ee1503dae787..e9eec0aca4d5e5ff1272b20f1a6161534d1460cd 100644 (file)
@@ -254,7 +254,7 @@ function FILTER_MEMBER_REFLINK_USER_SUBIDS_CONTENT ($content = '') {
                        array(getMemberId()), __FUNCTION__, __LINE__);
 
                // There should be entries left
-               assert(!ifSqlHasZeroNums($result));
+               assert(!ifSqlHasZeroNumRows($result));
 
                // Load all
                $out = '';
index 3e71feb7f18cf9d9d47e923e339763b67327a58e..294f1099bc74fd1b19a3b5c697898df278d2a777 100644 (file)
@@ -46,7 +46,7 @@ ORDER BY
        `filter_function` ASC', __FILE__, __LINE__);
 
 // Are there entries? (there should be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Load row by row
        while ($filter = sqlFetchArray($result)) {
                // Now search again for this filter and get it's total count
index a3054e0c86e5e56ec911139a01ef5d68c3b80d53..c4200c8fbc2ed4a1cf1d632eb72a708c7cf8aa0d 100644 (file)
@@ -37,7 +37,7 @@ if (!defined('__SECURITY')) {
 
 // Sanity-check: Is there ref level 0? If so, this must be fixed to NULL and `level` must be increased by one
 $result = sqlQuery('SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0', __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Remove index temporaly
        sqlQueryAlterTable('ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`', __FILE__, __LINE__);
 
@@ -69,7 +69,7 @@ ORDER BY
        `userid` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (!ifSqlHasZeroNums($result_direct)) {
+if (!ifSqlHasZeroNumRows($result_direct)) {
        // When 'walk' through all users
        while ($content = sqlFetchArray($result_direct)) {
                // Update refback table
index 835d7d785accdb79b1ad04946c036c863a30c2d2..96f15aebcdbc1a6b0fb29a6103388c1e551cafca 100644 (file)
@@ -50,7 +50,7 @@ ORDER BY
        `userid` ASC', __FILE__, __LINE__);
 
 // Are there entries? (there should be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Load row by row
        while ($row = sqlFetchArray($result)) {
                // Update the database again
index 8f8742b8802585e186b016128938efd244ebb90a..71eaa0db6c88060207007990a0d205014c76f630 100644 (file)
@@ -521,7 +521,7 @@ function sendAdminsEmails ($subject, $template, $content, $userid) {
                array($template), __FUNCTION__, __LINE__);
 
        // No entries found?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Is ext-admins' version at least 0.7.9?
                if (isExtensionInstalledAndNewer('admins', '0.7.9')) {
                        // Create new entry (to all admins)
index d5b51b782ab0f36a2275b5008d4c1eb80757e9b1..b37f45c61cbd173e657aa5d7e231da8dcc1d5b0e 100644 (file)
@@ -157,7 +157,7 @@ function addBonusRanks ($data, $type, $userid) {
        // Load rankings
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
                array($type, $data), __FUNCTION__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Output all ranks (levels)
                for ($rank = 1; $rank <= sqlNumRows($result); $rank++) {
                        // Load data
index 30dd888b1d800038a26a6c49f254fc4c243ebd6c..25e41287b9788e414161f2b2dcf24f9b3796f29d 100644 (file)
@@ -88,7 +88,7 @@ LIMIT %s",
                        $limit
                ), __FUNCTION__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List entries
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index b606f295dff340e526b4effda98a6b28cdcbe1f5..b73b0d1c38c9f8494888b625a173be90b2752f7b 100644 (file)
@@ -213,7 +213,7 @@ ORDER BY
        `forced_ads_id` ASC', __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Get all elements
                while ($content = sqlFetchArray($result)) {
                        // Add it
@@ -253,7 +253,7 @@ ORDER BY
        `forced_costs_id` ASC", __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Get all elements
                while ($content = sqlFetchArray($result)) {
                        // Add it
@@ -301,7 +301,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one entry?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Get all elements
                while ($content = sqlFetchArray($result)) {
                        // Add it
index b8d9ebd69a5f620e01dd48c27cfabf7f849de553..ae23b03fc9caf2a672e3dc109fae78df7a159a50 100644 (file)
@@ -54,7 +54,7 @@ WHERE
        `holiday_end` <= UNIX_TIMESTAMP()
 ORDER BY
        `userid` ASC", __FUNCTION__, __LINE__);
-       if (!ifSqlHasZeroNums($result_stop)) {
+       if (!ifSqlHasZeroNumRows($result_stop)) {
                // We foud at least one
                $admin = '';
 
index c3c1c6ddcf3a9bc72bbc4d6180eefe8b0bda288b..abd678a98c078d5c4081584b4996778d619d7a89 100644 (file)
@@ -50,7 +50,7 @@ function getJackpotPoints () {
        $result = sqlQuery("SELECT `points` FROM `{?_MYSQL_PREFIX?}_jackpot` WHERE `ok`='ok' LIMIT 1", __FUNCTION__, __LINE__);
 
        // Is there an entry?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // No, so create line
                sqlQuery("INSERT INTO `{?_MYSQL_PREFIX?}_jackpot` (`ok`, `points`) VALUES ('ok','0.00000')", __FUNCTION__, __LINE__);
        } else {
index f0f166d4951b767976841af451af729fe205ddaa..9979266aac62289fa75cdc8625540d1bea47cf12 100644 (file)
@@ -424,7 +424,7 @@ ORDER BY
                        array(bigintval($networkId)), __FUNCTION__, __LINE__);
 
                // Is there an entry?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Then add all
                        while ($row = sqlFetchArray($result)) {
                                // Add it with new index as it is no longer required
@@ -548,7 +548,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
                // Are there records?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Load all but make new indexes as the old are not required
                        while ($row = sqlFetchArray($result)) {
                                // Add it
@@ -667,7 +667,7 @@ ORDER BY
        `network_short_name` ASC', __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $rows = array();
                while ($row = sqlFetchArray($result)) {
@@ -744,7 +744,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $rows = array();
                while ($row = sqlFetchArray($result)) {
@@ -791,7 +791,7 @@ ORDER BY
        `t`.`network_type_handler` ASC', __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $rows = array();
                while ($row = sqlFetchArray($result)) {
@@ -1412,7 +1412,7 @@ ORDER BY
        `network_array_sort` ASC', __FUNCTION__, __LINE__);
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Get all entries
                        while ($row = sqlFetchArray($result)) {
                                // Add it to our global array
@@ -2570,7 +2570,7 @@ function doAdminNetworkProcessAddHandlerTypesConfig ($displayMessage = TRUE, $co
                        array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
 
                // Are there entries?
-               if (ifSqlHasZeroNums($result)) {
+               if (ifSqlHasZeroNumRows($result)) {
                        // No, then abort here
                        displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
                        return;
@@ -2666,7 +2666,7 @@ function doAdminNetworkProcessEditHandlerTypesConfig ($displayMessage = TRUE, $c
                        array(bigintval(getRequestElement('network_id'))), __FUNCTION__, __LINE__);
 
                // Are there entries?
-               if (ifSqlHasZeroNums($result)) {
+               if (ifSqlHasZeroNumRows($result)) {
                        // No, then abort here
                        displayMessage('{--ADMIN_CONFIG_NETWORK_HANDLER_SET_ALL_404--}');
                        return;
index 64308e77793dccdf489b3b1dc7dd273e366e2e4c..07b24ef8ab17bb308bc83dcd0441d7686e38732b 100644 (file)
@@ -58,7 +58,7 @@ function repairOptimizeDatabase () {
        $ret['tables'] = array();
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Fetch all rows
                while ($row = sqlFetchArray($result)) {
                        $tot_data = $row['Data_length'];
index 4058861fc065d2bdfcf605962d0d8a594d48c115..d7abac5fe2860013ffd654dc4ef2224974cfe437 100644 (file)
@@ -59,7 +59,7 @@ ORDER BY
                        array($points), __FUNCTION__, __LINE__);
 
                // Some entries found?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Init output
                        $OUT = '';
 
index bbd4bfa33a4aaa4d6cd07216ed504fb5e35b964e..a0812bb3a2586d85cc904fc18657eb497f5ded77 100644 (file)
@@ -92,7 +92,7 @@ LIMIT 1",
                        array(bigintval($content['id']), bigintval($content['userid'])), __FUNCTION__, __LINE__);
 
                // Is there an entry?
-               if (ifSqlHasZeroNums($result_ref)) {
+               if (ifSqlHasZeroNumRows($result_ref)) {
                        // Add userid and his ref count to table
                        $result_ref = sqlQueryEscaped("SELECT
        SUM(`p`.`points`) AS `points`
@@ -192,7 +192,7 @@ ORDER BY
                array($rallye), __FUNCTION__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result_prices)) {
+       if (!ifSqlHasZeroNumRows($result_prices)) {
                // Load prices
                $prices = '';
                if ($mode == PHP_EOL) {
@@ -429,7 +429,7 @@ LIMIT 1",
                        ), __FUNCTION__, __LINE__);
 
                // Is this user added?
-               if (ifSqlHasZeroNums($result)) {
+               if (ifSqlHasZeroNumRows($result)) {
                        // Add userid and his ref count to table
                        sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_users`
@@ -848,7 +848,7 @@ WHERE
        `expired`='Y'",
                array($EXPIRE), __FUNCTION__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_rallye)) {
+       if (!ifSqlHasZeroNumRows($result_rallye)) {
                // Init SQLs
                initSqls();
 
index 50676cfff821c2c80de8e8bcf1e60488dff51292..a6d13a89c3127b5a3969dab7a8f45fa1f843438c 100644 (file)
@@ -192,7 +192,7 @@ ORDER BY
 
        // Entries found?
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'numRows=' . sqlNumRows($result));
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Add all
                while ($content = sqlFetchArray($result)) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ',userid=' . $content['userid']);
@@ -239,7 +239,7 @@ ORDER BY
                array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
 
        // Are there some entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Fetch all entries
                while ($row = sqlFetchArray($result)) {
                        // Calculate click rate
index 5e86d02b942f6138c8d54461f2ec1e20414b3915..1bb911df8f768f3c49a57e1e3748c19517f88dc8 100644 (file)
@@ -98,7 +98,7 @@ ORDER BY
        `sort` ASC',
                __FUNCTION__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List alle visible modules (or all to the admin)
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
                while ($content = sqlFetchArray($result)) {
index 3de5472e7e07d6376be033ff00376408a0d100be..fa1767bea6454fae032e130b8131cc6535066a66 100644 (file)
@@ -282,7 +282,7 @@ WHERE
        " . $WHERE . "
 ORDER BY
        `sort` ASC", __FUNCTION__, __LINE__);
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Load every menu and it's sub menus
                while ($content = sqlFetchArray($result_main)) {
                        // Load sub menus
@@ -299,7 +299,7 @@ WHERE
 ORDER BY
        `sort` ASC",
                        array($content['main_action']), __FUNCTION__, __LINE__);
-                       if (!ifSqlHasZeroNums($result_sub)) {
+                       if (!ifSqlHasZeroNumRows($result_sub)) {
                                // Load sub menus
                                $SUB = '';
                                while ($content2 = sqlFetchArray($result_sub)) {
index b87c1ca4d8307b8ec8eb99a0c5a0f0ed849ed3bb..7cd5feef62ab8230a1afc5571b14ff83c065acc5 100644 (file)
@@ -637,7 +637,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one record?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Then load all!
                while ($dataRow = sqlFetchArray($result)) {
                        // Shall we group these results?
@@ -1665,7 +1665,7 @@ ORDER BY
                array(getMemberId()), __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all rows
                while ($row = sqlFetchArray($result)) {
                        // Add the row
@@ -1690,7 +1690,7 @@ function getSurfbarArrayFromStatus ($status) {
                array($status), __FUNCTION__, __LINE__);
 
        // Some entries there?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all actions
                // @TODO This can be somehow rewritten
                while ($content = sqlFetchArray($result)) {
index 24e853bcdc8507f0592c50a22745ee4a776ef8e9..5be0adbd3737835a5cd1a6300c4f9d08e9ac0eb0 100644 (file)
@@ -576,7 +576,7 @@ function createExtraTaskRows ($WHATs, $DESCRs, $TITLEs) {
                                $content['bottom'] = 'bottom';
                        } // END - if
 
-                       if ((!ifSqlHasZeroNums($result)) && (!empty($WHATs[$key]))) {
+                       if ((!ifSqlHasZeroNumRows($result)) && (!empty($WHATs[$key]))) {
                                if (empty($TITLEs[$key])) {
                                        $TITLEs[$key] = '{--ADMIN_TASK_UNKNOWN_LIST_TITLE--}';
                                } // END - if
index c2baa161c6c29abf2bb5fbbc114267336c96d2b9..22dd84f25335864d88592e9dd2662de827a3f712 100644 (file)
@@ -580,7 +580,7 @@ function doConfirmUserAccount ($hash) {
                array($hash), __FILE__, __LINE__);
 
        // One result should be found
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Nothing found or tried to confirm twice?
                displayMessage('{--GUEST_CONFIRMED_TWICE--}');
                return;
index 3bfd966c9e3b931c82130d4d20ae0e96ab9d0b47..554f101ed67c8c2cce666184c19da9409ef5e1fb 100644 (file)
@@ -85,7 +85,8 @@ if (!empty($sql)) {
 
        // Check for accounts to be notified
        $result_main = sqlQuery($sql, __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result_main)) {
+
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Normal notification mails or bonus mails?
                $sentBonusMails = ((getBegNotifyBonus() > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
 
index 6c47d4d6766c44d6ade49dc7f07e36324cad09ba..6fb1ef0d1d171748e5a77c97c80d9aed8faafcbc 100644 (file)
@@ -84,7 +84,8 @@ if (!empty($sql)) {
 
        // Check for accounts to be notified
        $result_main = sqlQuery($sql, __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result_main)) {
+
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Okay lets notify all users!
                while ($content = sqlFetchArray($result_main)) {
                        // Update account
index 9dc01cb14efed665d906e6c0669fa1f7c7f2e41f..8f1f04968407fe6a00ad78b147c029d2c3cdfbeb 100644 (file)
@@ -80,7 +80,7 @@ function getModuleTitle ($module) {
                        }  else {
                                // No name found
                                $data['title'] = '{%message,UNKNOWN_MODULE_DETECTED_TITLE=' . $module . '%}';
-                               if ((is_resource($result)) && (ifSqlHasZeroNums($result))) {
+                               if ((is_resource($result)) && (ifSqlHasZeroNumRows($result))) {
                                        // Add module to database and ignore return value
                                        checkModulePermissions($module);
                                } // END - if
index ea6351415fc91d0cc28488230af9b3f7a07cf4ab..6eee1eddf6e93996b89532899bfbb5c77fb54678 100644 (file)
@@ -53,7 +53,7 @@ function addAdminAccount ($adminLogin, $passHash, $adminEmail, $accessLevel = 'd
                array($adminLogin), __FUNCTION__, __LINE__);
 
        // Is the entry there?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Is ext-admins installed and version at least 0.3.0?
                if (isExtensionInstalledAndNewer('admins', '0.3.0')) {
                        // Ok, let's create the admin login
@@ -282,7 +282,7 @@ ORDER BY
        `id` DESC", __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                $OUT .= '<ul class="admin_menu_main">';
 
                // Load all 'action' menus
@@ -365,7 +365,7 @@ ORDER BY
                array($mainContent['main_action']), __FUNCTION__, __LINE__);
 
        // Remember the count for later checks
-       setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNums($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
+       setAdminMenuHasEntries($mainContent['main_action'], ((!ifSqlHasZeroNumRows($result_what)) && (($action == $mainContent['main_action']) || (isAdminMenuJavascriptEnabled()))));
 
        // Start li-tag for sub menu content
        $OUT .= '<li class="admin_menu_sub" id="action_menu_' . $mainContent['main_action'] . '"' . addStyleMenuContent('admin', $mainContent['main_action'], $action) . '>';
@@ -376,7 +376,7 @@ ORDER BY
                $SUB = TRUE;
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result_what)) {
+               if (!ifSqlHasZeroNumRows($result_what)) {
                        // Start HTML code
                        $OUT .= '<ul class="admin_menu_sub">';
 
@@ -543,7 +543,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
 
        $result = sqlQueryEscaped("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load menu as selection
                $OUT = '<select name="' . $mode . '_menu';
                if (!isValidId($defid)) $OUT .= '[' . intval($defid) . ']';
@@ -1152,7 +1152,7 @@ function sendAdminPasswordResetLink ($email) {
                array($email), __FUNCTION__, __LINE__);
 
        // Is there an account?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // No account found
                return '{--ADMIN_NO_LOGIN_WITH_EMAIL--}';
        } // END - if
index 869d193d7335d3cd6174788da28104996cbbce63..d356c2b79b165a7bbe702036782076ec06265518 100644 (file)
@@ -121,7 +121,7 @@ ORDER BY
        `task_created` DESC",
                array(getCurrentAdminId()), __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_tasks)) {
+       if (!ifSqlHasZeroNumRows($result_tasks)) {
                // New jobs found
                $jobsDone = FALSE;
        } // END - if
index cb17edd4f4ff3f08c9a4219597b3e768cd597037..4424423e8aaf2d5c83fbfda2ac2ef6f95751745e 100644 (file)
@@ -52,7 +52,7 @@ if (isFormSent()) {
        $result = sqlQueryEscaped("SELECT `id`, `admin_id` FROM `{?_MYSQL_PREFIX?}_rallye_data` WHERE (`start_time` <= %s AND `end_time` >= %s) OR (`start_time` >= %s AND `start_time` <= %s) LIMIT 1",
                array($START, $START, $START, $END), __FILE__, __LINE__);
 
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Ok, start and end time did not overlap
                sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_data`
index bd4f9c4fd283b22f2af48f405952cbcf91bcfa4e..d9a9a59155313607d3a6bb462d3e118e0d34c640 100644 (file)
@@ -56,7 +56,7 @@ if (!isFormSent()) {
 
        // 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__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = sqlFetchArray($result)) {
@@ -95,7 +95,7 @@ if (!isFormSent()) {
                foreach ($menus as $key_main => $value_main) {
                        $result = sqlQueryEscaped("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
-                       if (!ifSqlHasZeroNums($result)) {
+                       if (!ifSqlHasZeroNumRows($result)) {
                                // Init arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index 1042be5cff6f3072d22a9953316bee24335b7fd6..715c31c67ca1be0091c45d1336514c2c1a05c11c 100644 (file)
@@ -197,7 +197,7 @@ LIMIT 1",
        $result = sqlQuery("SELECT `id`, `action`, `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$AND." ORDER BY `sort` ASC", __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init variables
                $OUT = '';
                $count = '0';
index 580912c3d0f9e9644d078097c4a91ee6f261a044..b8b916c57691a410b8e5fa0a00f32852e86467d0 100644 (file)
@@ -124,7 +124,7 @@ ORDER BY
        `m`.`admin_id` ASC,
        `m`.`mail_template` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Shall I change entries?
                if (isFormSent('do_edit')) {
                        // Init SQLs
index f474dccf6b49144d54c40122c71352a810d48f79..603b92002a99d20e0d2a05b121e9e3f44e0e0b7a 100644 (file)
@@ -57,7 +57,7 @@ ORDER BY
        `imprint_id` ASC', __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all entries
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 2c312e5a3d03ba47bdb54f25d6e020a7c1e8213b..aadf88e84d3d60e8448bcf67b6d2c0e96bbdb3b1 100644 (file)
@@ -178,7 +178,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there entries left?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init row output
                $OUT = '';
 
index 6f9d288e7d425acc1599f4085a432c5ad6c3705e..6517b412102c1f01ee689c42eb3e3f643b53b541 100644 (file)
@@ -48,7 +48,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('title')) && (postRequestEle
        // Add new payout type
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_payout_types` WHERE type='%s' LIMIT 1",
                array(postRequestElement('title')), __FILE__, __LINE__);
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Add now
                sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_payout_types`
@@ -194,7 +194,7 @@ FROM
 ORDER BY
        `type` ASC', __FILE__, __LINE__);
 
-if ((!ifSqlHasZeroNums($result_type)) && ($display)) {
+if ((!ifSqlHasZeroNumRows($result_type)) && ($display)) {
        // List all payout types
        $OUT = '';
        while ($content = sqlFetchArray($result_type)) {
@@ -210,7 +210,7 @@ if ((!ifSqlHasZeroNums($result_type)) && ($display)) {
 } // END - if
 
 // Does your members request payouts?
-if ((!ifSqlHasZeroNums($result_mem)) && ($display === TRUE)) {
+if ((!ifSqlHasZeroNumRows($result_mem)) && ($display === TRUE)) {
        // Members has requested payouts
        displayMessage('<a href="{%url=modules.php?module=admin&amp;what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
 } elseif ($display === TRUE) {
index 876260118dc8cb89191ea72676d5157fa278dbd3..edc4b7d47d43178b339558211f4cc6b2d6b78d0e 100644 (file)
@@ -62,7 +62,9 @@ if (isFormSent('delete')) {
        } // END - if
 } // END - if
 
-// We only need outgoing transfers
+$total = '0';
+
+// Only out-going transfers are needed
 $result = sqlQuery('SELECT
        `userid` AS `from_userid`,
        `to_userid`,
@@ -75,8 +77,7 @@ FROM
 ORDER BY
        `trans_id` ASC', __FILE__, __LINE__);
 
-$total = '0';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Output rows
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 507513da66109f51465299273277a9d1be712884..f3f41f68ab9fc545004a2486f10b138fd315c05b 100644 (file)
@@ -131,7 +131,7 @@ ORDER BY
        `timestamp` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // There are mail orders available
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 7b53a78db69d94207b89943fa687e79422ad6c1d..9795f7bf1bbc0e761bd3e82ff351198b5f94dafc 100644 (file)
@@ -82,7 +82,7 @@ $numPages = round(sqlNumRows($result_maximum) / getMailsPage() + 0.5);
 // Free the result which we don't need
 sqlFreeResult($result_maximum);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
index 93eccb434375855a942c0dcb6c6a655860df627b..f941962989d977ccfea4ddad1274984fbbcef8cd 100644 (file)
@@ -195,7 +195,7 @@ if (isConfigEntrySet('mails_page')) {
 sqlFreeResult($result_normal);
 
 $MAIL = FALSE;
-if (!ifSqlHasZeroNums($result_list)) {
+if (!ifSqlHasZeroNumRows($result_list)) {
        // Init rows
        $OUT = '';
 
@@ -237,13 +237,13 @@ if (!ifSqlHasZeroNums($result_list)) {
        $MAIL = TRUE;
        if ((isExtensionActive('bonus')) && (empty($WHO))) {
                // Only check if bonus extension is active
-               if (!ifSqlHasZeroNums($result_bonus)) outputHtml('<br /><br />');
+               if (!ifSqlHasZeroNumRows($result_bonus)) outputHtml('<br /><br />');
        } // END - if
 } // END - if
 
 if ((isExtensionActive('bonus')) && (empty($WHO))) {
        // Load bonus mails only when extension is active
-       if (!ifSqlHasZeroNums($result_bonus)) {
+       if (!ifSqlHasZeroNumRows($result_bonus)) {
                // Calculate pages
                $numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5);
 
index 4198d7a7ccd23579243144b2de38f1644a8dd1a2..f87a6c160c75504dcb60d1f98e7d6a1659438ada 100644 (file)
@@ -307,7 +307,7 @@ ORDER BY
                }
 
                // Are there some entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Extensions are registered
                        $OUT = '';
                        while ($content = sqlFetchArray($result)) {
index 6ce9c68e93db86ed376e82ab19c0b2cb1af48b45..b17b369e97621c8fbc569331156813620b479e66 100644 (file)
@@ -62,7 +62,8 @@ WHERE
        (`what`='' OR `what` IS NULL)
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result_menu)) {
+
+       if (!ifSqlHasZeroNumRows($result_menu)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = sqlFetchArray($result_menu)) {
@@ -107,7 +108,8 @@ WHERE
        `what` IS NOT NULL
 ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
-                       if (!ifSqlHasZeroNums($result)) {
+
+                       if (!ifSqlHasZeroNumRows($result)) {
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index 6da09e3e6708e7406b14d4e252cb56ab28d25587..61fbe2321b59a453e064b6f9c5e790b3aabc1924 100644 (file)
@@ -201,7 +201,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        }
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init variables
                $count = '0';
                $OUT = '';
index 44d8e94813af6e51b8edcd18d151c097e8a949f3..f9833bcc3a6fd7e96f4b6dee501292d05c65e47a 100644 (file)
@@ -158,7 +158,7 @@ LIMIT 1",
                                        postRequestElement('action_menu'),
                                        postRequestElement('what_menu')
                                ), __FILE__, __LINE__);
-                       if (ifSqlHasZeroNums($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // Finally add the new ACL
                                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_admins_acls` (
        `admin_id`,
@@ -214,7 +214,7 @@ ORDER BY
        `id` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List ACLs
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 2ea68e8e1311a6537dd84823d91ac2777cd10964..0ff99f1899b2d754dd59b26ce6650c51a1645a27 100644 (file)
@@ -72,7 +72,7 @@ WHERE
 ORDER BY
        `d`.`userid` ASC", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Ok, we have found some inactive accounts
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 491e87b4891ffacde7a06d9b840fdfc335f1c3dc..ed1427960b498126b2dfdb4485d4516709547add 100644 (file)
@@ -178,7 +178,7 @@ ORDER BY
        `id` ASC', __FILE__, __LINE__);
 
 // Is there at lease one package?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all packages
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index e1ec84511d5c629b087b430b17664d7f4f657a99..c5c8eb2f671c948154ef061a960910753fee69f9 100644 (file)
@@ -79,7 +79,7 @@ ORDER BY
        `last_online` DESC,
        `userid` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List users
                $OUT = ''; $count = 1; $total = '0';
                while ($content = sqlFetchArray($result)) {
index 2fbfa978efbc7659349386b2e4afd17ebe96aed7..bfb7ca6ce1687f6547c32be28b66c6718b4bcd32 100644 (file)
@@ -91,7 +91,7 @@ ORDER BY
        `last_online` DESC,
        `userid` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List users
                $OUT   = '';
                $count = 1;
index ba872b00b5e977816c88cad30f7343f82bf5a1b7..919e203a054c10c25657ff9fad3febd72a3374ac 100644 (file)
@@ -48,10 +48,14 @@ addYouAreHereLink('admin', __FILE__);
 $CATS = '';
 
 if (isFormSent('add')) {
+       // Default message
+       $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
+
        // Add a new category
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `cat`='%s' LIMIT 1",
                array(postRequestElement('catname')), __FILE__, __LINE__);
-       if (ifSqlHasZeroNums($result)) {
+
+       if (ifSqlHasZeroNumRows($result)) {
                // Category does not exists, we simply add it...
                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_cats` (`cat`, `visible`, `sort`) VALUES ('%s','%s','%s')",
                        array(
@@ -59,11 +63,10 @@ if (isFormSent('add')) {
                                postRequestElement('visible'),
                                bigintval(postRequestElement('parent') + 1)
                        ), __FILE__, __LINE__);
+
+               // Category has been added
                $content = '{--CATEGORY_ADDED--}';
-       } else {
-               // Category does already exists
-               $content = '<span class="bad">{--CATEGORY_ALREADY_EXISTS--}</span>';
-       }
+       } // END - if
 
        // Free memory
        sqlFreeResult($result);
@@ -145,8 +148,17 @@ if (isFormSent('add')) {
        $CATS = '';
 
        // Load all categories
-       $result = sqlQuery("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       $result = sqlQuery("SELECT
+       `id`,
+       `cat`,
+       `visible`,
+       `sort`
+FROM
+       `{?_MYSQL_PREFIX?}_cats`
+ORDER BY
+       `sort` ASC", __FILE__, __LINE__);
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init variables
                $OUT = '';
 
index aab6faadd2bd72bbc3e1777f66da0c4d718d3add..93a5d73c87e94246efdec0fb8733bd25c16826d1 100644 (file)
@@ -48,7 +48,7 @@ if ((isFormSent('add')) && (isPostRequestElementSet('code')) && (isPostRequestEl
        // Check if country code does already exist
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_countries` WHERE `code`='%s' LIMIT 1",
        array(strtoupper(postRequestElement('code'))), __FILE__, __LINE__);
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Save entry
                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (`code`, `descr`, `is_active`) VALUES ('%s','%s','%s')",
                array(
@@ -177,7 +177,7 @@ LIMIT 1");
                __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all countries
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index aee069dce0be8508315cb73d8d8a1247b646d3cd..4d503c8640a575286bb5ab67b774b909bb6eb38f 100644 (file)
@@ -70,7 +70,7 @@ ORDER BY
                ), __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init variable
                $OUT = '';
 
@@ -110,7 +110,7 @@ ORDER BY
        `d`.`id` ASC', __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init variable
                $OUT = '';
 
index b4989fa00fd3d070248d198781bf0cda1a890218..676ce93bba8c249ca5c768395d6ee670172f852d 100644 (file)
@@ -52,7 +52,7 @@ if (isPostRequestElementSet('add_max')) {
        // Save all settings
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value='%s' LIMIT 1",
        array(bigintval(postRequestElement('max'))), __FILE__, __LINE__);
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Add this value (including comment)
                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES ('%s','%s')",
                array(bigintval(postRequestElement('max')), postRequestElement('comment')),__FILE__, __LINE__);
@@ -134,7 +134,7 @@ if (isPostRequestElementSet('add_max')) {
 } else {
        $result = sqlQuery("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
        __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List already existing entries for editing
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 85f9a437ba98803448209961094cf9e630760b79..51bb307ccc5b793778efcbf456b260db9cf64a99 100644 (file)
@@ -61,7 +61,7 @@ ON
 ORDER BY
        `h`.`userid` ASC", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all holiday requests
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 139eb2e4a4c09bf848a6cecbcb8bba5602527900..b0b5309e31be1d841e47d399626315a526407ecf 100644 (file)
@@ -68,7 +68,7 @@ if (isGetRequestElementSet('userid')) {
                        ), __FILE__, __LINE__);
 
                // Are there some entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Some unconfirmed mails left
                        if (getRequestElement('delete') == 'all') {
                                // Delete all unconfirmed mails by this user
index 31394ddad3cce4cff49def3c94f232ff86426d9a..96cf28f5fbad88ea35eed485079e34903d84a60a 100644 (file)
@@ -109,7 +109,7 @@ ORDER BY
                ), __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
index 1140d681a66617912588d5cb37b52b0350dc365b..428c3ce06f5a8f103f4a7bd2fa04ce72113ed1a6 100644 (file)
@@ -79,7 +79,7 @@ ORDER BY
        `network_short_name` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 8c5e5d7bc66b4daec688c0ff88e0e4522cf44a40..b2faeb778208b7e6b29ec7ffae1021bff757b86f 100644 (file)
@@ -105,7 +105,7 @@ ORDER BY
                array(bigintval(getRequestElement('network_id'))), __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
index 81436f7f868475c4ceb23dc5b8dc4fe15394eda3..4e50fd3fc8bf6261cf991cd5306ace2cf0426a52 100644 (file)
@@ -87,7 +87,7 @@ ORDER BY
                array(bigintval(getRequestElement('network_id'))), __FILE__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all entries
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
index 9aadbc567b59e883e4afdabbd6e699612f7b2648..40e4f6fd8244b50a36c6ca0c1675b6efcd06dc32 100644 (file)
@@ -76,12 +76,12 @@ $add = ' LIMIT ' . (bigintval(getRequestElement('offset')) * bigintval(getReques
 // Add limitation
 if (!empty($SQL2)) $SQL2 .= $add;
 
-if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNums($result_max)) && (!empty($SQL2))) {
+if ((isExtensionActive('bonus')) && (!ifSqlHasZeroNumRows($result_max)) && (!empty($SQL2))) {
        // Run SQL query for notification mails
        $result_bonus = sqlQuery($SQL2, __FILE__, __LINE__);
 
        // Load bonus mails only when extension is active
-       if (!ifSqlHasZeroNums($result_bonus)) {
+       if (!ifSqlHasZeroNumRows($result_bonus)) {
                // Calculate pages
                $numPages = round(sqlNumRows($result_bonus) / getMailsPage() + 0.5);
 
index 198f92c634d4d61fce877a46e5f2b576632b72f6..e475a8408e4d0e71d9e9e2a45ea621a16f5d2353 100644 (file)
@@ -245,7 +245,7 @@ ON
 ORDER BY
        `p`.`payout_timestamp` DESC', __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List found payouts
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 716fd06cc375de0c4da4a832dd6c6fe381d39474..f791b82c3c28769c17780d8e1a00ca0fee028f0d 100644 (file)
@@ -51,7 +51,7 @@ if (isGetRequestElementSet('rallye_id')) {
                        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s AND `price_level`='%s' LIMIT 1",
                        array(bigintval(getRequestElement('rallye_id')), bigintval(postRequestElement('level'))), __FILE__, __LINE__);
 
-                       if (ifSqlHasZeroNums($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // Ok, new price level entered!
                                sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_rallye_prices`
@@ -208,7 +208,7 @@ LIMIT 1",
                $result = sqlQueryEscaped("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
                        array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
 
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Load all prices for the selected rallye
                        $OUT = '';
                        while ($content = sqlFetchArray($result)) {
@@ -252,7 +252,7 @@ ON
        `d`.`admin_id`=`a`.`id`
 ORDER BY
        `d`.`start_time` DESC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List found rallyes
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index ae6e2c597bfe2459c82d551f7ee940389bc1a384..788c49723494a258a43cbe84f31dfc01b1621968 100644 (file)
@@ -263,7 +263,7 @@ WHERE
 ORDER BY
        `userid` ASC",
                array(bigintval(getRequestElement('rallye_id'))), __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                $OUT = '';
                $content['rallye_id'] = bigintval(getRequestElement('rallye_id'));
                while ($row = sqlFetchArray($result)) {
@@ -333,7 +333,7 @@ ORDER BY
        `start_time` DESC", __FILE__, __LINE__);
 
        // Records found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List found rallyes
                $OUT = '';
                while ($data = sqlFetchArray($result)) {
index 5ab17c495503b25c526eaed421c72967c6ee624e..1e31d96034f5b20e60d31dc8ca8f3fa24d15f2ff 100644 (file)
@@ -66,7 +66,7 @@ ORDER BY
        `level` ASC", __FILE__, __LINE__);
 
                // Are there some levels (VERY BAD IF NONE!)
-               if (!ifSqlHasZeroNums($result_levels)) {
+               if (!ifSqlHasZeroNumRows($result_levels)) {
                        // List all ref levels or entries if no refback is installed
                        $OUT = '';
                        while ($levels = sqlFetchArray($result_levels)) {
@@ -79,7 +79,7 @@ ORDER BY
                                //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.sqlNumRows($result_refs));
 
                                // Is there levels?
-                               if (!ifSqlHasZeroNums($result_refs)) {
+                               if (!ifSqlHasZeroNumRows($result_refs)) {
                                        // Count entries
                                        $totalReferrals       = getUsersTotalReferrals($userid, $levels['level']);
                                        $totalLockedReferrals = getUsersTotalLockedReferrals($userid, $levels['level']);
index db2b525e1727c0b64c2729dea0a72420e28b5efa..58b2243640c5f597d2de71bbdd7386ec9aa9c1ec 100644 (file)
@@ -120,7 +120,7 @@ ORDER BY
        `id` ASC",
                array(bigintval(getRequestElement('refid'))), __FILE__, __LINE__);
 
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // List refs now
                        // Free memory
                        sqlFreeResult($result);
@@ -146,7 +146,7 @@ FROM
 ORDER BY
        `id` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // At least one sponsor found
                $OUT = '';
                while ($content = sqlFetchArray($result_main)) {
index e992e522c989acd0aae195e2aefcd116f259255e..f5d505b6df4cb2d978e09cb92b75f62e286029bb 100644 (file)
@@ -113,7 +113,7 @@ if (isFormSent('add')) {
        // Check if entry with same name does exists
        $result = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` WHERE `pay_name`='%s' LIMIT 1",
                array(postRequestElement('pay_name')), __FILE__, __LINE__);
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // No entry found so add this line
                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`, `pay_rate`, `pay_min_count`, `pay_currency`) VALUES ('%s','%s','%s','%s')",
                        array(
@@ -185,7 +185,7 @@ ORDER BY
                __FILE__, __LINE__);
 
        // Are there some payment types setup?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Prepare variables for listing
                $OUT = '';
 
index e2c939a1b89ac6314a190534086e2d5f09376496..035e1f04acfe36df8459588edcf3e5905f556383 100644 (file)
@@ -43,7 +43,9 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addYouAreHereLink('admin', __FILE__);
 
-// We only need outgoing transfers
+$total = '0';
+
+// Only out-going transfers are needed
 $result = sqlQuery('SELECT
        `userid` AS `from_userid`,
        `to_userid`,
@@ -56,8 +58,7 @@ FROM
 ORDER BY
        `trans_id` ASC', __FILE__, __LINE__);
 
-$total = '0';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Output rows
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index bd1f091c14b6829402f8f0ece1e22780bd9c452b..897d760274220303bc3f42327274e27f79d7c862 100644 (file)
@@ -164,7 +164,7 @@ LIMIT %s",
                        ),__FILE__, __LINE__);
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // At least one link left to confirm
                        $OUT = '';
                        while ($row = sqlFetchArray($result)) {
index a2b4e0f16d3682031b345ad5194a260312500c1c..295b8144062ad50bd112d7035216d732c4b57d0d 100644 (file)
@@ -279,7 +279,7 @@ ORDER BY
        $result = sqlQuery($sql, __FILE__, __LINE__);
 
        // Are there some entries?
-       if (!ifSqlHasZeroNums($result_master)) {
+       if (!ifSqlHasZeroNumRows($result_master)) {
                // Sorting links and number of pages
                $templateContent['sort_links'] = addSortLinks(getRequestElement('letter'), getRequestElement('sortby'));
                $templateContent['num_pages'] = $numPages;
index 70ba8f0e9e9b29e3afe4548cfd2b82ad4001070d..84bf3a6673ed83bd8371a17143350bbc8e0791b9 100644 (file)
@@ -72,7 +72,7 @@ ORDER BY
        `p`.`userid` ASC', __FILE__, __LINE__);
 
 // Are there entries? (sorry, the XML functions cannot "produce" the above SQL statement)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Init amounts and points
        $totalPoints = '0';
        $amounts = array();
index 05d4408c7d8a69db60b88172c8c9d4491b4044e7..f357196c904cf79e53928cbf8f86f0e0fe257552 100644 (file)
@@ -55,9 +55,15 @@ if (isGetRequestElementSet('userid')) {
                $content['email']  = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">{%pipe,translateGender=' . $content['gender'] . '%} ' . $content['surname'] . ' ' . $content['family'] . '</a>';
 
                // Ok, list categories of this user
-               $result_cats = sqlQuery("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
+               $result_cats = sqlQuery("SELECT
+       `id`,
+       `cat`
+FROM
+       `{?_MYSQL_PREFIX?}_cats`
+ORDER BY
+       `sort` ASC", __FILE__, __LINE__);
 
-               if (!ifSqlHasZeroNums($result_cats)) {
+               if (!ifSqlHasZeroNumRows($result_cats)) {
                        // List categories
                        $count = 1; $OUT = '';
                        while ($row = sqlFetchArray($result_cats)) {
index 16511ade760c4d913e684e5ed3b631386be033ba..56686255486b096140ac6f5ad2f8af817cace192 100644 (file)
@@ -61,7 +61,7 @@ ORDER BY
        __FILE__, __LINE__);
 
 // Are there some entries to display?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all entries
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index ef63dda39791126d2d02e0bfb116102b9d088ae7..8ed6dea0029b287ac0b0e4fbce1da1448cbcc619 100644 (file)
@@ -58,7 +58,7 @@ if (!isFormSent()) {
        // 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",
                __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = sqlFetchArray($result)) {
@@ -99,7 +99,7 @@ if (!isFormSent()) {
                foreach ($menus as $key_main => $value_main) {
                        $result = sqlQueryEscaped("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
-                       if (!ifSqlHasZeroNums($result)) {
+                       if (!ifSqlHasZeroNumRows($result)) {
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index 81ce2c312f12e2f2b2cefc647692040381166691..dc9b102b557ff25d3dc1c353b7ec28ba414e8c16 100644 (file)
@@ -196,7 +196,7 @@ if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive()
        }
 
        // Some are there?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                $count = '0'; $OUT = '';
                while ($content = sqlFetchArray($result)) {
                        // Set sub value
index e24ac45321c2759c8bc200484b2d8910b4a312ca..4dc746ee8a953ceaf6ce7d43f8ef7bdf7daece9d 100644 (file)
@@ -183,7 +183,8 @@ FROM
        `{?_MYSQL_PREFIX?}_payments`
 ORDER BY
        `time` ASC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // Make referral levels editable and deletable
                $OUT = '';
 
index 52995fd5e32c114fb8f122877a4d9985dd9cb9ae..ae676687e56ee6381b12944488d057bc932e428e 100644 (file)
@@ -57,7 +57,7 @@ if (isFormSent()) {
                                array(postRequestElement('url')), __FILE__, __LINE__);
 
                        // Was the banner found?
-                       if (ifSqlHasZeroNums($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // Add banner
                                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_refbanner` (`url`, `alternate`, `visible`)
 VALUES ('%s','%s','%s')",
@@ -132,7 +132,7 @@ VALUES ('%s','%s','%s')",
        $result = sqlQuery('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Make referral banner editable and deletable
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 7dd4dbaa200cded17d719caf7d2d81f53e5b73dd..e72df0959f09c3b342d8ad7de36eab5003705039 100644 (file)
@@ -45,7 +45,8 @@ addYouAreHereLink('admin', __FILE__);
 
 // Go through all categories
 $result = sqlQuery("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
-if (!ifSqlHasZeroNums($result)) {
+
+if (!ifSqlHasZeroNumRows($result)) {
         // Nothing is removed for now... ;-)
        $removedRows = '0';
 
index ce1538a3aef07901f9e55439e3abb08ea8a55b12..83af7d93997172d42f0ea183b9524ed08859d94d 100644 (file)
@@ -67,7 +67,7 @@ ORDER BY
                        __FILE__, __LINE__);
 
                // Are there entries left?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Convert timestamp selections
                        $expirationTime = time() + createEpocheTimeFromSelections('coupon_default_time', postRequestArray());
 
index 8225f6e1c4fcef5d7ef17bc2a75f1d5f12ddfd66..f2b39c39cb23bd40093bb04e371dc7ba848c1e22 100644 (file)
@@ -54,7 +54,8 @@ WHERE
        `nl_receive`='Y'
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // Members are available so we can send out the newsletter!
                while ($content = sqlFetchArray($result)) {
                        // Construct mail...
index 2aaec8b85244aa8bd06ee287af14d8c903caf06d..aca6624c8a7d1579528489c64a05077d1c38f690 100644 (file)
@@ -59,7 +59,7 @@ ORDER BY
                array(bigintval(getRequestElement('url_id'))), __FILE__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Get all rows
                $OUT = ''; $count = '0'; $visits = '0';
                while ($content = sqlFetchArray($result)) {
@@ -102,7 +102,7 @@ ORDER BY
        `stats_userid` ASC", __FILE__, __LINE__);
 
        // Entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Get all rows
                $OUT = ''; $urlArray = '0'; $visits = '0';
                while ($content = sqlFetchArray($result)) {
index 8085e0f5b6b396907db3e81d0e08c95a8144c40f..e1e60490fe0c846ca50d7c47b8c3ef4a07537380 100644 (file)
@@ -106,7 +106,7 @@ FROM
 ORDER BY
        `theme_path` ASC", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        while ($content = sqlFetchArray($result)) {
                // Is the theme readable?
                if (isThemeReadable($content['theme_path'])) {
index ec5a0695644476dc4eeaf4fa565b2aead822b351..848c797aaf538c72bfb6db90bb053c510373a3a8 100644 (file)
@@ -61,7 +61,7 @@ WHERE
 ORDER BY
        `timestamp` ASC", __FILE__, __LINE__);
 
-if ((!ifSqlHasZeroNums($result_main)) || (isFormSent('lock'))) {
+if ((!ifSqlHasZeroNumRows($result_main)) || (isFormSent('lock'))) {
        if (isFormSent('accept')) {
                if (ifPostContainsSelections()) {
                        // Accept mail orders
index 0438e8c7512debd54456641c74acbef0959a9bf8..af6d22ea558275992c858c04b548ebd3e4d7419c 100644 (file)
@@ -95,7 +95,7 @@ WHERE
 ORDER BY
        `sp`.`pay_name` ASC",
                                        array($content['id']), __FILE__, __LINE__);
-                               if (!ifSqlHasZeroNums($result)) {
+                               if (!ifSqlHasZeroNumRows($result)) {
                                        // Payment does exist
                                        while ($content2 = sqlFetchArray($result)) {
                                                // Merge both arrays
@@ -212,7 +212,7 @@ WHERE
 ORDER BY
        `id`", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Entries found so let's list them!
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index f0bba0d91067194d88c3e868b56ca69c82344a23..0ca3fc427d899ff3979a1a663b0f458a485382eb 100644 (file)
@@ -55,9 +55,23 @@ if (isExtensionActive('online')) {
        loadTemplate('admin_mini_online', FALSE, $content);
 
        // Check for online users
-       $result = sqlQuery("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
-               __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       $result = sqlQuery("SELECT
+       `id`,
+       `ip`,
+       `userid`,
+       `refid`,
+       `module`,
+       `action`,
+       `what`,
+       `is_member`,
+       `is_admin`,
+       `timestamp`
+FROM
+       `{?_MYSQL_PREFIX?}_online`
+ORDER BY
+       `timestamp` DESC", __FILE__, __LINE__);
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all online users
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
index 3ec9c87ca6210678e288ec4e8e6de094a351b5e6..5c7c03c0a8763760218d1b092eb559bcf9c1730e 100644 (file)
@@ -58,7 +58,7 @@ ORDER BY
 LIMIT {?active_limit?}", __FILE__, __LINE__);
 
 // Entries found?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // At least one member was online so let's load them all
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 30af1336b25279c8ecfbda69d9aeb7f5f30285bb..de1db90f2fcf1bc35ef74d223fc5e04e64e409f7 100644 (file)
@@ -72,7 +72,7 @@ WHERE
 ORDER BY
        `m`.`sort` ASC", __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result_act)) {
+if (!ifSqlHasZeroNumRows($result_act)) {
        // Load all actions
        while ($content = sqlFetchArray($result_act)) {
                // Load row template and switch color
@@ -80,8 +80,18 @@ if (!ifSqlHasZeroNums($result_act)) {
        } // END - while
 
        // Check for pay types
-       $result_pay = sqlQuery('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result_pay)) {
+       // @TODO Cache this static data
+       $result_pay = sqlQuery('SELECT
+       `pay_name`,
+       `pay_rate`,
+       `pay_min_count`,
+       `pay_currency`
+FROM
+       `{?_MYSQL_PREFIX?}_sponsor_paytypes`
+ORDER BY
+       `pay_name` ASC', __FILE__, __LINE__);
+
+       if (!ifSqlHasZeroNumRows($result_pay)) {
                // Load all pay types
                while ($content = sqlFetchArray($result_pay)) {
                        // Load row template and switch color
index f145c2108e6235844a4f9baaa2aa6831775b739b..cb93271c33f44e364cf55f95666a1f69fd86c1fd 100644 (file)
@@ -238,7 +238,8 @@ FROM
        `{?_MYSQL_PREFIX?}_sponsor_paytypes`
 ORDER BY
        `pay_name` ASC', __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all types...
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
index 86ba162d24539a53e5c969b1da5b62d4ac1264e1..5c8789ef0de2caf22a454d839223412a1903c3f5 100644 (file)
@@ -185,7 +185,7 @@ switch (strtoupper($do)) {
                $mem_t10   = sqlQuery('SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__);
                $OUT = '';
 
-               if (!ifSqlHasZeroNums($guest_t10)) {
+               if (!ifSqlHasZeroNumRows($guest_t10)) {
                        // Guest clicks
                        $OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_GUEST_STATS--}');
                        while ($content = sqlFetchArray($guest_t10)) {
@@ -194,7 +194,7 @@ switch (strtoupper($do)) {
                        } // END - while
                } // END - if
 
-               if (!ifSqlHasZeroNums($mem_t10)) {
+               if (!ifSqlHasZeroNumRows($mem_t10)) {
                        // Member clicks
                        $OUT .= loadTemplate('guest_stats_header', TRUE, '{--GUEST_TOP_MEMBER_STATS--}');
                        while ($content = sqlFetchArray($mem_t10)) {
index e310ea0c1034c11b21e96f635643203fcc80d58c..6a1e548af6ead9a09c43cc469600a689f59ba60b 100644 (file)
@@ -82,7 +82,7 @@ LIMIT {?beg_ranks?}",
 
 // Reset temporary variable and check for users
 $OUT = '';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Load our winners...
        $count = 1;
        while ($content = sqlFetchArray($result)) {
index 782d6fa8a7c16f277c6d481f46280315fe077833..bfc486f5bc438e13b750deba84663fc1363e0ea0 100644 (file)
@@ -90,7 +90,7 @@ LIMIT {?bonus_ranks?}",
 
 // Reset temporary variable and check for users
 $OUT = '';
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Load our winners...
        $count = 1;
        while ($content = sqlFetchArray($result)) {
index ab2c5adc7e4b56079f97422f0a1c63a1b69a4ba1..d1ddf06e1feeea0cb8cfed22275d33a37f0765c7 100644 (file)
@@ -49,10 +49,17 @@ $whereStatement = " WHERE `visible`='Y'";
 if (isAdmin()) $whereStatement = '';
 
 // Get all categories
-$result = sqlQuery('SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats`' . $whereStatement . ' ORDER BY `sort` ASC', __FILE__, __LINE__);
+$result = sqlQuery('SELECT
+       `id`,
+       `cat`
+FROM
+       `{?_MYSQL_PREFIX?}_cats`
+' . $whereStatement . '
+ORDER BY
+       `sort` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        $LEAST = FALSE;
        if (isFormSent()) {
                $count = '0';
index 78366e03ffa218e0f8bb66fdcdec806f90df48ca..c4a213e5de5fc2d1e514cbc0a773fd938cb3b3e6 100644 (file)
@@ -66,7 +66,7 @@ ORDER BY
        `d`.`earning_sorting` ASC', __FILE__, __LINE__);
 
 // Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Init output
        $OUT = '';
 
index 757126c5c925b5fae7c3e7ddd1b70c4ead0a3619..e4ec9a406404f433d4dfef1ac4d776817f773f85 100644 (file)
@@ -74,7 +74,7 @@ ORDER BY
        `u`.`cashed_on` DESC", array(getMemberId()), __FILE__, __LINE__);
 
 // Are there entries?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Init variable
        $OUT = '';
 
index 610c14940464778d5105eea9fbc0521aa555f72e..ba66cb970da059a4378feacbb67aeb1098b6bb32 100644 (file)
@@ -75,7 +75,7 @@ if ($isValid === TRUE) {
                ), __FILE__, __LINE__);
 
        // Is it not in use?
-       if (ifSqlHasZeroNums($result)) {
+       if (ifSqlHasZeroNumRows($result)) {
                // Prepare array
                $filterData = array(
                        'history_subject' => 'NICKNAME_CHANGED',
index 307b27b7075ef6a84fab34bfd869b5a5f0b9ed52..f2822d0401d494caa5a735c4da1063fb6a3379ba 100644 (file)
@@ -286,7 +286,7 @@ ORDER BY
        `sort` ASC', __FILE__, __LINE__);
 
        // Some categories found?
-       if (!ifSqlHasZeroNums($result_cats)) {
+       if (!ifSqlHasZeroNumRows($result_cats)) {
                // Enought points left?
                if ($totalPoints > 0) {
                        // Initialize array...
@@ -359,7 +359,7 @@ ORDER BY
                        $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();
-                       if (!ifSqlHasZeroNums($result)) {
+                       if (!ifSqlHasZeroNumRows($result)) {
                                // Is the error code set?
                                if (isGetRequestElementSet('code')) {
                                        // Display error message
index 05fd0c9f000d7cdf9f0c95f720d4566139343c24..223d0c09d27d64515369d4c937019c49b9b12390 100644 (file)
@@ -76,7 +76,7 @@ ORDER BY
                array($payoutPoints), __FILE__, __LINE__);
 
        // Some entries found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Check for his payouts
                $result_payouts = sqlQueryEscaped('SELECT
        `p`.`id`,
@@ -101,7 +101,7 @@ WHERE
 ORDER BY
        `p`.`payout_timestamp` DESC',
                        array(getMemberId()), __FILE__, __LINE__);
-               if (!ifSqlHasZeroNums($result_payouts)) {
+               if (!ifSqlHasZeroNumRows($result_payouts)) {
                        // List all his requests
                        $OUT = '';
                        while ($content = sqlFetchArray($result_payouts)) {
index 9f5ef86794bed476eb5e74dd17c57a538af8ddfe..e9d69e6e384f1931637c4027d9329cffb7a81401 100644 (file)
@@ -107,7 +107,7 @@ ORDER BY
        `r`.`level` ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all levels
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 5655223cfb03f1335036b6ffd2e969a5884c293c..1152c1a4457f6cd80395b1c3f481be90c31cf766 100644 (file)
@@ -68,7 +68,7 @@ if (isAdmin()) $whereStatement = '';
 
 $result = sqlQuery('SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `id` ASC', __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List available ref banners
        $OUT = '';
        while ($row = sqlFetchArray($result)) {
index 5953d360cfe031099453380c360a36ef8897fc9d..e5ee8d9cf3d1c8657fdfc25577fe492a9a9450d2 100644 (file)
@@ -58,7 +58,7 @@ ORDER BY
        `level` ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // List all levels
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 48b5a2610faf59f5b22e3cc11d08bc784f1e5572..9c62bc4fd2338fc2f8bd23a4df2b26620afa8b0f 100644 (file)
@@ -69,7 +69,7 @@ ORDER BY
        array(getMemberId()), __FILE__, __LINE__);
 
 // Are there mails left in pool?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Load all orders
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
@@ -109,7 +109,7 @@ ORDER BY
        `timestamp_ordered` DESC',
        array(getMemberId()), __FILE__, __LINE__);
 
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Mail orders are in pool so we can display them
        $OUT = '';
        while ($content = sqlFetchArray($result)) {
index 6f334187822f2e4488d55ce02ddce06388f041b6..884e31b08df41383e8980ef408d08033f931768d 100644 (file)
@@ -216,7 +216,7 @@ switch ($mode) {
                        $result = sqlQueryEscaped("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED'" . runFilterChain('user_exclusion_sql', ' ') . " AND `opt_in`='Y' AND `userid` != '%s' ORDER BY `userid` ASC",
                                array(getMemberId()), __FILE__, __LINE__);
 
-                       if (!ifSqlHasZeroNums($result)) {
+                       if (!ifSqlHasZeroNumRows($result)) {
                                // Load list
                                $OUT  = '<select name="to_userid" size="1" class="form_select">
        <option value="0">{--SELECT_NONE--}</option>';
@@ -300,7 +300,7 @@ switch ($mode) {
                $result = sqlQueryEscaped($sql, array(getMemberId()), __FILE__, __LINE__);
 
                // Are there entries?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        $OUT = '';
                        while ($content = sqlFetchArray($result)) {
                                // Rewrite points, out is subtracted
@@ -386,7 +386,7 @@ INDEX (`party_userid`)
                        array(getMemberId()), __FILE__, __LINE__);
 
                $total = '0';
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Output rows
                        $OUT = '';
                        while ($content = sqlFetchArray($result)) {
index 84e148438c0e70c176d6d710327362477f018bc3..b1ef76e919167274f062d112ddd6daede52349cb 100644 (file)
@@ -158,7 +158,7 @@ if (isExtensionActive('bonus')) {
 }
 
 // Mails left for confirmation?
-if (!ifSqlHasZeroNums($result)) {
+if (!ifSqlHasZeroNumRows($result)) {
        // Please confirm these mails!
        $sum = '0'; $OUT = '';
 
index 92a158f09e9deb55dd0f7c240a1dbcaa5a603c8d..eeabf6493ceedaa29d94fa0bf1e69dac60277349 100644 (file)
@@ -77,7 +77,7 @@ ORDER BY
        `d`.`userid` ASC
 LIMIT {?beg_ranks?}", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Load our winners...
                while ($content = sqlFetchArray($result_main)) {
                        // Add points to user's account directly
index 895abd64495d7a347ba76d86473bdfeda6867f59..8078ecee3341de376d3ef75d7496e311cd0555b8 100644 (file)
@@ -76,7 +76,7 @@ ORDER BY
 LIMIT {?bonus_ranks?}', __FILE__, __LINE__);
 
        // Some entries were found?
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Load our winners...
                while ($content = sqlFetchArray($result_main)) {
                        // Make sure zero points are not mailed
index 314642ed0c89fecd759ec12e6abcc445160892c1..ff30180d0a40304c64619b482135044a17f3df68 100644 (file)
@@ -222,7 +222,7 @@ ORDER BY
                array($mode), __FUNCTION__, __LINE__);
 
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'main_cnt=' . $main_cnt . ',getWhat()=' . getWhat());
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = sqlFetchArray($result_main)) {
@@ -254,7 +254,7 @@ ORDER BY
                                ), __FUNCTION__, __LINE__);
 
                        // Are there some entries?
-                       if (!ifSqlHasZeroNums($result_sub)) {
+                       if (!ifSqlHasZeroNumRows($result_sub)) {
                                // Init counter
                                $count = '0';
 
@@ -665,7 +665,7 @@ function addMaxReceiveList ($mode, $default = '') {
        }
 
        // Some entries are found?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                $OUT = '';
                while ($content = sqlFetchArray($result)) {
                        $OUT .= '      <option value="' . $content['value'] . '"';
@@ -784,7 +784,7 @@ function isMenuActionValid ($mode, $action, $what, $updateEntry = FALSE) {
                $ret = (!ifSqlHasZeroAffectedRows());
        } else {
                // Check found rows
-               $ret = (!ifSqlHasZeroNums($result));
+               $ret = (!ifSqlHasZeroNumRows($result));
        }
 
        // Free memory
@@ -874,20 +874,21 @@ function getCategory ($cid) {
        // Is the category id set?
        if (!isValidId($cid)) {
                // No category
-               $data['cat'] = '{--_CATEGORY_NONE--}';
-       } elseif (isValidId($cid)) {
-               // Lookup the category in database
-               $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
-                       array(bigintval($cid)), __FUNCTION__, __LINE__);
-               if (sqlNumRows($result) == 1) {
-                       // Category found... :-)
-                       $data = sqlFetchArray($result);
-               } // END - if
+               return '{--_CATEGORY_NONE--}';
+       } // END - if
 
-               // Free result
-               sqlFreeResult($result);
+       // Lookup the category in database
+       $result = sqlQueryEscaped('SELECT `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `id`=%s LIMIT 1',
+               array(bigintval($cid)), __FUNCTION__, __LINE__);
+
+       if (sqlNumRows($result) == 1) {
+               // Category found... :-)
+               $data = sqlFetchArray($result);
        } // END - if
 
+       // Free result
+       sqlFreeResult($result);
+
        // Return result
        return $data['cat'];
 }
@@ -989,7 +990,7 @@ function removeReceiver (&$receivers, $key, $userid, $poolId, $statsId = 0, $isB
                                ), __FUNCTION__, __LINE__);
 
                        // Was it *not* found?
-                       if (ifSqlHasZeroNums($result)) {
+                       if (ifSqlHasZeroNumRows($result)) {
                                // So we add one!
                                sqlQueryEscaped("INSERT INTO `{?_MYSQL_PREFIX?}_user_links` (`%s`, `userid`, `link_type`) VALUES (%s,%s,'%s')",
                                        array(
@@ -1446,7 +1447,7 @@ function generateOptions ($table, $key, $value, $default = '', $extra = '', $whe
                        ), __FUNCTION__, __LINE__);
 
                // Is there rows?
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Found data so add them as OPTION lines
                        while ($content = sqlFetchArray($result)) {
                                // Is extra set?
@@ -1617,7 +1618,7 @@ ORDER BY
                __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // ... and begin loading stuff
                while ($content = sqlFetchArray($result)) {
                        // Transfer some data
@@ -1849,7 +1850,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
        );
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Now load all userids for one big query!
                $userids = array();
                while ($data = sqlFetchArray($result)) {
@@ -2008,7 +2009,7 @@ function doListEntries ($sql, $tableTemplate, $noEntryMessageId, $rowTemplate, $
        $result = sqlQuery($sql, __FUNCTION__, __LINE__);
 
        // Are there some URLs left?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // List all URLs
                $OUT = '';
                while ($row = sqlFetchArray($result)) {
@@ -2538,7 +2539,7 @@ ORDER BY
        $rows = array();
 
        // Are there entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all entries
                while ($row = sqlFetchArray($result)) {
                        array_push($rows, $row);
index 7a3653dd3ab9e065342c4fe3e164ba4432a7fd16..eb263b9905241feda5c5aa0995d6539756be13b6 100644 (file)
@@ -82,7 +82,7 @@ ORDER BY
        `timestamp` DESC", __FILE__, __LINE__);
 
        // Some mails left?
-       if (!ifSqlHasZeroNums($result_main)) {
+       if (!ifSqlHasZeroNumRows($result_main)) {
                // Init SQLs here
                initSqls();
 
index 7282f3cc2bdb6233c3edde977f0876624e7fefda..128d793eea663d566c30dfa225e20f7bab524949 100644 (file)
@@ -84,7 +84,7 @@ $lastSentId = '0';
 $count_back = array(0);
 $pointsBack = array(0);
 
-if (!ifSqlHasZeroNums($result_main)) {
+if (!ifSqlHasZeroNumRows($result_main)) {
        // Parse all mails
        while ($mailData = sqlFetchArray($result_main)) {
                // Set mail order as 'active'. That means it will be sent out
@@ -123,7 +123,7 @@ if (!ifSqlHasZeroNums($result_main)) {
 
                                        // If there's no stats entry add it!
                                        //* DEBUG: */ debugOutput('!L:'.__LINE__.'/'.sqlNumRows($result_stats).'!');
-                                       if (ifSqlHasZeroNums($result_stats)) {
+                                       if (ifSqlHasZeroNumRows($result_stats)) {
                                                // No entry was found, so we add him!
                                                sqlQueryEscaped("INSERT INTO
        `{?_MYSQL_PREFIX?}_user_stats`
index 3def007242ec6ff979174b56184c69057a75473b..33cc39f1df2247432edc41fdaf08bc0c34016cf0 100644 (file)
@@ -63,7 +63,7 @@ WHERE
        (UNIX_TIMESTAMP() - `timestamp_ordered`) >= {?auto_purge?}
 ORDER BY
        `userid` ASC', __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Start deleting procedure
                $userid = NULL;
                $points = '0';
@@ -112,14 +112,14 @@ ORDER BY
        if (isExtensionActive('bonus', TRUE)) {
                // Check for bonus campaigns
                $result = sqlQuery("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
-               if (!ifSqlHasZeroNums($result)) {
+               if (!ifSqlHasZeroNumRows($result)) {
                        // Start deleting procedure
                        $points = '0';
                        while ($content = sqlFetchArray($result)) {
                                // Check if confirmation links are purged or not
                                $result_links = sqlQueryEscaped("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                                        array(bigintval($content['id'])), __FILE__, __LINE__);
-                               if (!ifSqlHasZeroNums($result_links)) {
+                               if (!ifSqlHasZeroNumRows($result_links)) {
                                        // At least one link was found, enougth to pay back the points
                                        $points += $content['points'] * sqlNumRows($result_links);
 
index 2124c5fcb0889f8b8bbf8f89b18ec5511f6da213..7e4107b3c2a6071b040ffe4b015d6d2073f8b42e 100644 (file)
@@ -75,7 +75,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_inactive)) {
+       if (!ifSqlHasZeroNumRows($result_inactive)) {
                // Prepare variables and constants...
                $userids = array();
                $content['since'] = (getApInactiveSince() / 60 / 60);
@@ -132,7 +132,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-       if (!ifSqlHasZeroNums($result_inactive)) {
+       if (!ifSqlHasZeroNumRows($result_inactive)) {
                // Prepare userid array for admin...
                $userids = array();
 
index 183dee030cae0f3e5f6efcd255a97b1b6ca4cceb..60a9651eca4165cc580cd24d06c4fd19d2de4df1 100644 (file)
@@ -61,7 +61,7 @@ ORDER BY
 $deletedStats = '0';
 
 // Is there "purged" mails?
-if (!ifSqlHasZeroNums($result_mails)) {
+if (!ifSqlHasZeroNumRows($result_mails)) {
        // Okay, check for their sender's
        while ($content = sqlFetchArray($result_mails)) {
                // Check now...
@@ -90,7 +90,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 // Is there "purged" mails?
-if (!ifSqlHasZeroNums($result_mails)) {
+if (!ifSqlHasZeroNumRows($result_mails)) {
        // Okay, check for their sender's
        while ($content = sqlFetchArray($result_mails)) {
                // Check now...
index 11c767c946e48c4968cc75c9cbdfde250d97d8bb..d18fc5db72afad46be278cb71e8ede0c8d44d8ab 100644 (file)
@@ -64,7 +64,7 @@ WHERE
        (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__);
 
        // Send out a notification?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Init output and load all rows
                $output = ''; $ids = array();
                while ($row = sqlFetchArray($result)) {
index cefc7246902a28fb76857cccbd5d3e68a9fbe8d2..bb61a6e37da6e2822d89d4369c532bb261c0c937 100644 (file)
@@ -60,7 +60,7 @@ WHERE
        (UNIX_TIMESTAMP() - `joined`) >= {?ap_unconfirmed_time?}
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
-       if (!ifSqlHasZeroNums($result_uncon)) {
+       if (!ifSqlHasZeroNumRows($result_uncon)) {
                // Prepare variable...
                $userids = '';
                $content['time'] = (getApUnconfirmedTime()  / 60 / 60);
index 5c4ce145541c5e48299150e1f99a3837b9b3dc04..788e40cfa80bbabba4de8349a181f7d283f4f8a5 100644 (file)
@@ -414,7 +414,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there some entries?
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Fetch all entries
                while ($row = sqlFetchArray($result)) {
                        // Init click rate with zero
index ce598ad39aa0b5011c40b3ece36c3563ef06fe14..267dcb4fb8be6e4f4fb43a12a1e47c2dc0070bba 100644 (file)
@@ -524,7 +524,7 @@ function isSqlLinkUp () {
 }
 
 // Wrapper function to make code more readable
-function ifSqlHasZeroNums ($result) {
+function ifSqlHasZeroNumRows ($result) {
        // Just pass it through
        return (sqlNumRows($result) === 0);
 }
@@ -643,7 +643,7 @@ function ifSqlTableColumnExists ($tableName, $columnName, $forceFound = FALSE) {
        } // END - if
 
        // Determine it
-       $doesExist = (!ifSqlHasZeroNums($result));
+       $doesExist = (!ifSqlHasZeroNumRows($result));
 
        // Free result
        sqlFreeResult($result);
@@ -725,7 +725,7 @@ function getArrayFromSupportedSqlEngines ($requestedEngine = 'ALL') {
        $result = sqlQuery('SHOW ENGINES', __FUNCTION__, __LINE__);
 
        // Are there entries? (Bad if not)
-       if (!ifSqlHasZeroNums($result)) {
+       if (!ifSqlHasZeroNumRows($result)) {
                // Load all and check for active entries
                while ($content = sqlFetchArray($result)) {
                        // Debug message