X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffilter%2Fearning_filter.php;h=0b4bcace8550aea32ecd71b43c7740ec4be5c1e2;hb=596c8ab32594401ca84abfbfe35513ddfff31bec;hp=3378375c5fd0cc65091cb4c1a848d5082769bef4;hpb=a13cee9b7e7f0e4b40969c8957af72cb46bdb3a3;p=mailer.git diff --git a/inc/filter/earning_filter.php b/inc/filter/earning_filter.php index 3378375c5f..0b4bcace85 100644 --- a/inc/filter/earning_filter.php +++ b/inc/filter/earning_filter.php @@ -16,8 +16,8 @@ * $Author:: $ * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * - * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 by Mailer Developer Team * + * For more information visit: http://mxchange.org * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * @@ -46,15 +46,19 @@ function FILTER_ADD_EARNING_GROUP_POPUP ($filterData) { // Check if the current userid is same as in $filterData if (getMemberId() != $filterData['userid']) { // Not the same - debug_report_bug(__FUNCTION__, __LINE__, 'Validation of userid failed. ' . getMemberId() . '!=' . $filterData['userid']); + reportBug(__FUNCTION__, __LINE__, 'Validation of userid failed. ' . getMemberId() . '!=' . $filterData['userid']); } // END - if // Now check if the user has subscription and amount left $result = SQL_QUERY_ESC("SELECT d.`earning_id`, - d.`earning_name`, + d.`earning_provider`, u.`earning_current_amount`, - u.`earning_daily_amount` + u.`earning_daily_amount`, + u.`earning_active`, + u.`earning_added`, + u.`earning_canceled`, + u.`earning_points` FROM `{?_MYSQL_PREFIX?}_user_earning` AS u INNER JOIN @@ -72,17 +76,21 @@ ORDER BY getMemberId() ), __FUNCTION__, __LINE__); - // Do we have entries left? - if (SQL_NUMROWS($result) > 0) { + // Are there entries left? + if (!SQL_HASZERONUMS($result)) { // Load all names while ($content = SQL_FETCHARRAY($result)) { // Merge the $filterData array in $content = merge_array($content, $filterData); // Construct callback function name - $callbackName = 'get' . capitalizeUnderscoreString($content['earning_name']) . 'DataByEarningArray'; + $callbackName = 'get' . capitalizeUnderscoreString($content['earning_provider']) . 'DataByEarningArray'; - // And call it + /* + * And call it, the called function should NOT write data in + * '__output'. This however is done here in this function. The + * called function shall ALWAYS put it's data in '__data'. + */ $content = call_user_func($callbackName, $content); } // END - if } // END - if