Rewrites for config in SQLs
authorRoland Häder <roland@mxchange.org>
Fri, 6 Nov 2009 19:24:17 +0000 (19:24 +0000)
committerRoland Häder <roland@mxchange.org>
Fri, 6 Nov 2009 19:24:17 +0000 (19:24 +0000)
inc/libs/rallye_functions.php
inc/modules/member/what-refback.php
inc/modules/member/what-transfer.php
inc/reset/reset_birthday.php
inc/reset/reset_surfbar.php

index 1630c50..a6c26ad 100644 (file)
@@ -244,9 +244,9 @@ WHERE
        d.`status`='CONFIRMED' AND
        p.ref_depth=1 AND
        d.max_mails > 0 AND
-       d.mails_confirmed >= %s
+       d.mails_confirmed >= {?ref_payout?}
 LIMIT 1",
-                       array(bigintval($content['userid']), getConfig('ref_payout')), __FUNCTION__, __LINE__);
+                       array(bigintval($content['userid'])), __FUNCTION__, __LINE__);
 
                // Get points
                list($refpoints) = SQL_FETCHROW($result_ref);
index e2fd487..ed81e51 100644 (file)
@@ -104,11 +104,15 @@ if ((isPostRequestElementSet('edit')) && (isPostRequestElementSet('id'))) {
 } // END - if
 
 // Load all referal levels
-$result = SQL_QUERY_ESC("SELECT r.level, r.percents
-FROM `{?_MYSQL_PREFIX?}_refdepths` AS r
-WHERE r.level > 0
-ORDER BY r.level ASC",
-array(getMemberId()), __FILE__, __LINE__);
+$result = SQL_QUERY_ESC("SELECT
+       r.level, r.percents
+FROM
+       `{?_MYSQL_PREFIX?}_refdepths` AS r
+WHERE
+       r.level > 0
+ORDER BY
+       r.level ASC",
+       array(getMemberId()), __FILE__, __LINE__);
 
 // Are there some entries? (Shall be!)
 if (SQL_NUMROWS($result) > 0) {
index 3cb992d..691733e 100644 (file)
@@ -375,8 +375,8 @@ KEY (`party_userid`)
 ) TYPE=HEAP", __FILE__, __LINE__);
 
                // Let's begin with the incoming list
-               $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT %s",
-                       array(getMemberId(), getConfig('transfer_max')), __FILE__, __LINE__);
+               $result = SQL_QUERY_ESC("SELECT `trans_id`, `from_userid`, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `id` ASC LIMIT {?transfer_max?}",
+                       array(getMemberId()), __FILE__, __LINE__);
                while ($DATA = SQL_FETCHROW($result)) {
                        $DATA[] = 'IN';
                        $DATA = implode("','", $DATA);
index d8d2185..d4f8eaa 100644 (file)
@@ -95,8 +95,11 @@ if (SQL_NUMROWS($result_birthday) > 0) {
                        } // END - for
 
                        // Insert row into database
-                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (userid, points, chk_value) VALUES ('%s','%s','%s' )",
-                               array(bigintval($content['userid']), getConfig('birthday_points'), $content['check']), __FILE__, __LINE__);
+                       SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_birthday` (`userid`, `points`, `chk_value`) VALUES (%s,{?birthday_points?},'%s' )",
+                               array(
+                                       bigintval($content['userid']),
+                                       $content['check']
+                               ), __FILE__, __LINE__);
 
                        // Load email template with confirmation link
                        $message = loadEmailTemplate('member_birthday_confirm', $content, bigintval($content['userid']));
index 7b063c9..920491b 100644 (file)
@@ -48,7 +48,7 @@ if ((getOutputMode() != 0) || (!isResetModeEnabled())) return;
 //* DEBUG: */ outputHtml(basename(__FILE__)."<br />");
 
 // Reset surfbar counter
-updateConfiguration(array("surfbar_daily_counter", "surfbar_yester_counter"), array(0, getConfig('surfbar_daily_counter')));
+updateConfiguration(array('surfbar_daily_counter', 'surfbar_yester_counter'), array(0, getConfig('surfbar_daily_counter')));
 setConfigEntry('surfbar_yester_counter', getConfig('surfbar_daily_counter'));
 setConfigEntry('surfbar_daily_counter' , 0);