login bonus will no longer be payed when turned off, "Y/N" rewritten to 'Y/N'
[mailer.git] / inc / functions.php
index 161c73c35ddfcfc3d13ea97a30b85670b6587434..3162da2b78ce3fb8133659a2c418789607758cb5 100644 (file)
@@ -353,7 +353,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="")
 }
 
 // Send mail out to an email address
-function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML="N", $FROM="")
+function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML='N', $FROM="")
 {
        // Compile subject line (for POINTS constant etc.)
        $eval = "\$SUBJECT = \"".COMPILE_CODE(addslashes($SUBJECT))."\";";
@@ -397,7 +397,7 @@ function SEND_EMAIL($TO, $SUBJECT, $MSG, $HTML="N", $FROM="")
        }
 
        // Fix HTML parameter (default is no!)
-       if (empty($HTML)) $HTML = "N";
+       if (empty($HTML)) $HTML = 'N';
        if (DEBUG_MODE)
        {
                // In debug mode we want to display the mail instead of sending it away so we can debug this part
@@ -408,7 +408,7 @@ Subject : ".$SUBJECT."
 Message : ".$MSG."
 </PRE>\n";
        }
-        elseif (($HTML == "Y") && (EXT_IS_ACTIVE("html_mail", true)))
+        elseif (($HTML == 'Y') && (EXT_IS_ACTIVE("html_mail", true)))
        {
                // Send mail as HTML away
                SEND_HTML_EMAIL($TO, $SUBJECT, $MSG, $FROM);
@@ -421,7 +421,7 @@ Message : ".$MSG."
                // Send Mail away
                SEND_RAW_EMAIL(stripslashes($TO), COMPILE_CODE($SUBJECT), stripslashes($MSG), $FROM);
        }
-        elseif ($HTML == "N")
+        elseif ($HTML == 'N')
        {
                // Problem found!
                SEND_RAW_EMAIL(WEBMASTER, COMPILE_CODE($SUBJECT), stripslashes($MSG), $FROM);
@@ -746,7 +746,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0")
 
        // Keept for backward-compatiblity (please replace these variables against our new {--CONST--} syntax!)
        $MAIN_TITLE = MAIN_TITLE; $URL = URL; $WEBMASTER = WEBMASTER;
-       $surname = ""; $family = ""; $nick = ""; $sex = "N";
+       $surname = ""; $family = ""; $nick = ""; $sex = 'N';
 
        // Prepare IP number and User Agent
        $REMOTE_ADDR = getenv('REMOTE_ADDR');
@@ -891,7 +891,7 @@ function LOAD_EMAIL_TEMPLATE($template, $content="", $UID="0")
         else
        {
                // Neutral sex and email address is default
-               $sex = "N";
+               $sex = 'N';
                $email = WEBMASTER;
        }
 
@@ -986,7 +986,7 @@ function MAKE_TIME($H, $M, $S, $stamp)
        // Extract day, month and year from given timestamp
        $DAY   = date("d", $stamp);
        $MONTH = date("m", $stamp);
-       $YEAR  = date("Y", $stamp);
+       $YEAR  = date('Y', $stamp);
 
        // Create timestamp for wished time which depends on extracted date
        return mktime($H, $M, $S, $MONTH, $DAY, $YEAR);
@@ -1171,7 +1171,7 @@ function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0")
 
        case "year": // Year
                // Get current year
-               $YEAR = date("Y", time());
+               $YEAR = date('Y', time());
 
                // Check if the default value is larger than minimum and bigger than actual year
                if (($DEFAULT > 1930) && ($DEFAULT >= $YEAR))
@@ -1195,7 +1195,7 @@ function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0")
                {
                        // Get current year and subtract 16 (for erotic content)
                        $OUT .= "      <OPTION value=\"1929\">&lt;1930</OPTION>\n";
-                       $YEAR = date("Y", time()) - 16;
+                       $YEAR = date('Y', time()) - 16;
                        for ($idx = 1930; $idx <= $YEAR; $idx++)
                        {
                                $OUT .= "      <OPTION value=\"".$idx."\"";
@@ -1228,10 +1228,10 @@ function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0")
 
        case "yn":
                $OUT .= "      <OPTION value=\"Y\"";
-               if ($DEFAULT == "Y") $OUT .= " selected=\"selected\"";
+               if ($DEFAULT == 'Y') $OUT .= " selected=\"selected\"";
                $OUT .= ">".YES."</OPTION>
       <OPTION value=\"N\"";
-               if ($DEFAULT == "N") $OUT .= " selected=\"selected\"";
+               if ($DEFAULT == 'N') $OUT .= " selected=\"selected\"";
                $OUT .= ">".NO."</OPTION>\n";
                break;
        }
@@ -1243,8 +1243,8 @@ function TRANSLATE_YESNO($yn)
 {
        switch ($yn)
        {
-               case "Y": $yn = YES; break;
-               case "N": $yn = NO; break;
+               case 'Y': $yn = YES; break;
+               case 'N': $yn = NO; break;
                default : $yn = "??? (".$yn.")"; break;
        }
        return $yn;
@@ -1372,7 +1372,7 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
        $timestamp = round($timestamp / 15) * 15;
        // Do we have a leap year?
        $SWITCH = 0;
-       $TEST = date("Y", time()) / 4;
+       $TEST = date('Y', time()) / 4;
        $M1 = date("m", time());
        $M2 = date("m", (time() + $timestamp));
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
@@ -1413,7 +1413,7 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
                $OUT  = "<DIV align=\"".$align."\">\n";
                $OUT .= "<TABLE border=\"0\" cellspacing=\"0\" cellpadding=\"0\" class=\"admin_table dashed\">\n";
                $OUT .= "<TR>\n";
-               if (ereg("Y", $display) || (empty($display)))
+               if (ereg('Y', $display) || (empty($display)))
                {
                        $OUT .= "  <TD align=\"center\" class=\"admin_title bottom\"><STRONG class=\"tiny\">"._YEARS."</STRONG></TD>\n";
                }
@@ -1443,7 +1443,7 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen
                }
                $OUT .= "</TR>\n";
                $OUT .= "<TR>\n";
-               if (ereg("Y", $display) || (empty($display)))
+               if (ereg('Y', $display) || (empty($display)))
                {
                        // Generate year selection
                        $OUT .= "  <TD align=\"center\"><SELECT class=\"mini_select\" name=\"".$prefix."_ye\" size=\"1\">\n";
@@ -1567,7 +1567,7 @@ function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
        $ret = "0";
        // Do we have a leap year?
        $SWITCH = 0;
-       $TEST = date("Y", time()) / 4;
+       $TEST = date('Y', time()) / 4;
        $M1   = date("m", time());
        // If so and if current time is before 02/29 and estimated time is after 02/29 then add 86400 seconds (one day)
        if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02"))  $SWITCH = ONE_DAY;