]> git.mxchange.org Git - mailer.git/blobdiff - inc/libs/doubler_functions.php
Huge rewrite of default parameters, ext-network continued:
[mailer.git] / inc / libs / doubler_functions.php
index 1efe4bf30cf5c3fc26b4409d391a437735d30e16..28ce65d9b8cfaa87725e12708a55869e927ce44a 100644 (file)
@@ -44,16 +44,16 @@ if (!defined('__SECURITY')) {
 // Generates a HTML table based on given data
 // @TODO Lame description
 function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = 'ASC') {
-       if (empty($cnt)) $cnt = 0;
-       $add = ''; $DT_MODE = 0;
+       if (empty($cnt)) $cnt = '0';
+       $add = ''; $DT_MODE = '0';
        if ($userid > 0) {
                // Load entries only from a single user
-               $add = " AND `userid`='".bigintval($userid)."'";
-               $mode = 'member'; $COLS = '4'; $DT_MODE = '2';
+               $add = sprintf(" AND `userid`=%s", bigintval($userid));
+               $mode = 'member'; $COLS = 4; $DT_MODE = 2;
                $message = getMessage('DOUBLER_MEMBER_NO_ENTRIES_FOUND');
        } else {
                // Guest mode!
-               $mode = 'guest'; $COLS = '3'; $DT_MODE = '3';
+               $mode = 'guest'; $COLS = 3; $DT_MODE = 3;
                $message = getMessage('DOUBLER_GUEST_NO_ENTRIES_FOUND');
        }
 
@@ -74,7 +74,7 @@ function generateDoublerTable ($userid = '0', $done = 'N', $ref = 'N', $sort = '
 FROM
        `{?_MYSQL_PREFIX?}_doubler`
 WHERE
-       `completed`='".$done."' AND is_ref`='".$ref."'".$add."
+       `completed`='".$done."' AND `is_ref`='".$ref."'".$add."
 ORDER BY
        `timemark` ".$sort."
 LIMIT ".$limit, __FUNCTION__, __LINE__);
@@ -122,7 +122,7 @@ LIMIT ".$limit, __FUNCTION__, __LINE__);
 //
 function DOUBLER_GET_TOTAL_POINTS_LEFT() {
        // Initialize variables
-       $points = 0;
+       $points = '0';
 
        if (getConfig('doubler_own') == 'Y') {
                // Take points from doubler's own account