From 49acdb7a7adbcf25a8e8683b5581bfcec72b23bd Mon Sep 17 00:00:00 2001 From: Roland Haeder Date: Mon, 28 Mar 2016 15:24:33 +0200 Subject: [PATCH] Renamed ifSqlHasZeroNums() to ifSqlHasZeroNumRows() and improved some queries. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- beg.php | 2 +- inc/daily/daily_100_bonus.php | 2 +- inc/daily/daily_birthday.php | 2 +- inc/daily/daily_holiday.php | 2 +- inc/daily/daily_profile.php | 2 +- inc/daily/daily_user.php | 4 +- inc/filter-functions.php | 2 +- inc/filter/earning_filter.php | 2 +- inc/filter/user_filter.php | 2 +- inc/fix_filters.php | 2 +- inc/fix_refsystem.php | 4 +- inc/fix_user_points.php | 2 +- inc/libs/admins_functions.php | 2 +- inc/libs/bonus_functions.php | 2 +- inc/libs/doubler_functions.php | 2 +- inc/libs/forced_functions.php | 6 +-- inc/libs/holiday_functions.php | 2 +- inc/libs/jackpot_functions.php | 2 +- inc/libs/network_functions.php | 16 +++---- inc/libs/optimize_functions.php | 2 +- inc/libs/payout_functions.php | 2 +- inc/libs/rallye_functions.php | 8 ++-- inc/libs/refback_functions.php | 4 +- inc/libs/register_functions.php | 2 +- inc/libs/sponsor_functions.php | 4 +- inc/libs/surfbar_functions.php | 6 +-- inc/libs/task_functions.php | 2 +- inc/libs/user_functions.php | 2 +- inc/mails/beg_mails.php | 3 +- inc/mails/bonus_mails.php | 3 +- inc/module-functions.php | 2 +- inc/modules/admin/admin-inc.php | 12 +++--- inc/modules/admin/overview-inc.php | 2 +- inc/modules/admin/what-add_rallye.php | 2 +- inc/modules/admin/what-admin_add.php | 4 +- inc/modules/admin/what-adminedit.php | 2 +- inc/modules/admin/what-admins_mails.php | 2 +- inc/modules/admin/what-config_imprint.php | 2 +- .../admin/what-config_network_types.php | 2 +- inc/modules/admin/what-config_payouts.php | 6 +-- inc/modules/admin/what-del_transfer.php | 7 +-- inc/modules/admin/what-edit_emails.php | 2 +- inc/modules/admin/what-email_archiv.php | 2 +- inc/modules/admin/what-email_details.php | 6 +-- inc/modules/admin/what-extensions.php | 2 +- inc/modules/admin/what-guest_add.php | 6 ++- inc/modules/admin/what-guestedit.php | 2 +- inc/modules/admin/what-list_admins_acls.php | 4 +- inc/modules/admin/what-list_autopurge.php | 2 +- inc/modules/admin/what-list_bank_package.php | 2 +- inc/modules/admin/what-list_beg.php | 2 +- inc/modules/admin/what-list_bonus.php | 2 +- inc/modules/admin/what-list_cats.php | 26 ++++++++--- inc/modules/admin/what-list_country.php | 4 +- inc/modules/admin/what-list_coupon.php | 4 +- inc/modules/admin/what-list_email_max_rec.php | 4 +- inc/modules/admin/what-list_holiday.php | 2 +- inc/modules/admin/what-list_links.php | 2 +- .../what-list_network_array_translation.php | 2 +- inc/modules/admin/what-list_network_data.php | 2 +- .../what-list_network_request_params.php | 2 +- inc/modules/admin/what-list_network_types.php | 2 +- inc/modules/admin/what-list_notifications.php | 4 +- inc/modules/admin/what-list_payouts.php | 2 +- inc/modules/admin/what-list_rallye_prices.php | 6 +-- inc/modules/admin/what-list_rallyes.php | 4 +- inc/modules/admin/what-list_refs.php | 4 +- inc/modules/admin/what-list_sponsor.php | 4 +- inc/modules/admin/what-list_sponsor_pay.php | 4 +- inc/modules/admin/what-list_transfer.php | 7 +-- inc/modules/admin/what-list_unconfirmed.php | 2 +- inc/modules/admin/what-list_user.php | 2 +- inc/modules/admin/what-list_user_amounts.php | 2 +- inc/modules/admin/what-list_user_cats.php | 10 ++++- inc/modules/admin/what-list_wernis.php | 2 +- inc/modules/admin/what-mem_add.php | 4 +- inc/modules/admin/what-memedit.php | 2 +- inc/modules/admin/what-payments.php | 3 +- inc/modules/admin/what-refbanner.php | 4 +- inc/modules/admin/what-repair_cats.php | 3 +- inc/modules/admin/what-send_coupon.php | 2 +- inc/modules/admin/what-send_newsletter.php | 3 +- inc/modules/admin/what-surfbar_stats.php | 4 +- inc/modules/admin/what-theme_edit.php | 2 +- inc/modules/admin/what-unlock_emails.php | 2 +- inc/modules/admin/what-unlock_sponsor.php | 4 +- inc/modules/admin/what-usr_online.php | 20 +++++++-- inc/modules/guest/what-active.php | 2 +- inc/modules/guest/what-sponsor_infos.php | 16 +++++-- inc/modules/guest/what-sponsor_reg.php | 3 +- inc/modules/guest/what-stats.php | 4 +- inc/modules/member/what-beg2.php | 2 +- inc/modules/member/what-bonus.php | 2 +- inc/modules/member/what-categories.php | 11 ++++- inc/modules/member/what-earning.php | 2 +- inc/modules/member/what-list_coupon.php | 2 +- inc/modules/member/what-nickname.php | 2 +- inc/modules/member/what-order.php | 4 +- inc/modules/member/what-payout.php | 4 +- inc/modules/member/what-refback.php | 2 +- inc/modules/member/what-reflinks.php | 2 +- inc/modules/member/what-reflist.php | 2 +- inc/modules/member/what-stats.php | 4 +- inc/modules/member/what-transfer.php | 6 +-- inc/modules/member/what-unconfirmed.php | 2 +- inc/monthly/monthly_beg.php | 2 +- inc/monthly/monthly_bonus.php | 2 +- inc/mysql-manager.php | 43 ++++++++++--------- inc/pool/pool-bonus.php | 2 +- inc/pool/pool-user.php | 4 +- inc/purge/purge-general.php | 6 +-- inc/purge/purge-inact.php | 4 +- inc/purge/purge-mails.php | 4 +- inc/purge/purge-tasks.php | 2 +- inc/purge/purge-unconfirmed.php | 2 +- inc/referral-functions.php | 2 +- inc/sql-functions.php | 6 +-- 117 files changed, 270 insertions(+), 210 deletions(-) diff --git a/beg.php b/beg.php index 8870c2ed17..1ef706f9af 100644 --- 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(); diff --git a/inc/daily/daily_100_bonus.php b/inc/daily/daily_100_bonus.php index 4a326f4352..82cfbd612d 100644 --- a/inc/daily/daily_100_bonus.php +++ b/inc/daily/daily_100_bonus.php @@ -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 diff --git a/inc/daily/daily_birthday.php b/inc/daily/daily_birthday.php index 64e8df40ec..2b6bcc1952 100644 --- a/inc/daily/daily_birthday.php +++ b/inc/daily/daily_birthday.php @@ -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 diff --git a/inc/daily/daily_holiday.php b/inc/daily/daily_holiday.php index 81e392aa1d..10a7253bb7 100644 --- a/inc/daily/daily_holiday.php +++ b/inc/daily/daily_holiday.php @@ -59,7 +59,7 @@ ORDER BY __FILE__, __LINE__); // Entries found? -if (!ifSqlHasZeroNums($result_main)) { +if (!ifSqlHasZeroNumRows($result_main)) { // Init SQLs initSqls(); diff --git a/inc/daily/daily_profile.php b/inc/daily/daily_profile.php index 48e736f375..c687949163 100644 --- a/inc/daily/daily_profile.php +++ b/inc/daily/daily_profile.php @@ -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 diff --git a/inc/daily/daily_user.php b/inc/daily/daily_user.php index 1922b584b6..e09ff4213f 100644 --- a/inc/daily/daily_user.php +++ b/inc/daily/daily_user.php @@ -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 diff --git a/inc/filter-functions.php b/inc/filter-functions.php index 27a7b607c0..e0c383009a 100644 --- a/inc/filter-functions.php +++ b/inc/filter-functions.php @@ -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 diff --git a/inc/filter/earning_filter.php b/inc/filter/earning_filter.php index 0ed6f68969..a658857f59 100644 --- a/inc/filter/earning_filter.php +++ b/inc/filter/earning_filter.php @@ -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 diff --git a/inc/filter/user_filter.php b/inc/filter/user_filter.php index d282448ba4..e9eec0aca4 100644 --- a/inc/filter/user_filter.php +++ b/inc/filter/user_filter.php @@ -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 = ''; diff --git a/inc/fix_filters.php b/inc/fix_filters.php index 3e71feb7f1..294f1099bc 100644 --- a/inc/fix_filters.php +++ b/inc/fix_filters.php @@ -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 diff --git a/inc/fix_refsystem.php b/inc/fix_refsystem.php index a3054e0c86..c4200c8fbc 100644 --- a/inc/fix_refsystem.php +++ b/inc/fix_refsystem.php @@ -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 diff --git a/inc/fix_user_points.php b/inc/fix_user_points.php index 835d7d785a..96f15aebcd 100644 --- a/inc/fix_user_points.php +++ b/inc/fix_user_points.php @@ -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 diff --git a/inc/libs/admins_functions.php b/inc/libs/admins_functions.php index 8f8742b880..71eaa0db6c 100644 --- a/inc/libs/admins_functions.php +++ b/inc/libs/admins_functions.php @@ -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) diff --git a/inc/libs/bonus_functions.php b/inc/libs/bonus_functions.php index d5b51b782a..b37f45c61c 100644 --- a/inc/libs/bonus_functions.php +++ b/inc/libs/bonus_functions.php @@ -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 diff --git a/inc/libs/doubler_functions.php b/inc/libs/doubler_functions.php index 30dd888b1d..25e41287b9 100644 --- a/inc/libs/doubler_functions.php +++ b/inc/libs/doubler_functions.php @@ -88,7 +88,7 @@ LIMIT %s", $limit ), __FUNCTION__, __LINE__); - if (!ifSqlHasZeroNums($result)) { + if (!ifSqlHasZeroNumRows($result)) { // List entries $OUT = ''; while ($content = sqlFetchArray($result)) { diff --git a/inc/libs/forced_functions.php b/inc/libs/forced_functions.php index b606f295df..b73b0d1c38 100644 --- a/inc/libs/forced_functions.php +++ b/inc/libs/forced_functions.php @@ -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 diff --git a/inc/libs/holiday_functions.php b/inc/libs/holiday_functions.php index b8d9ebd69a..ae23b03fc9 100644 --- a/inc/libs/holiday_functions.php +++ b/inc/libs/holiday_functions.php @@ -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 = ''; diff --git a/inc/libs/jackpot_functions.php b/inc/libs/jackpot_functions.php index c3c1c6ddcf..abd678a98c 100644 --- a/inc/libs/jackpot_functions.php +++ b/inc/libs/jackpot_functions.php @@ -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 { diff --git a/inc/libs/network_functions.php b/inc/libs/network_functions.php index f0f166d495..9979266aac 100644 --- a/inc/libs/network_functions.php +++ b/inc/libs/network_functions.php @@ -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; diff --git a/inc/libs/optimize_functions.php b/inc/libs/optimize_functions.php index 64308e7779..07b24ef8ab 100644 --- a/inc/libs/optimize_functions.php +++ b/inc/libs/optimize_functions.php @@ -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']; diff --git a/inc/libs/payout_functions.php b/inc/libs/payout_functions.php index 4058861fc0..d7abac5fe2 100644 --- a/inc/libs/payout_functions.php +++ b/inc/libs/payout_functions.php @@ -59,7 +59,7 @@ ORDER BY array($points), __FUNCTION__, __LINE__); // Some entries found? - if (!ifSqlHasZeroNums($result)) { + if (!ifSqlHasZeroNumRows($result)) { // Init output $OUT = ''; diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index bbd4bfa33a..a0812bb3a2 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -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(); diff --git a/inc/libs/refback_functions.php b/inc/libs/refback_functions.php index 50676cfff8..a6d13a89c3 100644 --- a/inc/libs/refback_functions.php +++ b/inc/libs/refback_functions.php @@ -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 diff --git a/inc/libs/register_functions.php b/inc/libs/register_functions.php index 5e86d02b94..1bb911df8f 100644 --- a/inc/libs/register_functions.php +++ b/inc/libs/register_functions.php @@ -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 .= ''; while ($content = sqlFetchArray($result)) { diff --git a/inc/libs/sponsor_functions.php b/inc/libs/sponsor_functions.php index 3de5472e7e..fa1767bea6 100644 --- a/inc/libs/sponsor_functions.php +++ b/inc/libs/sponsor_functions.php @@ -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)) { diff --git a/inc/libs/surfbar_functions.php b/inc/libs/surfbar_functions.php index b87c1ca4d8..7cd5feef62 100644 --- a/inc/libs/surfbar_functions.php +++ b/inc/libs/surfbar_functions.php @@ -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)) { diff --git a/inc/libs/task_functions.php b/inc/libs/task_functions.php index 24e853bcdc..5be0adbd37 100644 --- a/inc/libs/task_functions.php +++ b/inc/libs/task_functions.php @@ -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 diff --git a/inc/libs/user_functions.php b/inc/libs/user_functions.php index c2baa161c6..22dd84f253 100644 --- a/inc/libs/user_functions.php +++ b/inc/libs/user_functions.php @@ -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; diff --git a/inc/mails/beg_mails.php b/inc/mails/beg_mails.php index 3bfd966c9e..554f101ed6 100644 --- a/inc/mails/beg_mails.php +++ b/inc/mails/beg_mails.php @@ -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'))); diff --git a/inc/mails/bonus_mails.php b/inc/mails/bonus_mails.php index 6c47d4d676..6fb1ef0d1d 100644 --- a/inc/mails/bonus_mails.php +++ b/inc/mails/bonus_mails.php @@ -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 diff --git a/inc/module-functions.php b/inc/module-functions.php index 9dc01cb14e..8f1f049684 100644 --- a/inc/module-functions.php +++ b/inc/module-functions.php @@ -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 diff --git a/inc/modules/admin/admin-inc.php b/inc/modules/admin/admin-inc.php index ea6351415f..6eee1eddf6 100644 --- a/inc/modules/admin/admin-inc.php +++ b/inc/modules/admin/admin-inc.php @@ -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 .= '