From 2cce06a4f4ff6bdbf0a14dcf7d2a89944b472c69 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Wed, 24 Sep 2008 23:05:23 +0000 Subject: [PATCH] - Surfbar further extended, currently broken! - List of user w/o refs fixed - Constant ONE_DAY rewritten to $_CONFIG['one_day'] - G. sei nicht sauer auf mich! :) --- inc/databases.php | 6 +- inc/extensions.php | 2 +- inc/extensions/ext-bonus.php | 2 +- inc/extensions/ext-sponsor.php | 2 +- inc/extensions/ext-surfbar.php | 7 +- inc/extensions/ext-transfer.php | 4 +- inc/functions.php | 17 +++-- inc/language/de.php | 1 + inc/language/surfbar_de.php | 4 ++ inc/libs/rallye_functions.php | 2 +- inc/mails/birthday_mails.php | 2 +- inc/modules/admin/overview-inc.php | 5 +- inc/modules/admin/what-add_rallye.php | 6 +- inc/modules/admin/what-list_norefs.php | 88 +++++++++++++++++--------- inc/modules/guest/what-rallyes.php | 4 +- inc/modules/member/what-holiday.php | 14 ++-- inc/modules/member/what-newsletter.php | 2 +- inc/modules/member/what-rallyes.php | 4 +- inc/mysql-connect.php | 3 + 19 files changed, 108 insertions(+), 67 deletions(-) diff --git a/inc/databases.php b/inc/databases.php index 118501b68b..d2fd859d8c 100644 --- a/inc/databases.php +++ b/inc/databases.php @@ -84,11 +84,11 @@ $REPLACER = array( ); // 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); @@ -113,7 +113,7 @@ define('USAGE_BASE', "usage"); 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); diff --git a/inc/extensions.php b/inc/extensions.php index 608efa6227..b480c0e5a4 100644 --- a/inc/extensions.php +++ b/inc/extensions.php @@ -239,7 +239,7 @@ function EXTENSION_REGISTER ($ext_name, $id, $dry_run=false) } // function EXTENSION_RUN_SQLS($id, $EXT_LOAD_MODE) { - global $cacheInstance; + global $cacheInstance, $_CONFIG; $SQLs = array(); // By default no SQL has been executed diff --git a/inc/extensions/ext-bonus.php b/inc/extensions/ext-bonus.php index 9787b3e02d..913982ff5b 100644 --- a/inc/extensions/ext-bonus.php +++ b/inc/extensions/ext-bonus.php @@ -262,7 +262,7 @@ KEY userid (userid) 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!) diff --git a/inc/extensions/ext-sponsor.php b/inc/extensions/ext-sponsor.php index 584b365a10..21401127dd 100644 --- a/inc/extensions/ext-sponsor.php +++ b/inc/extensions/ext-sponsor.php @@ -85,7 +85,7 @@ last_online VARCHAR(10) NOT NULL DEFAULT '0', 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', diff --git a/inc/extensions/ext-surfbar.php b/inc/extensions/ext-surfbar.php index dc43329f0c..80ff6e7e98 100644 --- a/inc/extensions/ext-surfbar.php +++ b/inc/extensions/ext-surfbar.php @@ -156,14 +156,17 @@ INDEX (`status`) $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)"; diff --git a/inc/extensions/ext-transfer.php b/inc/extensions/ext-transfer.php index 5bb8a5a029..7814a95528 100644 --- a/inc/extensions/ext-transfer.php +++ b/inc/extensions/ext-transfer.php @@ -92,8 +92,8 @@ PRIMARY KEY(id) // 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'"; diff --git a/inc/functions.php b/inc/functions.php index b99dff1497..3cdcf70695 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -1246,6 +1246,8 @@ function GENERATE_IMAGE($img_code, $header=true) { } // 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; @@ -1256,22 +1258,22 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen $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)) { @@ -1430,6 +1432,7 @@ function CREATE_TIME_SELECTIONS($timestamp, $prefix="", $display="", $align="cen } // function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) { + global $_CONFIG; $ret = 0; // Do we have a leap year? @@ -1437,7 +1440,7 @@ function CREATE_TIMESTAMP_FROM_SELECTIONS($prefix, $POST) { $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... diff --git a/inc/language/de.php b/inc/language/de.php index cba8018087..1a19fe529e 100644 --- a/inc/language/de.php +++ b/inc/language/de.php @@ -1167,6 +1167,7 @@ define('MEMBER_ORDER_PLEASE_WAIT_TESTER', "Bitte warten Sie den Framekiller-Test 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"); // ?> diff --git a/inc/language/surfbar_de.php b/inc/language/surfbar_de.php index 667278b82c..d76db8f08c 100644 --- a/inc/language/surfbar_de.php +++ b/inc/language/surfbar_de.php @@ -166,6 +166,8 @@ define('MEMBER_SURFBAR_ACTION_EDIT_SUBMIT', "Ändern"); 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."); @@ -174,6 +176,8 @@ define('MEMBER_SURFBAR_ACTION_EDIT_TITLE', "Ändern Sie hier Ihre URL, wenn 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."); // ?> diff --git a/inc/libs/rallye_functions.php b/inc/libs/rallye_functions.php index 10089fc559..50881d58eb 100644 --- a/inc/libs/rallye_functions.php +++ b/inc/libs/rallye_functions.php @@ -664,7 +664,7 @@ function RALLYE_DELETE_EXPIRED_RALLYES() { 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'", diff --git a/inc/mails/birthday_mails.php b/inc/mails/birthday_mails.php index 6758f0343d..1fa6a0c5a1 100644 --- a/inc/mails/birthday_mails.php +++ b/inc/mails/birthday_mails.php @@ -58,7 +58,7 @@ if (($_CONFIG['birthday_active']) && (EXT_IS_ACTIVE("autopurge")) && ($_CONFIG[' // 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__); diff --git a/inc/modules/admin/overview-inc.php b/inc/modules/admin/overview-inc.php index 101d3778de..23501fea99 100644 --- a/inc/modules/admin/overview-inc.php +++ b/inc/modules/admin/overview-inc.php @@ -37,9 +37,8 @@ if ((!defined('__SECURITY')) || (!IS_ADMIN())) { 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'", diff --git a/inc/modules/admin/what-add_rallye.php b/inc/modules/admin/what-add_rallye.php index b9cafd8947..1eb0f2f448 100644 --- a/inc/modules/admin/what-add_rallye.php +++ b/inc/modules/admin/what-add_rallye.php @@ -108,9 +108,9 @@ define('_START_MONTH', ADD_SELECTION("month", date("m", time()), "start")); 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")); diff --git a/inc/modules/admin/what-list_norefs.php b/inc/modules/admin/what-list_norefs.php index 83ea7425ce..94b8f903e6 100644 --- a/inc/modules/admin/what-list_norefs.php +++ b/inc/modules/admin/what-list_norefs.php @@ -52,16 +52,24 @@ if (empty($_GET['sortby'])) { $_GET['sortby'] = "userid"; } if (empty($_GET['page'])) { $_GET['page'] = "1"; } // Set base URL -$BASE = " 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', " ".NICKNAME.""); - } - 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.""; + 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."]"; + } // 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)."]"; + + // 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, @@ -128,18 +150,23 @@ if (SQL_NUMROWS($result_master) > 0) 'gender' => TRANSLATE_GENDER($gender), 'sname' => $sname, 'fname' => $fname, - 'email' => "".$email."", + 'email' => "[".$email."]", '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); @@ -151,12 +178,13 @@ if (SQL_NUMROWS($result_master) > 0) // 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); + // ?> diff --git a/inc/modules/guest/what-rallyes.php b/inc/modules/guest/what-rallyes.php index 336ff02cdc..6b07c6263c 100644 --- a/inc/modules/guest/what-rallyes.php +++ b/inc/modules/guest/what-rallyes.php @@ -66,10 +66,10 @@ if (SQL_NUMROWS($result) == 1) 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 { diff --git a/inc/modules/member/what-holiday.php b/inc/modules/member/what-holiday.php index 6ce5f0a02a..2d1d268568 100644 --- a/inc/modules/member/what-holiday.php +++ b/inc/modules/member/what-holiday.php @@ -96,7 +96,7 @@ if (isset($_POST['ok'])) // 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']); @@ -238,14 +238,14 @@ WHERE userid=%s LIMIT 1", array($GLOBALS['userid']), __FILE__, __LINE__); 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")); diff --git a/inc/modules/member/what-newsletter.php b/inc/modules/member/what-newsletter.php index e5eee490f9..04cb457a21 100644 --- a/inc/modules/member/what-newsletter.php +++ b/inc/modules/member/what-newsletter.php @@ -57,7 +57,7 @@ define('__CHARGE_VALUE', TRANSLATE_COMMA($_CONFIG['nl_charge'])); 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 diff --git a/inc/modules/member/what-rallyes.php b/inc/modules/member/what-rallyes.php index 83b1150c92..a015b4ab64 100644 --- a/inc/modules/member/what-rallyes.php +++ b/inc/modules/member/what-rallyes.php @@ -68,10 +68,10 @@ if (SQL_NUMROWS($result) == 1) 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 { diff --git a/inc/mysql-connect.php b/inc/mysql-connect.php index ccbc5ac41e..4020ecdc46 100644 --- a/inc/mysql-connect.php +++ b/inc/mysql-connect.php @@ -111,6 +111,9 @@ if ((!isBooleanConstantAndTrue('mxchange_installing')) && (isBooleanConstantAndT // Is it a valid resource? if ($db === true) { + // Remove MySQL array from namespace + unset($MySQL); + // Load configuration stuff $_CONFIG = LOAD_CONFIG(); -- 2.39.5