More fixes, missing js.php added
[mailer.git] / inc / modules / guest / what-mediadata.php
index c6bdf9c4e1f8a24e477fc06dc30132f09496b446..36a08cea700b88bbef4781045b01e321d86c08cd 100644 (file)
@@ -89,16 +89,10 @@ SQL_FREERESULT($result_rec);
 define('user_max_rec', $dummy);
 
 // Max mails per day
-$result_max = SQL_QUERY("SELECT SUM(max_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND max_mails > 0", __FILE__, __LINE__);
-list($dmy) = SQL_FETCHROW($result_max);
-SQL_FREERESULT($result_max);
-define('max', $dmy);
+define('max', GET_TOTAL_DATA("CONFIRMED", "user_data", "max_mails", "status", false, " AND `max_mails` > 0"));
 
 // Max mails for this day
-$result_rec = SQL_QUERY("SELECT SUM(receive_mails) FROM "._MYSQL_PREFIX."_user_data WHERE status='CONFIRMED' AND receive_mails > 0", __FILE__, __LINE__);
-list($dummy) = SQL_FETCHROW($result_rec);
-define('rec', $dummy);
-SQL_FREERESULT($result_rec);
+define('rec', GET_TOTAL_DATA("CONFIRMED", "user_data", "receive_mails", "status", false, " AND `receive_mails` > 0"));
 
 // Initial lots of variables
 $bmails = 0; $sent = 0; $max = 0; $rec = 0; $clicks = 0;
@@ -124,7 +118,7 @@ if (EXT_IS_ACTIVE("bonus")) {
        if (empty($dmy))  $dmy  = 0;
        if (empty($dmy2)) $dmy2 = 0;
        $sent += $dmy2; $clicks += $dmy;
-}
+} // END - if
 
 define('user_stats', ($nmails + $bmails));
 define('sent'      , $sent);