<TD";
if (!empty($ALIGN)) $OUT .=" align=\"".$ALIGN."\"";
$OUT .= " class=\"".$CLASS."\">";
- OUTPUT_HTML ($OUT);
+ OUTPUT_HTML($OUT);
}
// Close a table (you may want to add some footer stuff here)
function CLOSE_TABLE($ADD="")
{
- OUTPUT_HTML (" </TD>
+ OUTPUT_HTML(" </TD>
</TR>");
- if (!empty($ADD)) OUTPUT_HTML ($ADD);
- OUTPUT_HTML ("</TABLE>");
+ if (!empty($ADD)) OUTPUT_HTML($ADD);
+ OUTPUT_HTML("</TABLE>");
}
// 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;
else
{
// Output direct
- OUTPUT_HTML ($ret);
+ OUTPUT_HTML($ret);
}
}
elseif (DEBUG_MODE)
}
// 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))."\";";
}
// 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
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);
// 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);
return $ret;
}
//
-function IMG_CODE ($code, $TYPE, $DATA, $uid)
+function IMG_CODE ($code, $type, $DATA, $uid)
{
- return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&".$TYPE."=".$DATA."&mode=img&code=".$code."\">";
+ return "<IMG border=\"0\" alt=\"Code\" src=\"".URL."/mailid_top.php?uid=".$uid."&".$type."=".$DATA."&mode=img&code=".$code."\">";
}
//
function TRANSLATE_STATUS($status)
// 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');
else
{
// Neutral sex and email address is default
- $sex = "N";
+ $sex = 'N';
$email = WEBMASTER;
}
// 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);
$URL = htmlentities(strip_tags($URL), ENT_QUOTES);
// Output new location link as anchor
- OUTPUT_HTML ("<A href=\"".$URL."\">".$URL."</A>\n");
+ OUTPUT_HTML("<A href=\"".$URL."\">".$URL."</A>\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();
$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 .= " <SELECT name=\"".$PREFIX."\" class=\"register_select\" size=\"1\">\n";
+ if ($id > 0) $prefix .= "[".$id."]";
+ $OUT .= " <SELECT name=\"".$prefix."\" class=\"register_select\" size=\"1\">\n";
}
else
{
// Begin with regular selection box here
- if (!empty($PREFIX)) $PREFIX .= "_";
- $TYPE2 = $TYPE;
- if ($id > 0) $TYPE2 .= "[".$id."]";
- $OUT .= " <SELECT name=\"".strtolower($PREFIX.$TYPE2)."\" class=\"register_select\" size=\"1\">\n";
+ if (!empty($prefix)) $prefix .= "_";
+ $type2 = $type;
+ if ($id > 0) $type2 .= "[".$id."]";
+ $OUT .= " <SELECT name=\"".strtolower($prefix.$type2)."\" class=\"register_select\" size=\"1\">\n";
}
- switch ($TYPE)
+ switch ($type)
{
case "day": // Day
for ($idx = 1; $idx < 32; $idx++)
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))
{
// Get current year and subtract 16 (for erotic content)
$OUT .= " <OPTION value=\"1929\"><1930</OPTION>\n";
- $YEAR = date("Y", time()) - 16;
+ $YEAR = date('Y', time()) - 16;
for ($idx = 1930; $idx <= $YEAR; $idx++)
{
$OUT .= " <OPTION value=\"".$idx."\"";
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;
}
{
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;
$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)
$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";
}
}
$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";
$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;
//
function MXCHANGE_OPEN($script) {
+ // Compile the script name
+ $script = COMPILE_CODE($script);
+
+ // Use default SERVER_URL by default... ;) So?
+ $url = SERVER_URL;
+ if (substr($script, 0, 7) == "http://") {
+ // Use the hostname from script URL as new hostname
+ $url = substr($script, 7);
+ $extract = explode("/", $url);
+ $url = $extract[0];
+ // Done extracting the URL :)
+ }
+
// Extract host name
- $host = str_replace("http://", "", SERVER_URL);
+ $host = str_replace("http://", "", $url);
if (ereg("/", $host)) $host = substr($host, 0, strpos($host, "/"));
// Generate relative URL
- $script = substr(SERVER_URL, (strpos(SERVER_URL, $host) + strlen($host)))."/".basename($script);
+ $script = substr($script, (strlen($url) + 7));
if (substr($script, 0, 1) == "/") $script = substr($script, 1);
// Open connection