X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=blobdiff_plain;f=inc%2Fstats_bonus.php;h=b184358c7d266078da04a128c1843c6c9a8c0f5c;hp=db3f241983b8ad3053cd5d1ec64e5bb64a02a685;hb=f928ad2bed60fa256d0641eaf6d2c027a2944688;hpb=4001187f22197f55e5a1f211fc8defcc180f7c32 diff --git a/inc/stats_bonus.php b/inc/stats_bonus.php index db3f241983..b184358c7d 100644 --- a/inc/stats_bonus.php +++ b/inc/stats_bonus.php @@ -10,7 +10,12 @@ * -------------------------------------------------------------------- * * Kurzbeschreibung : Nach Mailbestaetigungen mit 100% Klickrate s. * * -------------------------------------------------------------------- * - * * + * $Revision:: $ * + * $Date:: $ * + * $Tag:: 0.2.1-FINAL $ * + * $Author:: $ * + * Needs to be in all Files and every File needs "svn propset * + * svn:keywords Date Revision" (autoprobset!) at least!!!!!! * * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2008 by Roland Haeder * * For more information visit: http://www.mxchange.org * @@ -33,35 +38,39 @@ // Some security stuff... if (!defined('__SECURITY')) { - $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), "/inc") + 4) . "/security.php"; + $INC = substr(dirname(__FILE__), 0, strpos(dirname(__FILE__), '/inc') + 4) . '/security.php'; require($INC); } // Check for 100% klickrate mails -$result_bonus = SQL_QUERY("SELECT id, userid, subject, timestamp_ordered, clicks, url -FROM `{!_MYSQL_PREFIX!}_user_stats` -WHERE max_rec=clicks AND clicks>0 AND bonus_stats_active='N' -ORDER BY userid", __FILE__, __LINE__); +$result_bonus = SQL_QUERY("SELECT + `id`, `userid`, `subject`, `timestamp_ordered`, `clicks`, `url` +FROM + `{!_MYSQL_PREFIX!}_user_stats` +WHERE + `max_rec`=`clicks` AND `clicks` > 0 AND `bonus_stats_active`='N' +ORDER BY + `userid` ASC", __FILE__, __LINE__); if (SQL_NUMROWS($result_bonus) > 0) { // Remember stats bonus in constant - define('__STATS_BONUS', TRANSLATE_COMMA(getConfig('bonus_stats'))); + define('__STATS_BONUS', translateComma(getConfig('bonus_stats'))); // We found some mail orders... while ($content = SQL_FETCHARRAY($result_bonus)) { // Add points - SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET bonus_stats=bonus_stats+%s WHERE userid=%s LIMIT 1", + SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_data` SET `bonus_stats`=`bonus_stats`+%s WHERE `userid`=%s LIMIT 1", array(getConfig('bonus_stats'), bigintval($content['userid'])), __FILE__, __LINE__); // Translate some data - $content['timestamp'] MAKE_DATETIME($content['timestamp_ordered'], "2"); + $content['timestamp'] = generateDateTime($content['timestamp_ordered'], '2'); // Load email template and send email - $msg = LOAD_EMAIL_TEMPLATE("member_stats_bonus", $content, bigintval($content['userid'])); - SEND_EMAIL($content['userid'], getMessage('BONUS_MEMBER_STATS_SUBJECT'), $msg); + $message = LOAD_EMAIL_TEMPLATE('member_stats_bonus', $content, bigintval($content['userid'])); + sendEmail($content['userid'], getMessage('BONUS_MEMBER_STATS_SUBJECT'), $message); // Update database - $result_update = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET bonus_stats_active='Y' WHERE id=%s LIMIT 1", + $result_update = SQL_QUERY_ESC("UPDATE `{!_MYSQL_PREFIX!}_user_stats` SET `bonus_stats_active`='Y' WHERE `id`=%s LIMIT 1", array(bigintval($content['id'])), __FILE__, __LINE__); } // END - while @@ -72,5 +81,5 @@ if (SQL_NUMROWS($result_bonus) > 0) { // Free memory SQL_FREERESULT($result_bonus); -// +// [EOF] ?>