inc/modules/member/what-start_surfbar.php svneol=native#text/plain
inc/modules/member/what-stats.php svneol=native#text/plain
inc/modules/member/what-stats_surfbar.php svneol=native#text/plain
+inc/modules/member/what-subids.php svneol=native#text/plain
inc/modules/member/what-support.php svneol=native#text/plain
inc/modules/member/what-surfbar_book.php svneol=native#text/plain
inc/modules/member/what-surfbar_list.php svneol=native#text/plain
inc/purge/purge-mails.php svneol=native#text/plain
inc/purge/purge-tasks.php svneol=native#text/plain
inc/purge/purge-unconfirmed.php svneol=native#text/plain
+inc/purge/purge-user.php svneol=native#text/plain
inc/referal-functions.php svneol=native#text/plain
inc/referral-functions.php svneol=native#text/plain
inc/request-functions.php svneol=native#text/plain
templates/de/html/mediadata_extra_row.tpl svneol=native#text/plain
templates/de/html/mediadata_extra_row2.tpl svneol=native#text/plain
templates/de/html/member/.htaccess svneol=native#text/plain
+templates/de/html/member/member_add_subid.tpl -text
templates/de/html/member/member_advert.tpl svneol=native#text/plain
templates/de/html/member/member_beg.tpl svneol=native#text/plain
templates/de/html/member/member_beg_404.tpl svneol=native#text/plain
templates/de/html/member/member_list_surfbar_form.tpl svneol=native#text/plain
templates/de/html/member/member_list_surfbar_row.tpl svneol=native#text/plain
templates/de/html/member/member_list_surfbar_table.tpl svneol=native#text/plain
+templates/de/html/member/member_list_user_subids.tpl svneol=native#text/plain
+templates/de/html/member/member_list_user_subids_row.tpl svneol=native#text/plain
templates/de/html/member/member_login_js.tpl svneol=native#text/plain
templates/de/html/member/member_mail_bonus_deleted.tpl svneol=native#text/plain
templates/de/html/member/member_mail_bonus_new.tpl svneol=native#text/plain
templates/en/html/welcome.tpl svneol=native#text/plain
templates/xml/.htaccess svneol=native#text/plain
templates/xml/admin/.htaccess svneol=native#text/plain
+templates/xml/member/.htaccess svneol=native#text/plain
theme/README.txt svneol=native#text/plain
theme/business/images/code_bg.jpg -text svneol=unset#image/jpeg
theme/business/images/code_bg.png -text svneol=unset#image/png
} // END - if
}
+// Handles the XML node 'member-entry-meta-data'
+function doXmlMemberEntryMetaData ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
+ } // END - if
+}
+
// Handles the XML node 'callback-function'
function doXmlCallbackFunction ($resource, $attributes) {
// There are two attributes, by default
} // END - if
}
+// Handles the XML node 'member-list-data'
+function doXmlMemberListData ($resource, $attributes) {
+ // There should be no attributes
+ if (count($attributes) > 0) {
+ // Please don't add any attributes to foo-list nodes
+ reportBug(__FUNCTION__, __LINE__, 'Expected 0 attributes, got ' . count($attributes));
+ } // END - if
+}
+
// Handles the XML node 'data-tables'
function doXmlDataTables ($resource, $attributes) {
// There should be no attributes
} elseif (!isXmlValueValid($attributes['TYPE'], $attributes['CONDITION'])) {
// 'CONDITION' not valid/verifyable
reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION does not validate. CONDITION=' . $attributes['CONDITION']);
- } elseif (!isXmlValueValid($attributes['TYPE'], $attributes['LOOK-FOR'])) {
- // 'LOOK-FOR' not valid/verifyable
- reportBug(__FUNCTION__, __LINE__, 'Attribute LOOK-FOR does not validate. LOOK-FOR=' . $attributes['LOOK-FOR']);
} elseif (!isXmlConditionValid($attributes['CONDITION'])) {
// 'CONDITION' is not known
reportBug(__FUNCTION__, __LINE__, 'Attribute CONDITION is not valid. LOOK-FOR=' . $attributes['CONDITION']);
// This is very bad and needs fixing
reportBug(__FUNCTION__, __LINE__, 'current_template in GLOBALS not set, callbackFunction=' . $callbackFunction . ',function_exists()=' . intval(function_exists($callbackFunction)));
} elseif (!function_exists($callbackFunction)) {
- // Log missing function
- logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackFunction . ' does not exist.');
+ // Log missing function only in debug mode
+ if (isDebugModeEnabled()) {
+ // Log it here
+ logDebugMessage(__FUNCTION__, __LINE__, 'Call-back function ' . $callbackFunction . ' does not exist.');
+ } // END - if
} else {
// Do the replacement
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'template='.$GLOBALS['current_template']);
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_config` CHANGE `' . $oldColumnName . '` `' . $newColumnName . '` ' . $columnSql);
}
+/**
+ * Checks if given subject is found and if not, adds an SQL query to the
+ * extension registration queue.
+ */
+function registerExtensionPointsData ($subject, $columnName, $lockedMode, $paymentMethod) {
+ // Default is old extension version
+ $add = '';
+
+ // Is the extension equal or newer 0.8.9?
+ if (((isInstallationPhase()) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (isExtensionInstalledAndNewer('sql_patches', '0.8.9'))) {
+ // Then add provider
+ $add = " AND `account_provider`='EXTENSION'";
+ } // END - if
+
+ // Is the 'subject' there?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ifSqlTableExists(points_data)=' . ifSqlTableExists('points_data') . ',getExtensionMode()=' . getExtensionMode() . ',add=' . $add);
+ if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
+ // Not found so:
+ if ((isset($GLOBALS['previous_extension'][getCurrentExtensionName()])) && (!ifSqlTableExists('points_data'))) {
+ $dummy = $GLOBALS['previous_extension'][getCurrentExtensionName()];
+ reportBug(__FUNCTION__, __LINE__, 'previous_extension[' . gettype($dummy) . ']=' . $dummy . ',getCurrentExtensionName()=' . getCurrentExtensionName() . ' - Under development, please report this!');
+ } // END - if
+
+ // ... add an SQL query
+ addExtensionSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('%s','%s','%s','%s')",
+ $subject,
+ $columnName,
+ $lockedMode,
+ $paymentMethod
+ ));
+ } // END - if
+}
+
+/**
+ * Checks if given subject is found and if so, adds an SQL query to the
+ * extension unregistration queue.
+ */
+function unregisterExtensionPointsData ($subject) {
+ // Default is old extension version
+ $add = '';
+
+ // Is the extension equal or newer 0.8.9?
+ if (isExtensionInstalledAndNewer('sql_patches', '0.8.9')) {
+ // Then add provider
+ $add = " AND `account_provider`='EXTENSION'";
+ } // END - if
+
+ // Is the 'subject' there?
+ if (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 1) {
+ // Found one or more, so add an SQL query
+ addExtensionSql(sprintf("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s'" . $add . " LIMIT 1",
+ $subject
+ ));
+ } // END - if
+}
+
// Enables/disables productive mode for current extension (used only while
// registration).
// @TODO This should be rewrittten to allow, more development states, e.g. 'planing','alpha','beta','beta2','stable'
`account_type` ENUM('CHECK','SAVING') NOT NULL DEFAULT 'CHECK',
`overdraft_credit` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
-UNIQUE (`pin`),
+UNIQUE INDEX (`pin`),
INDEX `userid_type` (`userid`,`account_type`),
INDEX (`account_created`),
INDEX (`account_locked`),
`tan` VARCHAR(50) NOT NULL DEFAULT '',
`used` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`),
-UNIQUE (`account_id`,`tan`)",
+UNIQUE INDEX (`account_id`,`tan`)",
'Bank TAN lists per user');
// Admin menu queries
`descr` VARCHAR(255) NOT NULL DEFAULT 'Deutschland',
`is_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
PRIMARY KEY (`id`),
-UNIQUE (`code`)",
+UNIQUE INDEX (`code`)",
'Country codes and their full-length descriptions');
// Insert first (Germany) country
`cashed_on` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `coupon_user` (`coupon_id`,`userid`),
-UNIQUE (`coupon_code`)",
+UNIQUE INDEX (`coupon_code`)",
'Coupon->user connection');
// Configuration entries
`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`lock_spam_reason` TINYTEXT,
PRIMARY KEY (`id`),
-UNIQUE (`key`),
-UNIQUE (`url`)",
+UNIQUE INDEX (`key`),
+UNIQUE INDEX (`url`)",
'Debug clients');
// Add this exchange as first client
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`log_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE (`log_id`),
+UNIQUE INDEX (`log_id`),
INDEX `client_log` (`client_id`,`log_id`)",
'Debug client <-> log connection');
`grade_name` VARCHAR(255) NOT NULL DEFAULT '',
`grade_description` TINYTEXT NOT NULL,
`grade_parent_id` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
-UNIQUE (`grade_name`),
+UNIQUE INDEX (`grade_name`),
INDEX (`grade_parent_id`),
PRIMARY KEY (`grade_id`)",
'Grade data');
`reached_points` FLOAT(20,5) UNSIGNED NULL DEFAULT NULL,
`reached_mails` BIGINT(20) UNSIGNED NULL DEFAULT NULL,
`time_valid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-UNIQUE (`grade_cash_name`),
+UNIQUE INDEX (`grade_cash_name`),
PRIMARY KEY (`cash_id`)",
'Data for "cashed" grades');
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`grade_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`grade_expired` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00:00',
-UNIQUE (`userid`,`grade_id`),
+UNIQUE INDEX (`userid`,`grade_id`),
INDEX (`grade_id`),
PRIMARY KEY (`connect_id`)",
'Grade<->user connection');
`imprint_key` VARCHAR(255) NOT NULL DEFAULT '',
`imprint_value` VARCHAR(255) NOT NULL DEFAULT '',
PRIMARY KEY (`imprint_id`),
-UNIQUE (`imprint_key`)",
+UNIQUE INDEX (`imprint_key`)",
'Imprint data');
// Init imprint data
`network_query_amount` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`network_active` ENUM('Y','N') NOT NULL DEFAULT 'Y',
PRIMARY KEY (`network_id`),
-UNIQUE (`network_short_name`)",
+UNIQUE INDEX (`network_short_name`)",
'Network data');
// Types the network provider is supporting (e.g. Forced-Banner and so on)
`network_translation_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`network_translation_name` VARCHAR(100) NOT NULL DEFAULT '',
PRIMARY KEY (`network_translation_id`),
-UNIQUE (`network_translation_name`)",
+UNIQUE INDEX (`network_translation_name`)",
'Translations for array keys, generic data, DO NOT ALTER!');
// Array-Element translation tables per type/provider
`last_payment` FLOAT(7,2) UNSIGNED NOT NULL DEFAULT 0.00,
`last_currency` VARCHAR(255) NOT NULL DEFAULT '€',
PRIMARY KEY (`id`),
-UNIQUE (`hash`),
+UNIQUE INDEX (`hash`),
INDEX (`refid`),
INDEX (`email`)",
'Main sponsor data');
`sort` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
UNIQUE INDEX `action_what` (`action`,`what`),
-UNIQUE (`what`),
+UNIQUE INDEX (`what`),
INDEX (`action`)",
'Sponsor menu');
//
`la_posx` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`la_posy` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE (`la_id`),
+UNIQUE INDEX (`la_id`),
INDEX (`la_posx`),
INDEX (`la_posy`)",
'LAS position and title data');
`theme_active` ENUM('Y','N') NOT NULL DEFAULT 'N',
`theme_ver` VARCHAR(255) NOT NULL DEFAULT '0.0.0',
PRIMARY KEY (`id`),
-UNIQUE (`theme_path`),
+UNIQUE INDEX (`theme_path`),
INDEX (`theme_active`)", 'Themes');
// Admin menu
} // END - if
// Version number
-setThisExtensionVersion('0.5.2');
+setThisExtensionVersion('0.5.3');
// Version history array (add more with , '0.0.1' and so on)
-setExtensionVersionHistory(array('0.0.0', '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'));
+setExtensionVersionHistory(array('0.0.0', '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'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
`login_failures` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_failure` TIMESTAMP NULL DEFAULT NULL,
PRIMARY KEY (`userid`),
-UNIQUE (`user_hash`),
+UNIQUE INDEX (`user_hash`),
INDEX (`refid`),
INDEX `status_mails` (`status`,`max_mails`)",
'Main user data');
addDropTableSql('user_refs');
addDropTableSql('user_stats');
addDropTableSql('user_stats_data');
+ addDropTableSql('user_subids');
+ addDropTableSql('subid_log');
addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what` IN('config_user','user_contct','list_user_del') OR `action`='user'");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('subids')");
// Register new filters for gathering points
unregisterFilter(__FILE__, __LINE__, 'get_total_points', 'USER_POINTS', true, isExtensionDryRun());
unregisterFilter(__FILE__, __LINE__, 'user_inclusion_sql', 'TESTER_USER_INCLUSION_SQL', true, isExtensionDryRun());
unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'TESTER_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
unregisterFilter(__FILE__, __LINE__, 'convert_user_data_columns', 'ADD_USER_DATA_CONVERT_SQL_COLUMNS', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
case '0.3.6': // SQL queries for v0.3.6
addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` DROP INDEX `userid`');
- addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE INDEX `userid_catid` (`userid`,`cat_id`)');
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_cats` ADD UNIQUE `userid_catid` (`userid`,`cat_id`)');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Der Sperrgrund wird nun mit abgespeichert und beim Löschen des Users mit ausgesendet.");
`level` smallINT(6) UNSIGNED NOT NULL DEFAULT 0,
`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`id`),
-UNIQUE INDEX `user_refid` (`userid`,`level`,`refid`),
+UNIQUE `user_refid` (`userid`,`level`,`refid`),
INDEX (`level`),
INDEX (`refid`)",
'User referrals');
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter zum Hinzufügen von SQL-Spalten für die Mitgliederanmeldung hinzugefügt.");
break;
+
+ case '0.5.3': // SQL queries for v0.5.3
+ // Register filter
+ registerFilter(__FILE__, __LINE__, 'post_refid_validation', 'HANDLE_USER_SUBID', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'pre_user_registration', 'SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS', false, true, isExtensionDryRun());
+
+ // Admin menu
+ addAdminMenuSql('user', 'list_user_subid', 'Sub-Ids', 'Listet alle pro vom Mitglied eingegebenen Sub-Ids und ermittelten Referral-URLs auf.', 7);
+
+ // Member menu
+ addMemberMenuSql('extras', 'subids', 'Sub-Id Tracking', 4);
+
+ // Add table for subids
+ addDropTableSql('user_subids');
+ addCreateTableSql('user_subids', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`subid` VARCHAR(255) NOT NULL DEFAULT '',
+`subid_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+UNIQUE `user_subid` (`userid`, `subid`),
+INDEX (`subid`)",
+ 'User sub ids');
+
+ // Add table for subid logging
+ addDropTableSql('subid_log');
+ addCreateTableSql('subid_log', "
+`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
+`refid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
+`subid` VARCHAR(255) NOT NULL DEFAULT '',
+`referral_url` TINYTEXT,
+`remote_address` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
+`entry_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
+PRIMARY KEY (`id`),
+INDEX (`refid`),
+INDEX (`subid`)",
+ 'Sub id logging');
+
+ // For saving used subid in user_data table
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD `subid` VARCHAR(255) NULL DEFAULT NULL');
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_user_data` ADD INDEX (`subid`)');
+
+ // Configuration entry for purging old subid logs (7 days default)
+ addConfigAddSql('user_subid_purge', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Filter, Datenbanktabelle und Menüpunkte für SubId-Tracking hinzugefügt.");
+ break;
} // END - switch
break;
return $sql;
}
+// Filter for handling user subids (called by referral link)
+function FILTER_HANDLE_USER_SUBID ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+ // Return filter data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ //* NOISY-DEBUG: */ print __FUNCTION__.':filterData=<pre>'.print_r($filterData,true).'</pre>';
+ return $filterData;
+}
+
+// Filter for adding SQL columns on user registration for subid
+function FILTER_SUBID_USER_REGISTRATION_ADD_SQL_COLUMNS ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+
+ // Is the sub id set in session?
+ if (isSessionVariableSet('subid')) {
+ // Okay, add subid here
+ addExtraRegistrationColumns(', `subid`');
+ addExtraRegistrationData(", '" . getSession('subid') . "'");
+ } // END - if
+
+ // Return filter data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+
// [EOF]
?>
return $isCreated;
}
+// Checks whether the given sub id is fused by current member
+function isMemberSubIdFree ($subId) {
+ // Check it
+ $isFree = (countSumTotalData(getMemberId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 0);
+
+ // Return result
+ return $isFree;
+}
+
+// Prepares given sub id for storage in database
+function prepareSubId ($subId) {
+ // First convert any spaces/dashes to underscores
+ $subId = str_replace(' ', '_', str_replace('-', '_', $subId));
+
+ // Then filter out any unwanted characters
+ $subId = preg_replace('/([^a-zA-Z0-9_])/', '', $subId);
+
+ // Then Check if it is available
+ if (!isMemberSubIdFree($subId)) {
+ // Is not free
+ $subId = false;
+ } // END - if
+
+ // Return prepared sub id
+ return $subId;
+}
+
//-----------------------------------------------------------------------------
// EL code functions
//-----------------------------------------------------------------------------
return $GLOBALS[__FUNCTION__][$userid];
}
+// ----------------------------------------------------------------------------
+// XML call-back functions
+// ----------------------------------------------------------------------------
+
+// For 'doing' add subid, the column-index is required
+function addXmlSpecialMemberAddDoSubid () {
+ // So set it all here
+ $GLOBALS['__COLUMN_INDEX']['doXmlCallbackFunction'] = 'column';
+ $GLOBALS['__XML_ARGUMENTS']['doXmlCallbackFunction']['column_index'] = 'column';
+}
+
// ----------------------------------------------------------------------------
// Wrapper functions for configuration entries
// ----------------------------------------------------------------------------
// Adds a given entry to the database
function adminAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
- //* DEBUG: */ die('columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,POST=<pre>'.print_r($_POST,true).'</pre>');
- // Verify that tableName and columns are not empty
- if ((!is_array($tableName)) || (count($tableName) != 1)) {
- // No tableName specified
- reportBug(__FUNCTION__, __LINE__, 'tableName is not given. Please fix your XML,tableName[]=' . gettype($tableName) . '!=array: userIdColumn=' . $userIdColumn);
- } elseif (count($columns) == 0) {
- // No columns specified
- reportBug(__FUNCTION__, __LINE__, 'columns is not given. Please fix your XML.');
- }
-
- // Init columns and value elements
- $sqlColumns = array();
- $sqlValues = array();
-
- // Do we have "time columns"?
- if (count($timeColumns) > 0) {
- // Then "walk" through all entries
- foreach ($timeColumns as $column) {
- // Convert all (possible) selections
- convertSelectionsToEpocheTimeInPostData($column . '_ye');
- } // END - foreach
- } // END - if
-
- // Add columns and values
- foreach ($columns as $key => $columnName) {
- //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',columnName=' . $columnName);
- // Is columnIndex set?
- if (!is_null($columnIndex)) {
- // Check conditions
- //* DEBUG: */ die('columnIndex=<pre>'.print_r($columnIndex,true).'</pre>'.debug_get_printable_backtrace());
- assert((is_array($columnName)) && (isset($columnName[$columnIndex])));
-
- // Then use that index "blindly"
- $columnName = $columnName[$columnIndex];
- } // END - if
-
- // Debug message
- /* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',columnName[' . gettype($columnName) . ']=' . $columnName . ',filterFunctions=' . $filterFunctions[$key] . ',extraValues=' . intval(isset($extraValues[$key])) . ',extraValuesName=' . intval(isset($extraValues[$columnName . '_list'])) . '<br />');
-
- // Copy entry securely to the final arrays
- $sqlColumns[$key] = SQL_ESCAPE($columnName);
- $sqlValues[$key] = SQL_ESCAPE(postRequestElement($columnName));
-
- // Send data through the filter function if found
- if ((isset($filterFunctions[$key])) && (isset($extraValues[$key . '_list']))) {
- // Filter function set!
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
- $sqlValues[$key] = call_user_func_array($filterFunctions[$key], merge_array(array($columnName), $extraValues[$key . '_list']));
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
- } elseif ((isset($filterFunctions[$key])) && (!empty($filterFunctions[$key]))) {
- // Run through an extra filter
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
- $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], '');
- /* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
- }
-
- // Is the value not a number?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key]);
- if (($sqlValues[$key] != 'NULL') && (is_string($sqlValues[$key]))) {
- // Add quotes around it
- $sqlValues[$key] = chr(39) . $sqlValues[$key] . chr(39);
- } // END - if
- } // END - foreach
-
- // Build the SQL query
- $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES (" . implode(',', $sqlValues) . ')';
-
- // Run the SQL query
- SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+ // Call inner function
+ doGenericAddEntries($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $columnIndex);
// Entry has been added?
- if (!SQL_HASZEROAFFECTED()) {
+ if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === true)) {
// Display success message
displayMessage('{--ADMIN_ENTRY_ADDED--}');
} else {
}
}
-// List all given rows (callback function from XML)
-function adminListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array()) {
- // Verify that tableName and columns are not empty
- if ((!is_array($tableName)) || (count($tableName) != 1)) {
- // No tableName specified
- reportBug(__FUNCTION__, __LINE__, 'tableName is not given. Please fix your XML,tableName[]=' . gettype($tableName) . '!=array,tableTemplate=' . $tableTemplate . ',rowTemplate=' . $rowTemplate);
- } elseif (count($columns) == 0) {
- // No columns specified
- reportBug(__FUNCTION__, __LINE__, 'columns is not given. Please fix your XML,tableTemplate=' . $tableTemplate . ',rowTemplate=' . $rowTemplate . ',tableName[0]=' . $tableName[0]);
- }
-
- // This is the minimum query, so at least columns and tableName must have entries
- $SQL = 'SELECT ';
-
- // Get the sql part back from given array
- $SQL .= getSqlPartFromXmlArray($columns);
-
- // Remove last commata and add FROM statement
- $SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
-
- // Do we have entries from whereColumns to add?
- if (count($whereColumns) > 0) {
- // Then add these as well
- if (count($whereColumns) == 1) {
- // One entry found
- $SQL .= ' WHERE ';
-
- // Table/alias included?
- if (!empty($whereColumns[0]['table'])) {
- // Add it as well
- $SQL .= $whereColumns[0]['table'] . '.';
- } // END - if
-
- // Add the rest
- $SQL .= '`' . $whereColumns[0]['column'] . '`' . $whereColumns[0]['condition'] . chr(39) . $whereColumns[0]['look_for'] . chr(39);
- } elseif ((count($whereColumns > 1)) && (count($conditions) > 0)) {
- // More than one "WHERE" + condition found
- foreach ($whereColumns as $idx => $columnArray) {
- // Default is WHERE
- $condition = 'WHERE';
-
- // Is the condition element there?
- if (isset($conditions[$columnArray['column']])) {
- // Assume the condition
- $condition = $conditions[$columnArray['column']];
- } // END - if
-
- // Add to SQL query
- $SQL .= ' ' . $condition;
-
- // Table/alias included?
- if (!empty($whereColumns[$idx]['table'])) {
- // Add it as well
- $SQL .= $whereColumns[$idx]['table'] . '.';
- } // END - if
-
- // Add the rest
- $SQL .= '`' . $whereColumns[$idx]['column'] . '`' . $whereColumns[$idx]['condition'] . chr(39) . convertDollarDataToGetElement($whereColumns[$idx]['look_for']) . chr(39);
- } // END - foreach
- } else {
- // Did not set $conditions
- reportBug(__FUNCTION__, __LINE__, 'Supplied more than "whereColumns" entries but no conditions! Please fix your XML template.');
- }
- } // END - if
-
- // Do we have entries from orderByColumns to add?
- if (count($orderByColumns) > 0) {
- // Add them as well
- $SQL .= ' ORDER BY ';
- foreach ($orderByColumns as $orderByColumn => $array) {
- // Get keys (table/alias) and values (sorting itself)
- $table = trim(implode('', array_keys($array)));
- $sorting = trim(implode('', array_keys($array)));
-
- // table/alias can be omitted
- if (!empty($table)) {
- // table/alias is given
- $SQL .= $table . '.';
- } // END - if
-
- // Add order-by column
- $SQL .= '`' . $orderByColumn . '` ' . $sorting . ',';
- } // END - foreach
-
- // Remove last column
- $SQL = substr($SQL, 0, -1);
- } // END - if
-
- // Now handle all over to the inner function which will execute the listing
- doAdminListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters);
-}
-
-// Do the listing of entries
-function doAdminListEntries ($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array()) {
- // Run the SQL query
- $result = SQL_QUERY($SQL, __FUNCTION__, __LINE__);
-
- // Do we have some URLs left?
- if (!SQL_HASZERONUMS($result)) {
- // List all URLs
- $OUT = '';
- while ($content = SQL_FETCHARRAY($result)) {
- // "Translate" content
- foreach ($callbackColumns as $columnName => $callbackName) {
- // Fill the callback arguments
- $args = array($content[$columnName]);
-
- // Do we have more to add?
- if (isset($extraParameters[$columnName])) {
- // Add them as well
- $args = merge_array($args, $extraParameters[$columnName]);
- } // END - if
-
- // Call the callback-function
- //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=<pre>'.print_r($args, true).'</pre>');
- // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
- $content[$columnName] = call_user_func_array($callbackName, $args);
- } // END - foreach
-
- // Load row template
- $OUT .= loadTemplate(trim($rowTemplate[0]), true, $content);
- } // END - while
-
- // Load main template
- loadTemplate(trim($tableTemplate[0]), false, $OUT);
- } else {
- // No URLs in surfbar
- displayMessage('{--' .$noEntryMessageId[0] . '--}');
- }
-
- // Free result
- SQL_FREERESULT($result);
-}
-
// Checks proxy settins by fetching check-updates3.php from mxchange.org
function adminTestProxySettings ($settingsArray) {
// Set temporary the new settings
displayMessage('{--PROBLEM_POINTS_OVERVIEW_UNAVAILABLE--}');
}
+// Is ext-payout installed?
if (isExtensionActive('payout')) {
// Payput extension is installed and active so we can check if the user has enougth points
outputPayoutList($content['part_points'] - getUserData('used_points'));
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/06/2012 *
+ * =================== Last change: 10/06/2012 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-subids.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Lists and manages member's own sub ids *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Auflisten und verwalten der Mitglied-SubIds *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://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')) {
+ exit();
+} elseif (!isMember()) {
+ redirectToIndexMemberOnlyModule();
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('user')) && (!isAdmin())) {
+ // Required extension ext-user not active
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}');
+
+ // Abort here
+ return;
+} // END - if
+
+// By default show the list...
+$show = true;
+
+// Check for 'url_id' element
+//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isFormSent()=' . intval(isFormSent('add_subid')) . ',ifPostContainsSelections()=' . intval(ifPostContainsSelections()) . ',countRequestPost()=' . countRequestPost());
+if ((!isFormSent('add_subid')) && ((!ifPostContainsSelections()) || (countRequestPost() == 0))) {
+ // Not found so output message
+ displayMessage('{--MEMBER_SUBID_NO_SELECTIONS--}');
+
+ // Abort here
+ return;
+} // END - if
+
+// Edit or delete button hit?
+if (isFormSent('add_subid')) {
+ // Add new sub id
+ showEntriesByXmlCallback('member_add_do_subid');
+} elseif (isFormSent('edit')) {
+ // Show entries for editing
+ showEntriesByXmlCallback('member_edit_show_subid');
+
+ // Do not show the list of URLs after this template
+ $show = false;
+} elseif (isFormSent('do_edit')) {
+ // Change data of entries
+ showEntriesByXmlCallback('member_edit_do_subid');
+} elseif (isFormSent('delete')) {
+ // Show entries for deletion
+ showEntriesByXmlCallback('member_delete_show_subid');
+
+ // Do not show the list of URLs after this template
+ $show = false;
+} elseif (isFormSent('do_delete')) {
+ // Remove entries from database
+ showEntriesByXmlCallback('member_delete_do_subid');
+}
+
+// Show entries?
+if ($show === false) {
+ // No, a form has already been show
+ return false;
+} // END - if
+
+// List all campaigns
+showEntriesByXmlCallback('member_list_subid');
+
+// Display form for adding a sub id
+loadTemplate('member_add_subid');
+
+// [EOF]
+?>
}
}
-/**
- * Checks if given subject is found and if not, adds an SQL query to the
- * extension registration queue.
- */
-function registerExtensionPointsData ($subject, $columnName, $lockedMode, $paymentMethod) {
- // Default is old extension version
- $add = '';
+// List all given rows (callback function from XML)
+function doGenericListEntries ($tableTemplate, $rowTemplate, $noEntryMessageId, $tableName, $columns, $whereColumns, $orderByColumns, $callbackColumns, $extraParameters = array(), $conditions = array()) {
+ // Verify that tableName and columns are not empty
+ if ((!is_array($tableName)) || (count($tableName) != 1)) {
+ // No tableName specified
+ reportBug(__FUNCTION__, __LINE__, 'tableName is not given. Please fix your XML,tableName[]=' . gettype($tableName) . '!=array,tableTemplate=' . $tableTemplate . ',rowTemplate=' . $rowTemplate);
+ } elseif (count($columns) == 0) {
+ // No columns specified
+ reportBug(__FUNCTION__, __LINE__, 'columns is not given. Please fix your XML,tableTemplate=' . $tableTemplate . ',rowTemplate=' . $rowTemplate . ',tableName[0]=' . $tableName[0]);
+ }
+
+ // This is the minimum query, so at least columns and tableName must have entries
+ $SQL = 'SELECT ';
- // Is the extension equal or newer 0.8.9?
- if (((isInstallationPhase()) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (isExtensionInstalledAndNewer('sql_patches', '0.8.9'))) {
- // Then add provider
- $add = " AND `account_provider`='EXTENSION'";
+ // Get the sql part back from given array
+ $SQL .= getSqlPartFromXmlArray($columns);
+
+ // Remove last commata and add FROM statement
+ $SQL .= ' FROM `{?_MYSQL_PREFIX?}_' . $tableName[0] . '`';
+
+ // Do we have entries from whereColumns to add?
+ if (count($whereColumns) > 0) {
+ // Then add these as well
+ if (count($whereColumns) == 1) {
+ // One entry found
+ $SQL .= ' WHERE ';
+
+ // Table/alias included?
+ if (!empty($whereColumns[0]['table'])) {
+ // Add it as well
+ $SQL .= $whereColumns[0]['table'] . '.';
+ } // END - if
+
+ // Add the rest
+ $SQL .= '`' . $whereColumns[0]['column'] . '`' . $whereColumns[0]['condition'] . chr(39) . $whereColumns[0]['look_for'] . chr(39);
+ } elseif ((count($whereColumns > 1)) && (count($conditions) > 0)) {
+ // More than one "WHERE" + condition found
+ foreach ($whereColumns as $idx => $columnArray) {
+ // Default is WHERE
+ $condition = 'WHERE';
+
+ // Is the condition element there?
+ if (isset($conditions[$columnArray['column']])) {
+ // Assume the condition
+ $condition = $conditions[$columnArray['column']];
+ } // END - if
+
+ // Add to SQL query
+ $SQL .= ' ' . $condition;
+
+ // Table/alias included?
+ if (!empty($whereColumns[$idx]['table'])) {
+ // Add it as well
+ $SQL .= $whereColumns[$idx]['table'] . '.';
+ } // END - if
+
+ // Add the rest
+ $SQL .= '`' . $whereColumns[$idx]['column'] . '`' . $whereColumns[$idx]['condition'] . chr(39) . convertDollarDataToGetElement($whereColumns[$idx]['look_for']) . chr(39);
+ } // END - foreach
+ } else {
+ // Did not set $conditions
+ reportBug(__FUNCTION__, __LINE__, 'Supplied more than "whereColumns" entries but no conditions! Please fix your XML template.');
+ }
} // END - if
- // Is the 'subject' there?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ifSqlTableExists(points_data)=' . ifSqlTableExists('points_data') . ',getExtensionMode()=' . getExtensionMode() . ',add=' . $add);
- if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
- // Not found so:
- if ((isset($GLOBALS['previous_extension'][getCurrentExtensionName()])) && (!ifSqlTableExists('points_data'))) {
- $dummy = $GLOBALS['previous_extension'][getCurrentExtensionName()];
- reportBug(__FUNCTION__, __LINE__, 'previous_extension[' . gettype($dummy) . ']=' . $dummy . ',getCurrentExtensionName()=' . getCurrentExtensionName() . ' - Under development, please report this!');
- } // END - if
+ // Do we have entries from orderByColumns to add?
+ if (count($orderByColumns) > 0) {
+ // Add them as well
+ $SQL .= ' ORDER BY ';
+ foreach ($orderByColumns as $orderByColumn => $array) {
+ // Get keys (table/alias) and values (sorting itself)
+ $table = trim(implode('', array_keys($array)));
+ $sorting = trim(implode('', array_keys($array)));
+
+ // table/alias can be omitted
+ if (!empty($table)) {
+ // table/alias is given
+ $SQL .= $table . '.';
+ } // END - if
- // ... add an SQL query
- addExtensionSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('%s','%s','%s','%s')",
- $subject,
- $columnName,
- $lockedMode,
- $paymentMethod
- ));
+ // Add order-by column
+ $SQL .= '`' . $orderByColumn . '` ' . $sorting . ',';
+ } // END - foreach
+
+ // Remove last column
+ $SQL = substr($SQL, 0, -1);
} // END - if
+
+ // Now handle all over to the inner function which will execute the listing
+ doListEntries($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters);
}
-/**
- * Checks if given subject is found and if so, adds an SQL query to the
- * extension unregistration queue.
- */
-function unregisterExtensionPointsData ($subject) {
- // Default is old extension version
- $add = '';
+// Do the listing of entries
+function doListEntries ($SQL, $tableTemplate, $noEntryMessageId, $rowTemplate, $callbackColumns, $extraParameters = array()) {
+ // Run the SQL query
+ $result = SQL_QUERY($SQL, __FUNCTION__, __LINE__);
+
+ // Do we have some URLs left?
+ if (!SQL_HASZERONUMS($result)) {
+ // List all URLs
+ $OUT = '';
+ while ($content = SQL_FETCHARRAY($result)) {
+ // "Translate" content
+ foreach ($callbackColumns as $columnName => $callbackName) {
+ // Fill the callback arguments
+ $args = array($content[$columnName]);
+
+ // Do we have more to add?
+ if (isset($extraParameters[$columnName])) {
+ // Add them as well
+ $args = merge_array($args, $extraParameters[$columnName]);
+ } // END - if
+
+ // Call the callback-function
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'callbackFunction=' . $callbackName . ',args=<pre>'.print_r($args, true).'</pre>');
+ // @TODO If we can rewrite the EL sub-system to support more than one parameter, this call_user_func_array() can be avoided
+ $content[$columnName] = call_user_func_array($callbackName, $args);
+ } // END - foreach
- // Is the extension equal or newer 0.8.9?
- if (isExtensionInstalledAndNewer('sql_patches', '0.8.9')) {
- // Then add provider
- $add = " AND `account_provider`='EXTENSION'";
+ // Load row template
+ $OUT .= loadTemplate(trim($rowTemplate[0]), true, $content);
+ } // END - while
+
+ // Load main template
+ loadTemplate(trim($tableTemplate[0]), false, $OUT);
+ } else {
+ // No URLs in surfbar
+ displayMessage('{--' .$noEntryMessageId[0] . '--}');
+ }
+
+ // Free result
+ SQL_FREERESULT($result);
+}
+
+// Adds a given entry to the database
+function doGenericAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
+ //* DEBUG: */ die('columns=<pre>'.print_r($columns,true).'</pre>,filterFunctions=<pre>'.print_r($filterFunctions,true).'</pre>,extraValues=<pre>'.print_r($extraValues,true).'</pre>,POST=<pre>'.print_r($_POST,true).'</pre>');
+ // Verify that tableName and columns are not empty
+ if ((!is_array($tableName)) || (count($tableName) != 1)) {
+ // No tableName specified
+ reportBug(__FUNCTION__, __LINE__, 'tableName is not given. Please fix your XML,tableName[]=' . gettype($tableName) . '!=array: userIdColumn=' . $userIdColumn);
+ } elseif (count($columns) == 0) {
+ // No columns specified
+ reportBug(__FUNCTION__, __LINE__, 'columns is not given. Please fix your XML.');
+ }
+
+ // Init columns and value elements
+ $sqlColumns = array();
+ $sqlValues = array();
+
+ // Default is that all went fine
+ $GLOBALS['__XML_PARSE_RESULT'] = true;
+
+ // Do we have "time columns"?
+ if (count($timeColumns) > 0) {
+ // Then "walk" through all entries
+ foreach ($timeColumns as $column) {
+ // Convert all (possible) selections
+ convertSelectionsToEpocheTimeInPostData($column . '_ye');
+ } // END - foreach
+ } // END - if
+
+ // Add columns and values
+ foreach ($columns as $key => $columnName) {
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',columnName=' . $columnName);
+ // Is columnIndex set?
+ if (!is_null($columnIndex)) {
+ // Check conditions
+ //* DEBUG: */ die('columnIndex=<pre>'.print_r($columnIndex,true).'</pre>'.debug_get_printable_backtrace());
+ assert((is_array($columnName)) && (is_string($columnIndex)) && (isset($columnName[$columnIndex])));
+
+ // Then use that index "blindly"
+ $columnName = $columnName[$columnIndex];
+ } // END - if
+
+ // Debug message
+ //* NOISY-DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'key=' . $key . ',columnName[' . gettype($columnName) . ']=' . $columnName . ',filterFunctions=' . $filterFunctions[$key] . ',extraValues=' . intval(isset($extraValues[$key])) . ',extraValuesName=' . intval(isset($extraValues[$columnName . '_list'])) . '<br />');
+
+ // Copy entry securely to the final arrays
+ $sqlColumns[$key] = SQL_ESCAPE($columnName);
+ $sqlValues[$key] = SQL_ESCAPE(postRequestElement($columnName));
+
+ // Send data through the filter function if found
+ if ((isset($filterFunctions[$key])) && (isset($extraValues[$key . '_list']))) {
+ // Filter function set!
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
+ $sqlValues[$key] = call_user_func_array($filterFunctions[$key], merge_array(array($columnName), $extraValues[$key . '_list']));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
+ } elseif ((isset($filterFunctions[$key])) && (!empty($filterFunctions[$key]))) {
+ // Run through an extra filter
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - BEFORE!');
+ $sqlValues[$key] = handleExtraValues($filterFunctions[$key], $sqlValues[$key], '');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key] . ' - AFTER!');
+ }
+
+ // Is the value not a number?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'sqlValues[' . $key . '][' . gettype($sqlValues[$key]) . ']=' . $sqlValues[$key]);
+ if (($sqlValues[$key] != 'NULL') && (is_string($sqlValues[$key]))) {
+ // Add quotes around it
+ $sqlValues[$key] = chr(39) . $sqlValues[$key] . chr(39);
+ } // END - if
+
+ // Is the value false?
+ if ($sqlValues[$key] === false) {
+ // One "parser" didn't like it
+ $GLOBALS['__XML_PARSE_RESULT'] = false;
+ break;
+ } // END - if
+ } // END - foreach
+
+ // If all values are okay, continue
+ if ($sqlValues[$key] !== false) {
+ // Build the SQL query
+ $SQL = 'INSERT INTO `{?_MYSQL_PREFIX?}_' . $tableName[0] . '` (`' . implode('`,`', $sqlColumns) . "`) VALUES (" . implode(',', $sqlValues) . ')';
+
+ // Run the SQL query
+ SQL_QUERY($SQL, __FUNCTION__, __LINE__);
} // END - if
+}
- // Is the 'subject' there?
- if (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 1) {
- // Found one or more, so add an SQL query
- addExtensionSql(sprintf("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_points_data` WHERE `subject`='%s'" . $add . " LIMIT 1",
- $subject
- ));
+// Adds a given entry to the database
+function memberAddEntries ($tableName, $columns = array(), $filterFunctions = array(), $extraValues = array(), $timeColumns = array(), $columnIndex = NULL) {
+ // Is it a member?
+ if (!isMember()) {
+ // Then abort here
+ return false;
} // END - if
+
+ // Set POST data generic userid
+ setPostRequestElement('userid', getMemberId());
+
+ // Call inner function
+ doGenericAddEntries($tableName, $columns, $filterFunctions, $extraValues, $timeColumns, $columnIndex);
+
+ // Entry has been added?
+ if ((!SQL_HASZEROAFFECTED()) && ($GLOBALS['__XML_PARSE_RESULT'] === true)) {
+ // Display success message
+ displayMessage('{--MEMBER_ENTRY_ADDED--}');
+ } else {
+ // Display failed message
+ displayMessage('{--MEMBER_ENTRY_NOT_ADDED--}');
+ }
}
// [EOF]
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 10/06/2012 *
+ * =================== Last change: 10/06/2012 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : purge-user.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Purging of user logs *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Bereinigung von Mitgliederlogbuechern *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2012 by Mailer Developer Team *
+ * For more information visit: http://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();
+} // END - if
+
+// Abort if autopurge is not active or disabled by admin
+if ((!isExtensionActive('autopurge')) || (getConfig('auto_purge_active') != 'Y')) {
+ // Abort here
+ return false;
+} // END - if
+
+// [EOF]
+?>
if (isReferralIdValid()) {
// Do not determine it, just return it
return getReferralId();
- } // END - if
-
- // Skip this in non-html-mode and outside ref.php
- if ((!isHtmlOutputMode()) && (basename($_SERVER['PHP_SELF']) != 'ref.php')) {
+ } elseif ((!isHtmlOutputMode()) && (basename($_SERVER['PHP_SELF']) != 'ref.php')) {
+ // Skip this in non-html-mode and outside ref.php
return false;
- } // END - if
+ }
// Check if refid is set
if (isReferralIdValid()) {
setReferralId(secureString(getRequestElement('refid')));
} elseif (isGetRequestElementSet('ref')) {
// Set refid=ref (the referral link uses such variable)
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using ref from GET data (' . getRequestElement('refid') . ')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Using ref from GET data (' . getRequestElement('ref') . ')');
setReferralId(secureString(getRequestElement('ref')));
} elseif ((isGetRequestElementSet('user')) && (basename($_SERVER['PHP_SELF']) == 'click.php')) {
// The variable user comes from click.php
setSession('refid', getReferralId());
}
+ // Run post validation filter chain
+ runFilterChain('post_refid_validation');
+
// Return determined refid
return getReferralId();
}
// Is it there?
if (!function_exists($callbackName)) {
+ // No, then please add it
reportBug(__FUNCTION__, __LINE__, 'callback=' . $callback . ',function=' . $function . 'arguments()=' . count($GLOBALS['__XML_ARGUMENTS'][$callback]) . ' - execute call-back does not exist.');
} // END - if
`password` VARCHAR(255) NOT NULL DEFAULT '',
`email` VARCHAR(255) NOT NULL,
PRIMARY KEY (`id`),
- UNIQUE (`login`)
+ UNIQUE INDEX (`login`)
) ENGINE = {?_TABLE_TYPE?} CHARACTER SET utf8 COLLATE utf8_general_ci COMMENT 'Administrator accounts';
DROP TABLE IF EXISTS `{?_MYSQL_PREFIX?}_cats`;
--- /dev/null
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=login&what=subids%}" method="post">
+<div class="table dashed">
+ <div class="table_header bottom">
+ <strong>{--MEMBER_ADD_SUBID_TITLE--}</strong>
+ </div>
+
+ <fieldset id="subid">
+ <legend>{--MEMBER_ADD_SUBID_LEGEND--}</legend>
+
+ <div class="table_row">
+ <label for="subid">{--MEMBER_ENTER_SUBID--}</label>
+ <input type="text" class="form_field" id="subid" name="subid" size="30" />
+ </div>
+ </fieldset>
+
+ <div class="table_footer top" style="margin-top:5px" colspan="2" align="center">
+ <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" name="add_subid" class="form_submit" value="{--MEMBER_ADD_SUBID_SUBMIT--}" />
+ </div>
+</div>
+</form>
+</div>
+
+<div class="notice">
+ {--MEMBER_ADD_SUBID_NOTICE--}
+</div>
--- /dev/null
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?module=login&what=subids%}" method="post">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+ <tr>
+ <td colspan="3" align="center" class="table_header bottom">
+ <strong>{--MEMBER_USER_SUBID_EDIT_DELETE_TITLE--}</strong>
+ </td>
+ </tr>
+ <tr>
+ <td align="center" class="header_column bottom right" width="20"><strong>{--ID_SELECT--}</strong></td>
+ <td align="center" class="header_column bottom right" width="160"><strong>{--SUBID_VALUE--}:</strong></td>
+ <td align="center" class="header_column bottom" width="160"><strong>{--SUBID_ADDED--}:</strong></td>
+ </tr>
+ $content
+ <tr>
+ <td colspan="3" class="table_footer">
+ <input type="reset" class="form_reset" value="{--UNDO_SELECTIONS--}" />
+ <input type="submit" class="form_submit" name="edit" value="{--MEMBER_ACTION_EDIT_SUBMIT--}" />
+ <input type="submit" class="form_delete" name="delete" value="{--MEMBER_ACTION_DELETE_SUBMIT--}" />
+ </td>
+ </tr>
+</table>
+</form>
+</div>
--- /dev/null
+<tr>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">
+ <input type="checkbox" title="{--ID_SELECT--} $content[id]" class="form_field" name="sel[$content[id]]" value="1" />
+ </td>
+ <td class="{%template,ColorSwitch%} bottom right">
+ <div class="tiny">
+ $content[subid]
+ </div>
+ <div class="tiny">
+ <a href="{%url=modules.php?module=login&what=subids&do=stats&id=$content[id]%}">{--MEMBER_USER_SUBID_STATS_LINK--}</a>
+ </div>
+ </td>
+ <td class="{%template,ColorSwitch%} bottom" align="center">
+ $content[subid_added]
+ </td>
+</tr>
-<div align="center">
+<div align="center">
<form accept-charset="UTF-8" action="{%url=modules.php?module=login&what=mydata%}" method="post">
<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
<tr>
<strong>{--YOUR_LOGIN--}: {%pipe,getMemberId%}</strong>
</td>
</tr>
+
<tr>
<td align="right">{--GENDER--}:</td>
<td>
{%pipe,generateGenderSelectionBox=$content[gender]%}
</td>
</tr>
+
<tr>
<td align="right">{--SURNAME--}, {--FAMILY--}:</td>
<td>
<input type="text" class="form_field" name="family" size="15" maxlength="255" value="{%user,family%}" />
</td>
</tr>
+
<tr>
<td align="right">{--STREET_NR--}:</td>
<td>
<input type="text" class="form_field" name="street_nr" size="25" maxlength="255" value="{%user,street_nr%}" />
</td>
</tr>
+
<tr>
<td align="right">{--COUNTRY--}, {--ZIP--}, {--CITY--}:</td>
<td>
<input type="text" class="form_field" name="city" size="20" maxlength="255" value="{%user,city%}" />
</td>
</tr>
+
<tr>
<td align="right">{--EMAIL--}:</td>
<td>
<input type="text" class="form_field" name="email" size="30" maxlength="255" value="$content[email]" />
</td>
</tr>
+
<tr>
<td class="bottom" align="right">{--BIRTHDAY--}:</td>
<td class="bottom">$content[dob]</td>
</tr>
+
<tr>
- <td class="bottom" align="center" colspan="2">$content[max_receive_list]</td>
+ <td class="bottom" align="center" colspan="2">
+ $content[max_receive_list]
+ </td>
</tr>
+
<tr>
<td class="bottom" colspan="2" align="center">
<span class="notice">{--MEMBER_MYDATA_NOTICE--}</span>
</td>
</tr>
+
<tr>
<td align="right">{--PASS_1--}:</td>
<td>
<input type="password" class="form_field" name="pass1" size="10" maxlength="255" />
</td>
</tr>
+
<tr>
<td class="bottom" align="right">{--PASS_2--}:</td>
<td class="bottom">
<input type="password" class="form_field" name="pass2" size="10" maxlength="255" />
</td>
</tr>
+
<tr>
<td colspan="2" class="table_footer" align="center">
<input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
<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>
+ </extra-parameter-list>
+ <!--
+ Columns for converting single time selections into a timestamp
+ //-->
+ <time-columns-list>
+ </time-columns-list>
</admin-entry-meta-data>
<callback-function-list-entry name="" type="string" value="convertCommaToDot" />
<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>
+ </extra-parameter-list>
+ <!--
+ Columns for converting single time selections into a timestamp
+ //-->
+ <time-columns-list>
+ </time-columns-list>
</admin-entry-meta-data>
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
Now we need information which template should be loaded and which functions
shall be called back. So lets start with the main list template. This mostly
<!--
Call-back function, the extracted data from this XML will then be re-read
from that function. The most common function this XML uses is
- adminListEntries() so mostly you can leave this alone unless you have JOINs.
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
Use adminListJoinEntries for JOINs:
//-->
- <callback-function type="string" value="adminListEntries" />
+ <callback-function type="string" value="doGenericListEntries" />
<!--
//-->
<!--
--- /dev/null
+Deny from all
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for adding sub ids to the database.
+
+@author Roland Haeder <webmaster@mxchange.org>
+@version 0.2.1-FINAL
+@copyright (c) 2003 - 2009 by Roland Haeder
+@copyright (c) 2009 - 2012 by Mailer Developer Team
+@license GNU GPL 2.0 or any newer version
+@link http://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
+//-->
+<member-entry-meta-data>
+ <!--
+ Call-back function which should all following parameter handled over
+ to. This will always be type of string but we like homogene XMLs.
+ //-->
+ <callback-function type="string" value="memberAddEntries" />
+ <!--
+ Name of the database table where the entries should be read/write from/to.
+ //-->
+ <database-table name="" type="string" value="user_subids" />
+ <!--
+ The following three lists must have the same count of list entries, else an
+ error may occur.
+ //-->
+ <!--
+ And all column names to read/write, leave this list tag empty for all (*).
+ //-->
+ <database-column-list>
+ <database-column-list-entry name="" type="string" table="" value="userid" alias="" function="" />
+ <database-column-list-entry name="" type="string" table="" value="subid" alias="" function="" />
+ </database-column-list>
+ <!--
+ "Filter" call-back functions to call back for piping the fetched data
+ through (can be left empty, no call-back function will be called)
+ //-->
+ <callback-function-list>
+ <callback-function-list-entry name="" type="string" value="bigintval" />
+ <callback-function-list-entry name="" type="string" value="prepareSubId" />
+ </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>
+ </extra-parameter-list>
+ <!--
+ Columns for converting single time selections into a timestamp
+ //-->
+ <time-columns-list>
+ </time-columns-list>
+</member-entry-meta-data>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for listing member's sub ids
+
+@author Roland Haeder <webmaster@mxchange.org>
+@version 0.2.1-FINAL
+@copyright (c) 2003 - 2009 by Roland Haeder
+@copyright (c) 2009 - 2012 by Mailer Developer Team
+@license GNU GPL 2.0 or any newer version
+@link http://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
+//-->
+<member-list-data>
+ <!--
+ Call-back function, the extracted data from this XML will then be re-read
+ from that function. The most common function this XML uses is
+ doGenericListEntries() so mostly you can leave this alone unless you have JOINs.
+ //-->
+ <callback-function type="string" value="doGenericListEntries" />
+ <!--
+ Now we need information which template should be loaded and which functions
+ shall be called back. So lets start with the main list template. This mostly
+ requires no call-back function.
+ //-->
+ <list-template type="string" value="member_list_user_subids" />
+ <!--
+ The template for all rows, mostly this name has a '_row' suffix and again,
+ no call-back function is usually required.
+ //-->
+ <list-row-template type="string" value="member_list_user_subids_row" />
+ <!--
+ Message id to display if no entry could be found
+ //-->
+ <no-entry-found-message type="string" value="MEMBER_USER_SUBIDS_404" />
+ <!--
+ The table(s) we shall grab the data from, all as list.
+ //-->
+ <data-tables>
+ <!--
+ A single table entry, with alias and without the configurable
+ _MYSQL_PREFIX. You can specify the table's name or alias later on.
+ //-->
+ <data-table type="string" alias="" value="user_subids" />
+ <!--
+ Columns to perform the SELECT statement on, with alias and name plus which table.
+ //-->
+ <select-data-from-list>
+ <!--
+ A single entry with table name (can be left empty), value (must
+ always be set), alias (again can be left empty) and SQL function
+ (can also be left empty) which shall be applied on the column.
+ //-->
+ <select-data-from-list-entry type="string" table="" value="id" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="subid" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="subid_added" alias="subid_added" function="UNIX_TIMESTAMP" />
+ </select-data-from-list>
+ <!--
+ And the column list to perform the WHERE statement on.
+ //-->
+ <where-select-from-list>
+ <!--
+ Search for current user's sub ids
+ //-->
+ <where-select-from-list-entry type="string" table="" value="userid" condition="EQUALS" look-for="{%pipe,getMemberId%}" />
+ </where-select-from-list>
+ <!--
+ Columns to perform the ORDER BY statement (GROUP BY is not yet supported)
+ //-->
+ <order-by-list>
+ <!--
+ A single entry to perform the ORDER BY statement on, see above WHERE entry for details.
+ //-->
+ <order-by-list-entry type="string" table="" order="subid" value="ASC" />
+ </order-by-list>
+ </data-tables>
+ <!--
+ List all column names from the 'select-data-from-list' node here, but now
+ with call-back informations. The list must only contain those entries where
+ a call-back function shall be called for.
+ //-->
+ <column-callback-list>
+ <!--
+ Another column, now we need a second parameter here because
+ generateDateTime() expects two parameters (first is always the data
+ from column).
+ //-->
+ <column-callback-list-entry>
+ <!--
+ The actual data, again.
+ //-->
+ <column-callback-data type="string" value="subid_added" callback="generateDateTime" />
+ <!--
+ More parameters, remember that the first parameter is always given
+ and that it is the data from column.
+ //-->
+ <callback-extra-parameter-list>
+ <!--
+ A single parameter, 'type' can be one of 'float', 'int',
+ 'bool', 'string'. 'array' is not yet supported.
+ //-->
+ <callback-extra-parameter-list-entry type="int" column="subid_added" value="2" />
+ </callback-extra-parameter-list>
+ </column-callback-list-entry>
+ </column-callback-list>
+</member-list-data>