Reset rewritten, SQL fixed, zeros are now numeric
[mailer.git] / inc / modules / guest / what-mediadata.php
index 5d7439a7a59dbc978143df6dfab13bd9bade4e15..e73614e2f447011a5f8a294cb2b0f232f4f7c90e 100644 (file)
@@ -101,28 +101,28 @@ define('rec', $dummy);
 SQL_FREERESULT($result_rec);
 
 // Initial lots of variables
-$bmails = "0"; $sent = "0"; $max = "0"; $rec = "0"; $clicks = "0";
+$bmails = 0; $sent = 0; $max = 0; $rec = 0; $clicks = 0;
 
 // Mail orders (only current)
 $nmails = MEDIA_GET_ENTRY("normal_orders");
-if (empty($nmails)) $nmails = "0";
+if (empty($nmails)) $nmails = 0;
 
 // Mails sent so far
 $clicks = MEDIA_GET_ENTRY("normal_clicks");
 $sent   = MEDIA_GET_ENTRY("normal_send");
-if (empty($sent))   $sent   = "0";
-if (empty($clicks)) $clicks = "0";
+if (empty($sent))   $sent   = 0;
+if (empty($clicks)) $clicks = 0;
 
 // Bonus mails
 if (EXT_IS_ACTIVE("bonus")) {
        $bmails = MEDIA_GET_ENTRY("bonus_orders");
-       if (empty($bmails)) $bmails = "0";
+       if (empty($bmails)) $bmails = 0;
 
        // Count bonus mails clicks / sent mails
        $dmy  = MEDIA_GET_ENTRY("bonus_clicks");
        $dmy2 = MEDIA_GET_ENTRY("bonus_send");
-       if (empty($dmy))  $dmy  = "0";
-       if (empty($dmy2)) $dmy2 = "0";
+       if (empty($dmy))  $dmy  = 0;
+       if (empty($dmy2)) $dmy2 = 0;
        $sent += $dmy2; $clicks += $dmy;
 }
 
@@ -140,7 +140,7 @@ define('_clr', TRANSLATE_COMMA($clr)."%");
 $result = SQL_QUERY("SELECT points FROM "._MYSQL_PREFIX."_jackpot WHERE ok='ok' LIMIT 1", __FILE__, __LINE__);
 list($jackpot) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
-if (empty($jackpot)) $jackpot = "0";
+if (empty($jackpot)) $jackpot = 0;
 define('jackpot', TRANSLATE_COMMA($jackpot));
 
 // Total referral link clicks, total logins
@@ -152,9 +152,9 @@ SQL_FREERESULT($result);
 // Get total points
 $points = MEDIA_GET_ENTRY("total_points");
 
-if (empty($points)) $points = "0";
-if (empty($ref))    $ref    = "0";
-if (empty($logins)) $logins = "0";
+if (empty($points)) $points = 0;
+if (empty($ref))    $ref    = 0;
+if (empty($logins)) $logins = 0;
 
 define('__TOTAL_POINTS'   , TRANSLATE_COMMA($points));
 define('__TOTAL_REFCLICKS', $ref);
@@ -168,9 +168,9 @@ $result = SQL_QUERY("SELECT SUM(counter), SUM(clicks) FROM "._MYSQL_PREFIX."_ref
 list($views, $clicks) = SQL_FETCHROW($result);
 SQL_FREERESULT($result);
 
-if (empty($total))  $total  = "0";
-if (empty($views))  $views  = "0";
-if (empty($clicks)) $clicks = "0";
+if (empty($total))  $total  = 0;
+if (empty($views))  $views  = 0;
+if (empty($clicks)) $clicks = 0;
 
 define('__REF_TOTAL' , $total);
 define('__REF_VIEWS' , $views);
@@ -191,7 +191,7 @@ if (EXT_IS_ACTIVE("beg")) {
        $result = SQL_QUERY("SELECT SUM(beg_clicks) FROM "._MYSQL_PREFIX."_user_data WHERE beg_clicks>0", __FILE__, __LINE__);
        list($extra) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
-       if (empty($extra)) $extra = "0";
+       if (empty($extra)) $extra = 0;
        $content = array(
                'lang'  => MEDIA_BEG_CLICKS,
                'value' => $extra
@@ -209,10 +209,10 @@ if (EXT_IS_ACTIVE("doubler")) {
        list($count2, $points2) = SQL_FETCHROW($result);
        SQL_FREERESULT($result);
 
-       if (empty($count1))  $count1  = "0";
-       if (empty($count2))  $count2  = "0";
-       if (empty($points1)) $points1 = "0";
-       if (empty($points2)) $points2 = "0";
+       if (empty($count1))  $count1  = 0;
+       if (empty($count2))  $count2  = 0;
+       if (empty($points1)) $points1 = 0;
+       if (empty($points2)) $points2 = 0;
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_DOUBLER_HEADER);
@@ -251,7 +251,7 @@ ON h.userid=d.userid
 WHERE d.holiday_active='Y'",
  __FILE__, __LINE__);
        list($holiday) = SQL_FETCHROW($result);
-       if (empty($holiday)) $holiday = "0";
+       if (empty($holiday)) $holiday = 0;
        $content = array(
                'lang'  => MEDIA_HOLIDAY_COUNT,
                'value' => $holiday
@@ -268,8 +268,8 @@ LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_in, $points_in) = SQL_FETCHROW($result);
-       if (empty($count_in))  $count_in  = "0";
-       if (empty($points_in)) $points_in = "0";
+       if (empty($count_in))  $count_in  = 0;
+       if (empty($points_in)) $points_in = 0;
 
        $result = SQL_QUERY("SELECT DISTINCT COUNT(t.id), SUM(t.points)
 FROM "._MYSQL_PREFIX."_user_transfers_out AS t
@@ -277,8 +277,8 @@ LEFT JOIN "._MYSQL_PREFIX."_user_data AS d
 ON t.userid=d.userid",
  __FILE__, __LINE__);
        list($count_out, $points_out) = SQL_FETCHROW($result);
-       if (empty($count_out))  $count_out  = "0";
-       if (empty($points_out)) $points_out = "0";
+       if (empty($count_out))  $count_out  = 0;
+       if (empty($points_out)) $points_out = 0;
 
        // Add header
        $OUT_SPECIAL .= LOAD_TEMPLATE("mediadata_extra_hrow", true, MEDIA_TRANSFER_HEADER);