X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Ffunctions.php;h=5c0d7da89b225f026349d799557127d31c281518;hb=6822d852b1eebf903029dc8218ade7778c0a331e;hp=d675eca81b5abe6dba65c639bbfbf7f4d6f1f816;hpb=75ad748a68473ace540251427a74fb781b1145e9;p=mailer.git diff --git a/inc/functions.php b/inc/functions.php index d675eca81b..5c0d7da89b 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -89,19 +89,19 @@ function OPEN_TABLE($PERCENT = "", $CLASS = "", $ALIGN="left", $VALIGN="", $td_o "; - OUTPUT_HTML ($OUT); + OUTPUT_HTML($OUT); } // Close a table (you may want to add some footer stuff here) function CLOSE_TABLE($ADD="") { - OUTPUT_HTML (" + OUTPUT_HTML(" "); - if (!empty($ADD)) OUTPUT_HTML ($ADD); - OUTPUT_HTML (""); + if (!empty($ADD)) OUTPUT_HTML($ADD); + OUTPUT_HTML(""); } // Output HTML code directly or "render" it. You addionally switch the new-line character off -function OUTPUT_HTML ($HTML, $NEW_LINE = true) { +function OUTPUT_HTML($HTML, $NEW_LINE = true) { // Some global variables global $OUTPUT, $FOOTER, $CSS; @@ -342,7 +342,7 @@ function LOAD_TEMPLATE($template, $return=false, $content="") else { // Output direct - OUTPUT_HTML ($ret); + OUTPUT_HTML($ret); } } elseif (DEBUG_MODE) @@ -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." \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); @@ -662,9 +662,9 @@ function SELECTION_COUNT($array) return $ret; } // -function IMG_CODE ($code, $TYPE, $DATA, $uid) +function IMG_CODE ($code, $type, $DATA, $uid) { - return "\"Code\""; + return "\"Code\""; } // function TRANSLATE_STATUS($status) @@ -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); @@ -1005,14 +1005,14 @@ function LOAD_URL($URL, $addUrlData=true) { $URL = htmlentities(strip_tags($URL), ENT_QUOTES); // Output new location link as anchor - OUTPUT_HTML ("".$URL."\n"); + OUTPUT_HTML("".$URL."\n"); } elseif (!headers_sent()) { // Load URL when headers are not sent @header ("Location: ".str_replace("&", "&", $URL)); } else { // Output error message include(PATH."inc/header.php"); - OUTPUT_HTML (LOAD_URL_ERROR_1.$URL.LOAD_URL_ERROR_2); + OUTPUT_HTML(LOAD_URL_ERROR_1.$URL.LOAD_URL_ERROR_2); include(PATH."inc/footer.php"); } exit(); @@ -1132,24 +1132,24 @@ function array_pk_sort(&$array, $a_sort, $primary_key = 0, $order = -1, $nums = $array = $dummy; } // -function ADD_SELECTION($TYPE, $DEFAULT, $PREFIX="", $id="0") +function ADD_SELECTION($type, $DEFAULT, $prefix="", $id="0") { global $MONTH_DESCR; $OUT = ""; - if ($TYPE == "yn") + if ($type == "yn") { // This is a yes/no selection only! - if ($id > 0) $PREFIX .= "[".$id."]"; - $OUT .= " \n"; } else { // Begin with regular selection box here - if (!empty($PREFIX)) $PREFIX .= "_"; - $TYPE2 = $TYPE; - if ($id > 0) $TYPE2 .= "[".$id."]"; - $OUT .= " \n"; } - switch ($TYPE) + switch ($type) { case "day": // Day for ($idx = 1; $idx < 32; $idx++) @@ -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 .= " \n"; - $YEAR = date("Y", time()) - 16; + $YEAR = date('Y', time()) - 16; for ($idx = 1930; $idx <= $YEAR; $idx++) { $OUT .= "