);
// One day
-define('ONE_DAY', 60*60*24);
+$_CONFIG['one_day'] = 60*60*24;
//
// Timestamp for yesterday, today ... all at 00:00 am
-define('START_YDAY', MAKE_TIME(0, 0, 0, time() - ONE_DAY));
+define('START_YDAY', MAKE_TIME(0, 0, 0, time() - $_CONFIG['one_day']));
define('START_TDAY', MAKE_TIME(0, 0, 0, time()));
$COOKIES = substr(URL, strpos(substr(URL, 8), "/") + 8);
define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "390");
+define('CURR_SVN_REVISION', "391");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
}
//
function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) {
- global $cacheInstance;
+ global $cacheInstance, $_CONFIG;
$SQLs = array();
// By default no SQL has been executed
break;
case "0.4.0": // SQL queries for v0.4.0
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(ONE_DAY * 7)."'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."'";
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD bonus_lines BIGINT(20) UNSIGNED NOT NULL DEFAULT '10'";
// Update notes (these will be set as task text!)
last_change VARCHAR(10) NOT NULL DEFAULT '0',
status ENUM('UNCONFIRMED','PENDING','CONFIRMED','LOCKED') NOT NULL DEFAULT 'UNCONFIRMED',
receive_warnings ENUM('Y','N') NOT NULL DEFAULT 'Y',
-warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(ONE_DAY*7)."',
+warning_interval BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*7)."',
points_amount DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
points_used DOUBLE(20,5) UNSIGNED NOT NULL DEFAULT '0.00000',
refid BIGINT(20) UNSIGNED NOT NULL DEFAULT '0',
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_weekly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_monthly_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_stats_reload` BIGINT(20) UNSIGNED NOT NULL DEFAULT 30";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(ONE_DAY*7)."";
- $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(ONE_DAY*3)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_deleted` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*7)."";
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_purge_migrated` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".($_CONFIG['one_day']*3)."";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_mode` ENUM('INTERNAL','EXERNAL') NOT NULL DEFAULT 'INTERNAL'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_pause_url` VARCHAR(255) NOT NULL DEFAULT ''";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_warn_low_points` BIGINT(20) NOT NULL DEFAULT 100";
$SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'";
+ // Extend user data
+ $SQLs[] = "ALTER TABLE `"._MYSQL_PREFIX."_user_data` ADD `surfbar_low_notified` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00'";
+
// Member menus
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar',NULL,'Surfbar','Y','Y',4)";
$SQLs[] = "INSERT INTO `"._MYSQL_PREFIX."_member_menu` (`action`,`what`,`title`,`visible`,`locked`,`sort`) VALUES ('surfbar','surfbar_start','Surfbar starten','Y','Y',1)";
// Add config values
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(ONE_DAY*28)."'";
- $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".ONE_DAY."'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".($_CONFIG['one_day']*28)."'";
+ $SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".$_CONFIG['one_day']."'";
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT '100'";
$SQLs[] = "ALTER TABLE "._MYSQL_PREFIX."_config ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT '5'";
}
// Create selection box or array of splitted timestamp
function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="center", $return_array=false) {
+ global $_CONFIG;
+
// Calculate 2-seconds timestamp
$stamp = round($timestamp / 2) * 2;
$M2 = date("m", (time() + $stamp));
// 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") && ($M2 > "02")) $SWITCH = ONE_DAY;
+ if ((floor($TEST) == $TEST) && ($M1 == "02") && ($M2 > "02")) $SWITCH = $_CONFIG['one_day'];
// First of all years...
$Y = abs(floor($stamp / (31536000 + $SWITCH)));
// Next months...
$M = abs(floor($stamp / 2628000 - $Y * 12));
// Next weeks
- $W = abs(floor($stamp / 604800 - $Y * ((365 + $SWITCH / ONE_DAY) / 7) - ($M / 12 * (365 + $SWITCH / ONE_DAY) / 7)));
+ $W = abs(floor($stamp / 604800 - $Y * ((365 + $SWITCH / $_CONFIG['one_day']) / 7) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) / 7)));
// Next days...
- $D = abs(floor($stamp / 86400 - $Y * (365 + $SWITCH / ONE_DAY) - ($M / 12 * (365 + $SWITCH / ONE_DAY)) - $W * 7));
+ $D = abs(floor($stamp / 86400 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day'])) - $W * 7));
// Next hours...
- $h = abs(floor($stamp / 3600 - $Y * (365 + $SWITCH / ONE_DAY) * 24 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24) - $W * 7 * 24 - $D * 24));
+ $h = abs(floor($stamp / 3600 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24) - $W * 7 * 24 - $D * 24));
// Next minutes..
- $m = abs(floor($stamp / 60 - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 60 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
+ $m = abs(floor($stamp / 60 - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 60) - $W * 7 * 24 * 60 - $D * 24 * 60 - $h * 60));
// And at last seconds...
- $s = abs(floor($stamp - $Y * (365 + $SWITCH / ONE_DAY) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / ONE_DAY) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
+ $s = abs(floor($stamp - $Y * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600 - ($M / 12 * (365 + $SWITCH / $_CONFIG['one_day']) * 24 * 3600) - $W * 7 * 24 * 3600 - $D * 24 * 3600 - $h * 3600 - $m * 60));
// Is seconds zero and time is < 60 seconds?
if (($s == 0) && ($stamp < 60)) {
}
//
function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) {
+ global $_CONFIG;
$ret = 0;
// Do we have a leap year?
$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;
+ if ((floor($TEST) == $TEST) && ($M1 == "02") && ($POST[$prefix."_mo"] > "02")) $SWITCH = $_CONFIG['one_day'];
// First add years...
$ret += $POST[$prefix."_ye"] * (31536000 + $SWITCH);
// Next months...
define('MEMBER_ORDER_TEST_STARTED', "Framekiller-Test startet...");
define('MEMBER_ORDER_PLEASE_WAIT_1', "Ihre Seite wird auf Framekiller getestet. Bitte noch ");
define('MEMBER_ORDER_PLEASE_WAIT_2', " Sekunden warten.");
+define('ADMIN_LIST_NOREFS_ACCOUNTS', "Auflistung aller Accounts ohne Werber");
//
?>
define('MEMBER_SURFBAR_ACTION_DELETE_SUBMIT', "Löschen");
define('MEMBER_SURFBAR_ACTION_RESUBMIT_SUBMIT', "Nochmal anmelden");
define('MEMBER_SURFBAR_ACTION_BOOKNOW_SUBMIT', "Jetzt buchen");
+define('MEMBER_SURFBAR_ACTION_PAUSE_SUBMIT', "Anhalten");
+define('MEMBER_SURFBAR_ACTION_UNPAUSE_SUBMIT', "Fortfahren");
// Member actions - button titles
define('MEMBER_SURFBAR_ACTION_RETREAT_TITLE', "Nehmen Sie hiermit Ihre Buchung wieder zurück, falls Sie diese doch nicht bewerben wollten.");
define('MEMBER_SURFBAR_ACTION_DELETE_TITLE', "Löschen Sie URLs, die in unserem System nicht mehr beworben werden sollen. Ihre URL wird dann als zu Löschen markiert und wird dann von uns entgültig gelöscht. Dies gilt als Vorsichtsmaßnahme.");
define('MEMBER_SURFBAR_ACTION_RESUBMIT_TITLE', "Melden Sie Ihre URL erneut an, wenn Sie diese an unsere AGBs angepasst haben, wie z.B. Framekiller oder Hardcore/Erotik entfernt. Diese sind bei uns nicht gestattet.");
define('MEMBER_SURFBAR_ACTION_BOOKNOW_TITLE', "Die URL wurde aus einer Mailbuchung migriert. Hiermit können Sie die URL jetzt in der Surfbar buchen.");
+define('MEMBER_SURFBAR_ACTION_PAUSE_TITLE', "Halten Sie die URL in der Surfbar kurz an, wenn sie gerade nicht erreichbar ist. Dies geschieht nicht automatisch.");
+define('MEMBER_SURFBAR_ACTION_UNPAUSE_TITLE', "Lassen Sie die URL in der Surfbar weiterlaufen, wenn Sie dies möchten. Wir müssen die URL jedoch erneut freigeben.");
//
?>
{
global $DATA, $_CONFIG;
// Check for expired rallyes
- $EXPIRE = ONE_DAY * 3; // @TODO The hard-coded value...
+ $EXPIRE = $_CONFIG['one_day'] * 3; // @TODO The hard-coded value...
$result_rallye = SQL_QUERY_ESC("SELECT id, title, start_time, end_time
FROM "._MYSQL_PREFIX."_rallye_data
WHERE end_time <= (UNIX_TIMESTAMP() - %s) AND expired='Y'",
// Only confirmed members shall receive birthday mails...
$result_birthday = SQL_QUERY_ESC("SELECT userid, email, birth_year
FROM "._MYSQL_PREFIX."_user_data
-WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".(ONE_DAY * 364).")".$ADD."
+WHERE status='CONFIRMED' AND birth_day=%s AND birth_month=%s AND birthday_sent < (UNIX_TIMESTAMP() - ".($_CONFIG['one_day'] * 364).")".$ADD."
ORDER BY userid",
array($DAY, $MONTH, $VALUE), __FILE__, __LINE__);
require($INC);
}
-function OUTPUT_STANDARD_OVERVIEW(&$result_tasks)
-{
- global $cacheArray, $cacheArray;
+function OUTPUT_STANDARD_OVERVIEW(&$result_tasks) {
+ global $cacheArray, $_CONFIG;
// First check for solved and not assigned tasks and assign them to current admin
$result_task = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_task_system SET assigned_admin='%s' WHERE assigned_admin < 1 AND status != 'NEW'",
define('_START_YEAR' , ADD_SELECTION("year" , date('Y', time()), "start"));
// Calcualte ending date
-$D = date("d", time() + (ONE_DAY * 7));
-$M = date("m", time() + (ONE_DAY * 7));
-$Y = date('Y', time() + (ONE_DAY * 7));
+$D = date("d", time() + ($_CONFIG['one_day'] * 7));
+$M = date("m", time() + ($_CONFIG['one_day'] * 7));
+$Y = date('Y', time() + ($_CONFIG['one_day'] * 7));
// Ending day
define('_END_SEC' , ADD_SELECTION("sec" , "0" , "end"));
if (empty($_GET['page'])) { $_GET['page'] = "1"; }
// Set base URL
-$BASE = "<A href=\"".URL."/modules.php?module=admin";
+$BASE = "[<A href=\"".URL."/modules.php?module=admin";
-$whereStatement = " WHERE refid='0'";
-if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter'])))
-{
+$whereStatement = " WHERE refid=0";
+if (($_GET['letter'] != _ALL2) && ($_GET['letter'] != _OTHERS) && (!empty($_GET['letter']))) {
// List only persons w
- $whereStatement = " WHERE refid='0' AND family LIKE '".$_GET['letter']."%'";
+ $whereStatement = " WHERE refid=0 AND family LIKE '".$_GET['letter']."%'";
}
+
+// Fix sorter
if ($_GET['sortby'] == "family_name") $_GET['sortby'] = "family";
-$SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status".$MORE." FROM "._MYSQL_PREFIX."_user_data".$whereStatement." ORDER BY ".$_GET['sortby'];
+
+// Construct query
+$SQL = "SELECT userid, gender, surname, family, email, REMOTE_ADDR, refid, status, emails_sent, mails_confirmed, emails_received".$MORE."
+FROM "._MYSQL_PREFIX."_user_data
+".$whereStatement."
+ORDER BY ".SQL_ESCAPE($_GET['sortby']);
+
+// Start master query
$result_master = SQL_QUERY($SQL, __FILE__, __LINE__);
// Calculate page count (0.5 fixes a bug with page count)
if (SQL_NUMROWS($result_master) > 0)
{
- // Free memory
- SQL_FREERESULT($result_master);
-
// We have some (new?) registrations!
define('__COLSPAN1' , $colspan);
define('__COLSPAN2' , ($colspan + 2));
define('__USER_CNT' , $user_count);
define('__ALPHA_SORT', alpha($_GET['sortby'], $colspan, true));
define('__SORT_LINKS', SortLinks($_GET['letter'], $_GET['sortby'], $colspan, true));
- if ($PAGES > 1)
- {
+ define('__TITLE' , ADMIN_LIST_NOREFS_ACCOUNTS);
+
+ if ($PAGES > 1) {
+ // Add navigation
define('__PAGE_NAV', ADD_PAGENAV($PAGES, $_CONFIG['user_limit'], true, $colspan, true));
- }
- else
- {
+ } else {
// No page navigation is required
define('__PAGE_NAV', "");
}
// Column with nickname when nickname extension is present
- if (EXT_IS_ACTIVE("nickname"))
- {
+ if (EXT_IS_ACTIVE("nickname")) {
// Nickname extension found
define('__NICKNAME_TH', " <TD class=\"admin_title bottom2\" align=\"center\">".NICKNAME."</TD>");
- }
- else
- {
+ } else {
// Not found
define('__NICKNAME_TH', "");
}
$SW = 2; $OUT = "";
- while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $status, $nick) = SQL_FETCHROW($result))
- {
- if ($ref > 0) $ref = ADMIN_USER_PROFILE_LINK($ref);
- $LINKS = TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_links", "id", "userid", true));
- if ($LINKS > 0) $LINKS = $BASE."&what=list_links&u_id=".$uid."\">".$LINKS."</A>";
+ while (list($uid, $gender, $sname, $fname, $email, $IP, $ref, $status, $emails_sent, $mails_confirmed, $emails_received, $nick) = SQL_FETCHROW($result)) {
+ // Get unconfirmed emails
+ $LINKS = GET_TOTAL_DATA($uid, "user_links", "id", "userid", true);
+
+ // Set link to unconfirmed emails
+ if ($LINKS > 0) {
+ // Translate value
+ $LINKS = TRANSLATE_COMMA($LINKS);
+
+ // Add link
+ $LINKS = $BASE."&what=list_links&u_id=".$uid."\">".$LINKS."</A>]";
+ } // END - if
// Add nickname
if ((empty($nick)) || ($uid == $nick)) $nick = "---";
+ // Sent emails
+ $SENT = $emails_sent;
+ if ($emails_sent > 0) $SENT = $BASE."&what=email_details&u_id=".$uid."\">".TRANSLATE_COMMA($emails_sent)."</A>]";
+
+ // Calculate total points
+ $pointsTotal = GET_TOTAL_DATA($uid, "user_points", "points") - GET_TOTAL_DATA($uid, "user_data", "used_points");
+
+ // Clickrate
+ $clickRate = 0;
+ if ($emails_received > 0) {
+ $clickRate = $mails_confirmed / $emails_received * 100;
+ } // END - if
+
// Transfer data to array
$content = array(
'sw' => $SW,
'gender' => TRANSLATE_GENDER($gender),
'sname' => $sname,
'fname' => $fname,
- 'email' => "<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>",
+ 'email' => "[<A href=\"".CREATE_EMAIL_LINK($email, "user_data")."\">".$email."</A>]",
'addr' => $IP,
'ref' => $ref,
'status' => TRANSLATE_STATUS($status),
'links' => $LINKS,
- 'nick' => $nick
+ 'alinks' => MEMBER_ACTION_LINKS($uid, $status),
+ 'nick' => $nick,
+ 'points' => TRANSLATE_COMMA($pointsTotal),
+ 'sent' => $SENT,
+ 'rate' => TRANSLATE_COMMA($clickRate),
+ 'locked' => TRANSLATE_COMMA(GET_TOTAL_DATA($uid, "user_points", "locked_points"))
);
// Load row template and switch colors
$OUT .= LOAD_TEMPLATE("admin_list_user_row", true, $content);
$SW = 3 - $SW;
- }
+ } // END - while
// Free memory
SQL_FREERESULT($result);
// Free some memory
SQL_FREERESULT($result_master);
-}
- else
-{
+} else {
// No one as registered so far! :-(
LOAD_TEMPLATE("admin_settings_saved", false, ADMIN_ACCOUNT_NOREFS_404);
}
+// Free memory
+SQL_FREERESULT($result_master);
+
//
?>
define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
$expired = true;
}
- elseif (time() >= ($end - ONE_DAY))
+ elseif (time() >= ($end - $_CONFIG['one_day']))
{
// Rallye will expire in less one day!
- define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
+ define('__RALLYE_EXTRAS', RALLYE_EXPIRE_$_CONFIG['one_day']);
}
else
{
// Test both values
$TEST = $END - $START;
- if (($TEST < 0) || ($TEST > (ONE_DAY * $_CONFIG['holiday_max'])) || ($START < time()) || ($END < time()))
+ if (($TEST < 0) || ($TEST > ($_CONFIG['one_day'] * $_CONFIG['holiday_max'])) || ($START < time()) || ($END < time()))
{
// Time test failed
unset($_POST['ok']);
case 'N': // Display activation form
// Starting day
- define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + ONE_DAY)), "start"));
- define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + ONE_DAY)), "start"));
- define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + ONE_DAY)), "start"));
+ define('_START_DAY' , ADD_SELECTION("day" , date("d", (time() + $_CONFIG['one_day'])), "start"));
+ define('_START_MONTH', ADD_SELECTION("month", date("m", (time() + $_CONFIG['one_day'])), "start"));
+ define('_START_YEAR' , ADD_SELECTION("year" , date('Y', (time() + $_CONFIG['one_day'])), "start"));
// Calcualte ending date
- $D = date("d", time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
- $M = date("m", time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
- $Y = date('Y', time() + ONE_DAY + (ONE_DAY * $_CONFIG['holiday_max']));
+ $D = date("d", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+ $M = date("m", time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
+ $Y = date('Y', time() + $_CONFIG['one_day'] + ($_CONFIG['one_day'] * $_CONFIG['holiday_max']));
// Ending day
define('_END_DAY' , ADD_SELECTION("day" , $D, "end"));
if ((isset($_POST['ok'])) && ($status == "Y") && ($span == "0"))
{
// Save request
- $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_timespan='".(ONE_DAY * 30)."' WHERE userid=%s LIMIT 1",
+ $result = SQL_QUERY_ESC("UPDATE "._MYSQL_PREFIX."_user_data SET nl_timespan='".($_CONFIG['one_day'] * 30)."' WHERE userid=%s LIMIT 1",
array($GLOBALS['userid']), __FILE__, __LINE__);
// Load admin message
define('__RALLYE_EXTRAS', RALLYE_HAS_EXPIRED);
$expired = true;
}
- elseif (time() >= ($end - ONE_DAY))
+ elseif (time() >= ($end - $_CONFIG['one_day']))
{
// Rallye will expire in less one day!
- define('__RALLYE_EXTRAS', RALLYE_EXPIRE_ONE_DAY);
+ define('__RALLYE_EXTRAS', RALLYE_EXPIRE_$_CONFIG['one_day']);
}
else
{
// Is it a valid resource?
if ($db === true) {
+ // Remove MySQL array from namespace
+ unset($MySQL);
+
// Load configuration stuff
$_CONFIG = LOAD_CONFIG();