inc/loader/load- svneol=native#text/plain
inc/loader/load-admins.php svneol=native#text/plain
inc/loader/load-config.php svneol=native#text/plain
+inc/loader/load-earning.php svneol=native#text/plain
inc/loader/load-extension.php svneol=native#text/plain
inc/loader/load-extensions.php svneol=native#text/plain
inc/loader/load-filter.php svneol=native#text/plain
inc/modules/member/what-cash_coupon.php svneol=native#text/plain
inc/modules/member/what-categories.php svneol=native#text/plain
inc/modules/member/what-doubler.php svneol=native#text/plain
+inc/modules/member/what-earnings.php svneol=native#text/plain
inc/modules/member/what-guest.php svneol=native#text/plain
inc/modules/member/what-holiday.php svneol=native#text/plain
inc/modules/member/what-html_mail.php svneol=native#text/plain
$result = false;
// Determine index/fulltext/unique word
- $noIndex = (
- (
- isInStringIgnoreCase('INDEX', $sql)
- ) && (
- isInStringIgnoreCase('KEY', $sql)
- ) && (
- isInStringIgnoreCase('FULLTEXT', $sql)
- ) && (
- isInStringIgnoreCase('UNIQUE', $sql)
- )
+ $isAlterIndex = (
+ (
+ isInString('INDEX', $sql)
+ ) && (
+ isInString('KEY', $sql)
+ ) && (
+ isInString('FULLTEXT', $sql)
+ ) && (
+ isInString('UNIQUE', $sql)
+ )
);
// Extract table name
$tableName = str_replace('`', '', $tableArray[2]);
// Debug log
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sql=' . $sql . ',tableName=' . $tableName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>,isAlterIndex=' . intval($isAlterIndex));
// Shall we add/drop?
- if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($noIndex === true)) {
+ if (((isInString('ADD', $sql)) || (isInString('DROP', $sql)) || (isInString('CHANGE', $sql))) && ($isAlterIndex === false)) {
// Try two columns, one should fix
foreach (array(4,5) as $idx) {
// If an entry is not set, abort here
} elseif ((getTableType() == 'InnoDB') && (isInString('FULLTEXT', $sql))) {
// Skip this query silently because InnoDB does not understand fulltext indexes
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("Skipped FULLTEXT: sql=%s,tableName=%s,hasZeroNums=%d,file=%s,line=%s", $sql, $tableName, intval((is_bool($result)) ? 0 : isSqlTableColumnFound($columnName)), $F, $L));
- } elseif ($noIndex === false) {
+ } elseif ($isAlterIndex === true) {
// And column name as well without backticks
$keyName = str_replace('`', '', $tableArray[5]);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'keyName=' . $keyName . ',tableArray=<pre>' . print_r($tableArray, true) . '</pre>');
// - Menu systems
addAdminMenuSql('setup', 'config_beg', 'Bettel-Link', 'IP-Sperre, {OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Vergütung usw. können Sie hier einstellen.', 10);
addGuestMenuSql('members', 'beg', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG} erbetteln!', 4);
- addMemberMenuSql('main', 'beg', 'Ihr Bettel-Link', 6);
+ addMemberMenuSql('extras', 'beg', 'Ihr Bettel-Link', 1);
// - Configuration
addConfigAddSql('beg_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 600');
addConfigAddSql('beg_userid_timeout', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 1800');
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
+ // Add dependency for ext-sql_patches
+ addExtensionDependency('sql_patches');
+
// All required tables for this extension:
// - Ads
addDropTableSql('forced_ads');
`forced_ads_type` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
`forced_ads_views_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`forced_ads_clicks_counter` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`forced_ads_reload_lock` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`forced_ads_min_stay` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`forced_ads_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`forced_ads_id`)",
'Forced Ads Data');
`forced_campaign_lock_timetstamp` TIMESTAMP NULL DEFAULT NULL,
`forced_campaign_expired` TIMESTAMP NULL DEFAULT NULL,
`forced_campaign_ordered_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`forced_campaign_costs_api` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
-`forced_campaign_price_api` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
+`forced_campaign_payment_api` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
+`forced_campaign_reload_lock` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`forced_campaign_min_stay` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`forced_ads_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`forced_campaign_userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`forced_costs_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
PRIMARY KEY (`forced_campaign_id`),
INDEX (`forced_costs_id`)",
'Forced Campaign Data');
- // - Campaigns <-> Ads
- addDropTableSql('forced_campaigns_ads');
- addCreateTableSql('forced_campaigns_ads', "
-`forced_campaign_ads_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`forced_campaign_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-`forced_ads_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-PRIMARY KEY (`forced_campaign_ads_id`),
-UNIQUE `ads_campaign`(`forced_campaign_id`,`forced_ads_id`)",
- 'Forced Campaigns<->Ads');
-
- // - Campaigns <-> "User" (could be a member, sponsor, admin or "API")
- addDropTableSql('forced_campaigns_user');
- addCreateTableSql('forced_campaigns_user', "
-`forced_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`forced_campaign_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-`forced_user_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-`forced_user_type` ENUM('MEMBER','SPONSOR','ADMIN','API') NOT NULL DEFAULT 'ADMIN',
-PRIMARY KEY (`forced_id`),
-UNIQUE `forced_campaign_user` (`forced_campaign_id`,`forced_user_id`,`forced_user_type`),
-INDEX (`forced_user_id`)",
- 'Forced Campaigns<->User');
-
// - Campaign costs
addDropTableSql('forced_costs');
addCreateTableSql('forced_costs', "
addCreateTableSql('forced_stats', "
`forced_stats_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`forced_stats_campaign_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-`forced_stats_user_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
+`forced_stats_userid` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`forced_stats_viewed` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`forced_stats_clicked` TIMESTAMP NULL DEFAULT NULL,
`forced_stats_real_ip` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
`forced_stats_session_id` VARCHAR(100) NULL DEFAULT NULL,
PRIMARY KEY (`forced_stats_id`),
INDEX (`forced_stats_campaign_id`),
-INDEX (`forced_stats_user_id`)",
+INDEX (`forced_stats_userid`)",
'Forced Campaign Statistics');
// Menu system
// - Administrator
- addAdminMenuSql('forced', NULL, 'Forced-Ads', 'Verwalten Sie hier bequem alle laufenden Forced-Banner und -Textlinks und deren Kampgnen. Sie können hier auch neue Werbmittel (Ads) hinzufügen oder laufende Forced-Kampagnen bei z.B. Regelverstössen sperren oder löschen. Auch das naträgliche Editieren von Ads und Kampagnen ist jederzeit möglich. Kampagnen dienen der einfacheren Verwaltung und der Trennung von dem Werbemittel selbst dienen. Sie brauchen also z.B. einen Forced-Banner nur einmal einfügen und können dann bei Bedarf weitere Kampagnen starten.', 5);
+ addAdminMenuSql('forced', NULL, 'Forced-Ads', 'Verwalten Sie hier bequem alle laufenden Forced-Banner, -Textlinks, -PopUps und deren Kampgnen. Sie können hier auch neue Werbmittel (Ads) hinzufügen oder laufende Forced-Kampagnen bei z.B. Regelverstössen sperren oder löschen. Auch das naträgliche Editieren von Ads und Kampagnen ist jederzeit möglich. Kampagnen dienen der einfacheren Verwaltung und der Trennung von dem Werbemittel selbst dienen. Sie brauchen also z.B. einen Forced-Banner nur einmal einfügen und können dann bei Bedarf weitere Kampagnen starten.', 5);
addAdminMenuSql('forced', 'list_forced_ads', 'Werbemittel verwalten', 'Listet alle eingetragenen Werbmittel (Ads) auf und fügt neue hinzu. Sie können hier diese nachträglich editieren falls Sie mal eine falsche URL eingegeben haben oder den Text ändern wollen. Löschen Sie hier auch Forced-Banner, die nicht mehr gültig sind (z.B. abgelaufen sind). Sollten doch mit dem Werbmittel verknüpfte Kampagnen vorhanden sein, erhalten Sie einen Warnhinweis. Neue Werbmittel können Sie hier ebenfalls hinzufügen. Denken Sie aber daran, dass ohne Kampagne dieses nicht angezeigt wird. Achten Sie hier auch die Reload-Sperre.', 2);
addAdminMenuSql('forced', 'list_forced_campaigns', 'Kampagnen verwalten', 'Listet alle Kampagnen auf und zeigt deren Status an. Jederzeit können Sie Kampagnen stoppen, falls Sie dies wünschen oder ein Regelverstoss vorliegt. Haben Sie ein Werbemittel hinzugefügt, so fügen Sie bitte unbedingt eine Kampagne hinzu, da es sonst nicht angezeigt wird.', 3);
addAdminMenuSql('forced', 'list_forced_costs', 'Kosten verwalten', 'Legen Sie die Preise pro Klick zum Buchen Forced-Werbemittel fest und wie viele {OPEN_CONFIG}POINTS{CLOSE_CONFIG} Ihre Mitglieder erhalten sollen. Generell sollten Sie bei Mitgliederbuchungen höhere Kosten pro Klick als was Ihre Mitglieder pro Klick erhalten einstellen, da so die {OPEN_CONFIG}POINTS{CLOSE_CONFIG} abgebaut werden (Sie können an Accountaufladungen z.B. verdienen).', 4);
addAdminMenuSql('forced', 'stats_forced', 'Statistiken', 'Zeigt Gesamtstatistiken und zu den einzelnen Kampagnen und Werbmitteln an. Die hier angezeigte Statistik kann jedoch nicht manuell gelöscht werden (bitte auch nicht selber tun) da sie auch gleichzeitigt als Reload-Sperre dient.', 5);
// - Members
- addMemberMenuSql('earn', 'forced_banner', 'Forced-Banner', 2);
- addMemberMenuSql('earn', 'forced_textlink', 'Forced-Textlinks', 3);
- addMemberMenuSql('extras','book_forced_banner','Forced-Banner buchen', 3);
- addMemberMenuSql('extras','book_forced_textlink','Forced-Textlink buchen', 4);
+ addMemberMenuSql('earn', 'forced_banner', 'Forced-Banner', 3);
+ addMemberMenuSql('earn', 'forced_textlink', 'Forced-Textlinks', 4);
+ addMemberMenuSql('extras', 'book_forced', 'Forced-Kampagne buchen', 3);
+
+ // Register Forced-PopUps with earning_data table
+ addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_earning_data` (`earning_group`,`earning_name`,`earning_sorting`) VALUES ('POPUP','FORCED_POPUP',1)");
// Register filter for default forced ad types
registerFilter('add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', false, true, isExtensionDryRun());
// SQL commands to run
addDropTableSql('forced_ads');
addDropTableSql('forced_campaigns');
- addDropTableSql('forced_campaigns_ads');
- addDropTableSql('forced_campaigns_user');
addDropTableSql('forced_costs');
addDropTableSql('forced_stats');
// Menu systems
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='forced' LIMIT 5");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('forced_banner','forced_textlink') LIMIT 2");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='forced'");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('forced_banner','forced_textlink','book_forced') LIMIT 3");
+
+ // Unregister Forced-PopUps from earning_data
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_earning_data` WHERE `earning_name`='FORCED_POPUP' LIMIT 1");
// Remove filter
unregisterFilter(__FUNCTION__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', true, isExtensionDryRun());
// SQL commands to run
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nickname` VARCHAR(255) NOT NULL DEFAULT ''");
addExtensionSql("ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `nick_userid` ENUM ('nick','userid') NOT NULL DEFAULT 'userid'");
- addMemberMenuSql('main','nickname','Nicknamen',5);
+
+ // Add member menu
+ addMemberMenuSql('extras', 'nickname', 'Nicknamen', 2);
break;
case 'remove': // Do stuff when removing extension
addConfigAddSql('nickname_len', 'TINYINT(3) UNSIGNED NOT NULL DEFAULT 5');
addConfigAddSql('nickname_pattern', "VARCHAR(255) NOT NULL DEFAULT 'a-zA-Z0-9_'");
addConfigAddSql('nickname_chars', "VARCHAR(255) NOT NULL DEFAULT 'a-z, A-Z, 0-9, _'");
- addAdminMenuSql('setup','config_nickname','Nicknamen','Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
+ addAdminMenuSql('setup', 'config_nickname', 'Nicknamen', 'Stellen Sie minimale Nicknamenlänge, sowie erlaubte Zeichen hier ein.', 12);
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Minimale Länge, sowie erlaubte Zeichen sind per Adminbereich änderbar. Setzen Sie als erlaubte Zeichen nur URL-konforme Zeichen ein!");
break;
case '0.1.9': // SQL queries for v0.1.9
- addAdminMenuSql('user','list_nickname','Nickname-Historie','Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
+ addAdminMenuSql('user', 'list_nickname', 'Nickname-Historie', 'Listet alle verwendeten Nicknames der Mitglieder auf.', 12);
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Menuüpunkt für Nickname-History hinzugefügt.");
} // END - if
// Version number
-setThisExtensionVersion('0.8.4');
+setThisExtensionVersion('0.8.5');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4'));
+setExtensionVersionHistory(array('0.0.0', '0.0.1', '0.0.2', '0.0.3', '0.0.4', '0.0.5', '0.0.6', '0.0.7', '0.0.8', '0.0.9', '0.1.0', '0.1.1', '0.1.2', '0.1.3', '0.1.4', '0.1.5', '0.1.6', '0.1.7', '0.1.8', '0.1.9', '0.2.0', '0.2.1', '0.2.2', '0.2.3', '0.2.4', '0.2.5', '0.2.6', '0.2.7', '0.2.8', '0.2.9', '0.3.0', '0.3.1', '0.3.2', '0.3.3', '0.3.4', '0.3.5', '0.3.6', '0.3.7', '0.3.8', '0.3.9', '0.4.0', '0.4.1', '0.4.2', '0.4.3', '0.4.4', '0.4.5', '0.4.6', '0.4.7', '0.4.8', '0.4.9', '0.5.0', '0.5.1', '0.5.2', '0.5.3', '0.5.4', '0.5.5', '0.5.6', '0.5.7', '0.5.8', '0.5.9', '0.6.0', '0.6.1', '0.6.2', '0.6.3', '0.6.4', '0.6.4', '0.6.5', '0.6.6', '0.6.7', '0.6.8', '0.6.9', '0.7.0', '0.7.1', '0.7.2', '0.7.3', '0.7.4', '0.7.5', '0.7.6', '0.7.7', '0.7.8', '0.7.9', '0.8.0', '0.8.1', '0.8.2', '0.8.3', '0.8.4', '0.8.5'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
- // This depends on 'cache' now
+ // This depends on ext-cache now
addExtensionDependency('cache');
break;
'config_proxy',
'config_session',
'list_filter',
- 'list_point_accounts'
+ 'list_point_accounts',
+ 'list_earnings'
)");
// Delete/update member menu entries
case 'update': // Update an extension
switch (getCurrentExtensionVersion()) {
case '0.0.1': // SQL queries for v0.0.1
- addConfigAddSql('ext_autopurge', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
- addAdminMenuSql('setup','config_extensions','Erweitungsmanagement','Alle Einstellungen am Erweiterungsmanagement.', 10);
+ addAdminMenuSql('setup', 'config_extensions', 'Erweitungsmanagement', 'Alle Einstellungen am Erweiterungsmanagement.', 10);
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Es kann nun bestimmt werden, ob vom Server gelöschte ext-xxx.php erkannt werden sollen und die verknüpften Daten auch aus der Datenbank entfernt werden sollen.");
case '0.7.7': // SQL queries for v0.7.7
addMemberMenuSql('earn', NULL, 'Verdienen', 2);
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='earn', `sort`=1 WHERE `what`='unconfirmed' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `action`='earn',`sort`=1 WHERE `what`='unconfirmed' LIMIT 1");
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Menüpunkt <strong>Verdienen</strong> hinzugefügt und <strong>Unbestätigte Mails</strong> als ersten Punkt dort hin verschoben.");
`locked_mode` ENUM('LOCKED','UNLOCKED') NOT NULL DEFAULT 'LOCKED',
`payment_method` ENUM('DIRECT','REFERAL') NOT NULL DEFAULT 'REFERAL',
`notify_recipient` ENUM('Y','N') NOT NULL DEFAULT 'N',
-PRIMARY KEY(`id`),
+PRIMARY KEY (`id`),
INDEX (`subject`)",
'Points account data');
// Admin menu
- addAdminMenuSql('setup','list_point_accounts','Guthabenkonten...','Veralten Sie hier bequem Einstellungen zu den Guthabenkonten.',5);
+ addAdminMenuSql('setup', 'list_point_accounts', 'Guthabenkonten...', 'Veralten Sie hier bequem Einstellungen zu den Guthabenkonten.', 5);
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Tabelle <em>points_data</em> erzeugt, diese soll das {?POINTS?}-Guthaben komplett lenken.");
break;
case '0.8.4': // SQL queries for v0.8.4
- addDropTableSql('history');
addCreateTableSql('history', "
`history_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`history_subject` VARCHAR(255) NOT NULL DEFAULT 'GENERIC',
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Allgemeine Historie-Tabelle hinzugefügt.");
break;
+
+ case '0.8.5': // SQL queries for v0.8.5
+ // Old-lost configuration entry
+ addConfigDropSql('ext_autopurge');
+
+ // Extra earning for our members :-)
+ addMemberMenuSql('earn', 'earnings', 'Zusatzverdienste', 2);
+
+ // Admin menu
+ addAdminMenuSql('setup', 'list_earnings', 'Zusatzverdienste...', 'Veralten Sie hier bequem alle Zusatzverdienste (wie z.B. vergütete PopUps usw.).', 6);
+
+ // Earning data table
+ addDropTableSql('earning_data');
+ addCreateTableSql('earning_data', "
+`earning_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`earning_group` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
+`earning_name` VARCHAR(255) NOT NULL DEFAULT 'INVALID',
+`earning_sorting` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+PRIMARY KEY (`earning_id`),
+UNIQUE `earning_group_name` (`earning_group`,`earning_name`)",
+ 'Registered (extra) earnings');
+
+ // User->earnings connection table
+ addDropTableSql('user_earning');
+ addCreateTableSql('user_earning', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`earning_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`earning_userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`earning_active` ENUM('Y','N') NOT NULL DEFAULT 'Y',
+`earning_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+`earning_canceled` TIMESTAMP NULL DEFAULT NULL,
+`earning_daily_amount` SMALLINT(7) NOT NULL DEFAULT 0,
+`earning_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000,
+PRIMARY KEY (`id`),
+UNIQUE `user_earning` (`earning_id`,`earning_userid`),
+INDEX (`earning_userid`)",
+ 'User->Earning connections');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Menüpunkt für Zusatzverdienste wie z.B. Forced-PopUps hinzugefügt und uralten Konfigurationseintrag entfernt.");
+ break;
} // END - switch
break;
break;
case 'init': // Do stuff when extension is initialized
+ // Transfer POINTS word
+ if (isExtensionInstalledAndNewer('sql_patches', '0.0.3')) {
+ // Okay, recent enough, so transfer the word for POINTS
+ setConfigEntry('POINTS', getPointsWord());
+ } // END - if
+
// Init key
setConfigEntry('secret_key', '');
debug_report_bug(__FILE__, __LINE__, 'Cannot read secret file! Please try to reload.');
}
} // END - if
-
- // Transfer words/numbers to constants if config entry is found
- if (isExtensionInstalledAndNewer('sql_patches', '0.0.3')) {
- setConfigEntry('POINTS', getPointsWord());
- } // END - if
break;
default: // Unknown extension mode
addAdminMenuSql('transfer','del_transfer','Manuell löschen','Hier können Sie - abgesehen von der automatischen Löschung - Transaktionen selber löschen. Bitte beachten Sie, dass immer aus- und eingehende Transaktionen gleichzeitig gelöscht werden.', 3);
// Member menu
- addMemberMenuSql('main', 'transfer', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Transfer', 5);
+ addMemberMenuSql('extras', 'transfer', '{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Transfer', 5);
// Add config values
addConfigAddSql('transfer_max', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT 50');
} // END - if
// Remove cache
- foreach (array('config','extension','filter','modules') as $cache) {
+ foreach (array('config', 'extension', 'filter', 'modules', 'earning') as $cache) {
if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
$GLOBALS['cache_instance']->removeCacheFile();
} // END - if
} // END - if
// Remove cache files
- foreach (array('admin','admin_acls','config','extension','modules','refdepths','refsystem','themes','filter','imprint') as $cache) {
+ foreach (array('admin', 'admin_acls', 'config', 'extension', 'earning', 'modules', 'refdepths', 'refsystem', 'themes', 'filter', 'imprint') as $cache) {
// Is the cache file readable?
// @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
if ($GLOBALS['cache_instance']->loadCacheFile($cache)) {
// Filter to add history entry
function FILTER_ADD_HISTORY_ENTRY ($filterData) {
// Add the entry
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_history` (`history_subject`,`history_userid`,`history_value`) VALUES('%s',%s,'%s')",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_history` (`history_subject`,`history_userid`,`history_value`) VALUES ('%s',%s,'%s')",
$filterData,
__FUNCTION__, __LINE__);
'ADMIN_FORCED_ADS_CLICKS_COUNTER' => "Anzahl Forced-Klicks",
'ADMIN_FORCED_ADS_HAS_FRAMEBREAKER' => "Framekiller?",
'ADMIN_FORCED_ADS_ADDED' => "Hinzugefügt",
- 'ADMIN_FORCED_ADS_RELOAD_LOCK' => "Reloadzeit",
- 'ADMIN_FORCED_ADS_MINIMUM_STAY' => "Mindestauffenthalt",
));
// [EOF]
return $return;
}
-// Handles the XML node 'extra-parameter-forced-ads-reload-lock-list'
-function doXmlExtraParameterForcedAdsReloadLockList ($resource, $attributes) {
- // There should be no attributes
- if (count($attributes) > 0) {
- // Please don't add any attributes to foo-list nodes
- debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['forced_ads_reload_lock_list'])) {
- // This list should be created already
- debug_report_bug(__FUNCTION__, __LINE__, 'forced_ads_reload_lock_list should be already created.');
- }
-}
-
-// Handles the XML node 'extra-parameter-forced-ads-reload-lock-list-entry'
-function doXmlExtraParameterForcedAdsReloadLockListEntry ($resource, $attributes) {
- // There are three attributes, by default
- if (count($attributes) != 3) {
- // Not the right count
- debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
- } elseif (!isset($attributes['NAME'])) {
- // 'NAME' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
- } elseif (!isset($attributes['TYPE'])) {
- // 'TYPE' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
- } elseif (!isInvalidXmlType($attributes['TYPE'])) {
- // No valid type
- debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
- } elseif (!isset($attributes['VALUE'])) {
- // 'VALUE' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
- } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
- // Not valid/verifyable
- debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['forced_ads_reload_lock_list'])) {
- // doXmlCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/forced-ads-reload-lock-list not included around this node. Please fix your XML.');
- }
-
- // Add the entry to the list
- addXmlValueToCallbackAttributes('extra_list', $attributes, 'forced_ads_reload_lock_list');
-}
-
-// Handles the XML node 'extra-parameter-forced-ads-min-stay-list'
-function doXmlExtraParameterForcedAdsMinStayList ($resource, $attributes) {
- // There should be no attributes
- if (count($attributes) > 0) {
- // Please don't add any attributes to foo-list nodes
- debug_report_bug(__FUNCTION__, __LINE__, 'Expected 0 attributes because this is a foo-list node, got ' . count($attributes));
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['forced_ads_min_stay_list'])) {
- // This list should be created already
- debug_report_bug(__FUNCTION__, __LINE__, 'forced_ads_min_stay_list should be already created.');
- }
-}
-
-// Handles the XML node 'extra-parameter-forced-ads-min-stay-list-entry'
-function doXmlExtraParameterForcedAdsMinStayListEntry ($resource, $attributes) {
- // There are three attributes, by default
- if (count($attributes) != 3) {
- // Not the right count
- debug_report_bug(__FUNCTION__, __LINE__, 'Expected 3 attributes, got ' . count($attributes));
- } elseif (!isset($attributes['NAME'])) {
- // 'NAME' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute NAME not found.');
- } elseif (!isset($attributes['TYPE'])) {
- // 'TYPE' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute TYPE not found.');
- } elseif (!isInvalidXmlType($attributes['TYPE'])) {
- // No valid type
- debug_report_bug(__FUNCTION__, __LINE__, 'TYPE is not valid, got: ' . $attributes['TYPE']);
- } elseif (!isset($attributes['VALUE'])) {
- // 'VALUE' not found
- debug_report_bug(__FUNCTION__, __LINE__, 'Required attribute VALUE not found.');
- } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['VALUE'])) {
- // Not valid/verifyable
- debug_report_bug(__FUNCTION__, __LINE__, 'Attribute VALUE does not validate. TYPE=' . $attributes['TYPE'] . ',VALUE=' . $attributes['VALUE']);
- } elseif (!isset($GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['extra_list']['forced_ads_min_stay_list'])) {
- // doXmlCallbackFunction is missing
- debug_report_bug(__FUNCTION__, __LINE__, 'Required XML node callback-function/extra-parameter-list/forced-ads-min-stay-list not included around this node. Please fix your XML.');
- }
-
- // Add the entry to the list
- addXmlValueToCallbackAttributes('extra_list', $attributes, 'forced_ads_min_stay_list');
-}
-
// [EOF]
?>
* =================== Last change: 10/24/2009 *
* *
* -------------------------------------------------------------------- *
- * File : load_cache- *
+ * File : load- *
* -------------------------------------------------------------------- *
* Short description : Load more cache files *
* -------------------------------------------------------------------- *
if (($GLOBALS['cache_instance']->loadCacheFile('foo')) && ($GLOBALS['cache_instance']->extensionVersionMatches('foo'))) {
// Load cache
$GLOBALS['cache_array']['foo'] = $GLOBALS['cache_instance']->getArrayFromCache();
-} elseif (isHtmlMode()) {
+} elseif (isHtmlOutputMode()) {
// Create cache file
$GLOBALS['cache_instance']->init();
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/31/2011 *
+ * =================== Last change: 07/31/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : load-earning.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Load more cache files *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Mehr Cache-Dateien nachladen *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} elseif (isInstallationPhase()) {
+ // Use this code if you don't want to run this cache loader on installation phase
+ return;
+}
+
+// Let's start with the admins table...
+if (($GLOBALS['cache_instance']->loadCacheFile('earning')) && ($GLOBALS['cache_instance']->extensionVersionMatches('sql_patches'))) {
+ // Load cache
+ $GLOBALS['cache_array']['earning'] = $GLOBALS['cache_instance']->getArrayFromCache();
+} elseif ((isHtmlOutputMode()) && (isExtensionInstalledAndNewer('sql_patches', '0.8.5'))) {
+ // Create cache file
+ $GLOBALS['cache_instance']->init();
+
+ // Query the database about this
+ $result = SQL_QUERY('SELECT * FROM `{?_MYSQL_PREFIX?}_earning_data` ORDER BY `earning_id` ASC', __FILE__, __LINE__);
+ while ($dummy = SQL_FETCHARRAY($result)) {
+ // Save row
+ $GLOBALS['cache_instance']->addRow($dummy);
+ } // END - while
+
+ // Free memory
+ SQL_FREERESULT($result);
+
+ // Close cache
+ $GLOBALS['cache_instance']->storeExtensionVersion('sql_patches');
+ $GLOBALS['cache_instance']->finalize();
+}
+
+// [EOF]
+?>
}
// Debug log
- logDebugMessage(__FUNCTION__, __LINE__, sprintf("module=%s, status=%s", $module_chk, getModuleStatus($module_chk)));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, sprintf("module=%s, status=%s", $module_chk, getModuleStatus($module_chk)));
// Return the value
return getModuleStatus($module_chk);
} // END - foreach
// Build the SQL query
- $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`, `', $sqlColumns) . "`) VALUES('" . implode("','", $sqlValues) . "')";
+ $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`, `', $sqlColumns) . "`) VALUES ('" . implode("','", $sqlValues) . "')";
// Run the SQL query
SQL_QUERY($SQL, __FUNCTION__, __LINE__);
// List all URLs
showEntriesByXmlCallback('admin_list_forced_ads');
-// Prepare content for template
-$content = array(
- 'reload_lock' => createTimeSelections(0, 'forced_ads_reload_lock', 'WDhm'),
- 'min_stay' => createTImeSelections(0, 'forced_ads_min_stay' , 'ms')
-);
-
// Display form for adding a forced-ad
-loadTemplate('admin_add_forced_ad', false, $content);
+loadTemplate('admin_add_forced_ad');
// [EOF]
?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/31/2011 *
+ * =================== Last change: 07/31/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-earnings.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Extra earnings for the user *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Zusatzverdienst fuer die Mitglieder *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} elseif (!isMember()) {
+ redirectToIndexMemberOnlyModule();
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+// [EOF]
+?>
</td>
</tr>
- <tr>
- <td align="right">
- {--ADMIN_ENTER_FORCED_AD_RELOAD_LOCK--}
- </td>
- <td>
- $content[reload_lock]
- </td>
- </tr>
-
- <tr>
- <td align="right">
- {--ADMIN_ENTER_FORCED_AD_MINIMUM_STAY--}
- </td>
- <td>
- $content[min_stay]
- </td>
- </tr>
-
<tr>
<td class="bottom" align="right">
{--ADMIN_SELECT_FORCED_AD_TYPE--}
<form accept-charset="UTF-8" action="{%url=modules.php?module=admin&what=list_forced_ads%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="table dashed" width="800">
<tr>
- <td align="center" colspan="7" class="table_header">
+ <td align="center" colspan="5" class="table_header">
<strong>{--ADMIN_LIST_FORCED_ADS_TITLE--}</strong>
</td>
</tr>
<td class="header_column bottom right" align="center"><strong>{--ADMIN_TEST_URL--}</strong></td>
<td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_TYPE--}</strong></td>
<td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_HAS_FRAMEBREAKER--}</strong></td>
- <td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_ADDED--}</strong></td>
- <td class="header_column bottom right" align="center"><strong>{--ADMIN_FORCED_ADS_RELOAD_LOCK--}</strong></td>
- <td class="header_column bottom" align="center"><strong>{--ADMIN_FORCED_ADS_MINIMUM_STAY--}</strong></td>
+ <td class="header_column bottom" align="center"><strong>{--ADMIN_FORCED_ADS_ADDED--}</strong></td>
</tr>
$content
<tr>
- <td class="table_footer" colspan="7">
+ <td class="table_footer" colspan="5">
<input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
<input type="submit" class="form_submit" name="edit" value="{--ADMIN_ACTION_EDIT_SUBMIT--}" />
<input type="submit" class="form_delete" name="delete" value="{--ADMIN_ACTION_DELETE_SUBMIT--}" />
<td align="center" class="bottom right {%template,ColorSwitch%}">
{%pipe,translateYesNo=$content[forced_ads_framebreaker]%}
</td>
- <td align="center" class="bottom right {%template,ColorSwitch%}">
- $content[forced_ads_added]
- </td>
- <td align="center" class="bottom right {%template,ColorSwitch%}">
- {%pipe,createFancyTime=$content[forced_ads_reload_lock]%}
- </td>
<td align="center" class="bottom {%template,ColorSwitch%}">
- {%pipe,createFancyTime=$content[forced_ads_min_stay]%}
+ $content[forced_ads_added]
</td>
</tr>
<database-column-list-entry name="" type="string" value="forced_ads_click_url" />
<database-column-list-entry name="" type="string" value="forced_ads_alt_text" />
<database-column-list-entry name="" type="string" value="forced_ads_framebreaker" />
- <database-column-list-entry name="forced_ads_reload_lock" type="string" value="forced_ads_reload_lock" />
- <database-column-list-entry name="forced_ads_min_stay" type="string" value="forced_ads_min_stay" />
<database-column-list-entry name="" type="string" value="forced_ads_type" />
<database-column-list-entry name="" type="string" value="forced_ads_width" />
<database-column-list-entry name="" type="string" value="forced_ads_height" />
<callback-function-list-entry name="" type="string" value="" />
<callback-function-list-entry name="" type="string" value="" />
<callback-function-list-entry name="" type="string" value="" />
- <callback-function-list-entry name="forced_ads_reload_lock" type="string" value="createEpocheTimeFromSelections" />
- <callback-function-list-entry name="forced_ads_min_stay" type="string" value="createEpocheTimeFromSelections" />
<callback-function-list-entry name="" type="string" value="" />
<callback-function-list-entry name="" type="string" value="bigintval" />
<callback-function-list-entry name="" type="string" value="bigintval" />
<callback-function-list-entry name="" type="string" value="" />
</callback-function-list>
- <!--
- Extra parameters (2nd, 3rd, ...) for above call-back functions. If an array
- is provided, we have more than two parameters to handle over to the
- call-back function. See function handleExtraValues() for details.
- //-->
- <extra-parameter-list>
- <!--
- Dummy entries
- //-->
- <extra-parameter-list-entry name="" type="string" value="" />
- <extra-parameter-list-entry name="" type="string" value="" />
- <extra-parameter-list-entry name="" type="string" value="" />
- <!--
- Entry for forced_ads_reload_lock
- //-->
- <extra-parameter-list-entry name="" type="array" value="forced_ads_reload_lock">
- <!--
- Only one more parameter which is a special type 'callback'
- //-->
- <extra-parameter-forced-ads-reload-locklist>
- <!--
- createEpocheTimeFromSelections() requires the whole $_POST
- array as second parameter, getPostArray() wraps this.
- //-->
- <extra-parameter-forced-ads-reload-locklist-entry name="" type="callback" value="postRequestArray" />
- </extra-parameter-forced-ads-reload-locklist>
- </extra-parameter-list-entry>
- <!--
- Entry for forced_ads_reload_lock
- //-->
- <extra-parameter-list-entry name="" type="array" value="forced_ads_min_stay">
- <!--
- Only one more parameter which is a special type 'callback'
- //-->
- <extra-parameter-forced-ads-min-stay-list>
- <!--
- createEpocheTimeFromSelections() requires the whole $_POST
- array as second parameter, getPostArray() wraps this.
- //-->
- <extra-parameter-forced-ads-min-stay-list-entry name="" type="callback" value="postRequestArray" />
- </extra-parameter-forced-ads-min-stay-list>
- </extra-parameter-list-entry>
- <!--
- More dummy enries
- //-->
- <extra-parameter-list-entry name="" type="string" value="" />
- <extra-parameter-list-entry name="" type="string" value="" />
- <extra-parameter-list-entry name="" type="string" value="" />
- <extra-parameter-list-entry name="" type="string" value="" />
- </extra-parameter-list>
</admin-entry-meta-data>
<select-data-from-list-entry type="string" table="" value="forced_ads_type" alias="" function="" />
<select-data-from-list-entry type="string" table="" value="forced_ads_framebreaker" alias="" function="" />
<select-data-from-list-entry type="string" table="" value="forced_ads_added" alias="forced_ads_added" function="UNIX_TIMESTAMP" />
- <select-data-from-list-entry type="string" table="" value="forced_ads_reload_lock" alias="" function="" />
- <select-data-from-list-entry type="string" table="" value="forced_ads_min_stay" alias="" function="" />
</select-data-from-list>
<!--
And the column list to perform the WHERE statement on.