]> git.mxchange.org Git - mailer.git/blobdiff - inc/mysql-manager.php
More rewrites to make use of (cached) wrapper functions
[mailer.git] / inc / mysql-manager.php
index 322626c01f6f50e53158e9b7cbc0c1659acbff7e..283fd4b02dbfea93eb5e6c12d6491b882cdb0d75 100644 (file)
@@ -208,7 +208,7 @@ ORDER BY
                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)) {
@@ -237,7 +237,7 @@ ORDER BY
                                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';
 
@@ -601,7 +601,7 @@ function addMaxReceiveList ($mode, $default = '', $return = false) {
        }
 
        // Some entries are found?
-       if (SQL_NUMROWS($result) > 0) {
+       if (!SQL_HASZERONUMS($result)) {
                $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?
-                       if (($sendNotify === true) && (getUserData('refid') > 0) && ($locked === false)) {
+                       if (($sendNotify === true) && (isValidUserId(getUserData('refid'))) && ($locked === false)) {
                                // Prepare content
                                $content = array(
                                        'percents' => $per,
@@ -1104,7 +1104,7 @@ function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify
                        }
 
                        // 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);
@@ -1405,7 +1405,7 @@ function generateOptionList ($table, $id, $name, $default='', $special='', $wher
                        ), __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)) {
@@ -1620,7 +1620,7 @@ function generateCategoryOptionsList ($mode) {
                __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
@@ -1827,7 +1827,7 @@ ORDER BY
                ), __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
@@ -1879,7 +1879,7 @@ function reduceRecipientReceivedMails ($column, $id, $count) {
                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)) {