From 6c79a2ab7254e656340ee4504e652662babae7c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Fri, 6 Nov 2009 19:24:17 +0000 Subject: [PATCH] Rewrites for config in SQLs --- inc/libs/rallye_functions.php | 4 ++-- inc/modules/member/what-refback.php | 14 +++++++++----- inc/modules/member/what-transfer.php | 4 ++-- inc/reset/reset_birthday.php | 7 +++++-- inc/reset/reset_surfbar.php | 2 +- 5 files changed, 19 insertions(+), 12 deletions(-) diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 1630c50e22..a6c26adca2 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -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); diff --git a/inc/modules/member/what-refback.php b/inc/modules/member/what-refback.php index e2fd4870d9..ed81e5104d 100644 --- a/inc/modules/member/what-refback.php +++ b/inc/modules/member/what-refback.php @@ -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) { diff --git a/inc/modules/member/what-transfer.php b/inc/modules/member/what-transfer.php index 3cb992daf5..691733e5e7 100644 --- a/inc/modules/member/what-transfer.php +++ b/inc/modules/member/what-transfer.php @@ -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); diff --git a/inc/reset/reset_birthday.php b/inc/reset/reset_birthday.php index d8d2185b88..d4f8eaa8af 100644 --- a/inc/reset/reset_birthday.php +++ b/inc/reset/reset_birthday.php @@ -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'])); diff --git a/inc/reset/reset_surfbar.php b/inc/reset/reset_surfbar.php index 7b063c9538..920491b16a 100644 --- a/inc/reset/reset_surfbar.php +++ b/inc/reset/reset_surfbar.php @@ -48,7 +48,7 @@ if ((getOutputMode() != 0) || (!isResetModeEnabled())) return; //* DEBUG: */ outputHtml(basename(__FILE__)."
"); // 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); -- 2.39.5