./inc/functions.php:2255: // @TODO This is still very static, rewrite it somehow
./inc/gen_sql_patches.php:96:// @TODO Rewrite this to a filter
./inc/install-functions.php:59: // @TODO DEACTIVATED: changeDataInFile(getCachePath() . 'config-local.php', 'OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1117:// @TODO Rewrite these two constants
-./inc/language/de.php:1132:// @TODO Rewrite these three constants
+./inc/language/de.php:1116:// @TODO Rewrite these two constants
+./inc/language/de.php:1131:// @TODO Rewrite these three constants
./inc/language/de.php:300: // @TODO Following two are unused?
-./inc/language/de.php:811:// @TODO Are these constants longer used?
+./inc/language/de.php:810:// @TODO Are these constants longer used?
./inc/language-functions.php:234: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:46:// @TODO Rewrite all language constants to this function.
./inc/language/rallye_de.php:13: * @TODO Naming convention not applied for language strings *
./inc/libs/register_functions.php:292: // @TODO Rewrite these all to a single filter
./inc/libs/register_functions.php:362: // @TODO Rewrite this to a filter
./inc/libs/register_functions.php:369: // @TODO Wether the registration bonus should only be added to user directly or through referal system should be configurable
+./inc/libs/sponsor_functions.php:162: // @TODO Rewrite this to API function
+./inc/libs/sponsor_functions.php:433: // @TODO Rewrite this to API function
./inc/libs/surfbar_functions.php:1540: // @TODO This can be somehow rewritten
./inc/libs/surfbar_functions.php:712:// @TODO Can't we use our new expression language instead of this ugly code?
./inc/libs/surfbar_functions.php:953: // @TODO Invalid salt should be refused
./inc/libs/theme_functions.php:95: // @TODO Can't this be rewritten to an API function?
./inc/libs/user_functions.php:146: // @TODO These two constants are no longer used, maybe we reactivate this code?
./inc/libs/user_functions.php:234:// @TODO Double-check configuration entry here
-./inc/libs/user_functions.php:326: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
-./inc/libs/user_functions.php:346: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
-./inc/libs/user_functions.php:422: // @TODO We should try to rewrite this to fetchUserData() somehow
+./inc/libs/user_functions.php:327: // @TODO Make this filter working: $ADDON = runFilterChain('post_login_update', $content);
+./inc/libs/user_functions.php:347: // @TODO Make this filter working: $url = runFilterChain('do_login', array('content' => $content, 'addon' => $ADDON));
+./inc/libs/user_functions.php:423: // @TODO We should try to rewrite this to fetchUserData() somehow
./inc/libs/yoomedia_functions.php:116: $response = YOOMEDIA_QUERY_API('out_textmail.php', true); // @TODO Ask Yoo!Media for test script
./inc/load_config.php:77: // @TODO Rewrite them to avoid this else block
./inc/loader/load_cache-extension.php:13: * @TODO Rewrite this whole file to load_cache-extensions.php *
./inc/modules/admin/what-usr_online.php:51: // @TODO Add a filter for sponsor
./inc/modules/guest/what-beg.php:53:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
./inc/modules/guest/what-confirm.php:111: // @TODO Try to rewrite the following unset()
-./inc/modules/guest/what-login.php:114: // @TODO Move this HTML code into a template
+./inc/modules/guest/what-login.php:123: // @TODO Move this HTML code into a template
./inc/modules/guest/what-mediadata.php:183:// @TODO Rewrite all these if-blocks to filters
./inc/modules/guest/what-mediadata.php:70: // @TODO Find a better formular than this one
./inc/modules/guest/what-rallyes.php:91: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $adminId . '%}">' . $login . '</a>';
`network_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_type_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_reload_lock` SMALLINT(5) UNSIGNED NOT NULL DEFAULT 0,
-`network_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP(),
+`network_inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
UNIQUE `provider_type` (`network_id`,`network_type_id`),
PRIMARY KEY (`network_reload_id`)
) TYPE={?_TABLE_TYPE?} COMMENT='Reload locks'");
`url` VARCHAR(255) NOT NULL DEFAULT '',
`password` VARCHAR(255) NOT NULL DEFAULT '',
`remote_addr` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
-`sponsor_created` VARCHAR(10) NOT NULL DEFAULT 0,
-`last_online` VARCHAR(10) NOT NULL DEFAULT 0,
-`last_change` VARCHAR(10) NOT NULL DEFAULT 0,
+`sponsor_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`last_online` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`last_change` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`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 '".(getConfig('ONE_DAY')*7)."',
`payment_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`pay_count` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`pay_status` ENUM('PENDING','PAYED','UNPAYED','DELETED') NOT NULL DEFAULT 'PENDING',
-`pay_ordered` VARCHAR(10) NOT NULL DEFAULT 0,
-`pay_done` VARCHAR(10) NOT NULL DEFAULT 0,
+`pay_ordered` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`pay_done` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
INDEX (`payment_id`),
INDEX (`regid`),
INDEX (`admin_id`),
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
`is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
-`stamp_added` VARCHAR(10) NOT NULL DEFAULT 0,
+`stamp_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
INDEX (`ext_name`),
INDEX (`admin_id`),
PRIMARY KEY (`id`)
`sponsor_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`campaign_name` VARCHAR(255) NOT NULL DEFAULT '',
-`campaign_start` VARCHAR(10) NOT NULL DEFAULT 0,
-`campaign_end` VARCHAR(10) NOT NULL DEFAULT 0,
+`campaign_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`campaign_start` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
+`campaign_end` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`campaign_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`campaign_expired` ENUM('Y','N') NOT NULL DEFAULT 'N',
`campaign_locked` ENUM('Y','N') NOT NULL DEFAULT 'Y',
-`campaign_ended` VARCHAR(10) NOT NULL DEFAULT 0,
+`campaign_ended` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`locked_reason` TINYTEXT,
-`locked_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
+`locked_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
INDEX (`admin_id`),
INDEX (`sponsor_id`),
//
// Add default entries
//
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_registry` (`ext_name`, `is_active`, `admin_id`, `stamp_added`) VALUES ('sponsor','N',".getCurrentAdminId().",UNIX_TIMESTAMP())");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_registry` (`ext_name`, `is_active`, `admin_id`, `stamp_added`) VALUES ('sponsor','N',".getCurrentAdminId().",NOW())");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_action_convert` (`ext_name`, `conv_rate`, `conv_name`) VALUES ('sponsor','10','Mails')");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Standart-Paket', 5, 1000.00000, '€')");
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_sponsor_paytypes` (`pay_name`,`pay_min_count`,`pay_rate`,`pay_currency`) VALUES ('Spar-Paket', 1, 200.00000, '€')");
'LAST_MODULE' => "Ihr zuletzt ausgewähltes Modul",
'MEMBER_EDIT_PROFILE' => "Profildaten ändern",
'GENDER' => "Geschlecht",
- 'GUEST_GENDER' => "Geschlecht",
'GENDER_M' => "Herr",
'GENDER_F' => "Frau",
'GENDER_C' => ""Firma"",
$sql = "UPDATE `{?_MYSQL_PREFIX?}_sponsor_data` SET ";
foreach ($DATA['keys'] as $k => $v) {
$sql .= $v."='%s', ";
- }
+ } // END - foreach
// Remove last ", " from SQL string
$sql = substr($sql, 0, -2)." WHERE `id`=%s LIMIT 1";
$ret = 'updated';
} elseif (($ALREADY === false) || (($postData['force'] == 1) && (isAdmin()))) {
// Add new sponsor, first add more data
- $DATA['keys'][] = 'sponsor_created'; $DATA['values'][] = time();
$DATA['keys'][] = 'status';
if (($update === true) && (isAdmin()) && (getWhat() == 'add_sponsor')) {
// Only allowed for admin
// Generate hash code
$DATA['keys'][] = 'hash';
+ // @TODO Rewrite this to API function
$DATA['values'][] = md5(session_id().':'.$postData['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time());
$DATA['keys'][] = 'remote_addr';
$DATA['values'][] = detectRemoteAddr();
SQL_QUERY_ESC("UPDATE
`{?_MYSQL_PREFIX?}_sponsor_data`
SET
- `last_online`=UNIX_TIMESTAMP()
+ `last_online`=NOW()
WHERE
`id`=%s AND
`password`='%s'
$sql .= " `status`='EMAIL', `hash`='%s',";
// Generate hash code
- $HASH = md5(session_id().':'.$postData['email'].':'.detectRemoteAddr().':'.detectUserAgent().':'.time());
+ // @TODO Rewrite this to API function
+ $HASH = md5(session_id() . ':' . $postData['email'] . ':' . detectRemoteAddr() . ':' . detectUserAgent() . ':' . time());
$DATA[] = $HASH;
} // END - if
} // END - if
-
// Remove last commata
$sql = substr($sql, 0, -1);
+ // Add last_change
+ $sql .= ', `last_change`=NOW()';
+
// Add SQL tail data
$sql .= " WHERE `id`=%s AND `password`='%s' LIMIT 1";
$DATA[] = bigintval(getSession('sponsor_id'));
$content = SQL_FETCHARRAY($result);
// Prepare data for the template
- $content['gender'] = translateGender($content['gender']);
$content['reason'] = secureString(postRequestParameter('reason'));
// Prepare message and send it away
$result = SQL_QUERY_ESC("SELECT
`company`, `position`, `gender`, `surname`, `family`, `street_nr1`, `street_nr2`, `zip`, `city`, `country`,
`phone`, `fax`, `cell`, `email`, `url`, `tax_ident`,
- `status`, `sponsor_created`, `last_online`, `last_change`, `receive_warnings`,
+ `status`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+ UNIX_TIMESTAMP(`last_online`) AS `last_online`,
+ UNIX_TIMESTAMP(`last_change`) AS `last_change`,
+ `receive_warnings`,
`points_amount`, `points_used`, `remote_addr`, `warning_interval`, `refid`, `ref_count`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
// Sponsor found so let's list all his referals
$result = SQL_QUERY_ESC("SELECT
`id`, `gender`, `surname`, `family`, `email`, `status`,
- `sponsor_created`, `last_online`, `points_amount`, `points_used`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+ UNIX_TIMESTAMP(`last_online`) AS `last_online`,
+ `points_amount`, `points_used`,
`remote_addr`, `ref_count`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
// List all sponsors
$result_main = SQL_QUERY("SELECT
`id`, `gender`, `surname`, `family`, `email`, `status`,
- `sponsor_created`, `last_online`, `points_amount`, `points_used`, `remote_addr`
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+ UNIX_TIMESTAMP(`last_online`) AS `last_online`,
+ `points_amount`, `points_used`, `remote_addr`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
ORDER BY
// Load his personal data
$result_main = SQL_QUERY_ESC("SELECT
- `id`, `gender`, `surname`, `family`, `email`, `remote_addr`, `sponsor_created`, `points_amount`, `points_used`, `refid`
+ `id`, `gender`, `surname`, `family`, `email`, `remote_addr`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`,
+ `points_amount`, `points_used`, `refid`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
// Check for open payments and close them
$result = SQL_QUERY_ESC("SELECT
- so.admin_id, so.pay_count, so.pay_ordered, so.pay_status,
- sp.pay_name, sp.pay_rate, sp.pay_currency
+ so.admin_id, so.pay_count,
+ UNIX_TIMESTAMP(so.pay_ordered) AS `pay_ordered`,
+ so.pay_status, sp.pay_name, sp.pay_rate, sp.pay_currency
FROM
`{?_MYSQL_PREFIX?}_sponsor_orders` AS so
LEFT JOIN
// Begin listing of all pending sponsor accounts
$result = SQL_QUERY("SELECT
- `id`, `gender`, `surname`, `family`, `email`, `remote_addr`, `sponsor_created`
+ `id`, `gender`, `surname`, `family`, `email`, `remote_addr`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
if (isFormSent()) {
// Check email
- $result = SQL_QUERY_ESC("SELECT id, hash, status, remote_addr, gender, surname, family, sponsor_created
-FROM `{?_MYSQL_PREFIX?}_sponsor_data`
-WHERE email='%s' AND (`status`='UNCONFIRMED' OR `status`='EMAIL') LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT
+ `id`, `hash`, `status`, `remote_addr`, `gender`, `surname`, `family`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
+FROM
+ `{?_MYSQL_PREFIX?}_sponsor_data`
+WHERE
+ `email`='%s' AND
+ (`status`='UNCONFIRMED' OR `status`='EMAIL')
+LIMIT 1",
array(postRequestParameter('email')), __FILE__, __LINE__);
// Entry found?
if (isFormSent()) {
// Check email
$result = SQL_QUERY_ESC("SELECT
- `id`, `hash`, `remote_addr`, `gender`, `surname`, `family`, `sponsor_created`
+ `id`, `hash`, `remote_addr`, `gender`, `surname`, `family`,
+ UNIX_TIMESTAMP(`sponsor_created`) AS `sponsor_created`
FROM
`{?_MYSQL_PREFIX?}_sponsor_data`
WHERE
// Unconfirmed sponsor account found so let's load the requested data
$DATA = SQL_FETCHARRAY($result);
- // Translate some data
- $DATA['gender'] = translateGender($DATA['gender']);
- $DATA['sponsor_created'] = generateDateTime($DATA['sponsor_created']);
-
- // Generate password
+ // Generate password/translate some data
$DATA['password'] = generatePassword();
+ $DATA['sponsor_created'] = generateDateTime($DATA['sponsor_created']);
// Prepare email and send it to the sponsor
$message_sponsor = loadEmailTemplate('sponsor_lost', $DATA);
{--SPONSOR_ENTER_COMPANY_POSITION--}: $content[new_data][position] ($content[position])
{--SPONSOR_ENTER_TAX_IDENT--}: $content[new_data][tax_ident] ($content[tax_ident])
------------------------------
-{--GUEST_GENDER--}: {%pipe,translateGender=$content[new_data][gender]%} ({%pipe,translateGender=$content[gender]%})
+{--GENDER--}: {%pipe,translateGender=$content[new_data][gender]%} ({%pipe,translateGender=$content[gender]%})
{--SURNAME_FAMILY--}: $content[new_data][surname] $content[new_data][family] ({%sponsor,surname=$content[id]%} {%sponsor,family=$content[id]%})
{--SPONSOR_EMAIL_STREET_NR1--}: $content[new_data][street_nr1] ($content[street_nr1])
{--SPONSOR_EMAIL_STREET_NR2--}: $content[new_data][street_nr2] ($content[street_nr2])
{--SPONSOR_ENTER_COMPANY_POSITION--}: $content[new_data][position] ($content[position])
{--SPONSOR_ENTER_TAX_IDENT--}: $content[new_data][tax_ident] ($content[tax_ident])
------------------------------
-{--GUEST_GENDER--}: {%pipe,translateGender=$content[new_data][gender]%} ({%pipe,translateGender=$content[gender]%})
+{--GENDER--}: {%pipe,translateGender=$content[new_data][gender]%} ({%pipe,translateGender=$content[gender]%})
{--SURNAME_FAMILY--}: $content[new_data][surname] $content[new_data][family] ({%sponsor,surname=$content[id]%} {%sponsor,family=$content[id]%})
{--SPONSOR_EMAIL_STREET_NR1--}: $content[new_data][street_nr1] ($content[street_nr1])
{--SPONSOR_EMAIL_STREET_NR2--}: $content[new_data][street_nr2] ($content[street_nr2])
{--SPONSOR_ENTER_COMPANY_POSITION--}: $content[position]
{--SPONSOR_ENTER_TAX_IDENT--}: $content[tax_ident]
------------------------------
-{--GUEST_GENDER--}: {%sponsor,gender,translateGender=$content[id]%}
+{--GENDER--}: {%sponsor,gender,translateGender=$content[id]%}
{--SURNAME_FAMILY--}: {%sponsor,surname=$content[id]%} {%sponsor,family=$content[id]%}
{--SPONSOR_EMAIL_STREET_NR1--}: $content[street_nr1]
{--SPONSOR_EMAIL_STREET_NR2--}: $content[street_nr2]
{--SPONSOR_ENTER_COMPANY_POSITION--}: $content[position] ({%sponsor,position=$content[id]%})
{--SPONSOR_ENTER_TAX_IDENT--}: $content[tax_ident] ({%sponsor,tax_ident=$content[id]%})
------------------------------
-{--GUEST_GENDER--}: $content[gender] ({%sponsor,gender,translateGender=$content[id]%})
+{--GENDER--}: $content[gender] ({%sponsor,gender,translateGender=$content[id]%})
{--SURNAME_FAMILY--}: $content[surname] $content[family] ({%sponsor,surname=$content[id]%} {%sponsor,family=$content[id]%})
{--SPONSOR_EMAIL_STREET_NR1--}: $content[street_nr1] ({%sponsor,street_nr1=$content[id]%})
{--SPONSOR_EMAIL_STREET_NR2--}: $content[street_nr2] ({%sponsor,street_nr2=$content[id]%})
</tr>
<tr>
<td align="right">
- {--GUEST_GENDER--}:
+ {--GENDER--}:
</td>
<td>
<select name="gender" class="admin_select" size="1">
<option value="0">{--SELECT_NONE--}</option>
<option value="{%math,Day=1%}">1 {--DAYS--}</option>
<option value="{%math,Day=3%}">3 {--DAYS--}</option>
- <option value="{%math,Week=1)%}" selected="selected">1 {--LIFE_WEEKS--}</option>
- <option value="{%math,Week=2)%}">2 {--LIFE_WEEKS--}</option>
- <option value="{%math,Week=4)%}">4 {--LIFE_WEEKS--}</option>
- <option value="{%math,Week=8)%}">8 {--LIFE_WEEKS--}</option>
+ <option value="{%math,Week=1%}" selected="selected">1 {--LIFE_WEEKS--}</option>
+ <option value="{%math,Week=2%}">2 {--LIFE_WEEKS--}</option>
+ <option value="{%math,Week=4%}">4 {--LIFE_WEEKS--}</option>
+ <option value="{%math,Week=8%}">8 {--LIFE_WEEKS--}</option>
</select>
</td>
</tr>
</tr>
<tr>
<td width="295" align="right" height="21">
- {--GUEST_GENDER--}:
+ {--GENDER--}:
</td>
<td width="255">
<select name="gender" class="admin_select" size="1">
<table border="0" cellspacing="0" cellpadding="0" width="100%">
<tr>
<td class="register_left">
- {--GUEST_GENDER--}$content[must_fillout_gender]:
+ {--GENDER--}$content[must_fillout_gender]:
</td>
<td class="register_right"><select name="gender"
size="1" class="guest_select">
</tr>
<tr>
<td align="right">
- {--GUEST_GENDER--}:
+ {--GENDER--}:
</td>
<td>
<select name="gender" class="guest_select" size="1">
</tr>
<tr>
<td class="bottom right" align="right" height="27">
- {--GUEST_GENDER--}:
+ {--GENDER--}:
</td>
<td class="bottom">
<select name="gender" class="guest_select" size="1">