More rewrites to make use of (cached) wrapper functions
authorRoland Häder <roland@mxchange.org>
Thu, 1 Jul 2010 04:45:22 +0000 (04:45 +0000)
committerRoland Häder <roland@mxchange.org>
Thu, 1 Jul 2010 04:45:22 +0000 (04:45 +0000)
108 files changed:
beg.php
doubler.php
inc/autopurge/purge-general.php
inc/autopurge/purge-inact.php
inc/autopurge/purge-mails.php
inc/autopurge/purge-unconfirmed.php
inc/filter-functions.php
inc/fix_filters.php
inc/functions.php
inc/gen_refback.php
inc/libs/bonus_functions.php
inc/libs/doubler_functions.php
inc/libs/network_functions.php
inc/libs/online_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/mails/beg_mails.php
inc/mails/bonus_mails.php
inc/modules/admin/admin-inc.php
inc/modules/admin/overview-inc.php
inc/modules/admin/what-admin_add.php
inc/modules/admin/what-adminedit.php
inc/modules/admin/what-admins_edit.php
inc/modules/admin/what-admins_mails.php
inc/modules/admin/what-chk_regs.php
inc/modules/admin/what-config_admins.php
inc/modules/admin/what-config_cats.php
inc/modules/admin/what-config_email.php
inc/modules/admin/what-config_imprint.php
inc/modules/admin/what-config_mediadata.php
inc/modules/admin/what-config_mods.php
inc/modules/admin/what-config_payouts.php
inc/modules/admin/what-config_points.php
inc/modules/admin/what-config_rallye_prices.php
inc/modules/admin/what-del_holiday.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_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_holiday.php
inc/modules/admin/what-list_network_params.php
inc/modules/admin/what-list_network_types.php
inc/modules/admin/what-list_networks.php
inc/modules/admin/what-list_notifications.php
inc/modules/admin/what-list_payouts.php
inc/modules/admin/what-list_primera.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_surfbar_actions.php
inc/modules/admin/what-list_surfbar_urls.php
inc/modules/admin/what-list_task.php
inc/modules/admin/what-list_transfer.php
inc/modules/admin/what-list_user.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_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-unlock_surfbar_urls.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/guest/what-wernis_portal.php
inc/modules/member/what-beg2.php
inc/modules/member/what-bonus.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-user.php
inc/reset/reset_holiday.php
inc/reset/reset_profile.php
inc/template-functions.php
inc/wrapper-functions.php
mailid.php
mailid_top.php
ref.php
show_bonus.php

diff --git a/beg.php b/beg.php
index 57b930c8d9fc4869b1b720f163def020db07383d..65516a55b635e08dadffb71a1f4e4e66b88fb6f1 100644 (file)
--- a/beg.php
+++ b/beg.php
@@ -98,7 +98,7 @@ if (isGetRequestParameterSet('userid')) {
        } // END - if
 
        // User id valid and not webmaster's id?
        } // END - if
 
        // User id valid and not webmaster's id?
-       if ((getUserData('userid') > 0) && (getConfig('beg_userid') != getUserData('userid'))) {
+       if ((isValidUserId(getUserData('userid'))) && (getConfig('beg_userid') != getUserData('userid'))) {
                // Update counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
                // Update counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(getUserData('userid')), __FILE__, __LINE__);
@@ -109,7 +109,6 @@ if (isGetRequestParameterSet('userid')) {
 
                // Entry not found, points set and not logged in?
                if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
 
                // Entry not found, points set and not logged in?
                if (((SQL_HASZERONUMS($result)) || (isAdmin())) && ($points > 0) && (!isMember()) && (getConfig('beg_pay_mode') == 'NONE')) {
-
                        // Admin is testing?
                        if (!isAdmin()) {
                                // Remember remote address, userid and timestamp for next click
                        // Admin is testing?
                        if (!isAdmin()) {
                                // Remember remote address, userid and timestamp for next click
index 635448e77b3de39a2c0c33f814b16c056abaed69..8685143cf2f2f935ab93a199e9f15c76424c3fe9 100644 (file)
@@ -117,7 +117,7 @@ if (isFormSent()) {
                                incrementConfigEntry('doubler_points', $points);
 
                                // Add second line for the referal but only when userid != refid
                                incrementConfigEntry('doubler_points', $points);
 
                                // Add second line for the referal but only when userid != refid
-                               if ((determineReferalId() > 0) && (determineReferalId() != getUserData('userid'))) {
+                               if ((isValidUserId(determineReferalId())) && (determineReferalId() != getUserData('userid'))) {
                                        // Okay add a refid line and apply refid percents
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')",
                                                array(
                                        // Okay add a refid line and apply refid percents
                                        SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`, `refid`, `points`, `remote_ip`, `timemark`, `completed`, `is_ref`) VALUES ('%s',0,'%s','".detectRemoteAddr()."',UNIX_TIMESTAMP(),'N','Y')",
                                                array(
index 0e26307b13849fa5b71121dcf1c509b2bd787710..68b98ac43524d0510fb1c02395d827cbb4d4b386 100644 (file)
@@ -66,7 +66,7 @@ WHERE
        s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
 ORDER BY
        s.userid ASC", __FILE__, __LINE__);
        s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
 ORDER BY
        s.userid ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Start deleting procedure
                $userid = '0'; $points = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                // Start deleting procedure
                $userid = '0'; $points = '0';
                while ($content = SQL_FETCHARRAY($result)) {
@@ -108,14 +108,14 @@ ORDER BY
        if (isExtensionActive('bonus', true)) {
                // Check for bonus campaigns
                $result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
        if (isExtensionActive('bonus', true)) {
                // Check for bonus campaigns
                $result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Start deleting procedure
                        $points = '0';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Check if confirmation links are purged or not
                                $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                                        array(bigintval($content['id'])), __FILE__, __LINE__);
                        // Start deleting procedure
                        $points = '0';
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Check if confirmation links are purged or not
                                $result_links = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `bonus_id`=%s",
                                        array(bigintval($content['id'])), __FILE__, __LINE__);
-                               if (SQL_NUMROWS($result_links) > 0) {
+                               if (!SQL_HASZERONUMS($result_links)) {
                                        // At least one link was found, enougth to pay back the points
                                        $points += $content['points'] * SQL_NUMROWS($result_links);
 
                                        // At least one link was found, enougth to pay back the points
                                        $points += $content['points'] * SQL_NUMROWS($result_links);
 
index 74dd7469a14577fc6becaa474bcc9d51fd868393..4a0ef168653731e83a6832201ed8177eec766721 100644 (file)
@@ -56,10 +56,7 @@ if (getConfig('autopurge_inactive') == 'Y') {
        // Init exclusion list
        // @TODO Rewrite these if() blocks to a filter
        $EXCLUDE_LIST = '';
        // Init exclusion list
        // @TODO Rewrite these if() blocks to a filter
        $EXCLUDE_LIST = '';
-       if (getConfig('def_refid') > 0) {
-               $EXCLUDE_LIST = ' AND d.`userid` != {?def_refid?}';
-       } // END - if
-
+       if (isValidUserId(getConfig('def_refid'))) $EXCLUDE_LIST .= ' AND d.`userid` != {?def_refid?}';
        // Check for more extensions
        if (isExtensionActive('beg'))     $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
        if (isExtensionActive('bonus'))   $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
        // Check for more extensions
        if (isExtensionActive('beg'))     $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
        if (isExtensionActive('bonus'))   $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
@@ -89,7 +86,7 @@ ORDER BY
                        getApInactiveSince()
                ), __FILE__, __LINE__);
 
                        getApInactiveSince()
                ), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_inactive) > 0) {
+       if (!SQL_HASZERONUMS($result_inactive)) {
                // Prepare variables and constants...
                $useridsContent = '';
                $content['since'] = (getApInactiveSince() / 60 / 60);
                // Prepare variables and constants...
                $useridsContent = '';
                $content['since'] = (getApInactiveSince() / 60 / 60);
@@ -140,7 +137,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_inactive) > 0) {
+       if (!SQL_HASZERONUMS($result_inactive)) {
                // Prepare variable...
                $useridsContent = '';
 
                // Prepare variable...
                $useridsContent = '';
 
index d605fc33a99c83386ff1cb87355d6fc63a952e11..8f9e3308b1329063bf8390b233c79d3b76e2b4c1 100644 (file)
@@ -62,7 +62,7 @@ ORDER BY
 $deletedStats = '0';
 
 // Do we have "purged" mails?
 $deletedStats = '0';
 
 // Do we have "purged" mails?
-if (SQL_NUMROWS($result_mails) > 0) {
+if (!SQL_HASZERONUMS($result_mails)) {
        // Okay, check for their sender's
        while ($content = SQL_FETCHARRAY($result_mails)) {
                // Check now...
        // Okay, check for their sender's
        while ($content = SQL_FETCHARRAY($result_mails)) {
                // Check now...
@@ -101,7 +101,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 // Do we have "purged" mails?
        `userid` ASC", __FILE__, __LINE__);
 
 // Do we have "purged" mails?
-if (SQL_NUMROWS($result_mails) > 0) {
+if (!SQL_HASZERONUMS($result_mails)) {
        // Okay, check for their sender's
        while ($content = SQL_FETCHARRAY($result_mails)) {
                // Check now...
        // Okay, check for their sender's
        while ($content = SQL_FETCHARRAY($result_mails)) {
                // Check now...
index 8b94274b75729e405f02e013272ad48cdb8993e9..162b4f6f48a8b3bbf0a750d72d96fc9fc68cb49f 100644 (file)
@@ -59,7 +59,7 @@ WHERE
        `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?})
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
        `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?})
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_uncon) > 0) {
+       if (!SQL_HASZERONUMS($result_uncon)) {
                // Prepare variable...
                $userids = '';
                $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
                // Prepare variable...
                $userids = '';
                $content['time'] = (getConfig('ap_unconfirmed_time')  / 60 / 60);
index 316bc6c93aa1951efa883d5f26754c25c7e410d8..d0e881ae8cd698d221e5faf3abc38f18174a3996 100644 (file)
@@ -71,7 +71,7 @@ ORDER BY
        `filter_id` ASC", __FUNCTION__, __LINE__);
 
                // Are there entries?
        `filter_id` ASC", __FUNCTION__, __LINE__);
 
                // Are there entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Load all filters
                        while ($filterArray = SQL_FETCHARRAY($result)) {
                                // Get filter name and function
                        // Load all filters
                        while ($filterArray = SQL_FETCHARRAY($result)) {
                                // Get filter name and function
index b2762810fe45cc23589bcf2e72bb8a260d320cc3..f18079a787b0b6d5923b9e21edb8f90f6d7c3d48 100644 (file)
@@ -51,7 +51,7 @@ ORDER BY
        `filter_name` ASC, `filter_function` ASC', __FILE__, __LINE__);
 
 // Do we have entries? (we should have!)
        `filter_name` ASC, `filter_function` ASC', __FILE__, __LINE__);
 
 // Do we have entries? (we should have!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Load row by row
        while ($filter = SQL_FETCHARRAY($result)) {
                // Now search again for this filter and get it's total count
        // Load row by row
        while ($filter = SQL_FETCHARRAY($result)) {
                // Now search again for this filter and get it's total count
index fbfc36201714a216853d3f13295b90e057134500..69d696e544cba7d48983c67135cd89a08c87a952 100644 (file)
@@ -907,7 +907,7 @@ function sendRawRequest ($host, $request) {
        $useProxy = false;
 
        // Are proxy settins set?
        $useProxy = false;
 
        // Are proxy settins set?
-       if ((isConfigEntrySet('proxy_host')) && (getConfig('proxy_host') != '') && (isConfigEntrySet('proxy_port')) && (getConfig('proxy_port') > 0)) {
+       if (isProxyUsed()) {
                // Then use it
                $useProxy = true;
        } // END - if
                // Then use it
                $useProxy = true;
        } // END - if
@@ -1919,13 +1919,13 @@ function determineReferalId () {
        } elseif (isGetRequestParameterSet('ref')) {
                // Set refid=ref (the referal link uses such variable)
                $GLOBALS['refid'] = secureString(getRequestParameter('ref'));
        } elseif (isGetRequestParameterSet('ref')) {
                // Set refid=ref (the referal link uses such variable)
                $GLOBALS['refid'] = secureString(getRequestParameter('ref'));
-       } elseif ((isSessionVariableSet('refid')) && (getSession('refid') > 0)) {
+       } elseif ((isSessionVariableSet('refid')) && (isValidUserId(getSession('refid')))) {
                // Set session refid als global
                $GLOBALS['refid'] = bigintval(getSession('refid'));
        } elseif ((isExtensionInstalledAndNewer('user', '0.3.4')) && (isRandomReferalIdEnabled())) {
                // Select a random user which has confirmed enougth mails
                $GLOBALS['refid'] = determineRandomReferalId();
                // Set session refid als global
                $GLOBALS['refid'] = bigintval(getSession('refid'));
        } elseif ((isExtensionInstalledAndNewer('user', '0.3.4')) && (isRandomReferalIdEnabled())) {
                // Select a random user which has confirmed enougth mails
                $GLOBALS['refid'] = determineRandomReferalId();
-       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (getConfig('def_refid') > 0)) {
+       } elseif ((isExtensionInstalledAndNewer('sql_patches', '0.1.2')) && (isValidUserId(getConfig('def_refid')))) {
                // Set default refid as refid in URL
                $GLOBALS['refid'] = getConfig('def_refid');
        } else {
                // Set default refid as refid in URL
                $GLOBALS['refid'] = getConfig('def_refid');
        } else {
@@ -1934,7 +1934,7 @@ function determineReferalId () {
        }
 
        // Set cookie when default refid > 0
        }
 
        // Set cookie when default refid > 0
-       if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((getSession('refid') == '0') && (isConfigEntrySet('def_refid')) && (getConfig('def_refid') > 0))) {
+       if (!isSessionVariableSet('refid') || (!empty($GLOBALS['refid'])) || ((!isValidUserId(getSession('refid'))) && (isConfigEntrySet('def_refid')) && (isValidUserId(getConfig('def_refid'))))) {
                // Default is not found
                $found = false;
 
                // Default is not found
                $found = false;
 
index 47d20055ba1a7e6f52bce4893b4a00e6a0686501..0ffa66449a0c5dc706b2870e2a129de1ff5bc2cc 100644 (file)
@@ -47,7 +47,7 @@ loadIncludeOnce('inc/libs/refback_functions.php');
 
 // Sanity-check: Do we have ref level 0?
 $result = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0", __FILE__, __LINE__);
 
 // Sanity-check: Do we have ref level 0?
 $result = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_refsystem` WHERE `level`=0", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Remove index temporaly
        SQL_ALTER_TABLE("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
 
        // Remove index temporaly
        SQL_ALTER_TABLE("ALTER TABLE `{?_MYSQL_PREFIX?}_refsystem` DROP INDEX `userid_level`", __FILE__, __LINE__);
 
@@ -78,7 +78,7 @@ ORDER BY
        u.userid ASC', __FILE__, __LINE__);
 
 // Do we have entries?
        u.userid ASC', __FILE__, __LINE__);
 
 // Do we have entries?
-if (SQL_NUMROWS($result_direct) > 0) {
+if (!SQL_HASZERONUMS($result_direct) > 0) {
        // When 'walk' through all users
        while ($content = SQL_FETCHARRAY($result_direct)) {
                // Init level
        // When 'walk' through all users
        while ($content = SQL_FETCHARRAY($result_direct)) {
                // Init level
index 8570debddff4212e612b400c22f323179dddd851..55fb01e9cef71f0766f41a5fcd32eba84d6dd84e 100644 (file)
@@ -151,7 +151,7 @@ function addBonusRanks ($data, $type, $userid) {
        // Load rankings
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
                array($type, $data), __FUNCTION__, __LINE__);
        // Load rankings
        $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `%s`=%s ORDER BY `level` ASC LIMIT {?bonus_lines?}",
                array($type, $data), __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Start generating the ranking list
                $max = SQL_NUMROWS($result);
 
                // Start generating the ranking list
                $max = SQL_NUMROWS($result);
 
@@ -240,7 +240,7 @@ function handleBonusPoints ($mode) {
        // Subtract points from...
        switch (getConfig('bonus_mode')) {
                case 'JACKPOT': // ... jackpot
        // Subtract points from...
        switch (getConfig('bonus_mode')) {
                case 'JACKPOT': // ... jackpot
-                       if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (getConfig('bonus_userid') > 0)) {
+                       if ((isExtensionActive('jackpot')) && (subtractPointsFromJackpot($points) == -1) && (isValidUserId(getConfig('bonus_userid')))) {
                                if ($total >= $points) {
                                        // Subtract points from userid's account
                                        subtractPointsFromJackpot('bonus_payout_jackpot', getConfig('bonus_userid'), $points);
                                if ($total >= $points) {
                                        // Subtract points from userid's account
                                        subtractPointsFromJackpot('bonus_payout_jackpot', getConfig('bonus_userid'), $points);
index ba8b2902d08c525c4ed4d16c25da045b5e5b4f19..5e331bd71e3873c224bf336c71f0eb6a12d973c1 100644 (file)
@@ -86,7 +86,7 @@ LIMIT %s",
                        $limit
                ), __FUNCTION__, __LINE__);
 
                        $limit
                ), __FUNCTION__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List entries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // List entries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
@@ -146,7 +146,7 @@ function getDoublerTotalPointsLeft() {
                if (!empty($jackpot)) $points += $jackpot;
        } // END - if
 
                if (!empty($jackpot)) $points += $jackpot;
        } // END - if
 
-       if (getConfig('doubler_userid') > 0) {
+       if (isValidUserId(getConfig('doubler_userid'))) {
                // Get user's points
                $user = countSumTotalData(getConfig('doubler_userid'), 'user_points', 'points');
                $points += $user;
                // Get user's points
                $user = countSumTotalData(getConfig('doubler_userid'), 'user_points', 'points');
                $points += $user;
index da20b81374de623e09200c14277b09daa030a084..246e054dfc7823cfb59a8702d6445797e58ab5a0 100644 (file)
@@ -366,7 +366,7 @@ ORDER BY
        `network_short_name` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
        `network_short_name` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
@@ -410,7 +410,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Do we have entries?
                ), __FUNCTION__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
@@ -454,7 +454,7 @@ ORDER BY
        t.`network_type_handle` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
        t.`network_type_handle` ASC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
                // List all entries
                $rows = array();
                while ($row = SQL_FETCHARRAY($result)) {
@@ -618,7 +618,7 @@ function doAdminNetworkProcessAddnetworkForm () {
 // Displays selected networks for editing
 function doAdminNetworkProcessHandlenetworkForm () {
        // Do we have selections?
 // Displays selected networks for editing
 function doAdminNetworkProcessHandlenetworkForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Something has been selected, so start displaying one by one
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
                // Something has been selected, so start displaying one by one
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $sel) {
@@ -684,7 +684,7 @@ function doAdminNetworkProcessHandlenetworkForm () {
 // Handle network type form
 function doAdminNetworkProcessHandlenetworktypeForm () {
        // Do we have selections?
 // Handle network type form
 function doAdminNetworkProcessHandlenetworktypeForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Load network data
                $networkData = getNetworkDataById(getRequestParameter('network'));
 
                // Load network data
                $networkData = getNetworkDataById(getRequestParameter('network'));
 
@@ -742,7 +742,7 @@ function doAdminNetworkProcessHandlenetworktypeForm () {
 // Handle network request parameter form
 function doAdminNetworkProcessHandlerequestparamsForm () {
        // Do we have selections?
 // Handle network request parameter form
 function doAdminNetworkProcessHandlerequestparamsForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Init cache array
                $GLOBALS['network_params_disabled'] = array();
 
                // Init cache array
                $GLOBALS['network_params_disabled'] = array();
 
@@ -812,7 +812,7 @@ function doAdminNetworkProcessHandlerequestparamsForm () {
 // Changes given networks
 function doAdminNetworkProcessChangenetworkForm () {
        // Do we have selections?
 // Changes given networks
 function doAdminNetworkProcessChangenetworkForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
 
                // By default nothing is updated
                $updated = 0;
 
@@ -857,7 +857,7 @@ function doAdminNetworkProcessChangenetworkForm () {
 // Removes given networks
 function doAdminNetworkProcessRemovenetworkForm () {
        // Do we have selections?
 // Removes given networks
 function doAdminNetworkProcessRemovenetworkForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
 
                // By default nothing is removed
                $removed = 0;
 
@@ -926,7 +926,7 @@ function doAdminNetworkProcessAddnetworktypeForm () {
 // Changes given network type handlers
 function doAdminNetworkProcessChangenetworktypeForm () {
        // Do we have selections?
 // Changes given network type handlers
 function doAdminNetworkProcessChangenetworktypeForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
 
                // By default nothing is updated
                $updated = 0;
 
@@ -977,7 +977,7 @@ function doAdminNetworkProcessChangenetworktypeForm () {
 // Changes given network request parameters
 function doAdminNetworkProcessChangenetworkparamForm () {
        // Do we have selections?
 // Changes given network request parameters
 function doAdminNetworkProcessChangenetworkparamForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is updated
                $updated = 0;
 
                // By default nothing is updated
                $updated = 0;
 
@@ -1028,7 +1028,7 @@ function doAdminNetworkProcessChangenetworkparamForm () {
 // Removes given network type handlers
 function doAdminNetworkProcessRemovenetworktypeForm () {
        // Do we have selections?
 // Removes given network type handlers
 function doAdminNetworkProcessRemovenetworktypeForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
 
                // By default nothing is removed
                $removed = 0;
 
@@ -1055,7 +1055,7 @@ function doAdminNetworkProcessRemovenetworktypeForm () {
 // Removes given network request parameters
 function doAdminNetworkProcessRemovenetworkparamForm () {
        // Do we have selections?
 // Removes given network request parameters
 function doAdminNetworkProcessRemovenetworkparamForm () {
        // Do we have selections?
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // By default nothing is removed
                $removed = 0;
 
                // By default nothing is removed
                $removed = 0;
 
index 14c8503b624deafad86e08036c9207a9415197c0..73ff9147fb78be9835cf8cc463710a52af4b882e 100644 (file)
@@ -59,7 +59,7 @@ function FILTER_UPDATE_ONLINE_LIST () {
        $isAdmin = 'N';
 
        // Valid userid?
        $isAdmin = 'N';
 
        // Valid userid?
-       if ((isMemberIdSet()) && (getMemberId() > 0) && (isMember())) {
+       if (isMember()) {
                // Is valid user
                $userid = getMemberId();
                $isMember = 'Y';
                // Is valid user
                $userid = getMemberId();
                $isMember = 'Y';
index 8cdac37d2bfad5492290452371209a3943d99795..492eeda10ee4b7d5d98e80d69d606c83e8f27ad4 100644 (file)
@@ -56,7 +56,7 @@ WHERE
 ORDER BY
        `type` ASC",
                        array($points), __FUNCTION__, __LINE__);
 ORDER BY
        `type` ASC",
                        array($points), __FUNCTION__, __LINE__);
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Now let's check
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Are these points enougth?
                        // Now let's check
                        while ($content = SQL_FETCHARRAY($result)) {
                                // Are these points enougth?
index 62bc2a03cb787968e029177e92d21967b2bfb974..a840198c4ae9428c0e0b755f4a919e831f852312 100644 (file)
@@ -193,7 +193,7 @@ ORDER BY
                array($rallye), __FUNCTION__, __LINE__);
 
        // Entries found?
                array($rallye), __FUNCTION__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result_prices) > 0) {
+       if (!SQL_HASZERONUMS($result_prices)) {
                // Load prices
                if ($mode == "\n") $prices = '{--RALLYE_MEMBER_PRICES_ADDED--}:' . $mode . '------------------------------' . $mode;
 
                // Load prices
                if ($mode == "\n") $prices = '{--RALLYE_MEMBER_PRICES_ADDED--}:' . $mode . '------------------------------' . $mode;
 
@@ -775,7 +775,7 @@ WHERE
        `expired`='Y'",
                array($EXPIRE), __FUNCTION__, __LINE__);
 
        `expired`='Y'",
                array($EXPIRE), __FUNCTION__, __LINE__);
 
-       if (SQL_NUMROWS($result_rallye) > 0) {
+       if (!SQL_HASZERONUMS($result_rallye)) {
                // Init SQLs
                initSqls();
 
                // Init SQLs
                initSqls();
 
index bc50b0a209b05e796590afba57f9f880e1625eb4..69f7fe73ca8b7c1f71dee5aca3284d8aa9349969 100644 (file)
@@ -163,7 +163,7 @@ ORDER BY
 
        // Entries found?
        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
 
        // Entries found?
        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Add all
                while ($content = SQL_FETCHARRAY($result)) {
                        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
                // Add all
                while ($content = SQL_FETCHARRAY($result)) {
                        //* DEBUG: */ print(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
@@ -308,7 +308,7 @@ ORDER BY
                array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
 
        // Are there some entries?
                array(bigintval($userid), bigintval($level)), __FUNCTION__, __LINE__);
 
        // Are there some entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Fetch all entries
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add row
                // Fetch all entries
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add row
index e34ccd2b503ccd57c68a7184df3e46d6c15e1021..abe48e3d13b3d0d1591092805936465bcfc5725e 100644 (file)
@@ -87,7 +87,7 @@ function registerGenerateCategoryTable ($mode, $return=false) {
        $result = SQL_QUERY("SELECT `id`, `cat`, `visible` FROM `{?_MYSQL_PREFIX?}_cats` ".$AND." ORDER BY `sort` ASC",
                __FUNCTION__, __LINE__);
 
        $result = SQL_QUERY("SELECT `id`, `cat`, `visible` FROM `{?_MYSQL_PREFIX?}_cats` ".$AND." ORDER BY `sort` ASC",
                __FUNCTION__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List alle visible modules (or all to the admin)
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
                while ($content = SQL_FETCHARRAY($result)) {
                // List alle visible modules (or all to the admin)
                $OUT .= '<table border="0" cellspacing="0" cellpadding="0" width="100%">';
                while ($content = SQL_FETCHARRAY($result)) {
index 76296b04e9743e337a4296953d98e6edf9c277d7..81810de1d1a09172836f1310bc037f2566f85b2d 100644 (file)
@@ -276,18 +276,32 @@ function addSponsorMenu ($current) {
        if (isAdmin()) $WHERE = '';
 
        // Load main menu entries
        if (isAdmin()) $WHERE = '';
 
        // Load main menu entries
-       $result_main = SQL_QUERY("SELECT action AS main_action, title AS main_title FROM `{?_MYSQL_PREFIX?}_sponsor_menu`
-WHERE (`what`='' OR `what` IS NULL) ".$WHERE."
-ORDER BY `sort`", __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result_main) > 0) {
+       $result_main = SQL_QUERY("SELECT
+       `action` AS `main_action`, `title` AS `main_title`
+FROM
+       `{?_MYSQL_PREFIX?}_sponsor_menu`
+WHERE
+       (`what`='' OR `what` IS NULL)
+       ".$WHERE."
+ORDER BY
+       `sort` ASC", __FUNCTION__, __LINE__);
+       if (!SQL_HASZERONUMS($result_main)) {
                // Load every menu and it's sub menus
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Load sub menus
                // Load every menu and it's sub menus
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Load sub menus
-                       $result_sub = SQL_QUERY_ESC("SELECT what AS sub_what, title AS sub_title FROM `{?_MYSQL_PREFIX?}_sponsor_menu`
-WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ".$WHERE."
-ORDER BY `sort`",
+                       $result_sub = SQL_QUERY_ESC("SELECT
+       `what` AS `sub_what`, `title` AS `sub_title`
+FROM
+       `{?_MYSQL_PREFIX?}_sponsor_menu`
+WHERE
+       `action`='%s' AND
+       `what` != '' AND
+       `what` IS NOT NULL
+       ".$WHERE."
+ORDER BY
+       `sort` ASC",
                        array($content['main_action']), __FUNCTION__, __LINE__);
                        array($content['main_action']), __FUNCTION__, __LINE__);
-                       if (SQL_NUMROWS($result_sub) > 0) {
+                       if (!SQL_HASZERONUMS($result_sub)) {
                                // Load sub menus
                                $SUB = '';
                                while ($content2 = SQL_FETCHARRAY($result_sub)) {
                                // Load sub menus
                                $SUB = '';
                                while ($content2 = SQL_FETCHARRAY($result_sub)) {
index fff246464e3198be72592df85b9687939d99d476..9feb142f5a05c29b82cdcc842483ba499175d36a 100644 (file)
@@ -565,7 +565,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one record?
                ), __FUNCTION__, __LINE__);
 
        // Is there at least one record?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Then load all!
                while ($dataRow = SQL_FETCHARRAY($result)) {
                        // Shall we group these results?
                // Then load all!
                while ($dataRow = SQL_FETCHARRAY($result)) {
                        // Shall we group these results?
@@ -1020,7 +1020,7 @@ function SURFBAR_LOCKDOWN_ID ($urlId) {
 function SURFBAR_PAY_POINTS () {
        // Remove it from the URL owner
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS().'', false);
 function SURFBAR_PAY_POINTS () {
        // Remove it from the URL owner
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid='.SURFBAR_GET_USERID().',costs='.SURFBAR_GET_COSTS().'', false);
-       if (SURFBAR_GET_USERID() > 0) {
+       if (isValidUserId(SURFBAR_GET_USERID())) {
                subtractPoints(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
        } // END - if
 
                subtractPoints(sprintf("surfbar_%s", getConfig('surfbar_pay_model')), SURFBAR_GET_USERID(), SURFBAR_GET_COSTS());
        } // END - if
 
@@ -1510,7 +1510,7 @@ ORDER BY
        array(getMemberId()), __FUNCTION__, __LINE__);
 
        // Are there entries?
        array(getMemberId()), __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load all rows
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add the row
                // Load all rows
                while ($row = SQL_FETCHARRAY($result)) {
                        // Add the row
@@ -1535,7 +1535,7 @@ function SURFBAR_GET_ARRAY_FROM_STATUS ($status) {
                array($status), __FUNCTION__, __LINE__);
 
        // Some entries there?
                array($status), __FUNCTION__, __LINE__);
 
        // Some entries there?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load all actions
                // @TODO This can be somehow rewritten
                while ($content = SQL_FETCHARRAY($result)) {
                // Load all actions
                // @TODO This can be somehow rewritten
                while ($content = SQL_FETCHARRAY($result)) {
index cb5fc1c2835551a66e1c11a44f47bbfb7ae89103..b4ea70bfd0f9c64b93bfdf831fad204ad7d91ea0 100644 (file)
@@ -91,7 +91,7 @@ if (!empty($sql)) {
 
        // Check for accounts to be notified
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
 
        // Check for accounts to be notified
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // Normal notification mails or bonus mails?
                $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
 
                // Normal notification mails or bonus mails?
                $sentBonusMails = ((getConfig('beg_notify_bonus') > 0) && ($mode == 'enable') && (isExtensionActive('bonus')));
 
index 7696dbf933b9c909efeab36a48d417dcceb0ad9a..c236c76b44acf66ef528890cfc8d9e17bb71ea80 100644 (file)
@@ -93,7 +93,7 @@ if (!empty($sql)) {
 
        // Check for accounts to be notified
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
 
        // Check for accounts to be notified
        $result_main = SQL_QUERY($sql, __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // Okay lets notify all users!
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Update account
                // Okay lets notify all users!
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Update account
index e4296a066b3522250b43eb46cf349e93f34a7e5f..12d20dcf4abdd854c4a16fe3898d5bc0daa4da70 100644 (file)
@@ -256,7 +256,7 @@ ORDER BY
        `id` DESC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
        `id` DESC", __FUNCTION__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                $OUT .= '<ul class="admin_menu_main">';
                // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
                $OUT .= '<ul class="admin_menu_main">';
                // @TODO Rewrite this to $content = SQL_FETCHARRAY()
                while (list($menu, $title, $descr) = SQL_FETCHROW($result_main)) {
@@ -322,10 +322,10 @@ ORDER BY
                                        array($menu), __FUNCTION__, __LINE__);
 
                                // Remember the count for later checks
                                        array($menu), __FUNCTION__, __LINE__);
 
                                // Remember the count for later checks
-                               setAdminMenuHasEntries($menu, ((SQL_NUMROWS($result_what) > 0) && ($action == $menu)));
+                               setAdminMenuHasEntries($menu, ((!SQL_HASZERONUMS($result_what)) && ($action == $menu)));
 
                                // Do we have entries?
 
                                // Do we have entries?
-                               if ((ifAdminMenuHasEntries($menu)) && (SQL_NUMROWS($result_what) > 0)) {
+                               if ((ifAdminMenuHasEntries($menu)) && (!SQL_HASZERONUMS($result_what))) {
                                        $GLOBALS['menu']['description'] = array();
                                        $GLOBALS['menu']['title'] = array(); $SUB = true;
                                        $OUT .= '<li class="admin_menu_sub"><ul class="admin_menu_sub">';
                                        $GLOBALS['menu']['description'] = array();
                                        $GLOBALS['menu']['title'] = array(); $SUB = true;
                                        $OUT .= '<li class="admin_menu_sub"><ul class="admin_menu_sub">';
@@ -443,7 +443,7 @@ function adminMenuSelectionBox_DEPRECATED ($mode, $default = '', $defid = '') {
 
        $result = SQL_QUERY_ESC("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
 
        $result = SQL_QUERY_ESC("SELECT `%s` AS `menu`, `title` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE ".$what." ORDER BY `sort` ASC",
                array($mode), __FUNCTION__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load menu as selection
                $OUT = '<select name="' . $mode . '_menu';
                if ((!empty($defid)) || ($defid == '0')) $OUT .= '[' . $defid . ']';
                // Load menu as selection
                $OUT = '<select name="' . $mode . '_menu';
                if ((!empty($defid)) || ($defid == '0')) $OUT .= '[' . $defid . ']';
@@ -1393,7 +1393,7 @@ function addEmailNavigation ($numPages, $offset, $show_form, $colspan, $return=f
                        $NAV .= '<a href="{%url=modules.php?module=admin&amp;what=' . getWhat() . '&amp;page=' . $page . '&amp;offset=' . $offset;
 
                        // Add userid when we shall show all mails from a single member
                        $NAV .= '<a href="{%url=modules.php?module=admin&amp;what=' . getWhat() . '&amp;page=' . $page . '&amp;offset=' . $offset;
 
                        // Add userid when we shall show all mails from a single member
-                       if ((isGetRequestParameterSet('userid')) && (bigintval(getRequestParameter('userid')) > 0)) $NAV .= '&amp;userid=' . bigintval(getRequestParameter('userid'));
+                       if ((isGetRequestParameterSet('userid')) && (isValidUserId(getRequestParameter('userid')))) $NAV .= '&amp;userid=' . bigintval(getRequestParameter('userid'));
 
                        // Close open anchor tag
                        $NAV .= '%}">';
 
                        // Close open anchor tag
                        $NAV .= '%}">';
index ecd876f699d3f4ea85a1714e916b560e2f291327..abeab6b2fefc66983718a5fde4e7c69f8cfc27ff 100644 (file)
@@ -116,7 +116,7 @@ ORDER BY
        `task_created` DESC",
                array(getCurrentAdminId()), __FILE__, __LINE__);
 
        `task_created` DESC",
                array(getCurrentAdminId()), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_tasks) > 0) {
+       if (!SQL_HASZERONUMS($result_tasks)) {
                // New jobs found!
                $jobsDone = false;
        } // END - if
                // New jobs found!
                $jobsDone = false;
        } // END - if
index ae6c292bd2a95c6150f6f0aa158d796b83a0b67f..f205f3c17b4adcc904a9cdf1020600b8f9951305 100644 (file)
@@ -56,7 +56,7 @@ if (!isFormSent()) {
 
        // Get all available main menus
        $result = SQL_QUERY("SELECT action, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__);
 
        // Get all available main menus
        $result = SQL_QUERY("SELECT action, title, sort FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort`", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
@@ -95,7 +95,7 @@ if (!isFormSent()) {
                foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                        array($value_main), __FILE__, __LINE__);
                foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT `what`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='%s' AND `what` != '' AND `what` IS NOT NULL ORDER BY `sort`",
                        array($value_main), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) > 0) {
+                       if (!SQL_HASZERONUMS($result)) {
                                // Init arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
                                // Init arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index 8e6b10bc6e62010fc5f06b9a34b0a81e11dadbef..d6d95ec5a3d29d0a25bfed0500564dd9f5a79ac8 100644 (file)
@@ -53,7 +53,7 @@ if (isGetRequestParameterSet('sub')) {
 } // END - if
 
 // List all menu points and make them editable
 } // END - if
 
 // List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Edit menu entries
        // @TODO Kill all constants in this file
        $content['sub'] = $SUB;
        // Edit menu entries
        // @TODO Kill all constants in this file
        $content['sub'] = $SUB;
@@ -100,7 +100,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_amenu_edit_form', false, $content);
 
        // Load template
        loadTemplate('admin_amenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Prepare misc content
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Prepare misc content
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
index 05747bc21edfd18a0604869df6bc6b6525897c2a..3826085fc4c8792c728c1d92337344b272dc8f31 100644 (file)
@@ -58,17 +58,17 @@ if (isGetRequestParameterSet('admin')) {
        setPostRequestParameter('sel', array($adminId => 1));
 } // END - if
 
        setPostRequestParameter('sel', array($adminId => 1));
 } // END - if
 
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit account(s)
        adminsEditAdminAccount(postRequestArray());
 } elseif ((isFormSent('change')) && (count(postRequestParameter('login')) > 0)) {
        // Change admin accounts
        adminsChangeAdminAccount(postRequestArray());
        // Edit account(s)
        adminsEditAdminAccount(postRequestArray());
 } elseif ((isFormSent('change')) && (count(postRequestParameter('login')) > 0)) {
        // Change admin accounts
        adminsChangeAdminAccount(postRequestArray());
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Show admin accounts for deletetion
        adminsDeleteAdminAccount(postRequestArray());
 } else {
        // Show admin accounts for deletetion
        adminsDeleteAdminAccount(postRequestArray());
 } else {
-       if ((isFormSent('remove')) && (countPostSelection() > 0)) {
+       if ((isFormSent('remove')) && (ifPostContainsSelections())) {
                // Remove accounts now
                adminsRemoveAdminAccount(postRequestArray());
        } // END - if
                // Remove accounts now
                adminsRemoveAdminAccount(postRequestArray());
        } // END - if
index 6873a5889edd11ad95947e928be4676aa90e3fd7..bc6ff230aac9e850ffc669985e5a52a78f1d999c 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent('edit')) {
        // Check if entires are checked
 
 if (isFormSent('edit')) {
        // Check if entires are checked
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
                $rows = '';
                // Add option for events
                $adminsList = generateOptionList('admins', 'id', 'login', '', 'email');
                $rows = '';
@@ -118,7 +118,7 @@ ORDER BY
        m.admin_id ASC,
        m.mail_template ASC", __FILE__, __LINE__);
 
        m.admin_id ASC,
        m.mail_template ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Shall I change entries?
                if (isFormSent('change')) {
                        // Init SQLs
                // Shall I change entries?
                if (isFormSent('change')) {
                        // Init SQLs
index 4760a601053b0ea48bfbe2ffdf2822764f2dc70b..55fa4aa54b81f0d0f286c18e5236c5171be8b123 100644 (file)
@@ -55,7 +55,7 @@ WHERE
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // We have some (new?) registrations!
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // We have some (new?) registrations!
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index f53b8c206a06a4eb96d9b5808112b0a4358a0eab..25b0fb39801dc74137698902a1698d3bd37c89ba 100644 (file)
@@ -45,7 +45,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
 // Add description as navigation point
 addMenuDescription('admin', __FILE__);
 
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit ACLs
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
        // Edit ACLs
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -78,7 +78,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
 
        // Load main template
        loadTemplate('admin_config_admins_edit', false, $OUT);
 
        // Load main template
        loadTemplate('admin_config_admins_edit', false, $OUT);
-} elseif ((isFormSent('change')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('change')) && (ifPostContainsSelections())) {
        // Change entries
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Secure id
        // Change entries
        foreach (postRequestParameter('sel') as $id => $selected) {
                // Secure id
@@ -102,7 +102,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
 
        // Entries changed
        loadTemplate('admin_settings_saved', false, '{--ADMIN_ADMINS_ENTRIES_CHANGED--}');
 
        // Entries changed
        loadTemplate('admin_settings_saved', false, '{--ADMIN_ADMINS_ENTRIES_CHANGED--}');
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Delete ACLs
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
        // Delete ACLs
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -121,7 +121,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0)) {
 
        // Load main template
        loadTemplate('admin_config_admins_del', false, $OUT);
 
        // Load main template
        loadTemplate('admin_config_admins_del', false, $OUT);
-} elseif ((isFormSent('remove')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('remove')) && (ifPostContainsSelections())) {
        // Remove entries
        // @TODO Rewrite this to filter 'run_sqls'
        foreach (postRequestParameter('sel') as $id => $selected) {
        // Remove entries
        // @TODO Rewrite this to filter 'run_sqls'
        foreach (postRequestParameter('sel') as $id => $selected) {
@@ -193,7 +193,7 @@ VALUES ('%s','%s','%s','%s')",
        $result_acls = SQL_QUERY('SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC, `id` ASC', __FILE__, __LINE__);
 
        // Entries found?
        $result_acls = SQL_QUERY('SELECT `id`, `admin_id`, `action_menu`, `what_menu`, `access_mode` FROM `{?_MYSQL_PREFIX?}_admins_acls` ORDER BY `admin_id` ASC, `id` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result_acls) > 0) {
+       if (!SQL_HASZERONUMS($result_acls)) {
                // List ACLs
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result_acls)) {
                // List ACLs
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result_acls)) {
index 393d94333eb41899873fbf8aec64494cf27abd2d..59fadde8d521b4348282e05cc1989696a44ee877 100644 (file)
@@ -111,7 +111,7 @@ if (isFormSent('add')) {
                // Display message
                loadTemplate('admin_settings_saved', false, $TEXT);
        } // END - if
                // Display message
                loadTemplate('admin_settings_saved', false, $TEXT);
        } // END - if
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Delete categories
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Delete categories
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -135,7 +135,7 @@ if (isFormSent('add')) {
 
        // Load main template
        loadTemplate('admin_del_cats', false, $OUT);
 
        // Load main template
        loadTemplate('admin_del_cats', false, $OUT);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit categories
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Edit categories
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -165,7 +165,7 @@ if (isFormSent('add')) {
 
        // Load all categories
        $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
 
        // Load all categories
        $result = SQL_QUERY("SELECT `id`, `cat`, `visible`, `sort` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Init variables
                $OUT = '';
 
                // Init variables
                $OUT = '';
 
index 8af929b1113dffb1b92686ecdf4023f10aa36868..88c10a2e395376bc1a0e8305130f96e500ae66e5 100644 (file)
@@ -98,7 +98,7 @@ if (isPostRequestParameterSet(('add_max'))) {
                // Display message
                loadTemplate('admin_settings_saved', false, $TEXT);
        } // END - if
                // Display message
                loadTemplate('admin_settings_saved', false, $TEXT);
        } // END - if
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Delete entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Delete entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -115,7 +115,7 @@ if (isPostRequestParameterSet(('add_max'))) {
 
        // Load main template
        loadTemplate('admin_config_email_del', false, $content);
 
        // Load main template
        loadTemplate('admin_config_email_del', false, $content);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Edit entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -135,7 +135,7 @@ if (isPostRequestParameterSet(('add_max'))) {
 } else {
        $result = SQL_QUERY("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
        __FILE__, __LINE__);
 } else {
        $result = SQL_QUERY("SELECT `id`, `value`, `comment` FROM `{?_MYSQL_PREFIX?}_max_receive` ORDER BY `value` ASC",
        __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List already existing entries for editing
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // List already existing entries for editing
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index 47ea2b39ebef4523b7d6ed32a1558f4b33388038..95e5eaed593464fb322a8e00dbc71f5ce7265573 100644 (file)
@@ -53,7 +53,7 @@ if (isFormSent()) {
        $result = SQL_QUERY('SELECT `imprint_key`,`imprint_value` FROM `{?_MYSQL_PREFIX?}_imprint_data` ORDER BY `imprint_id` ASC', __FILE__, __LINE__);
 
        // Do we have entries?
        $result = SQL_QUERY('SELECT `imprint_key`,`imprint_value` FROM `{?_MYSQL_PREFIX?}_imprint_data` ORDER BY `imprint_id` ASC', __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load all entries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // Load all entries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index 7b87200ab3ff10f6865a60958167f13715bc68e3..7a5b8f423a6fb5d0a1b046e5e09fd857ffdc8433 100644 (file)
@@ -66,8 +66,8 @@ if (isFormSent()) {
        if (postRequestParameter('mt_stage') <= getTotalConfirmedUser()) {
                // Not enougth!
                unsetPostRequestParameter('ok');
        if (postRequestParameter('mt_stage') <= getTotalConfirmedUser()) {
                // Not enougth!
                unsetPostRequestParameter('ok');
-       }
-}
+       } // END - if
+} // END - if
 
 if (isFormSent()) {
        // Save data
 
 if (isFormSent()) {
        // Save data
index aad70b3f7489f8660b5df4cc05e05bb590013041..809f4be165eadc650ede036fbc2f8d5dac3c1cec 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent('edit')) {
        // Check if at least one module is selected
 
 if (isFormSent('edit')) {
        // Check if at least one module is selected
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Output header
                $OUT = '';
 
                // Output header
                $OUT = '';
 
@@ -122,7 +122,7 @@ if (isFormSent('edit')) {
        loadTemplate('admin_settings_saved', false, '{--ADMIN_MODS_CHANGED--}');
 }
 
        loadTemplate('admin_settings_saved', false, '{--ADMIN_MODS_CHANGED--}');
 }
 
-if (countPostSelection() == 0) {
+if (!ifPostContainsSelections()) {
        // Load module data (We do not need to check if there's at least one...)
        $result = SQL_QUERY('SELECT
        `id`, `module`, `locked`, `hidden`, `admin_only`, `title`, `mem_only`
        // Load module data (We do not need to check if there's at least one...)
        $result = SQL_QUERY('SELECT
        `id`, `module`, `locked`, `hidden`, `admin_only`, `title`, `mem_only`
index de84bf55b075d2a925531d85d0bc6628849ced2c..46e22c3d306906a161ce832fe62c1bd3de576185 100644 (file)
@@ -84,7 +84,7 @@ VALUES ('%s', %s, %s,'%s','%s','%s','%s','%s','%s','%s')",
 $result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
 
 $display = true;
 $result_mem = SQL_QUERY("SELECT `id` FROM `{?_MYSQL_PREFIX?}_user_payouts` WHERE `status`='NEW' ORDER BY payout_timestamp DESC", __FILE__, __LINE__);
 
 $display = true;
-if ((isFormSent('edit')) && (countPostSelection() > 0)) {
+if ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs
        // Edit payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs
@@ -141,7 +141,7 @@ LIMIT 1",
                // Load main template
                loadTemplate('admin_config_payouts_edit', false, $OUT);
        }
                // Load main template
                loadTemplate('admin_config_payouts_edit', false, $OUT);
        }
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Delete payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs
        // Delete payout types
        if ((isGetRequestParameterSet('ok')) && (getRequestParameter('ok') == 'ok')) {
                // Init SQLs
@@ -193,7 +193,7 @@ FROM
 ORDER BY
        `type` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `type` ASC", __FILE__, __LINE__);
 
-if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
+if ((!SQL_HASZERONUMS($result_type)) && ($display)) {
        // List all payout types
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result_type)) {
        // List all payout types
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result_type)) {
@@ -209,7 +209,7 @@ if ((SQL_NUMROWS($result_type) > 0) && ($display)) {
 } // END - if
 
 // Does your members request payouts?
 } // END - if
 
 // Does your members request payouts?
-if ((SQL_NUMROWS($result_mem) > 0) && ($display)) {
+if ((!SQL_HASZERONUMS($result_mem)) && ($display)) {
        // Members has requested payouts
        loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&amp;what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
 } elseif ($display) {
        // Members has requested payouts
        loadTemplate('admin_settings_saved', false, '<a href="{%url=modules.php?module=admin&amp;what=list_payouts%}">{--ADMIN_PAYOUT_LIST_REQUESTS--}</a>');
 } elseif ($display) {
index 20f6d0f0ee9d46be762209c0fd69d50afca18118..beff7d490e4e2f3bbebe991a5451ebb1d878202c 100644 (file)
@@ -184,7 +184,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
        loadTemplate('admin_config_point_settings', false, $content);
 } elseif (getRequestParameter('sub') == 'ref') {
        // 12                  3     32    2                  3     32    2               3            4     43    21
        loadTemplate('admin_config_point_settings', false, $content);
 } elseif (getRequestParameter('sub') == 'ref') {
        // 12                  3     32    2                  3     32    2               3            4     43    21
-       if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+       if ((isFormSent('del')) && (isPostRequestParameterSet('sel')) && (ifPostContainsSelections())) {
                // Delete entries
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
                // Delete entries
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
@@ -199,7 +199,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
 
                // Load main template
                loadTemplate('admin_points_del', false, $OUT);
 
                // Load main template
                loadTemplate('admin_points_del', false, $OUT);
-       } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (countPostSelection() > 0)) {
+       } elseif ((isFormSent('edit')) && (isPostRequestParameterSet('sel')) && (ifPostContainsSelections())) {
                // Edit entries
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
                // Edit entries
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $value) {
@@ -217,7 +217,7 @@ WHERE `mails_confirmed` < %s", $REF, $REF));
        } else {
                // Referal levels
                $result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
        } else {
                // Referal levels
                $result = SQL_QUERY("SELECT `id`, `level`, `percents` FROM `{?_MYSQL_PREFIX?}_refdepths` ORDER BY `level` ASC", __FILE__, __LINE__);
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Make referal levels editable and deletable
                        $OUT = '';
 
                        // Make referal levels editable and deletable
                        $OUT = '';
 
index 693e7f057c0254ed3dfac9e3cbbac11ebd73b6c2..1d211e3d1081d2da97e24d9b0b46b1e748125069 100644 (file)
@@ -77,7 +77,7 @@ if (isGetRequestParameterSet('rallye')) {
                }
        } elseif (isFormSent('remove')) {
                // Check if at last one line is selected
                }
        } elseif (isFormSent('remove')) {
                // Check if at last one line is selected
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // Delete selected entries
                        foreach (postRequestParameter('sel') as $id => $sel) {
                                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
                        // Delete selected entries
                        foreach (postRequestParameter('sel') as $id => $sel) {
                                SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `id`=%s LIMIT 1",
@@ -121,7 +121,7 @@ LIMIT 1",
 
        if (isFormSent('edit')) {
                // Check if at last one line is selected
 
        if (isFormSent('edit')) {
                // Check if at last one line is selected
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // Make selected editable
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
                        // Make selected editable
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
@@ -153,7 +153,7 @@ LIMIT 1",
                }
        } elseif (isFormSent('del')) {
                // Check if at last one line is selected
                }
        } elseif (isFormSent('del')) {
                // Check if at last one line is selected
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // List all prices
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
                        // List all prices
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $sel) {
@@ -183,7 +183,7 @@ LIMIT 1",
                $result = SQL_QUERY_ESC("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
                        array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
 
                $result = SQL_QUERY_ESC("SELECT `id`, `price_level`, `points`, `info` FROM `{?_MYSQL_PREFIX?}_rallye_prices` WHERE `rallye_id`=%s ORDER BY `price_level` ASC",
                        array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
 
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Load all prices for the selected rallye
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
                        // Load all prices for the selected rallye
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
@@ -221,7 +221,7 @@ ON
        d.admin_id=a.id
 ORDER BY
        d.start_time DESC", __FILE__, __LINE__);
        d.admin_id=a.id
 ORDER BY
        d.start_time DESC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List found rallyes
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // List found rallyes
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index 66004b2f8e9f8bd4b123fefb4b74ff15ebee0955..55b4d6159e3644b69de2a0735e1db9badf3c2112 100644 (file)
@@ -46,7 +46,7 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
 addMenuDescription('admin', __FILE__);
 
 // Shall I delete selected holidays???
 addMenuDescription('admin', __FILE__);
 
 // Shall I delete selected holidays???
-if (countPostSelection() > 0) {
+if (ifPostContainsSelections()) {
        // Delete multiple holiday requests (for list_holiday)
        $cnt = '0';
        foreach (postRequestParameter('sel') as $id => $sel) {
        // Delete multiple holiday requests (for list_holiday)
        $cnt = '0';
        foreach (postRequestParameter('sel') as $id => $sel) {
index 0681df69ac15efbda2f6902a9ba601f456d9ec56..3b578c409cbc7446a8d2548c34a47cbbcf37060e 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 if (isFormSent('del')) {
        // Delete entries from tables
 
 if (isFormSent('del')) {
        // Delete entries from tables
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Init SQLs
                initSqls();
 
                // Init SQLs
                initSqls();
 
@@ -73,7 +73,7 @@ ORDER BY
        `trans_id` ASC', __FILE__, __LINE__);
 
 $total = '0';
        `trans_id` ASC', __FILE__, __LINE__);
 
 $total = '0';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Output rows
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Output rows
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 6cc821b374689f48dab4cbb83fa58c4e984b5ea3..0ecb55d49f33e57da838fea16c15ea682e461899 100644 (file)
@@ -58,7 +58,7 @@ ORDER BY
        `timestamp` ASC", __FILE__, __LINE__);
 
 // Entries found?
        `timestamp` ASC", __FILE__, __LINE__);
 
 // Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        if (isFormSent()) {
                // Make mail editable...
                $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `text`, `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
        if (isFormSent()) {
                // Make mail editable...
                $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `text`, `url` FROM `{?_MYSQL_PREFIX?}_pool` WHERE `id`=%s LIMIT 1",
index d08304294ec56b80d9107e6d12a3ba0270130866..e5f66afc1197cd734ce1e08ef2dce39521eef342 100644 (file)
@@ -77,7 +77,7 @@ $numPages = round(SQL_NUMROWS($result_maximum) / getConfig('mails_page') + 0.5);
 // Free the result which we don't need
 SQL_FREERESULT($result_maximum);
 
 // Free the result which we don't need
 SQL_FREERESULT($result_maximum);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
        // Mail orders are in pool so we can display them
 
        // Add navigation table rows
index 60f0462e39ddc7027bbe307abd62de6c5ddb2d73..0e5023dc8e9e9924183d318278ae0ba2efec060b 100644 (file)
@@ -153,7 +153,7 @@ if (isConfigEntrySet('mails_page')) {
 SQL_FREERESULT($result_normal);
 
 $MAIL = false;
 SQL_FREERESULT($result_normal);
 
 $MAIL = false;
-if (SQL_NUMROWS($result_list) > 0) {
+if (!SQL_HASZERONUMS($result_list)) {
        // Init rows
        $OUT = '';
 
        // Init rows
        $OUT = '';
 
@@ -195,13 +195,13 @@ if (SQL_NUMROWS($result_list) > 0) {
        $MAIL = true;
        if ((isExtensionActive('bonus')) && (empty($WHO))) {
                // Only check if bonus extension is active
        $MAIL = true;
        if ((isExtensionActive('bonus')) && (empty($WHO))) {
                // Only check if bonus extension is active
-               if (SQL_NUMROWS($result_bonus) > 0) outputHtml('<br /><br />');
+               if (!SQL_HASZERONUMS($result_bonus)) outputHtml('<br /><br />');
        } // END - if
 }
 
 if ((isExtensionActive('bonus')) && (empty($WHO))) {
        // Load bonus mails only when extension is active
        } // END - if
 }
 
 if ((isExtensionActive('bonus')) && (empty($WHO))) {
        // Load bonus mails only when extension is active
-       if (SQL_NUMROWS($result_bonus) > 0) {
+       if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
                $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
 
                // Calculate pages
                $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
 
index aad057e0f9e8776e69fa1f703092b0f14d9795e1..1da8cee39865a8a836cca9ead91a0c6e0037ca9f 100644 (file)
@@ -52,7 +52,7 @@ if (isGetRequestParameterSet('reg_ext')) {
        // We are about to register a new extension
        $do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
        // The id comes from task management and it is - of course - *not* the extension's name!
        // We are about to register a new extension
        $do = 'register'; $taskId = bigintval(getRequestParameter('reg_ext'));
        // The id comes from task management and it is - of course - *not* the extension's name!
-} elseif ((isFormSent('change')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('change')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // De-/activate extensions
        foreach (postRequestParameter('sel') as $taskId => $active) {
                // Shall we keep the extension always active?
        // De-/activate extensions
        foreach (postRequestParameter('sel') as $taskId => $active) {
                // Shall we keep the extension always active?
@@ -73,7 +73,7 @@ if (isGetRequestParameterSet('reg_ext')) {
 
        // Redirect to prevent missing cache in js.php
        redirectToUrl('modules.php?module=admin&amp;what=extensions&amp;changed=' . countPostSelection());
 
        // Redirect to prevent missing cache in js.php
        redirectToUrl('modules.php?module=admin&amp;what=extensions&amp;changed=' . countPostSelection());
-} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif (((isFormSent('edit')) || (isPostRequestParameterSet('modify'))) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Change settings like CSS file load
        if (isPostRequestParameterSet('modify')) {
                // Change entries
        // Change settings like CSS file load
        if (isPostRequestParameterSet('modify')) {
                // Change entries
@@ -160,7 +160,7 @@ if (isGetRequestParameterSet('reg_ext')) {
                loadTemplate('admin_extensions_edit', false, $OUT);
                $do = 'edit';
        }
                loadTemplate('admin_extensions_edit', false, $OUT);
                $do = 'edit';
        }
-} elseif ((isPostRequestParameterSet('delete')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('delete')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // List extensions and when verbose is enabled SQL statements which will be executed
        $OUT = '';
        foreach (postRequestParameter('sel') as $taskId => $sel) {
        // List extensions and when verbose is enabled SQL statements which will be executed
        $OUT = '';
        foreach (postRequestParameter('sel') as $taskId => $sel) {
@@ -208,7 +208,7 @@ if (isGetRequestParameterSet('reg_ext')) {
        // Load template
        loadTemplate('admin_extensions_delete', false, $OUT);
        $do = 'delete';
        // Load template
        loadTemplate('admin_extensions_delete', false, $OUT);
        $do = 'delete';
-} elseif ((isFormSent('remove')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('remove')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Remove extensions from DB (you have to delete all files manually!)
        $cache_update = '0';
        foreach (postRequestParameter('sel') as $taskId => $active) {
        // Remove extensions from DB (you have to delete all files manually!)
        $cache_update = '0';
        foreach (postRequestParameter('sel') as $taskId => $active) {
@@ -287,7 +287,7 @@ ORDER BY
                }
 
                // Are there some entries?
                }
 
                // Are there some entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Extensions are registered
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
                        // Extensions are registered
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result)) {
index 423415b7bb8d1d9cb3c3756527066c5bdca5980a..d86210f5319ef5c7f1b4e9442c7f5405f596f993 100644 (file)
@@ -64,7 +64,7 @@ WHERE
        (`what`='' OR `what` IS NULL)
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
        (`what`='' OR `what` IS NULL)
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
@@ -112,7 +112,7 @@ WHERE
        `what` IS NOT NULL
 ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
        `what` IS NOT NULL
 ORDER BY `sort` ASC",
                                array($value_main), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) > 0) {
+                       if (!SQL_HASZERONUMS($result)) {
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index eb779a1f35ef80e60289bd3f1cc4dd6dad98b186..78a6d96ffd696807592c44a765ab706c5ca541bb 100644 (file)
@@ -54,7 +54,7 @@ if (isGetRequestParameterSet('sub')) {
 } // END - if
 
 // List all menu points and make them editable
 } // END - if
 
 // List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -98,7 +98,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_gmenu_edit_form', false, $content);
 
        // Load template
        loadTemplate('admin_gmenu_edit_form', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -176,7 +176,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
                        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
                        break;
        } // END - switch
                        loadTemplate('admin_settings_saved', false, getMaskedMessage('ADMIN_UNKNOWN_OKAY', postRequestParameter('ok')));
                        break;
        } // END - switch
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Change status (visible / locked)
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Change status (visible / locked)
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
index aa8f843ec6751adab0d864bfcd830b6a6bd8f0f8..1d2cd22b690e3be7708ade1ab7d061062e89af8d 100644 (file)
@@ -48,11 +48,7 @@ addMenuDescription('admin', __FILE__);
 // Exclude default referal id if set
 // @TODO Rewrite those lines to filter
 $EXCLUDE_LIST = '';
 // Exclude default referal id if set
 // @TODO Rewrite those lines to filter
 $EXCLUDE_LIST = '';
-if (getConfig('def_refid') > 0) {
-       $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}';
-} // END - if
-
-// Check for more extensions
+if (getConfig('def_refid') > 0)                $EXCLUDE_LIST .= ' AND d.userid != {?def_refid?}';
 if (isExtensionActive('beg'))                  $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
 if (isExtensionActive('bonus'))                $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
 if (isExtensionActive('doubler'))              $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
 if (isExtensionActive('beg'))                  $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
 if (isExtensionActive('bonus'))                $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
 if (isExtensionActive('doubler'))              $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
@@ -72,7 +68,7 @@ WHERE
 ORDER BY
        d.userid ASC", __FILE__, __LINE__);
 
 ORDER BY
        d.userid ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Ok, we have found some inactive accounts
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Ok, we have found some inactive accounts
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index fb6f1e8321dd575ffeda6f1b4b2497a6e4e4c2bf..e388fc0ccc2dd01c594005194b5d3e7d3953984c 100644 (file)
@@ -87,7 +87,7 @@ ORDER BY
        `id` ASC", __FILE__, __LINE__);
 
 // Is there at lease one package?
        `id` ASC", __FILE__, __LINE__);
 
 // Is there at lease one package?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all packages
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all packages
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 954a70a92f87f36a06e2e72aa65499212c9066fa..51281d1a6f9c9244d1939482c81ce24f6b6e7596 100644 (file)
@@ -73,7 +73,7 @@ ORDER BY
        `last_online` DESC,
        `userid` ASC", __FILE__, __LINE__);
 
        `last_online` DESC,
        `userid` ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List users
                $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                // List users
                $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
index 2cf00c09d67cb2b18043382bd49490bcc9aaf433..d3b45396ac5fc56d4a4d1a718c48a1f9e7f685e5 100644 (file)
@@ -91,7 +91,7 @@ ORDER BY
        `userid` ASC",
                array($ONLINE), __FILE__, __LINE__);
 
        `userid` ASC",
                array($ONLINE), __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List users
                $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                // List users
                $OUT = ''; $cnt = 1; $total = '0';
                while ($content = SQL_FETCHARRAY($result)) {
index 9659b0bde857366690c6c72b48b666a91d99d460..74ae670e96de0cbc64baf4ff9cbc01fa06166c6a 100644 (file)
@@ -60,7 +60,7 @@ if (isGetRequestParameterSet('userid')) {
                // Ok, list categories of this user
                $result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
 
                // Ok, list categories of this user
                $result_cats = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` ORDER BY `sort` ASC", __FILE__, __LINE__);
 
-               if (SQL_NUMROWS($result_cats) > 0) {
+               if (!SQL_HASZERONUMS($result_cats)) {
                        // List categories
                        $cnt = 1; $OUT = '';
                        while ($row = SQL_FETCHARRAY($result_cats)) {
                        // List categories
                        $cnt = 1; $OUT = '';
                        while ($row = SQL_FETCHARRAY($result_cats)) {
index fe0e6b9ee7d0e9265389e724ce57c4499c2a144c..a419063cf565151840ed95cae7bac53adc81e3e1 100644 (file)
@@ -170,12 +170,12 @@ if ((isFormSent('add')) && (isPostRequestParameterSet('code')) && (isPostRequest
 
                // Display message
                loadTemplate('admin_settings_saved', false, $message);
 
                // Display message
                loadTemplate('admin_settings_saved', false, $message);
-       }
+       } // END - if
 
        // Load currenty setup country codes to list
        $result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY code',
        __FILE__, __LINE__);
 
        // Load currenty setup country codes to list
        $result = SQL_QUERY('SELECT id, code, descr, is_active FROM `{?_MYSQL_PREFIX?}_countries` ORDER BY code',
        __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all countries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // List all countries
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index b6573bb1dd6872fa60dc75dda0497d6ecb899580..f2d29b272385a065fa3c245374427a6bb7e8b65d 100644 (file)
@@ -57,7 +57,7 @@ ON
 ORDER BY
        h.userid ASC", __FILE__, __LINE__);
 
 ORDER BY
        h.userid ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all holiday requests
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all holiday requests
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 5946800572487e30b88fee9da764c01222dccd7c..47f3b621897da2e56a451644c831e0cbffdcdc9e 100644 (file)
@@ -98,7 +98,7 @@ ORDER BY
                array(getRequestParameter('network')), __FILE__, __LINE__);
 
        // Do we have entries?
                array(getRequestParameter('network')), __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
                // List all entries
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
index c6ca40c374b3541728a0a1055c50eb60586746c7..3f2b02ec7659a45af42bd576a0b252aeb41848ce 100644 (file)
@@ -83,7 +83,7 @@ ORDER BY
                array(getRequestParameter('network')), __FILE__, __LINE__);
 
        // Do we have entries?
                array(getRequestParameter('network')), __FILE__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all entries
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
                // List all entries
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
index 62123ad33c6d1dbd281c4ba5548655a05830d5df..c9e26e2c1655e6f596316cc0c4bf42d1bac2fc92 100644 (file)
@@ -72,7 +72,7 @@ ORDER BY
        `network_short_name` ASC', __FILE__, __LINE__);
 
 // Do we have entries?
        `network_short_name` ASC', __FILE__, __LINE__);
 
 // Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 5509489086669858febdddb342415fe0d786fff7..deb3f600a94f28a2681e240e4a2483aa5a61e3cd 100644 (file)
@@ -78,12 +78,12 @@ $add = ' LIMIT ' . (bigintval(getRequestParameter('offset')) * bigintval(getRequ
 // Add limitation
 if (!empty($SQL2)) $SQL2 .= $add;
 
 // Add limitation
 if (!empty($SQL2)) $SQL2 .= $add;
 
-if ((isExtensionActive('bonus')) && (SQL_NUMROWS($result_max) > 0) && (!empty($SQL2))) {
+if ((isExtensionActive('bonus')) && (!SQL_HASHZERONUMS($result_max)) && (!empty($SQL2))) {
        // Run SQL query for notification mails
        $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
 
        // Load bonus mails only when extension is active
        // Run SQL query for notification mails
        $result_bonus = SQL_QUERY($SQL2, __FILE__, __LINE__);
 
        // Load bonus mails only when extension is active
-       if (SQL_NUMROWS($result_bonus) > 0) {
+       if (!SQL_HASZERONUMS($result_bonus)) {
                // Calculate pages
                $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
 
                // Calculate pages
                $numPages = round(SQL_NUMROWS($result_bonus) / getConfig('mails_page') + 0.5);
 
index 2f5d98b20bcc337a457ffc599dd608d9e37e381f..7e10f9a4f7eb3c7cc1a116e53da7c8ffb72cf16c 100644 (file)
@@ -233,7 +233,7 @@ ON
 ORDER BY
        p.payout_timestamp DESC", __FILE__, __LINE__);
 
 ORDER BY
        p.payout_timestamp DESC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List found payouts
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // List found payouts
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index b49af4ed8b08773e9a22ca15eec7c7897667f033..a70784139197351f7bce08c5549bb727eaa9dbb3 100644 (file)
@@ -56,7 +56,7 @@ ORDER BY
        __FILE__, __LINE__);
 
 // Are there some entries to display?
        __FILE__, __LINE__);
 
 // Are there some entries to display?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 65cf9f270d6ecba6aacfa69343325ad6289ebf25..fa0d0a2ee912fbb408efd0230f5eec737ae9c30f 100644 (file)
@@ -104,7 +104,7 @@ if (isGetRequestParameterSet('rallye')) {
        runFilterChain('run_sqls');
 } elseif (isFormSent('remove')) {
        // Delete rallyes
        runFilterChain('run_sqls');
 } elseif (isFormSent('remove')) {
        // Delete rallyes
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Init SQLs
                initSqls();
 
                // Init SQLs
                initSqls();
 
@@ -130,7 +130,7 @@ if (isGetRequestParameterSet('rallye')) {
        }
 } elseif (isFormSent('change')) {
        // Change rallye
        }
 } elseif (isFormSent('change')) {
        // Change rallye
-       if (countSelection(postRequestParameter('title')) > 0) {
+       if (ifPostContainsSelections('title')) {
                // Init SQLs
                initSqls();
 
                // Init SQLs
                initSqls();
 
@@ -179,7 +179,7 @@ LIMIT 1",
 
 if (isFormSent('edit')) {
        // Check for selections
 
 if (isFormSent('edit')) {
        // Check for selections
-       if (countPostSelection() > 0) {
+       if (ifPostContainsSelections()) {
                // Make all selected and deactivated rallyes editable
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $selected) {
                // Make all selected and deactivated rallyes editable
                $OUT = '';
                foreach (postRequestParameter('sel') as $id => $selected) {
@@ -239,7 +239,7 @@ WHERE
 ORDER BY
        `userid` ASC",
                array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
 ORDER BY
        `userid` ASC",
                array(bigintval(getRequestParameter('rallye'))), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                $OUT = '';
                $content['rallye'] = getRequestParameter('rallye');
                while ($row = SQL_FETCHARRAY($result)) {
                $OUT = '';
                $content['rallye'] = getRequestParameter('rallye');
                while ($row = SQL_FETCHARRAY($result)) {
@@ -295,7 +295,7 @@ ORDER BY
        `start_time` DESC", __FILE__, __LINE__);
 
        // Records found?
        `start_time` DESC", __FILE__, __LINE__);
 
        // Records found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List found rallyes
                $OUT = '';
                while ($data = SQL_FETCHARRAY($result)) {
                // List found rallyes
                $OUT = '';
                while ($data = SQL_FETCHARRAY($result)) {
index 70ab759ac238221f8cb8641b92279d1365e1f122..55e70338d00cdd46b35ddb0709353d43498496b9 100644 (file)
@@ -73,7 +73,7 @@ ORDER BY
        `level` ASC", __FILE__, __LINE__);
 
                // Are there some levels (VERY BAD IF NONE!)
        `level` ASC", __FILE__, __LINE__);
 
                // Are there some levels (VERY BAD IF NONE!)
-               if (SQL_NUMROWS($result_levels) > 0) {
+               if (!SQL_HASZERONUMS($result_levels)) {
                        // List all ref levels or entries if no refback is installed
                        $OUT = '';
                        while ($levels = SQL_FETCHARRAY($result_levels)) {
                        // List all ref levels or entries if no refback is installed
                        $OUT = '';
                        while ($levels = SQL_FETCHARRAY($result_levels)) {
@@ -85,7 +85,7 @@ ORDER BY
                                        //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
 
                                        // Do we have levels?
                                        //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
 
                                        // Do we have levels?
-                                       if (SQL_NUMROWS($result_refs) > 0) {
+                                       if (!SQL_HASZERONUMS($result_refs)) {
                                                // Count entries
                                                $menge =     countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
                                                $menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
                                                // Count entries
                                                $menge =     countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
                                                $menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
index 1fd3ed52705018c6d95498db6adf69fce8c75fb9..32ad71a64a2358e02f6e86707f69f7f6de6ad16e 100644 (file)
@@ -107,7 +107,7 @@ ORDER BY
        `id` ASC",
                array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
 
        `id` ASC",
                array(bigintval(getRequestParameter('rid'))), __FILE__, __LINE__);
 
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // List refs now
                        // Free memory
                        SQL_FREERESULT($result);
                        // List refs now
                        // Free memory
                        SQL_FREERESULT($result);
@@ -129,7 +129,7 @@ FROM
 ORDER BY
        `id` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `id` ASC", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // At least one sponsor found!
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
                // At least one sponsor found!
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
index 7375e79285c7b3ebcd28b3e5fd5ec9ffab57adda..dee8f22e8c23bfecee08533590b697127b7622c3 100644 (file)
@@ -183,7 +183,7 @@ ORDER BY
                __FILE__, __LINE__);
 
        // Do we have some paytypes setup?
                __FILE__, __LINE__);
 
        // Do we have some paytypes setup?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Prepare variables for listing
                $OUT = '';
 
                // Prepare variables for listing
                $OUT = '';
 
index afacd0579ab63250cddd2570712db56e80ad7233..29dcdb6519d546700a73eee01bca75b953b183e3 100644 (file)
@@ -58,7 +58,7 @@ ORDER BY
        `actions_action` ASC", __FILE__, __LINE__);
 
 // Entries found?
        `actions_action` ASC", __FILE__, __LINE__);
 
 // Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 105a80be10408af072a8072f97309cdce8c5ce46..d8ab24966601ecc66870e0d9ce93aa56fe6aa2ce 100644 (file)
@@ -175,7 +175,7 @@ ORDER BY
        `url_id` ASC", __FILE__, __LINE__);
 
 // Do we have some URLs left?
        `url_id` ASC", __FILE__, __LINE__);
 
 // Do we have some URLs left?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all URLs
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all URLs
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 32469cadf7009c8958ed780c8b0bc9896666c738..f9884af24a42155d0a85ae2c0a1c706e147b864b 100644 (file)
@@ -85,7 +85,7 @@ switch (getRequestParameter('type')) {
 } // END - switch
 
 if (!empty($whereStatement)) {
 } // END - switch
 
 if (!empty($whereStatement)) {
-       if ((isPostRequestParameterSet('assign')) && (countPostSelection() > 0)) {
+       if ((isPostRequestParameterSet('assign')) && (ifPostContainsSelections())) {
                // Assign / do tasks
                loadIncludeOnce('inc/modules/admin/overview-inc.php');
                if (empty($dmy)) $dmy = '';
                // Assign / do tasks
                loadIncludeOnce('inc/modules/admin/overview-inc.php');
                if (empty($dmy)) $dmy = '';
@@ -104,7 +104,7 @@ ORDER BY
        `subject` ASC,
        `task_created` DESC',
                        __FILE__, __LINE__);
        `subject` ASC,
        `task_created` DESC',
                        __FILE__, __LINE__);
-               if ((countPostSelection() > 0) && (!isDemoModeActive())) {
+               if ((ifPostContainsSelections()) && (!isDemoModeActive())) {
                        // Only unassign / delete tasks when there are selected tasks posted
                        if (isPostRequestParameterSet('unassign')) {
                                // Unassign from tasks
                        // Only unassign / delete tasks when there are selected tasks posted
                        if (isPostRequestParameterSet('unassign')) {
                                // Unassign from tasks
index a66c6acfd20b9ea331d4ce075bec1308e481c66e..41a3cb954696ce6729c5e4427bae5175378e3ec8 100644 (file)
@@ -54,7 +54,7 @@ ORDER BY
        `trans_id` ASC', __FILE__, __LINE__);
 
 $total = '0';
        `trans_id` ASC', __FILE__, __LINE__);
 
 $total = '0';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Output rows
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Output rows
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index f28d7376d336279cc8f9534d5249d2c826795d7c..6e78f65d9ed415c7212aca5c781a81967c9f2432 100644 (file)
@@ -239,7 +239,7 @@ LIMIT 1",
        $result = SQL_QUERY($sql, __FILE__, __LINE__);
 
        // Are there some entries?
        $result = SQL_QUERY($sql, __FILE__, __LINE__);
 
        // Are there some entries?
-       if (SQL_NUMROWS($result_master) > 0) {
+       if (!SQL_HASZERONUMS($result_master)) {
                // We have some (new?) registrations!
                $templateContent['colspan2']   = ($colspan + 2);
                $templateContent['user_count'] = getTotalConfirmedUser();
                // We have some (new?) registrations!
                $templateContent['colspan2']   = ($colspan + 2);
                $templateContent['user_count'] = getTotalConfirmedUser();
index 418e8c11e5386f1176fcc169e732124ecd7cf8cb..333b9165564bd740520396cf8fce77ab94225930 100644 (file)
@@ -56,7 +56,7 @@ ORDER BY
        __FILE__, __LINE__);
 
 // Are there some entries to display?
        __FILE__, __LINE__);
 
 // Are there some entries to display?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all entries
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 102e4ca1bb1211063e055e1aa58ba63225c61b91..61be3eca8ef407a730a3e8214325a240a0a6b997 100644 (file)
@@ -60,7 +60,7 @@ if (!isFormSent()) {
        // Get all available main menus
        $result = SQL_QUERY("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC",
                __FILE__, __LINE__);
        // Get all available main menus
        $result = SQL_QUERY("SELECT `action`, `title`, `sort` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE (`what`='' OR `what` IS NULL) ORDER BY `sort` ASC",
                __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
                // Read menu structure
                // @TODO Cant this be rewritten?
                while ($content = SQL_FETCHARRAY($result)) {
@@ -101,7 +101,7 @@ if (!isFormSent()) {
                foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort`",
                        array($value_main), __FILE__, __LINE__);
                foreach ($menus as $key_main => $value_main) {
                        $result = SQL_QUERY_ESC("SELECT what, title, sort FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='%s' AND `what` != '' ORDER BY `sort`",
                        array($value_main), __FILE__, __LINE__);
-                       if (SQL_NUMROWS($result) > 0) {
+                       if (!SQL_HASZERONUMS($result)) {
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
                                // Initialize arrays
                                $menus[$value_main] = array();
                                $titles[$value_main] = array();
index 0349a74b3563586efb42342571885c8e262c75b0..82f666c408fd16d0bb587aa0a101b173c11b6826 100644 (file)
@@ -54,7 +54,7 @@ if (isGetRequestParameterSet('sub')) {
 } // END - if
 
 // List all menu points and make them editable
 } // END - if
 
 // List all menu points and make them editable
-if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+if ((isFormSent('edit')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Edit menu entries
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -96,7 +96,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_mmenu_edit', false, $content);
 
        // Load template
        loadTemplate('admin_mmenu_edit', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Del menu entries with or without confirmation
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
@@ -134,7 +134,7 @@ if ((isFormSent('edit')) && (countPostSelection() > 0) && (!isDemoModeActive()))
 
        // Load template
        loadTemplate('admin_mmenu_delete', false, $content);
 
        // Load template
        loadTemplate('admin_mmenu_delete', false, $content);
-} elseif ((isPostRequestParameterSet('status')) && (countPostSelection() > 0) && (!isDemoModeActive())) {
+} elseif ((isPostRequestParameterSet('status')) && (ifPostContainsSelections()) && (!isDemoModeActive())) {
        // Change status (visible / locked)
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
        // Change status (visible / locked)
        $content['sub'] = $SUB;
        $content['chk'] = countPostSelection();
index 7edb41e4b9b2afd6a5f6ee9631ae87a906cb6c8e..1df93ee820e85d7e70a1150a1e1e50bc2e646efc 100644 (file)
@@ -89,7 +89,7 @@ if (isFormSent()) {
 
        // Output template
        loadTemplate('admin_settings_saved', false, $content);
 
        // Output template
        loadTemplate('admin_settings_saved', false, $content);
-} elseif ((isFormSent('del')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('del')) && (ifPostContainsSelections())) {
        // Delete entries here
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Delete entries here
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -111,7 +111,7 @@ if (isFormSent()) {
 
        // Load main template
        loadTemplate('admin_del_payments', false, $OUT);
 
        // Load main template
        loadTemplate('admin_del_payments', false, $OUT);
-} elseif ((isFormSent('edit')) && (countPostSelection() > 0)) {
+} elseif ((isFormSent('edit')) && (ifPostContainsSelections())) {
        // Edit entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
        // Edit entries
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $value) {
@@ -138,7 +138,7 @@ if (isFormSent()) {
 } else {
        // Referal levels
        $result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__);
 } else {
        // Referal levels
        $result = SQL_QUERY("SELECT `id`, `time`, `payment`, `mail_title`, `price` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `time` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Make referal levels editable and deletable
                $OUT = '';
 
                // Make referal levels editable and deletable
                $OUT = '';
 
index 33635e8eefc61e91bccfdeef8d397c197d37d9ec..8f23c36e460b6a00f25b6cad2305a5db50b25c00 100644 (file)
@@ -104,7 +104,7 @@ VALUES ('%s','%s','%s')",
 
        // Display message
        loadTemplate('admin_settings_saved', false, $content);
 
        // Display message
        loadTemplate('admin_settings_saved', false, $content);
-} elseif ((countPostSelection() > 0) && (isFormSent('edit'))) {
+} elseif ((ifPostContainsSelections()) && (isFormSent('edit'))) {
        // Edit banner
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $sel) {
        // Edit banner
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $sel) {
@@ -124,7 +124,7 @@ VALUES ('%s','%s','%s')",
        // Load main template
        loadTemplate('admin_refbanner_edit', false, $OUT);
 } else {
        // Load main template
        loadTemplate('admin_refbanner_edit', false, $OUT);
 } else {
-       if ((countPostSelection() > 0) && (isFormSent('del'))) {
+       if ((ifPostContainsSelections()) && (isFormSent('del'))) {
                // Delete banner
                foreach (postRequestParameter('sel') as $id => $sel) {
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
                // Delete banner
                foreach (postRequestParameter('sel') as $id => $sel) {
                        SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_refbanner` WHERE `id`=%s LIMIT 1",
@@ -136,7 +136,7 @@ VALUES ('%s','%s','%s')",
        $result = SQL_QUERY('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
 
        // Entries found?
        $result = SQL_QUERY('SELECT `id`, `url`, `alternate`, `visible`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner` ORDER BY `url` ASC', __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Make referal banner editable and deletable
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                // Make referal banner editable and deletable
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
index 5e99503109eb5b4045538abff154e66b2b42cf1b..32b6e415d3a9ab0c521034c668d7d7df2bde1f5c 100644 (file)
@@ -47,7 +47,7 @@ addMenuDescription('admin', __FILE__);
 
 // Go through all categories
 $result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
 
 // Go through all categories
 $result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_cats` GROUP BY `userid` ORDER BY `userid` ASC", __FILE__, __LINE__);
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
         // Nothing is removed for now... ;-)
        $REMOVED = '0';
 
         // Nothing is removed for now... ;-)
        $REMOVED = '0';
 
index 5458ff6e5ff4bf6c072297717785513602f61e68..2d9eaef8a6849a218017568102a7574902b902ab 100644 (file)
@@ -54,7 +54,7 @@ WHERE
        `status`='CONFIRMED' AND `nl_receive`='Y'
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
        `status`='CONFIRMED' AND `nl_receive`='Y'
 ORDER BY
        `userid` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Members are available so we can send out the newsletter!
                while ($content = SQL_FETCHARRAY($result)) {
                        // Construct mail...
                // Members are available so we can send out the newsletter!
                while ($content = SQL_FETCHARRAY($result)) {
                        // Construct mail...
index 161c0d0eb95d62a0227d956d4f7eba4cea2b3a5e..1790adc2488a4b18e48dad6de391c1e33d270745 100644 (file)
@@ -61,7 +61,7 @@ ORDER BY
                array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
 
        // Entries found?
                array(bigintval(getRequestParameter('url_id'))), __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Get all rows
                $OUT = ''; $cnt = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                // Get all rows
                $OUT = ''; $cnt = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
@@ -104,7 +104,7 @@ ORDER BY
        `stats_userid` ASC", __FILE__, __LINE__);
 
        // Entries found?
        `stats_userid` ASC", __FILE__, __LINE__);
 
        // Entries found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Get all rows
                $OUT = ''; $urlArray = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
                // Get all rows
                $OUT = ''; $urlArray = '0'; $visits = '0';
                while ($content = SQL_FETCHARRAY($result)) {
index 6fc4f5055721dc3cff99809f494a7239c33d8115..cc0f464db5607be39bd5d367f967cc8428c1dbbe 100644 (file)
@@ -51,7 +51,7 @@ if (!isExtensionActive('theme')) {
 } // END - if
 
 // Check for selected themes
 } // END - if
 
 // Check for selected themes
-if (countPostSelection() > 0) {
+if (ifPostContainsSelections()) {
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $sel) {
                $sql = '';
        $OUT = '';
        foreach (postRequestParameter('sel') as $id => $sel) {
                $sql = '';
@@ -113,7 +113,7 @@ FROM
 ORDER BY
        `theme_path` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `theme_path` ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        while ($content = SQL_FETCHARRAY($result)) {
                // Construct IFN
                $inc = sprintf("theme/%s/theme.php", $content['theme_path']);
        while ($content = SQL_FETCHARRAY($result)) {
                // Construct IFN
                $inc = sprintf("theme/%s/theme.php", $content['theme_path']);
index a7c5a861dfcf2b47fd2c357f0bf29bbfb76b55ab..881f9c21c7aa8a7b2bf1b9f067f09d3205bb4db0 100644 (file)
@@ -55,9 +55,9 @@ WHERE
 ORDER BY
        `timestamp` ASC", __FILE__, __LINE__);
 
 ORDER BY
        `timestamp` ASC", __FILE__, __LINE__);
 
-if ((SQL_NUMROWS($result_main) > 0) || (isFormSent('lock'))) {
+if ((!SQL_HASZERONUMS($result_main)) || (isFormSent('lock'))) {
        if (isFormSent('accept')) {
        if (isFormSent('accept')) {
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // Accept mail orders
                        foreach (postRequestParameter('sel') as $id => $value) {
                                // Secure id number
                        // Accept mail orders
                        foreach (postRequestParameter('sel') as $id => $value) {
                                // Secure id number
@@ -124,7 +124,7 @@ LIMIT 1",
                // Mails unlocked for mail delivery
                loadTemplate('admin_settings_saved', false, $message);
        } elseif (isPostRequestParameterSet(('reject'))) {
                // Mails unlocked for mail delivery
                loadTemplate('admin_settings_saved', false, $message);
        } elseif (isPostRequestParameterSet(('reject'))) {
-               if (countPostSelection() > 0) {
+               if (ifPostContainsSelections()) {
                        // Reject mail orders
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $value) {
                        // Reject mail orders
                        $OUT = '';
                        foreach (postRequestParameter('sel') as $id => $value) {
@@ -168,7 +168,7 @@ LIMIT 1",
                        // Nothing selected
                        loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
                }
                        // Nothing selected
                        loadTemplate('admin_settings_saved', false, '{--ADMIN_MAILS_NOTHING_CHECKED--}');
                }
-       } elseif ((isFormSent('lock')) && (countPostSelection() > 0) && (getConfig('url_blacklist') == 'Y')) {
+       } elseif ((isFormSent('lock')) && (ifPostContainsSelections()) && (getConfig('url_blacklist') == 'Y')) {
                // Lock URLs
                foreach (postRequestParameter('sel') as $id => $url) {
                        // Secure id number
                // Lock URLs
                foreach (postRequestParameter('sel') as $id => $url) {
                        // Secure id number
index 06d20c510f98cfa790f06175b321280fb2465e49..ba14bdff29967cd59c62d9688777359b2dabb2df 100644 (file)
@@ -48,7 +48,7 @@ addMenuDescription('admin', __FILE__);
 // Check if admin has submitted form
 if (isFormSent()) {
        // Does he have selected at least one sponsor?
 // Check if admin has submitted form
 if (isFormSent()) {
        // Does he have selected at least one sponsor?
-       if (countSelection(postRequestParameter('id')) > 0) {
+       if (ifPostContainsSelections('id')) {
                // At least one entry selected
                foreach (postRequestParameter('id') as $id => $selected) {
                        // Secure id number and init $content
                // At least one entry selected
                foreach (postRequestParameter('id') as $id => $selected) {
                        // Secure id number and init $content
@@ -87,7 +87,7 @@ WHERE
 ORDER BY
        sp.pay_name ASC",
                                        array($content['id']), __FILE__, __LINE__);
 ORDER BY
        sp.pay_name ASC",
                                        array($content['id']), __FILE__, __LINE__);
-                               if (SQL_NUMROWS($result) > 0) {
+                               if (!SQL_HASZERONUMS($result)) {
                                        // Payment does exist
                                        while ($content2 = SQL_FETCHARRAY($result)) {
                                                // Merge both arrays
                                        // Payment does exist
                                        while ($content2 = SQL_FETCHARRAY($result)) {
                                                // Merge both arrays
@@ -196,7 +196,7 @@ WHERE
 ORDER BY
        `id`", __FILE__, __LINE__);
 
 ORDER BY
        `id`", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Entries found so let's list them!
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Entries found so let's list them!
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 6dc57d0511b19b9409ae6d9812ec25bb666643b3..0eb908dd5dbf734b501e6ca6f5017c6a81218abe 100644 (file)
@@ -80,7 +80,7 @@ ORDER BY
        `url_id` ASC", __FILE__, __LINE__);
 
 // Do we have some URLs left?
        `url_id` ASC", __FILE__, __LINE__);
 
 // Do we have some URLs left?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all URLs
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all URLs
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index fbc6143f4832471a7a1e5c18513777590b95312f..22c4a00e44c12acab6b8132ecca79c61b960d59d 100644 (file)
@@ -59,7 +59,7 @@ if (isExtensionActive('online')) {
        // Check for online users
        $result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
                __FILE__, __LINE__);
        // Check for online users
        $result = SQL_QUERY("SELECT `id`, `ip`, `userid`, `refid`, `module`, `action`, `what`, `is_member`, `is_admin`, `timestamp` FROM `{?_MYSQL_PREFIX?}_online` ORDER by `timestamp` DESC",
                __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // List all online users
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
                // List all online users
                $OUT = '';
                while ($row = SQL_FETCHARRAY($result)) {
index 17e4d337976e17f695a58345c38f4ea852cf9d7c..7e017196db325b43b2f6db6be0ef7b31cb47c340 100644 (file)
@@ -68,7 +68,7 @@ ORDER BY
 LIMIT {?active_limit?}", __FILE__, __LINE__);
 
 // Entries found?
 LIMIT {?active_limit?}", __FILE__, __LINE__);
 
 // Entries found?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // At least one member was online so let's load them all
        $OUT = '';
        while (list($userid, $nick, $last) = SQL_FETCHROW($result)) {
        // At least one member was online so let's load them all
        $OUT = '';
        while (list($userid, $nick, $last) = SQL_FETCHROW($result)) {
index a6d7246e9fa404a15545e7e909c79afaada31297..ae57f8345b8b6c9c21db7416d3a17d891cb814c9 100644 (file)
@@ -62,7 +62,7 @@ LEFT JOIN `{?_MYSQL_PREFIX?}_sponsor_registry` AS r ON m.what=r.ext_name
 WHERE m.`action`='actions' AND r.is_active='Y'
 ORDER BY m.sort ASC", __FILE__, __LINE__);
 
 WHERE m.`action`='actions' AND r.is_active='Y'
 ORDER BY m.sort ASC", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result_act) > 0) {
+if (!SQL_HASZERONUMS($result_act)) {
        // Load all actions
        $OUT_ACT = '';
        while ($content = SQL_FETCHARRAY($result_act)) {
        // Load all actions
        $OUT_ACT = '';
        while ($content = SQL_FETCHARRAY($result_act)) {
@@ -80,7 +80,7 @@ if (SQL_NUMROWS($result_act) > 0) {
 
        // Check for pay types
        $result_pay = SQL_QUERY('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__);
 
        // Check for pay types
        $result_pay = SQL_QUERY('SELECT `pay_name`, `pay_rate`, `pay_min_count`, `pay_currency` FROM `{?_MYSQL_PREFIX?}_sponsor_paytypes` ORDER BY `pay_name` ASC', __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_pay) > 0) {
+       if (!SQL_HASZERONUMS($result_pay)) {
                // Load all pay types
                $OUT_PAY = '';
                while ($content = SQL_FETCHARRAY($result_pay)) {
                // Load all pay types
                $OUT_PAY = '';
                while ($content = SQL_FETCHARRAY($result_pay)) {
index 28673055b3ba89b077fdba28637d042dc9a9789b..a68943183351ed5e91f607ea616454a8351b0bb1 100644 (file)
@@ -285,7 +285,7 @@ FROM
        `{?_MYSQL_PREFIX?}_sponsor_paytypes`
 ORDER BY 
        pay_name` ASC', __FILE__, __LINE__);
        `{?_MYSQL_PREFIX?}_sponsor_paytypes`
 ORDER BY 
        pay_name` ASC', __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Load all types...
                // @TODO Swap this HTML code to templates
                $OUT = '<table border="0" cellspacing="0" cellpadding="0" width="300" class="left right top">';
                // Load all types...
                // @TODO Swap this HTML code to templates
                $OUT = '<table border="0" cellspacing="0" cellpadding="0" width="300" class="left right top">';
index 38ea6bbf473a8d561e7d32bb0f2daf5d3be44e3c..9dd3fe910208e201b1f4628c94347de3751c654d 100644 (file)
@@ -194,7 +194,7 @@ switch (getConfig('guest_stats')) {
                $mem_t10   = SQL_QUERY("SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0".$AND." ORDER BY `counter` DESC LIMIT 0,10", __FILE__, __LINE__);
                $OUT = ''; 
 
                $mem_t10   = SQL_QUERY("SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0".$AND." ORDER BY `counter` DESC LIMIT 0,10", __FILE__, __LINE__);
                $OUT = ''; 
 
-               if (SQL_NUMROWS($guest_t10) > 0) {
+               if (!SQL_HASZERONUMS($guest_t10)) {
                        // Guest clicks
                        $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_GUEST_STATS--}');
                        while ($content = SQL_FETCHARRAY($guest_t10)) {
                        // Guest clicks
                        $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_GUEST_STATS--}');
                        while ($content = SQL_FETCHARRAY($guest_t10)) {
@@ -203,7 +203,7 @@ switch (getConfig('guest_stats')) {
                        } // END - while
                } // END - if
 
                        } // END - while
                } // END - if
 
-               if (SQL_NUMROWS($mem_t10) > 0) {
+               if (!SQL_HASZERONUMS($mem_t10)) {
                        // Member clicks
                        $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_MEMBER_STATS--}');
                        while ($content = SQL_FETCHARRAY($mem_t10)) {
                        // Member clicks
                        $OUT .= loadTemplate('guest_stats_header', true, '{--GUEST_TOP_MEMBER_STATS--}');
                        while ($content = SQL_FETCHARRAY($mem_t10)) {
@@ -212,7 +212,7 @@ switch (getConfig('guest_stats')) {
                        } // END - while
                } // END - if
 
                        } // END - while
                } // END - if
 
-               if ((SQL_NUMROWS($guest_t10) > 0) || (SQL_NUMROWS($mem_t10) > 0)) {
+               if ((!SQL_HASZERONUMS($guest_t10)) || (!SQL_HASZERONUMS($mem_t10))) {
                        // Prepare content
                        $content = array(
                                'rows'   => $OUT,
                        // Prepare content
                        $content = array(
                                'rows'   => $OUT,
index 7a29cbe3e1db2afb3be9607061a4a1182dcca0e3..126a08492f3553b52684d6c4efc2c686095374ae 100644 (file)
@@ -70,7 +70,7 @@ $rdf->set_Options(
 );
 
 // Use proxy?
 );
 
 // Use proxy?
-if ((getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0)) {
+if (isProxyUsed()) {
        // Set proxy data
        $rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port'));
 
        // Set proxy data
        $rdf->set_proxy(getConfig('proxy_host'), getConfig('proxy_port'));
 
index b5f03912f6cfa02356fc4c982bed639248e44616..a0ff700d637b9f85fc45ea9e9e22965739a755c2 100644 (file)
@@ -81,7 +81,7 @@ LIMIT {?beg_ranks?}",
 
 // Reset temporary variable and check for users
 $OUT = '';
 
 // Reset temporary variable and check for users
 $OUT = '';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Load our winners...
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result)) {
        // Load our winners...
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result)) {
index c6191e92ff26630f05dd7739255d0263d221d83b..6f88dcfa5dac98f8651cdd73b50497f543ce1d9c 100644 (file)
@@ -94,7 +94,7 @@ LIMIT {?bonus_ranks?}",
 
 // Reset temporary variable and check for users
 $OUT = '';
 
 // Reset temporary variable and check for users
 $OUT = '';
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Load our winners...
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result)) {
        // Load our winners...
        $cnt = 1;
        while ($content = SQL_FETCHARRAY($result)) {
index d6744299fa0bce45bf865432ebe5f3d682ee038c..281248a7950803e3705b67810bb60bb3807db954 100644 (file)
@@ -444,7 +444,7 @@ FROM
 ".$whereStatement."
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
 ".$whereStatement."
 ORDER BY
        `sort` ASC", __FILE__, __LINE__);
-       if (SQL_NUMROWS($result_cats) > 0) {
+       if (!SQL_HASZERONUMS($result_cats)) {
                if ($total > 0) {
                        // Initialize array...
                        $categories = array(
                if ($total > 0) {
                        // Initialize array...
                        $categories = array(
@@ -534,7 +534,7 @@ LIMIT 1",
                        $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
 
                        $types = array();
                        $result = SQL_QUERY("SELECT `id`, `price`, `payment`, `mail_title` FROM `{?_MYSQL_PREFIX?}_payments` ORDER BY `payment` ASC", __FILE__, __LINE__);
 
                        $types = array();
-                       if (SQL_NUMROWS($result) > 0) {
+                       if (!SQL_HASZERONUMS($result)) {
                                // Check for message id in URL
                                $message = getMessageFromErrorCode(getRequestParameter('code'));
 
                                // Check for message id in URL
                                $message = getMessageFromErrorCode(getRequestParameter('code'));
 
index 246e0e31402819f3977cc7501045cbc250ec5919..edb05b80424fb096c29798ba73caf3bcfb007072 100644 (file)
@@ -77,7 +77,7 @@ WHERE
 ORDER BY
        `type` ASC",
                array($totalPoints), __FILE__, __LINE__);
 ORDER BY
        `type` ASC",
                array($totalPoints), __FILE__, __LINE__);
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Free memory
                SQL_FREERESULT($result);
 
                // Free memory
                SQL_FREERESULT($result);
 
@@ -95,7 +95,7 @@ WHERE
 ORDER BY
        p.payout_timestamp DESC",
                        array(getMemberId()), __FILE__, __LINE__);
 ORDER BY
        p.payout_timestamp DESC",
                        array(getMemberId()), __FILE__, __LINE__);
-               if (SQL_NUMROWS($result_payouts) > 0) {
+               if (!SQL_HASZERONUMS($result_payouts)) {
                        // List all his requests
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result_payouts)) {
                        // List all his requests
                        $OUT = '';
                        while ($content = SQL_FETCHARRAY($result_payouts)) {
index 128e19c846f4d267726391bf7351d1cc0872db74..b69124c94ccff2c4742255905acc1e4fdedbab75 100644 (file)
@@ -108,7 +108,7 @@ ORDER BY
        r.level ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
        r.level ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all levels
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all levels
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 2e838689b888c67c13c7dfdb0d34688bea03fa2c..c25d3ff01264e67dbaee3d7f580b973887f037f0 100644 (file)
@@ -69,7 +69,7 @@ $whereStatement = " WHERE `visible`='Y'";
 if (isAdmin()) $whereStatement = '';
 $result = SQL_QUERY("SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner`", __FILE__, __LINE__);
 
 if (isAdmin()) $whereStatement = '';
 $result = SQL_QUERY("SELECT `id`, `url`, `alternate`, `counter`, `clicks` FROM `{?_MYSQL_PREFIX?}_refbanner`", __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List available ref banners
        $OUT = '';
        while ($row = SQL_FETCHARRAY($result)) {
        // List available ref banners
        $OUT = '';
        while ($row = SQL_FETCHARRAY($result)) {
index d4b3e97f5e450ded54fe9d46a9c01706b612535a..cc34322a0320c6aa8e00632a17d3b4f01260af2a 100644 (file)
@@ -59,7 +59,7 @@ ORDER BY
        `level` ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
        `level` ASC', __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // List all levels
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // List all levels
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 510dc049db5133f7cd5c7b3eb687bf4b1f32f4f1..8a37457834b40138ecdace2802f72110ab840217 100644 (file)
@@ -63,7 +63,7 @@ ORDER BY
        array(getMemberId()), __FILE__, __LINE__);
 
 // Are there mails left in pool?
        array(getMemberId()), __FILE__, __LINE__);
 
 // Are there mails left in pool?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Load all orders
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Load all orders
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
@@ -95,7 +95,7 @@ ORDER BY
        `timestamp_ordered` DESC",
        array(getMemberId()), __FILE__, __LINE__);
 
        `timestamp_ordered` DESC",
        array(getMemberId()), __FILE__, __LINE__);
 
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Mail orders are in pool so we can display them
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
        // Mail orders are in pool so we can display them
        $OUT = '';
        while ($content = SQL_FETCHARRAY($result)) {
index 699dc3d867079e40c2422fd2b3831a396e4deb4c..aad5bf37e2264d0ce4b92c8c92b96924e19162ce 100644 (file)
@@ -88,7 +88,7 @@ switch ($mode) {
                        $valid_reason = (isPostRequestParameterSet('reason'));
 
                        // Test if a recipient is selected
                        $valid_reason = (isPostRequestParameterSet('reason'));
 
                        // Test if a recipient is selected
-                       $valid_recipient = (postRequestParameter('to_userid') > 0);
+                       $valid_recipient = isValidUserId(postRequestParameter('to_userid'));
 
                        // Check for nickname extension and set additional data
                        // @TODO Rewrite this to a filter
 
                        // Check for nickname extension and set additional data
                        // @TODO Rewrite this to a filter
@@ -215,7 +215,7 @@ switch ($mode) {
                                        array(getMemberId()), __FILE__, __LINE__);
                        }
 
                                        array(getMemberId()), __FILE__, __LINE__);
                        }
 
-                       if (SQL_NUMROWS($result) > 0) {
+                       if (!SQL_HASZERONUMS($result)) {
                                // Load list
                                $OUT  = "<select name=\"to_userid\" size=\"1\" class=\"member_select\">
        <option value=\"0\">{--SELECT_NONE--}</option>\n";
                                // Load list
                                $OUT  = "<select name=\"to_userid\" size=\"1\" class=\"member_select\">
        <option value=\"0\">{--SELECT_NONE--}</option>\n";
@@ -299,7 +299,7 @@ switch ($mode) {
                $result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__);
 
                // Do we have entries?
                $result = SQL_QUERY_ESC($sql, array(getMemberId()), __FILE__, __LINE__);
 
                // Do we have entries?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        $OUT = '';
                        // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
                        while (list($tid, $userid, $points, $reason, $stamp) = SQL_FETCHROW($result)) {
                        $OUT = '';
                        // @TODO This should be somehow rewritten to $row = SQL_FETCHARRAY(), see switch() block above for SQL queries
                        while (list($tid, $userid, $points, $reason, $stamp) = SQL_FETCHROW($result)) {
@@ -385,7 +385,7 @@ KEY (`party_userid`)
                SQL_FREERESULT($result);
 
                $total = '0';
                SQL_FREERESULT($result);
 
                $total = '0';
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Search for entries
                        $result = SQL_QUERY("SELECT `party_userid`, `trans_id`, `points`, `reason`, `time_trans`, `trans_type` FROM `{?_MYSQL_PREFIX?}_transfers_tmp` ORDER BY `time_trans` DESC",
                                __FILE__, __LINE__);
                        // Search for entries
                        $result = SQL_QUERY("SELECT `party_userid`, `trans_id`, `points`, `reason`, `time_trans`, `trans_type` FROM `{?_MYSQL_PREFIX?}_transfers_tmp` ORDER BY `time_trans` DESC",
                                __FILE__, __LINE__);
index 48178e2cfe4c32670163ab66bbc227bc6c359e81..bb59e8151c12e29adf10f5f97a6b02178467ad68 100644 (file)
@@ -133,7 +133,7 @@ if (isExtensionActive('bonus')) {
 }
 
 // Mails left for confirmation?
 }
 
 // Mails left for confirmation?
-if (SQL_NUMROWS($result) > 0) {
+if (!SQL_HASZERONUMS($result)) {
        // Please confirm these mails!
        $sum = '0'; $OUT = '';
 
        // Please confirm these mails!
        $sum = '0'; $OUT = '';
 
index 1bdd5295acefb7eec61396a49d810ff367774b66..c74ea9f6c53734e8dce632f95b73aa27fff4b620 100644 (file)
@@ -57,7 +57,7 @@ if (($curr != getConfig('last_month')) && (getConfig('last_month') > 0) && (getC
        $whereStatement1 = '';
 
        // Shall we exclude webmaster's own userid?
        $whereStatement1 = '';
 
        // Shall we exclude webmaster's own userid?
-       if ((getConfig('beg_include_own') != 'Y') && (getConfig('beg_userid') > 0)) {
+       if ((getConfig('beg_include_own') != 'Y') && (isValidUserId(getConfig('beg_userid')))) {
                // Exclude it
                $whereStatement1 = " AND `userid` != {?beg_userid?}";
        } // END - if
                // Exclude it
                $whereStatement1 = " AND `userid` != {?beg_userid?}";
        } // END - if
@@ -84,7 +84,7 @@ ORDER BY
        `userid` ASC
 LIMIT {?beg_ranks?}", __FILE__, __LINE__);
 
        `userid` ASC
 LIMIT {?beg_ranks?}", __FILE__, __LINE__);
 
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Add points to user's account directly
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Add points to user's account directly
index 7ad2c9fdd61472cbbb6c8db1bb136c016908f6c2..516e43a0d2ec9e404ac572ec6306b91e5b9b8592 100644 (file)
@@ -90,7 +90,7 @@ ORDER BY
 LIMIT {?bonus_ranks?}", __FILE__, __LINE__);
 
        // Some entries were found?
 LIMIT {?bonus_ranks?}", __FILE__, __LINE__);
 
        // Some entries were found?
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Make sure zero points are not mailed
                // Load our winners...
                while ($content = SQL_FETCHARRAY($result_main)) {
                        // Make sure zero points are not mailed
index 322626c01f6f50e53158e9b7cbc0c1659acbff7e..283fd4b02dbfea93eb5e6c12d6491b882cdb0d75 100644 (file)
@@ -208,7 +208,7 @@ ORDER BY
                array($mode), __FUNCTION__, __LINE__);
 
        //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
                array($mode), __FUNCTION__, __LINE__);
 
        //* DEBUG: */ debugOutput(__LINE__.'/'.$main_cnt.':'.getWhat().'*');
-       if (SQL_NUMROWS($result_main) > 0) {
+       if (!SQL_HASZERONUMS($result_main)) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
                // There are menus available, so we simply display them... :)
                $GLOBALS['rows'] = '';
                while ($content = SQL_FETCHARRAY($result_main)) {
@@ -237,7 +237,7 @@ ORDER BY
                                array($mode, $content['action']), __FUNCTION__, __LINE__);
 
                        // Do we have some entries?
                                array($mode, $content['action']), __FUNCTION__, __LINE__);
 
                        // Do we have some entries?
-                       if (SQL_NUMROWS($result_sub) > 0) {
+                       if (!SQL_HASZERONUMS($result_sub)) {
                                // Init counter
                                $cnt = '0';
 
                                // Init counter
                                $cnt = '0';
 
@@ -601,7 +601,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
        }
 
        // Some entries are found?
        }
 
        // Some entries are found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        $OUT .= '      <option value="' . $content['value'] . '"';
                $OUT = '';
                while ($content = SQL_FETCHARRAY($result)) {
                        $OUT .= '      <option value="' . $content['value'] . '"';
@@ -1075,7 +1075,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        } // END - if
 
                        // Points updated, maybe I shall send him an email?
                        } // END - if
 
                        // Points updated, maybe I shall send him an email?
-                       if (($sendNotify === true) && (getUserData('refid') > 0) && ($locked === false)) {
+                       if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
                                // Prepare content
                                $content = array(
                                        'percents' => $per,
                                // Prepare content
                                $content = array(
                                        'percents' => $per,
@@ -1104,7 +1104,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        }
 
                        // Maybe there's another ref?
                        }
 
                        // Maybe there's another ref?
-                       if ((getUserData('refid') > 0) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
+                       if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($add_mode == 'ref')) {
                                // Then let's credit him here...
                                //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.getUserData('refid').',points='.$points.' - ADVANCE!');
                                addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'), $locked);
                                // Then let's credit him here...
                                //* DEBUG: */ debugOutput(__FUNCTION__ . '(<font color="#0000aa">' . __LINE__ . '</font>):userid='.$userid.',ref='.getUserData('refid').',points='.$points.' - ADVANCE!');
                                addPointsThroughReferalSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, $sendNotify, getUserData('refid'), $locked);
@@ -1405,7 +1405,7 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher
                        ), __FUNCTION__, __LINE__);
 
                // Do we have rows?
                        ), __FUNCTION__, __LINE__);
 
                // Do we have rows?
-               if (SQL_NUMROWS($result) > 0) {
+               if (!SQL_HASZERONUMS($result)) {
                        // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
                        // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
                        while (list($value, $title, $add) = SQL_FETCHROW($result)) {
                        // Found data so add them as OPTION lines: $id is the value and $name is the "name" of the option
                        // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
                        while (list($value, $title, $add) = SQL_FETCHROW($result)) {
@@ -1620,7 +1620,7 @@ function generateCategoryOptionsList ($mode) {
                __FUNCTION__, __LINE__);
 
        // Do we have entries?
                __FUNCTION__, __LINE__);
 
        // Do we have entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // ... and begin loading stuff
                while ($content = SQL_FETCHARRAY($result)) {
                        // Transfer some data
                // ... and begin loading stuff
                while ($content = SQL_FETCHARRAY($result)) {
                        // Transfer some data
@@ -1827,7 +1827,7 @@ ORDER BY
                ), __FUNCTION__, __LINE__);
 
        // Are there some entries?
                ), __FUNCTION__, __LINE__);
 
        // Are there some entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Fetch all entries
                while ($row = SQL_FETCHARRAY($result)) {
                        // Get total points of this user
                // Fetch all entries
                while ($row = SQL_FETCHARRAY($result)) {
                        // Get total points of this user
@@ -1879,7 +1879,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
                array($column, bigintval($id), $count), __FUNCTION__, __LINE__);
 
        // Are there entries?
                array($column, bigintval($id), $count), __FUNCTION__, __LINE__);
 
        // Are there entries?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // Now load all userids for one big query!
                $userids = array();
                while ($data = SQL_FETCHARRAY($result)) {
                // Now load all userids for one big query!
                $userids = array();
                while ($data = SQL_FETCHARRAY($result)) {
index c9bee512e0a5c9bed25288761e405a53f733ec13..b9fffa4cf1abaa0c533d631cac26ec90cb9562fd 100644 (file)
@@ -63,7 +63,7 @@ if (isExtensionActive('html_mail')) {
 
 // Reset variables
 $cnt2 = '0'; $lastSentId = '0'; $cnt_back = array(0); $pointsBack = array(0);
 
 // Reset variables
 $cnt2 = '0'; $lastSentId = '0'; $cnt_back = array(0); $pointsBack = array(0);
-if (SQL_NUMROWS($result_main) > 0) {
+if (!SQL_HASZERONUMS($result_main)) {
        // Parse all mails
        while ($DATA = SQL_FETCHARRAY($result_main, 0, false)) {
                // Set mail order as 'active'. That means it will be sent out
        // Parse all mails
        while ($DATA = SQL_FETCHARRAY($result_main, 0, false)) {
                // Set mail order as 'active'. That means it will be sent out
index 6e7116e2c1c9bd23e6bbbe1ca64d830a60757e97..e19ca6dc5447fe07abf83cec8a60edf45d4e4963 100644 (file)
@@ -62,7 +62,7 @@ ORDER BY
 __FILE__, __LINE__);
 
 // Entries found?
 __FILE__, __LINE__);
 
 // Entries found?
-if (SQL_NUMROWS($result_main) > 0) {
+if (!SQL_HASZERONUMS($result_main)) {
        // Init SQLs
        initSqls();
 
        // Init SQLs
        initSqls();
 
index 5cfe43e12ef90754986eb019e6dd5edf7fb28708..16001ed8566ee68602f37c140d76cd35bbf6c660 100644 (file)
@@ -64,7 +64,7 @@ ORDER BY
        `userid` ASC", __FILE__, __LINE__);
 
        // Do we have some notifications to sent?
        `userid` ASC", __FILE__, __LINE__);
 
        // Do we have some notifications to sent?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                // We need to send-out notifications...
                while ($content = SQL_FETCHARRAY($result)) {
                        // Translate timestamp
                // We need to send-out notifications...
                while ($content = SQL_FETCHARRAY($result)) {
                        // Translate timestamp
index aea217a7fa08e9253dee6faa4c6086b48658f6af..59354c3b2ada5a1ddad7e4c818380884a07a80e4 100644 (file)
@@ -458,7 +458,7 @@ function loadEmailTemplate ($template, $content = array(), $userid = '0') {
 
        // Load user's data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
 
        // Load user's data
        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "UID={$userid},template={$template},content[]=".gettype($content));
-       if (($userid > 0) && (is_array($content))) {
+       if ((isValidUserId($userid)) && (is_array($content))) {
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
                // If nickname extension is installed, fetch nickname as well
                if ((isExtensionActive('nickname')) && (isNicknameUsed($userid))) {
                        //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "NICKNAME!<br />");
index 1abc3ca5de7261f0e0e92c04bd91e3cef6889cff..6af2c038bd453976b151379c6307dee53c0c22fc 100644 (file)
@@ -499,23 +499,14 @@ function isConfigLocalLoaded () {
 
 // Checks wether a nickname or userid was entered and caches the result
 function isNicknameUsed ($userid) {
 
 // Checks wether a nickname or userid was entered and caches the result
 function isNicknameUsed ($userid) {
-       // Default is false
-       $isUsed = false;
-
        // Is the cache there
        // Is the cache there
-       if (isset($GLOBALS['is_nickname_used'][$userid])) {
-               // Then use it
-               $isUsed = $GLOBALS['is_nickname_used'][$userid];
-       } else {
+       if (!isset($GLOBALS['is_nickname_used'][$userid])) {
                // Determine it
                // Determine it
-               $isUsed = (('' . round($userid) . '') != $userid);
-
-               // And write it to the cache
-               $GLOBALS['is_nickname_used'][$userid] = $isUsed;
-       }
+               $GLOBALS['is_nickname_used'][$userid] = (('' . round($userid) . '') != $userid);
+       } // END - if
 
        // Return the result
 
        // Return the result
-       return $isUsed;
+       return $GLOBALS['is_nickname_used'][$userid];
 }
 
 // Getter for 'what' value
 }
 
 // Getter for 'what' value
@@ -885,7 +876,7 @@ function getCurrentUserId () {
 
 // Checks if current userid is set
 function isCurrentUserIdSet () {
 
 // Checks if current userid is set
 function isCurrentUserIdSet () {
-       return ((isset($GLOBALS['current_userid'])) && ($GLOBALS['current_userid'] > 0));
+       return ((isset($GLOBALS['current_userid'])) && (isValidUserId($GLOBALS['current_userid'])));
 }
 
 // Checks wether we are debugging template cache
 }
 
 // Checks wether we are debugging template cache
@@ -908,7 +899,7 @@ function getFetchedUserData ($keyColumn, $userid, $valueColumn) {
                $data = '{--USERNAME_GUEST--}';
 
                // Can we fetch the user data?
                $data = '{--USERNAME_GUEST--}';
 
                // Can we fetch the user data?
-               if (($userid > 0) && (fetchUserData($userid, $keyColumn))) {
+               if ((isValidUserId($userid)) && (fetchUserData($userid, $keyColumn))) {
                        // Now get the data back
                        $data = getUserData($valueColumn);
                } // END - if
                        // Now get the data back
                        $data = getUserData($valueColumn);
                } // END - if
@@ -1535,5 +1526,29 @@ function getApInactiveSince () {
        return $GLOBALS['ap_inactive_since'];
 }
 
        return $GLOBALS['ap_inactive_since'];
 }
 
+// Checks wether proxy configuration is used
+function isProxyUsed () {
+       // Do we have cache?
+       if (!isset($GLOBALS['is_proxy_used'])) {
+               // Determine it
+               $GLOBALS['is_proxy_used'] = ((getExtensionVersion('sql_patches') >= '0.4.3') && (getConfig('proxy_host') != '') && (getConfig('proxy_port') > 0));
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['is_proxy_used'];
+}
+
+// Checks wether POST data contains selections
+function ifPostContainsSelections ($element = 'sel') {
+       // Do we have cache?
+       if (!isset($GLOBALS['post_contains_selections'][$element])) {
+               // Determine it
+               $GLOBALS['post_contains_selections'][$element] = (countPostSelection($element) > 0);
+       } // END - if
+
+       // Return cache
+       return $GLOBALS['post_contains_selections'][$element];
+}
+
 // [EOF]
 ?>
 // [EOF]
 ?>
index 72f107e4e8761ab7336707618d67fb8bf23a405b..d0c4dbf7d7483c0516780422793a2734eb05d4a9 100644 (file)
@@ -68,7 +68,7 @@ if (isGetRequestParameterSet('mailid'))  $url_mid    = bigintval(getRequestParam
 if (isGetRequestParameterSet('bonusid')) $url_bid    = bigintval(getRequestParameter('bonusid'));
 
 // 01           1        12            2    2            21    1                      2210
 if (isGetRequestParameterSet('bonusid')) $url_bid    = bigintval(getRequestParameter('bonusid'));
 
 // 01           1        12            2    2            21    1                      2210
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
        // Init result
        $result_link = false;
 
        // Init result
        $result_link = false;
 
index d516df02aed42d4701c4fa9f756139e5dae8960e..e267d77efa333e4d0887ae48eaa92f5ba62d07a0 100644 (file)
@@ -74,7 +74,7 @@ if (isGetRequestParameterSet('code'))    $code       = bigintval(getRequestParam
 if (isGetRequestParameterSet('mode'))    $mode       = getRequestParameter('mode');
 
 // 01           1        12            2    2            21    1                   22     10
 if (isGetRequestParameterSet('mode'))    $mode       = getRequestParameter('mode');
 
 // 01           1        12            2    2            21    1                   22     10
-if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
+if ((isValidUserId($url_userid)) && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDetected())) {
        // No image? Then output header
        if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
        // No image? Then output header
        if ($mode != 'img') loadIncludeOnce('inc/header.php');
 
@@ -285,7 +285,7 @@ if (($url_userid) > 0 && (($url_mid > 0) || ($url_bid > 0)) && (!ifFatalErrorsDe
 
                                                                                // Load template
                                                                                loadTemplate($template, false, $content);
 
                                                                                // Load template
                                                                                loadTemplate($template, false, $content);
-                                                                       } elseif ($sender > 0) {
+                                                                       } elseif (isValidUserId($sender)) {
                                                                                // Wrong image code! So add points to sender's account
                                                                                addPointsDirectly('mailid_payback', $sender, $payment);
 
                                                                                // Wrong image code! So add points to sender's account
                                                                                addPointsDirectly('mailid_payback', $sender, $payment);
 
diff --git a/ref.php b/ref.php
index 6fd272a009afc08193a1ee0f3e968911b1235d38..b4f6950180b91b8e9bac19ef71ada61c2690cc29 100644 (file)
--- a/ref.php
+++ b/ref.php
@@ -79,7 +79,7 @@ if (determineReferalId() != 0) {
        setSession('refid', determineReferalId());
 
        // Is the refid valid?
        setSession('refid', determineReferalId());
 
        // Is the refid valid?
-       if (determineReferalId() > 0) {
+       if (isValidUserId(determineReferalId())) {
                // Update ref counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(determineReferalId()), __FILE__, __LINE__);
                // Update ref counter
                SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
                        array(determineReferalId()), __FILE__, __LINE__);
index a6eb714ec53faae9e9585d5e49d6cb8d74ca0f49..cc1ad2af634a1e3c2977d1e0bd5ed8a0aba3e386 100644 (file)
@@ -59,7 +59,7 @@ redirectOnUninstalledExtension('bonus');
 // Include header
 loadIncludeOnce('inc/header.php');
 
 // Include header
 loadIncludeOnce('inc/header.php');
 
-if ((getRequestParameter('userid') > 0) && (getRequestParameter('d') > 0) && (isGetRequestParameterSet('t'))) {
+if ((isValidUserId(getRequestParameter('userid'))) && (getRequestParameter('d') > 0) && (isGetRequestParameterSet('t'))) {
        // Set row name
        $t = '';
        switch (getRequestParameter('t')) {
        // Set row name
        $t = '';
        switch (getRequestParameter('t')) {