inc/autopurge/purge-unconfirmed.php -text
inc/cache/.htaccess -text
inc/cache/_compiled/.htaccess -text
+inc/cache/_compiled/emails/.htaccess -text
inc/cache/_compiled/html/.htaccess -text
inc/classes/.htaccess -text
inc/classes/cachesystem.class.php -text
// @TODO Rewrite these if() blocks to a filter
$EXCLUDE_LIST = '';
if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid');
+ $EXCLUDE_LIST = ' AND d.`userid` != {?def_refid?}';
} // END - if
// Check for more extensions
- if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid')."";
- if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid')."";
- if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid')."";
+ if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.`userid` != {?beg_userid?}';
+ if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.`userid` != {?bonus_userid?}';
+ if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.`userid` != {?doubler_userid?}';
// Check for new holiday extension
if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
// Now let's have a look for inactive accounts we want to delete we newly use the same exclude list
// here for e.g. excluding holiday users
- $result_inactive = SQL_QUERY_ESC("SELECT d.userid, d.email, d.last_online
-FROM `{?_MYSQL_PREFIX?}_user_data` AS d
-WHERE `status`='CONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - %s) AND `last_online` < (UNIX_TIMESTAMP() - %s) AND `ap_notified` < (UNIX_TIMESTAMP() - %s)
+ $result_inactive = SQL_QUERY_ESC("SELECT
+ d.userid, d.email, d.last_online
+FROM
+ `{?_MYSQL_PREFIX?}_user_data` AS d
+WHERE
+ `status`='CONFIRMED' AND
+ `joined` < (UNIX_TIMESTAMP() - %s) AND
+ `last_online` < (UNIX_TIMESTAMP() - %s) AND
+ `ap_notified` < (UNIX_TIMESTAMP() - %s)
".$EXCLUDE_LIST."
-ORDER BY `userid` ASC",
+ORDER BY
+ `userid` ASC",
array(
getConfig('ap_inactive_since'),
getConfig('ap_inactive_since'),
--- /dev/null
+Deny from all
// Remove \t, \n and \r from queries they may confuse some MySQL version I have heard
$sqlString = str_replace("\t", ' ', str_replace("\n", ' ', str_replace("\r", ' ', $sqlString)));
- // Replace {PER}
- $sqlString = str_replace('{PER}', '%', $sqlString);
-
// Compile config entries out
- $sqlString = SQL_PREPARE_SQL_STRING($sqlString);
+ $GLOBALS['last_sql'] = SQL_PREPARE_SQL_STRING($sqlString);
// Starting time
$querytimeBefore = microtime(true);
// Run SQL command
- //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($sqlString) . '<br />');
- $result = mysql_query($sqlString, SQL_GET_LINK())
- or debug_report_bug(__FUNCTION__, __LINE__, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n".
-'Query string:' . $sqlString);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sqlString . ',numRows=' . SQL_NUMROWS($result) . ',affected=' . SQL_AFFECTEDROWS());
+ //* DEBUG: */ print('F=' . basename($F) . ',L=' . $L . 'sql=' . htmlentities($GLOBALS['last_sql']) . '<br />');
+ $result = mysql_query($GLOBALS['last_sql'], SQL_GET_LINK())
+ or debug_report_bug($F, $L, 'file='. $F . ',line=' . $L . ':mysql_error()=' . mysql_error() . "\n".
+'Query string:' . $GLOBALS['last_sql']);
+ /* DEBUG: */ logDebugMessage($F, $L, 'sql=' . $GLOBALS['last_sql'] . ',affected=' . SQL_AFFECTEDROWS());
// Calculate query time
$queryTime = microtime(true) - $querytimeBefore;
// Add this query to array including timing
- addSqlToDebug($result, $sqlString, $queryTime, $F, $L);
+ addSqlToDebug($result, $GLOBALS['last_sql'], $queryTime, $F, $L);
// Save last successfull query
- setConfigEntry('db_last_query', $sqlString);
+ setConfigEntry('db_last_query', $GLOBALS['last_sql']);
// Count all query times
incrementConfigEntry('sql_time', $queryTime);
fwrite($fp, 'Module=' . getModule() . "\n");
$GLOBALS['sql_first_entry'] = true;
} // END - if
- fwrite($fp, $F . '(LINE=' . $L . '|NUM=' . SQL_NUMROWS($result) . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $sqlString)) . "\n");
+ fwrite($fp, $F . '(LINE=' . $L . '|NUM=' . SQL_NUMROWS($result) . '|AFFECTED=' . SQL_AFFECTEDROWS() . '|QUERYTIME:' . $queryTime . '): ' . str_replace("\r", '', str_replace("\n", ' ', $GLOBALS['last_sql'])) . "\n");
fclose($fp);
} // END - if
$lines = mysql_num_rows($resource);
} else {
// No resource given, please fix this
- trigger_error('No resource given! result[]=' . gettype($resource));
+ debug_report_bug(__FUNCTION__, __LINE__, 'No resource given! result[]=' . gettype($resource) . ',last_sql=' . $GLOBALS['last_sql']);
}
// Return lines
function SQL_PREPARE_SQL_STRING ($sqlString) {
// Is it already cached?
if (!isset($GLOBALS['sql_strings'][$sqlString])) {
- // No, so compile and set it
- $GLOBALS['sql_strings'][$sqlString] = FILTER_COMPILE_EXPRESSION_CODE(compileSqlConfig($sqlString));
+ // Compile config+expression code
+ $sqlString2 = FILTER_COMPILE_EXPRESSION_CODE(FILTER_COMPILE_CONFIG($sqlString));
+
+ // Do final compilation
+ $GLOBALS['sql_strings'][$sqlString] = doFinalCompilation($sqlString2, false);
} // END - if
// Return it
// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
function doExpressionConfig ($data) {
// Default replacer is the config value itself
- $replacer = '{DQUOTE} . getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ') . {DQUOTE}';
-
- // Is there a call-back function provided?
- if (!empty($data['callback'])) {
- // Construct a new expression
- $replacer = '{%pipe,' . $data['callback'] . ',' . $configValue . '%}';
- } // END - if
+ $replacer = '{DQUOTE} . ' . $data['callback'] . '(getConfig(' . "'" . $data['matches'][4][$data['key']] . "'" . ')) . {DQUOTE}';
// Replace the config entry
$code = replaceExpressionCode($data, $replacer);
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='admins'");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`');
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_admins` DROP `default_acl`");
// Remove filters
// But allow current admin everything (THIS SHALL BE YOU!)
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_admins` SET `default_acl`='allow' WHERE `login`='".getSession('admin_login')."' LIMIT 1");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_acls`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_acls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case '0.4.0': // SQL queries for v0.4.0
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_admins_mails`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_admins_mails` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_accounts` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (account_locked),
INDEX (last_tan_stamp)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_transfers` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
to_account_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (to_account_id, from_account_id),
INDEX (day_bookkeeping, day_available)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_packages` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
title VARCHAR(255) NOT NULL DEFAULT '',
// what the member shall get for the specified income. output_system_mode
// must be extended with the mode you get for free: output_system_mode:LOGIN
// should be fine. More than one entry and not DISABLED ;) are not supported.
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bank_tanlist` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
idx TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_accounts`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_transfers`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_packages`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bank_tanlist`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='bank'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='bank'");
break;
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD beg_userid_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD beg_points FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00100");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD beg_clicks BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_beg_ips` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_beg' OR `what`='list_beg'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='beg'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='beg' OR `what`='beg2'");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_beg_ips`");
break;
case 'activate': // Do stuff when admin activates this extension
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP birthday_sent");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_birthday'");
break;
break;
case '0.2.0': // SQL queries for v0.2
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD birthday_points BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `birthday_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_birthday`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_birthday` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
// SQL commands to run
addAdminMenuSql('email','send_bonus','Bonusmail senden','Versenden Sie hier Bonus-Mails an alle Mitglieder oder nur an alle aus einer Kategorie. Es spielt keine Rolle, wie viele Mails bereits versendet worden, Sie können hier immer senden.', 5);
addMemberMenuSql('main','bonus','Bonuspunkte','N','Y',7);
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`cat_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('bonus','config_bonus','send_bonus','list_bonus','list_notifications')");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='bonus' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='bonus'");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`');
// Unregister filter
unregisterFilter('member_login_check', 'ADD_LOGIN_BONUS', true, getExtensionDryRun());
case '0.2.1': // SQL queries for v0.2.1
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_bonus` FLOAT(20,3) NOT NULL DEFAULT 10.000");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_bonus` FLOAT(20,3) NOT NULL DEFAULT 100.000");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY')."");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `login_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `turbo_rates` VARCHAR(255) NOT NULL DEFAULT '50;20;10'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `bonus_ranks` TINYINT(3) UNSIGNED NOT NULL DEFAULT 10");
// Use actual month for this update
break;
case '0.2.2': // SQL queries for v0.2.2
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_turbo`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_bonus_turbo` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case '0.2.5': // SQL queries for v0.2.5
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_urls`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_bonus_customer`');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Tabellen <u>{?_MYSQL_PREFIX?}_bonus_urls</u> und <u>{?_MYSQL_PREFIX?}_bonus_customer</u> entfernt, da dies bald von der Erweiterung <u>sponsor</u> erledigt wird.");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `booking_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 3)."");
// Drop/create table for user bookings
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_book`(
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
break;
case 'remove': // Do stuff when removing extension
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_book`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_booking','list_booking')");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_countries` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
code CHAR(2) NOT NULL DEFAULT 'DE',
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_countries` (code, descr, is_active) VALUES ('DE','Deutschland','Y')");
// Admin menu
- addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {?mt_word?} anmelden können.', 8);
+ addAdminMenuSql('country', NULL, 'Ländercodes verwalten','Stellen Sie hier Ländercodes ein, damit auch internationale Mitglieder sich zu Ihrem {OPEN_CONFIG}mt_word{CLOSE_CONFIG} anmelden können.', 8);
addAdminMenuSql('country','list_country','Verwalten','Hinzufügen, Ändern und Löschen von Ländercodes.', 1);
// Add entry to user table
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_countries`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='country'");
break;
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Table for debug log entries
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sender_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Debug log data'");
// Table against debug log abuse
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_log_abuse` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Debug log abuse'");
// Table on relay/server for client exchanges
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`key` VARCHAR(255) NOT NULL DEFAULT 'SELF',
addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_debug_client` (`url`,`title`,`webmaster`,`status`) VALUES ('{?URL?}','{?MAIN_TITLE?}','{?WEBMASTER?}','ACTIVE')");
// Table for debug log <-> client connection
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_debug_client_log` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 1,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client_log`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_client`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_debug_log_abuse`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='debug'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='debug'");
break;
default: // Unknown extension mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
// [EOF]
?>
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Doubler table
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_doubler` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_doubler`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='doubler'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='doubler'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='doubler'");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// Create database
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_holidays` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_holidays`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='holiday' LIMIT 1");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='holiday' LIMIT 4");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE value=0 LIMIT 1");
- addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (value, comment) VALUES (0,'Urlaub')");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_max_receive` WHERE `value`=0 LIMIT 1");
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_max_receive` (`value`, `comment`) VALUES (0,'Urlaub')");
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `imprint_image_script` VARCHAR(255) NOT NULL DEFAULT ''");
// Create imprint data table
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_imprint_data` (
`imprint_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`imprint_key` VARCHAR(255) NOT NULL DEFAULT '',
break;
case 'remove': // Do stuff when removing extension
+ // Imprint data
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`');
+
// Guest menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='imprint' LIMIT 1");
// Admin menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_imprint' LIMIT 1");
-
- // Imprint data
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_imprint_data`");
break;
case 'activate': // Do stuff when admin activates this extension
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addAdminMenuSql('stats','logs','Aufruflogbücher','Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)',8);
+ addAdminMenuSql('stats', 'logs', 'Aufruflogbücher', 'Verwalten Sie Ihre Aufruflogbücher mit diesem Admin-Bereich! (Derzeit nur Download!)', 8);
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `logs_base` VARCHAR(255) NOT NULL DEFAULT 'logs'");
break;
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_mediadata'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'");
case '0.0.4': // SQL queries for v0.0.4
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_mediadata`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_mediadata` (
`media_key` VARCHAR(255) NOT NULL DEFAULT '',
`media_value` VARCHAR(255) NOT NULL DEFAULT '',
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `nl_archive` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Admin menu
- addAdminMenuSql('newsletter', 'list_newsletter','Newsletter Verwalten','Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an und listen Sie bestehende auf. Die Grunddaten lassen sich hier ebenfalls ändern.', 1);
- addAdminMenuSql('newsletter', 'list_newsletter_topic','Thema verwalten','Legen Sie hier ein weiteres Thema an oder editieren bzw. löschen Sie bestehende.', 2);
- addAdminMenuSql('newsletter', 'list_newsletter_ordrs','Buchungen verwalten','Verwalten Sie hier die Buchungen im Newsletter von Ihren Sponsoren.', 3);
- addAdminMenuSql('newsletter', 'config_newsletter','Einstellungen','Einstellungen am Newsletter vornehmen.', 4);
+ addAdminMenuSql('newsletter', 'list_newsletter', 'Newsletter Verwalten', 'Legen Sie hier einen neuen Newsletter mit Betreff und Verfallsdatum an und listen Sie bestehende auf. Die Grunddaten lassen sich hier ebenfalls ändern.', 1);
+ addAdminMenuSql('newsletter', 'list_newsletter_topic', 'Thema verwalten', 'Legen Sie hier ein weiteres Thema an oder editieren bzw. löschen Sie bestehende.', 2);
+ addAdminMenuSql('newsletter', 'list_newsletter_ordrs', 'Buchungen verwalten', 'Verwalten Sie hier die Buchungen im Newsletter von Ihren Sponsoren.', 3);
+ addAdminMenuSql('newsletter', 'config_newsletter', 'Einstellungen', 'Einstellungen am Newsletter vornehmen.', 4);
// Remove member menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='newsletter' LIMIT 1");
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='nickname'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN ('config_nickname','list_nickname')");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
break;
case 'activate': // Do stuff when admin activates this extension
case '0.1.9': // SQL queries for v0.1.9
addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_nickname_history`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_nickname_history` (
-id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-nickname VARCHAR(255) NOT NULL DEFAULT '',
-added TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-last_used TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
-INDEX userid (userid),
-INDEX (last_used DESC),
-PRIMARY KEY (id)
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`nickname` VARCHAR(255) NOT NULL DEFAULT '',
+`added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`last_used` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
+INDEX `userid` (`userid`),
+INDEX (`last_used` DESC),
+PRIMARY KEY (`id`)
) TYPE={?_TABLE_TYPE?} COMMENT='History of used nicknames'");
// Update notes (these will be set as task text!)
default: // Unknown extension mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
-//
+// [EOF]
?>
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_online` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sid` VARCHAR(32) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_online`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='usr_online'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='online'");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_optimize_gain` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`gain` decimal(10,3) NOT NULL DEFAULT '0.000',
PRIMARY KEY (`id`)
) TYPE={?_TABLE_TYPE?}");
- addAdminMenuSql('misc','optimize','DB optimieren','Führen Sie dies ab und an aus, damit überflüssige Binärdaten aus der Datenbank entfernt werden.',5);
+ addAdminMenuSql('misc', 'optimize', 'DB optimieren', 'Führen Sie dies ab und an aus, damit überflüssige Binärdaten aus der Datenbank entfernt werden.', 5);
break;
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_optimize_gain`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='optimize' LIMIT 1");
break;
break;
case '0.5.0': // SQL queries for v0.5.0
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_url_blacklist`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_url_blacklist`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_url_blacklist` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url` VARCHAR(255) NOT NULL DEFAULT '',
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Inkonsistenz in Konfigurationsnamen korregiert.");
break;
- }
+ } // END - switch
break;
case 'modify': // When the extension got modified
case 'init': // Do stuff when extension is initialized
// Do daily reset only when installed and extension version is at least 0.1.1
+ // @TODO This should be moved out to inc/reset/
if ((isResetModeEnabled()) && (isInstalled()) && (isAdminRegistered()) && (isExtensionInstalledAndNewer('order', '0.1.1'))) {
// Reset mail order values
- $result_ext = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET mail_orders=0 WHERE mail_orders > 0", __FILE__, __LINE__);
+ $result_ext = SQL_QUERY("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `mail_orders`=0 WHERE `mail_orders` > 0", __FILE__, __LINE__);
} // END - if
break;
default: // Unknown extension mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
// [EOF]
?>
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_payouts` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
KEY (payout_id),
PRIMARY KEY (id)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_payout_types` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
type VARCHAR(255) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_payouts`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_payout_types`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='payouts'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='payout'");
break;
default: // Unknown extension mode
logDebugMessage(__FILE__, __LINE__, sprintf("Unknown extension mode %s in extension %s detected.", getExtensionMode(), getCurrentExtensionName()));
break;
-}
+} // END - switch
// [EOF]
?>
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_primera` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_primera`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='primera'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='primera'");
break;
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_rallye_data` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
admin_id BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// Drop tables
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_data`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_prices`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_rallye_users`');
// Remove menus
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='rallye'");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_refs` (
`id` BIGINT(20) UNSIGNED NOT NULL auto_increment,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_refs`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='refback'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_refback','list_refback')");
addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_refsystem` SET level=level-1");
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_register'");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
// Unregister a filter
unregisterFilter('register_must_fillout', 'REGISTER_MUST_FILLOUT', true, getExtensionDryRun());
break;
case 'update': // Update an extension
- switch (getCurrentExtensionVersion())
- {
+ switch (getCurrentExtensionVersion()) {
case '0.1.0': // SQL queries for v0.1
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_must_register`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_must_register` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
field_name VARCHAR(255) NOT NULL DEFAULT '',
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip'");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='config_removeip' LIMIT 1");
// Remove filters
unregisterFilter('post_youhere_line', 'ADD_ANONYMITY_NOTICE', true, getExtensionDryRun());
//
// Sponsor data
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`company` VARCHAR(255) NOT NULL DEFAULT '',
//
// Sponsor orders
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_orders` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Pay-types
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_paytypes` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`pay_name` VARCHAR(255) NOT NULL DEFAULT '',
//
// Points-to-action converting
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_action_convert` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`ext_name` VARCHAR(255) NOT NULL DEFAULT 'sponsor',
//
// Sponsor menu system (default)
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_menu` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`action` VARCHAR(255) NOT NULL DEFAULT '',
//
// Registry for performable actions by your sponsors
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_registry` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`admin_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// URLs from the sponsors
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_urls` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Banners of any size from the sponsors
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_banner` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Campaigns
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaigns` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Campaigns + URLs + Banner
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`campaignid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
//
// Allowed data to display (administrative)
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_admin_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`data_row` VARCHAR(255) NOT NULL DEFAULT '',
//
// Allowed data to display (sponsor-side)
//
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_sponsor_display_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`sponsorid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_data`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_orders`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_action_convert`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_paytypes`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_menu`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_registry`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_urls`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_banner`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaigns`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_campaign_assigns`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_admin_data`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_sponsor_display_data`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='sponsor' OR `what` IN('repr_sponsor','sponsor_medit','sponsor_madd')");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `action`='sponsor'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='sponsor'");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run (surfbar URLs)
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_urls` (
`url_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`url_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar URLs'");
// Reload locks
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_locks` (
`locks_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`locks_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar reload locks'");
// Surfbar salts
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_salts` (
`salts_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`salts_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar last used salts'");
// Statistics
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_stats` (
`stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`stats_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
) TYPE={?_TABLE_TYPE?} COMMENT='Surfbar Statistics'");
// Member actions pending on status
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_surfbar_actions` (
`actions_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`actions_status` ENUM('PENDING','ACTIVE','LOCKED','STOPPED','REJECTED','DELETED','MIGRATED','DEPLETED') NULL DEFAULT NULL,
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notify_limits` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notify_admin_unlock` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_warn_low_points` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".getConfig('ONE_DAY')."");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_low_interval` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_migrate_order` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_notification_mode` ENUM('INSTANT','RESET') NOT NULL DEFAULT 'INSTANT'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `surfbar_guest_login_form` ENUM('Y','N') NOT NULL DEFAULT 'Y'");
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_actions`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_locks`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_salts`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_stats`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_surfbar_urls`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `action`='surfbar'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='surfbar'");
break;
case 'remove': // Do stuff when removing extension
// Drop theme table
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`');
// Delete admin menu
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='theme'");
case '0.0.8': // SQL queries for v0.0.8
// Theme table
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_themes`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_themes` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`theme_path` VARCHAR(255) NOT NULL DEFAULT '',
) TYPE={?_TABLE_TYPE?} COMMENT='Themes'");
// Admin menu
- addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres {?mt_word2?}.', 8);
+ addAdminMenuSql('theme', NULL, 'Themes','Verwalten Sie hier alle Designs (Themes) Ihres {OPEN_CONFIG}mt_word2{CLOSE_CONFIG}.', 8);
addAdminMenuSql('theme','theme_import','Importieren','Es wird das Verzeichnis "theme" nach neuen Ordnern durchsucht und anschliessend in die Datenbank gesperrt aufgenommen.', 1);
addAdminMenuSql('theme','theme_edit','Modifizieren','Ändern Sie Titel, Freigaben usw. an den Themes. Sie können bis auf das Standart-Theme "default" auch Themes aus der Datenbank entfernen. Vorher sollten Sie es jedoch vom Server löschen, damit es niht erneut importiert werden kann.', 2);
addAdminMenuSql('theme','theme_check','Prüfen','Nach neuen Themes suchen bzw. nach Updates zu den Themes suchen.', 3);
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`');
// Transfer from a member
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_transfers_in` (
addMemberMenuSql('main','transfer','{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Transfer','N','Y', 5);
// Add config values
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_max BIGINT(20) UNSIGNED NOT NULL DEFAULT '50'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_age BIGINT(20) UNSIGNED NOT NULL DEFAULT '".(getConfig('ONE_DAY')*28)."'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_timeout BIGINT(20) UNSIGNED NOT NULL DEFAULT '".getConfig('ONE_DAY')."'");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_balance BIGINT(20) UNSIGNED NOT NULL DEFAULT 100");
- addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD transfer_code BIGINT(20) UNSIGNED NOT NULL DEFAULT 5");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_max` BIGINT(20) UNSIGNED NOT NULL DEFAULT 50");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_age` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY')*28));
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_timeout` BIGINT(20) UNSIGNED NOT NULL DEFAULT {?ONE_DAY?}");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_balance` BIGINT(20) UNSIGNED NOT NULL DEFAULT 100");
+ addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `transfer_code` BIGINT(20) UNSIGNED NOT NULL DEFAULT 5");
// Add row(s) to user's data
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD opt_in ENUM('Y','N') NOT NULL DEFAULT 'N'");
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_in`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_transfers_out`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='transfer'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='transfer'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` DROP `opt_in`");
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_cats` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`cat_id`)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_data` (
`userid` BIGINT(22) NOT NULL AUTO_INCREMENT,
`surname` VARCHAR(255) NOT NULL DEFAULT '',
INDEX `status_mails` (`status`,`max_mails`)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_points` (
`id` BIGINT(22) NOT NULL AUTO_INCREMENT,
`userid` BIGINT(22) NOT NULL DEFAULT 0,
INDEX (`userid`)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_links` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`stats_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`stats_id`)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
INDEX (`pool_id`)
) TYPE={?_TABLE_TYPE?}");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_stats_data` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`');
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_cats`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_data`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_points`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_links`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats`");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_stats_data`");
break;
case 'activate': // Do stuff when admin activates this extension
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_reason` TINYTEXT");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `lock_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00'");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_config` ADD `user_delete_purge` BIGINT(20) UNSIGNED NOT NULL DEFAULT ".(getConfig('ONE_DAY') * 30)."");
- addAdminMenuSql('user','list_user_del','Löschungen auflisten','Listet die Löschungen von Usern auf.', 9);
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`");
+ addAdminMenuSql('user', 'list_user_del', 'Löschungen auflisten', 'Listet die Löschungen von Usern auf.', 9);
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_del`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_del` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_user_wernis` (
id BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
userid BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'remove': // Do stuff when removing extension
// SQL commands to run
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_user_wernis`');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='wernis'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='wernis'");
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='wernis_portal'");
addAdminMenuSql('email','list_yoomedia_tm','Yoo!Media Textmails','Listet Textmail-Buchungen über das Interface 2.0 von Yoo!Media nach Ihren eingestellten Kriterien auf. <strong>Vorsicht:</strong> Jede Aktualisierung dieser Liste kostet Ihnen eine Abfrage!',10);
// Reload lock table
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`');
addExtensionSql("CREATE TABLE `{?_MYSQL_PREFIX?}_yoomedia_reload` (
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`type` VARCHAR(255) NOT NULL DEFAULT 'general',
case 'remove': // Do stuff when removing extension
// SQL commands to run
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_yoomedia','list_yoomedia_tm')");
- addExtensionSql("DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`");
+ addExtensionSql('DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_yoomedia_reload`');
break;
case 'activate': // Do stuff when admin activates this extension
if ($compiled === true) {
// Run the code
$eval = "\$GLOBALS['compiled_config'][\$uncompiled] = \"" . $GLOBALS['compiled_config'][$uncompiled] . "\";";
- /* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:<pre>' . str_replace('$', '$', htmlentities($eval)) . '</pre>');
+ //* DEBUG: */ print(__FUNCTION__.'['.__LINE__.']:<pre>' . str_replace('$', '$', htmlentities($eval)) . '</pre>');
eval($eval);
} // END - if
$cnt = 0;
// Compile all out
- while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{!') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
+ while (((strpos($code, '{--') !== false) || (strpos($code, '{DQUOTE}') !== false) || (strpos($code, '{?') !== false) || (strpos($code, '{%') !== false)) && ($cnt < 3)) {
// Init common variables
$content = array();
$newContent = '';
// Do we have to compile the code?
$ret = '';
- if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{!') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
+ if ((strpos($GLOBALS['tpl_content'], '$') !== false) || (strpos($GLOBALS['tpl_content'], '{--') !== false) || (strpos($GLOBALS['tpl_content'], '{?') !== false) || (strpos($GLOBALS['tpl_content'], '{%') !== false)) {
// Normal HTML output?
if (getOutputMode() == '0') {
// Add surrounding HTML comments to help finding bugs faster
}
// Why did we end up here? This should not happen
- debug_report_bug('Ending up: template=' . $template);
+ debug_report_bug(__FUNCTION__, __LINE__, 'Ending up: template=' . $template);
}
// Check to use wether legacy mail() command or PHPMailer class
case 'N': $content[$prefix . 'visible_css'] = $prefix . 'menu_invisible'; break;
default:
// Please report this
- debug_report_bug('Unsupported visible value detected. content=<pre>'.print_r($content, true).'</pre>');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported visible value detected. content=<pre>'.print_r($content, true).'</pre>');
break;
} // END - switch
case 'N': $content[$prefix . 'locked_css'] = $prefix . 'menu_unlocked'; break;
default:
// Please report this
- debug_report_bug('Unsupported locked value detected. content=<pre>'.print_r($content, true).'</pre>');
+ debug_report_bug(__FUNCTION__, __LINE__, 'Unsupported locked value detected. content=<pre>'.print_r($content, true).'</pre>');
break;
} // END - switch
}
// Compiles the code (use compileCode() only for HTML because of the comments)
-// @TODO $simple is deprecated
+// @TODO $simple/$constants are deprecated
function compileRawCode ($code, $simple = false, $constants = true, $full = true) {
// Is the code a string?
if (!is_string($code)) {
// Compile more through a filter
$code = runFilterChain('compile_code', $code);
- // Compile constants
- if ($constants === true) {
- // BEFORE 0.2.1 : Language and data constants
- // WITH 0.2.1+ : Only language constants
- $code = str_replace('{--', "{DQUOTE} . getMessage('", str_replace('--}', "') . {DQUOTE}", $code));
-
- // BEFORE 0.2.1 : Not used
- // WITH 0.2.1+ : Data constants
- $code = str_replace('{!', "{DQUOTE} . constant('", str_replace('!}', "') . {DQUOTE}", $code));
- } // END - if
+ // Compile message strings
+ $code = str_replace('{--', '{%message,', str_replace('--}', '%}', $code));
// Compile QUOT and other non-HTML codes
foreach ($secChars['to'] as $k => $to) {
$GLOBALS['cache_instance'] = new CacheSystem();
if ($GLOBALS['cache_instance']->getStatus() != 'done') {
// Failed to initialize cache sustem
- addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): ' . getMessage('CACHE_CANNOT_INITIALIZE'));
+ addFatalMessage(__FUNCTION__, __LINE__, '(<font color="#0000aa">' . __LINE__ . '</font>): {--CACHE_CANNOT_INITIALIZE--}');
} // END - if
}
$since = getConfig('ap_inactive_since');
$EXCLUDE_LIST = '';
if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
+ $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}';
} // END - if
// Check for more extensions
// @TODO These can be rewritten to filter
- if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid')."";
- if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid')."";
- if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid')."";
+ if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
+ if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
+ if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
if (isExtensionInstalledAndNewer('holiday', '0.1.3')) {
// Recent ext-holiday found
$EXCLUDE_LIST .= " AND d.`holiday_active`='N'";
// Is the extension version fine?
if (isExtensionInstalledAndNewer('user', '0.3.4')) {
// Get all user ids
- $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= ".getConfig('user_min_confirmed')."");
+ $totalUsers = countSumTotalData('CONFIRMED', 'user_data', 'userid', 'status', true, " AND `rand_confirmed` >= {?user_min_confirmed?}");
// Do we have at least one?
if ($totalUsers > 0) {
// Okay lets notify all users!
while ($content = SQL_FETCHARRAY($result_main)) {
// Update account
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
SET
`bonus_ral_notify`=UNIX_TIMESTAMP(),
`bonus_ral_%s_notify`=UNIX_TIMESTAMP()
$content['member_selection'] = addMemberSelectionBox(getConfig('bonus_userid'), false, true, true, 'bonus_userid');
// Initialize array for the points list
- //die("*".getConfig('turbo_rates')."*");
$RANKS = explode(';', getConfig('turbo_rates'));
// Automatically calculate bonus points for ranks 2 and 3 when not set
addMenuDescription('admin', __FILE__);
// Exclude default referal id if set
+// @TODO Rewrite those lines to filter
$EXCLUDE_LIST = '';
if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = " AND d.userid != ".getConfig('def_refid')."";
+ $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}';
} // END - if
// Check for more extensions
-// @TODO Rewrite those lines to filter
-if (isExtensionActive('beg')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('beg_userid')."";
-if (isExtensionActive('bonus')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('bonus_userid')."";
-if (isExtensionActive('doubler')) $EXCLUDE_LIST .= " AND d.userid != ".getConfig('doubler_userid')."";
+if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
+if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
+if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
if (isExtensionInstalledAndNewer('holiday', '0.1.3')) $EXCLUDE_LIST .= " AND d.holiday_active='N'";
// Check for all accounts
// Check for bonus extension version >= 0.4.4 for the order bonus
if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) {
// Add points directly
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+".getConfig('bonus_order')." WHERE `userid`=%s LIMIT 1",
+ SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_order`=`bonus_order`+{?bonus_order?} WHERE `userid`=%s LIMIT 1",
array(bigintval($content['sender'])), __FILE__, __LINE__);
// Subtract bonus points from system
$userid = '0';
// Search for an unconfirmed or confirmed account
- $result = SQL_QUERY_ESC("SELECT `userid`, `email`, `refid`,`gender` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `userid`, `email`, `refid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `user_hash`='%s' AND (`status`='UNCONFIRMED' OR `status`='CONFIRMED') LIMIT 1",
array(getRequestParameter('hash')), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Ok, he want's to confirm now so we load some data
- list($userid, $email, $rid, $gender) = SQL_FETCHROW($result);
+ list($userid, $email, $refid) = SQL_FETCHROW($result);
// Fetch user data
if (!fetchUserData($userid)) {
// Load all data and add points
$content = getUserDataArray();
- $content['gender'] = translateGender($content['gender']);
- $content['points'] = getConfig('points_register');
// Unlock his account (but only when it is on UNCONFIRMED!)
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `status`='CONFIRMED', ref_payout={?ref_payout?}, `user_hash`=NULL WHERE `user_hash`='%s' AND `status`='UNCONFIRMED' LIMIT 1",
+ SQL_QUERY_ESC("UPDATE
+ `{?_MYSQL_PREFIX?}_user_data`
+SET
+ `status`='CONFIRMED',
+ `ref_payout`={?ref_payout?},
+ `user_hash`=NULL
+WHERE
+ `user_hash`='%s' AND
+ `status`='UNCONFIRMED'
+LIMIT 1",
array(getRequestParameter('hash')), __FILE__, __LINE__);
if (SQL_AFFECTEDROWS() == 1) {
// Send email if updated
sendEmail($email, getMessage('GUEST_THANX_CONFIRM'), $message);
// Maybe he got "referaled"?
- if (($rid > 0) && ($rid != $userid)) {
+ if (($refid > 0) && ($refid != $userid)) {
// Select the referal userid
- if (fetchUserData($rid)) {
+ if (fetchUserData($refid)) {
// Update ref counter...
- updateReferalCounter($rid);
+ updateReferalCounter($refid);
// Shall I 'pay' the referal points imidiately?
if (getConfig('ref_payout') == '0') {
if ((isExtensionInstalledAndNewer('bonus', '0.4.4')) && (getConfig('bonus_active') == 'Y')) {
// Add points (directly only!)
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `bonus_ref`=`bonus_ref`+{?bonus_ref?} WHERE `userid`=%s LIMIT 1",
- array(bigintval($rid)), __FILE__, __LINE__);
+ array(bigintval($refid)), __FILE__, __LINE__);
// Subtract points from system
handleBonusPoints(getConfig('bonus_ref'));
// Add one-time referal bonus over referal system or directly
// @TODO Try to rewrite the following unset()
unset($GLOBALS['ref_level']);
- addPointsThroughReferalSystem('referal_bonus', $rid, getConfig('points_ref'), true, bigintval($userid), $locked, getConfig('reg_points_mode'));
+ addPointsThroughReferalSystem('referal_bonus', $refid, getConfig('points_ref'), true, bigintval($userid), $locked, getConfig('reg_points_mode'));
} // END - if
} // END - if
switch (getConfig('guest_stats')) {
case 'MEMBERS': // Statistics about your members
// Members yesterday / today online
- $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_YDAY')." AND `last_online` < ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
- $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_YDAY?} AND `last_online` < {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
+ $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__));
// Yesterday / today registered
- $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_YDAY')." AND `joined` < ".getConfig('START_TDAY'), __FILE__, __LINE__));
- $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_TDAY'), __FILE__, __LINE__));
+ $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_YDAY?} AND `joined` < {?START_TDAY?}", __FILE__, __LINE__));
+ $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_TDAY?}", __FILE__, __LINE__));
// Only males / females
$male = countSumTotalData('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'");
case 'INACTIVE': // Deactivated stats
loadTemplate('admin_settings_saved', false, getMessage('GUEST_STATS_DEACTIVATED'));
break;
-}
+} // END - switch
// [EOF]
?>
$add = '';
if ((getConfig('order_multi_page') == 'Y') && (isPostRequestParameterSet('zip')) && (postRequestParameter('zip') != '')) {
// Choose recipients by ZIP code
- $add = " AND d.zip LIKE '".bigintval(postRequestParameter('zip'))."{PER}'";
+ $add = sprintf(" AND d.zip LIKE '%s%%'",
+ bigintval(postRequestParameter('zip'))
+ );
} // END - if
// Check for userids
$nothingMessage = '';
switch ($mode) {
case 'list_in':
- $sql = "SELECT `trans_id`, `from_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max');
+ $sql = "SELECT `trans_id`, `from_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_in` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}";
$nothingMessage = getMessage('TRANSFER_NO_INCOMING_TRANSFERS');
$content['balance'] = getMessage('TRANSFER_TOTAL_INCOMING');
$content['title'] = getMessage('TRANSFER_LIST_INCOMING');
break;
case 'list_out':
- $sql = "SELECT `trans_id`, `to_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT ".getConfig('transfer_max');
+ $sql = "SELECT `trans_id`, `to_userid` AS party_userid, `points`, `reason`, `time_trans` FROM `{?_MYSQL_PREFIX?}_user_transfers_out` WHERE `userid`=%s ORDER BY `time_trans` DESC LIMIT {?transfer_max?}";
$nothingMessage = getMessage('TRANSFER_NO_OUTGOING_TRANSFERS');
$content['balance'] = getMessage('TRANSFER_TOTAL_OUTGOING');
$content['title'] = getMessage('TRANSFER_LIST_OUTGOING');
setGetRequestParameter('mode', 'list');
// And load all rows!
- $result = SQL_QUERY_ESC("SELECT `id`,`wernis_account`,`wernis_amount`,`wernis_timestamp`,`wernis_type` FROM `{?_MYSQL_PREFIX?}_user_wernis` WHERE `userid`=%s ORDER BY `wernis_timestamp` DESC",
+ $result = SQL_QUERY_ESC("SELECT `id`, `wernis_account`, `wernis_amount`, `wernis_timestamp`, `wernis_type` FROM `{?_MYSQL_PREFIX?}_user_wernis` WHERE `userid`=%s ORDER BY `wernis_timestamp` DESC",
array(getMemberId()), __FILE__, __LINE__);
// Load all rows
// Prepare data for output
$rowContent = array(
'wernis_timestamp' => generateDateTime($data['wernis_timestamp'], 2),
- 'points' => translateComma($data['wernis_amount']),
- 'wernis_account' => bigintval($data['wernis_account']),
- 'status' => WERNIS_TRANSFER_STATUS($data['wernis_type']),
- 'raw_type' => strtolower($data['wernis_type']),
+ 'wernis_amount' => $data['wernis_amount'],
+ 'wernis_account' => $data['wernis_account'],
+ 'wernis_type' => $data['wernis_type'],
'sw' => $SW,
);
// Is the payout mode active?
if (getConfig('wernis_payout_active') == 'Y') {
// Add link
- $content['payout_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{%url=modules.php?module=login&what=wernis&mode=payout%}\"><div style=\"padding-top: 10px\">{--MEMBER_WERNIS_MODE_PAYOUT--}</div></a>";
+ $content['payout_link'] = '<a class="menu_blur" style="height: 40px" href="{%url=modules.php?module=login&what=wernis&mode=payout%}"><div style="padding-top: 10px">{--MEMBER_WERNIS_MODE_PAYOUT--}</div></a>';
} // END - if
// Is the withdraw mode active?
if (getConfig('wernis_withdraw_active') == 'Y') {
// Add link
- $content['withdraw_link'] = "<a class=\"menu_blur\" style=\"height: 40px\" href=\"{%url=modules.php?module=login&what=wernis&mode=withdraw%}\"><div style=\"padding-top: 10px\">{--MEMBER_WERNIS_MODE_WITHDRAW--}</div></a>";
+ $content['withdraw_link'] = '<a class="menu_blur" style="height: 40px" href="{%url=modules.php?module=login&what=wernis&mode=withdraw%}"><div style="padding-top: 10px">{--MEMBER_WERNIS_MODE_WITHDRAW--}</div></a>';
} // END - if
// Mode chooser! ;-)
// Checks wether the given email address is used.
function isEmailTaken ($email) {
// Query the database
- $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '{PER}%s{PER}' OR `email` LIKE '{PER}%s{PER}' LIMIT 1",
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' OR `email` LIKE '%%%s%%' LIMIT 1",
array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__);
// Is the email there?
return $GLOBALS['http_status'];
}
-// Compiles config entries for SQL queries
-function compileSqlConfig ($sqlString) {
- // Replace all
- foreach (array('_MYSQL_PREFIX', '_TABLE_TYPE') as $configEntry) {
- // "Compile" it
- $sqlString = str_replace('{?' . $configEntry . '?}', getConfig($configEntry), $sqlString);
- } // END - foreach
-
- // Return the compiled SQL string
- return $sqlString;
-}
-
// Setter for 'is_template_html'
function enableTemplateHtml ($enable = true) {
$GLOBALS['is_template_html'] = (bool) $enable;
Bitte überprüfen Sie diese Daten und überweisen Sie dann den geforderten Betrag.
-Die {!WERNIS_POINTS_VALUE!} Wernis wurden dem Mitglied bereits abgebucht.
+Die {%pipe,translateComma=$content[wernis_amout]%} Wernis wurden dem Mitglied bereits abgebucht.
Bitte vergessen Sie nicht, das Mitglied über die Auszahlung zu informieren, da dies nicht automatisch erfolgt.
Ihre Login-Id lautet: $userid
URL zum Login: {?URL?}/login.php
-für Ihre Anmeldung werden wir Ihnen als Willkommensgutschrift $content[points] {?POINTS?} gutschreiben, sobald Sie {?ref_payout?} Mails bestätigt haben. Erst dann können Sie Mails an die anderen Mitglieder verschicken!
+für Ihre Anmeldung werden wir Ihnen als Willkommensgutschrift {%config,translateComma=points_register%} {?POINTS?} gutschreiben, sobald Sie {?ref_payout?} Mails bestätigt haben. Erst dann können Sie Mails an die anderen Mitglieder verschicken!
Wir wünschen Ihnen viel Spass und Erfolg beim Mail-Versand!
Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%},
-Sie hatten an uns {?MAIN_TITLE?} eine Auszahlungsanfrage geschickt.
+Sie hatten an uns eine Auszahlungsanfrage geschickt.
Wir haben folgende Daten von Ihnen per Mail erhalten:
------------------------------
An Konto: $content[account]
------------------------------
-Die dazu nötigen {!WERNIS_POINTS_VALUE!} Wernis haben wir Ihnen bereits abgezogen.
+Die dazu nötigen {%pipe,translateComma=$content[wernis_amout]%} Wernis haben wir Ihnen bereits abgezogen.
Sie sollten soeben eine Aufbuchung auf Ihrem WDS66-Hauptaccount erhalten haben!
<tr>
- <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom right">$content[points] Wernis</td>
- <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom right">$content[wernis_account]</td>
+ <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom right">{%pipe,translateComma=$content[wernis_amount]%} Wernis</td>
+ <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom right">{%pipe,bigintval=$content[wernis_account]%}</td>
<td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom right">$content[wernis_timestamp]</td>
- <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom">$content[status]</td>
+ <td align="center" class="switch_sw$content[sw] wernis_type_$content[raw_type] bottom">{%pipe,WERNIS_TRANSFER_STATUS=$content[wernis_type]%}</td>
</tr>