templates/de/html/member/member_list_referral_row.tpl svneol=native#text/plain
templates/de/html/member/member_list_reflinks.tpl svneol=native#text/plain
templates/de/html/member/member_list_reflinks_row.tpl svneol=native#text/plain
+templates/de/html/member/member_list_subid_stats.tpl svneol=native#text/plain
+templates/de/html/member/member_list_subid_stats_row.tpl svneol=native#text/plain
templates/de/html/member/member_list_surfbar.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
./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
./inc/header.php:66:// @TODO Find a way to not use direct module comparison
./inc/install-functions.php:91: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestElement('omode'), 0);
-./inc/language/de.php:1112: // @TODO Rewrite these two constants
-./inc/language/de.php:1128: // @TODO Rewrite these three constants
+./inc/language/de.php:1120: // @TODO Rewrite these two constants
+./inc/language/de.php:1136: // @TODO Rewrite these three constants
./inc/language/de.php:749:// @TODO Are these constants longer used?
./inc/language-functions.php:255: // @TODO These are all valid languages, again hard-coded
./inc/language-functions.php:44:// @TODO Rewrite all language constants to this function.
./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_USERID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter *
./inc/modules/member/what-logout.php:52: // @TODO Move this in a filter, e.g. member_logout
-./inc/modules/member/what-order.php:471: // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:459: // @TODO Rewrite this to a filter
./inc/modules/member/what-order.php:84: // @TODO Rewrite this to SQL_FETCHARRAY()
./inc/modules/member/what-payout.php:194: // @TODO Rewrite this to a filter
./inc/modules/member/what-points.php:61:// @TODO Should we rewrite this to a filter?
`userid` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`account_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`account_locked` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`locked_reason` TINYTEXT,
+`locked_reason` TINYTEXT NOT NULL,
`status` ENUM('NEW','ACTIVE','LOCKED') NOT NULL DEFAULT 'NEW',
`account_balance` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`output_mode` ENUM('LOGIN','EMAIL','DISABLED'),
`month_transfered` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_tan` VARCHAR(5) NOT NULL DEFAULT '00000',
`last_tan_stamp` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
-`last_tan_purpose` TINYTEXT,
+`last_tan_purpose` TINYTEXT NOT NULL,
`account_type` ENUM('CHECK','SAVING') NOT NULL DEFAULT 'CHECK',
`overdraft_credit` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
`points_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`day_bookkeeping` CHAR(4) NOT NULL DEFAULT '0000',
`day_available` CHAR(4) NOT NULL DEFAULT '0000',
-`transfer_purpose` TINYTEXT,
+`transfer_purpose` TINYTEXT NOT NULL,
PRIMARY KEY (`id`),
INDEX (`to_account_id`,`from_account_id`),
INDEX (`day_bookkeeping`,`day_available`)",
addCreateTableSql('bank_packages', "
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`title` VARCHAR(255) NOT NULL DEFAULT '',
-`description` TINYTEXT,
+`description` TINYTEXT NOT NULL,
`account_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`free_transfers` INT(7) UNSIGNED NOT NULL DEFAULT 0,
`transfer_fee` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`total_cashed` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`points` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
-`coupon_description` TEXT,
+`coupon_description` TEXT NOT NULL,
PRIMARY KEY (`id`)",
'Created coupons');
`timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`file` VARCHAR(255) NOT NULL DEFAULT '',
`line` MEDIUMINT NOT NOT NULL DEFAULT 0,
-`message` LONGTEXT,
-`comment` TINYTEXT,
+`message` LONGTEXT NOT NULL,
+`comment` TINYTEXT NOT NULL,
`status` ENUM('NEW','PENDING','ACCEPTED','FIXED','INVALID','DUBLICATE','SPAM') NOT NULL DEFAULT 'NEW',
`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`client_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
-`raw_data` LONGTEXT,
+`raw_data` LONGTEXT NOT NULL,
`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
INDEX (`client_id`)",
`status` ENUM('ACTIVE','NEW','PENDING','LOCKED','DELETED','SPAM') NOT NULL DEFAULT 'PENDING',
`type` ENUM ('CLIENT','RELAY','SERVER') NOT NULL DEFAULT 'CLIENT',
`inserted` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`lock_spam_reason` TINYTEXT,
+`lock_spam_reason` TINYTEXT NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX (`key`),
UNIQUE INDEX (`url`)",
addCreateTableSql('newsletter_data', "
`nl_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`nl_subject` VARCHAR(255) NOT NULL DEFAULT '{OPEN_CONFIG}nl_default_subject{CLOSE_CONFIG}',
-`nl_header_text` MEDIUMTEXT,
-`nl_footer_text` MEDIUMTEXT,
+`nl_header_text` MEDIUMTEXT NOT NULL,
+`nl_footer_text` MEDIUMTEXT NOT NULL,
`nl_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`nl_send` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`nl_ready` ENUM('Y','N') NOT NULL DEFAULT 'N',
`nl_topic_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
`nl_id` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`nl_topic_title` VARCHAR(255) NOT NULL DEFAULT '',
-`nl_topic_text` MEDIUMTEXT,
+`nl_topic_text` MEDIUMTEXT NOT NULL,
`nl_topic_clicks` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
PRIMARY KEY (`nl_topic_id`),
INDEX `newsletter_id` (`nl_id`)",
addConfigAddSql('nl_expire', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 7));
addConfigAddSql('nl_archive_expire', 'BIGINT(20) UNSIGNED NOT NULL DEFAULT ' . (getOneDay() * 14));
addConfigAddSql('nl_default_subject', "VARCHAR(255) NOT NULL DEFAULT 'Newsletter vom {OPEN_CONFIG}CURRENT_DATE{CLOSE_CONFIG}'");
- addConfigAddSql('nl_default_header', 'MEDIUMTEXT');
- addConfigAddSql('nl_default_footer', 'MEDIUMTEXT');
+ addConfigAddSql('nl_default_header', 'MEDIUMTEXT NOT NULL,');
+ addConfigAddSql('nl_default_footer', 'MEDIUMTEXT NOT NULL,');
addConfigAddSql('nl_archive', "ENUM('Y','N') NOT NULL DEFAULT 'Y'");
// Admin menu
`signup_id` BIGINT (20) UNSIGNED NOT NULL AUTO_INCREMENT,
`signup_sponsor_id` BIGINT (20) UNSIGNED NOT NULL,
`signup_title` VARCHAR (255) NOT NULL DEFAULT '',
-`signup_text` LONGTEXT,
-`signup_welcome_text` TINYTEXT,
+`signup_text` LONGTEXT NOT NULL,
+`signup_welcome_text` TINYTEXT NOT NULL,
`signup_question` VARCHAR (255) NOT NULL DEFAULT '',
`signup_url` VARCHAR (255) NOT NULL DEFAULT '',
`signup_banner` VARCHAR (255) NOT NULL DEFAULT '',
`campaign_expired` ENUM('Y','N') NOT NULL DEFAULT 'N',
`campaign_locked` ENUM('Y','N') NOT NULL DEFAULT 'Y',
`campaign_ended` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
-`locked_reason` TINYTEXT,
+`locked_reason` TINYTEXT NOT NULL,
`locked_timestamp` TIMESTAMP NOT NULL DEFAULT '0000-00-00 00:00',
`status` ENUM('PENDING','ACTIVE','LOCKED') NOT NULL DEFAULT 'PENDING',
PRIMARY KEY (`id`),
} // END - if
// Version number
-setThisExtensionVersion('0.5.3');
+setThisExtensionVersion('0.5.4');
// 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', '0.5.3'));
+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', '0.5.4'));
// Keep this extension always active!
setExtensionAlwaysActive('Y');
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());
+ unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', true, isExtensionDryRun());
+ unregisterFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
`joined` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`last_online` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
`del_timestamp` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
-`del_reason` TINYTEXT,
+`del_reason` TINYTEXT NOT NULL,
PRIMARY KEY (`id`),
INDEX (`userid`)",
'List of deleted users');
`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,
+`referral_url` TINYTEXT NOT NULL,
`remote_address` VARCHAR(15) NOT NULL DEFAULT '0.0.0.0',
`entry_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
// Update notes (these will be set as task text!)
setExtensionUpdateNotes("Filter, Datenbanktabelle und Menüpunkte für SubId-Tracking hinzugefügt.");
break;
+
+ case '0.5.4': // SQL queries for v0.5.4
+ // Register filter
+ registerFilter(__FILE__, __LINE__, 'update_referral_data', 'GENERIC_UPDATE_USER_REFERRAL', false, true, isExtensionDryRun());
+ registerFilter(__FILE__, __LINE__, 'update_referral_data', 'UPDATE_USER_SUBID', false, true, isExtensionDryRun());
+
+ // Add user agent
+ addExtensionSql('ALTER TABLE `{?_MYSQL_PREFIX?}_subid_log` ADD `user_agent` TINYTEXT NOT NULL AFTER `remote_address`');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes("Weitere Filter für Referral-Counter und Sub-Id hinzugefügt.");
+ break;
} // END - switch
break;
`wernis_amount` FLOAT(20,5) UNSIGNED NOT NULL DEFAULT 0.00000,
`wernis_timestamp` VARCHAR(10) NOT NULL DEFAULT 0,
`wernis_type` ENUM('WITHDRAW','PAYOUT','FAILED') NOT NULL DEFAULT 'FAILED',
-`wernis_api_message` TINYTEXT,
+`wernis_api_message` TINYTEXT NOT NULL,
`wernis_api_status` VARCHAR(255) NULL DEFAULT NULL,
PRIMARY KEY (`id`),
INDEX (`userid`)",
return $filterData;
}
+// Generic filter for updating referral counter of currently detected referral id
+function FILTER_GENERIC_UPDATE_USER_REFERRAL ($filterData) {
+ // Make sure the referral id is detected
+ assert(isReferralIdValid());
+
+ // Update ref counter, determineReferralId() must already be called before this filter is executed
+ SQL_QUERY('UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`={%pipe,getReferralId%} LIMIT 1', __FUNCTION__, __LINE__);
+
+ // Return filter data
+ return $filterData;
+}
+
+// Filter for updating sub id records
+function FILTER_UPDATE_USER_SUBID ($filterData) {
+ // Make sure the referral id is detected
+ assert(isReferralIdValid());
+
+ // Get sub id and secure it
+ $subId = SQL_ESCAPE(getRequestElement('subid'));
+
+ // Is the sub id available and registered with referral id?
+ if (countSumTotalData(getReferralId(), 'user_subids', 'id', 'userid', true, sprintf(" AND `subid`='%s'", $subId)) == 1) {
+ // Sub id is assigned to referral id, so add a record
+ SQL_QUERY_ESC("INSERT INTO
+ `{?_MYSQL_PREFIX?}_subid_log`
+(
+ `refid`,
+ `subid`,
+ `referral_url`,
+ `remote_address`,
+ `user_agent`
+) VALUES (
+ {%%pipe,getReferralId%%},
+ '%s',
+ '{%%pipe,detectReferer%%}',
+ '{%%pipe,detectRemoteAddr%%}',
+ '{%%pipe,detectUserAgent%%}'
+)",
+ array(
+ // @NOTE: SQL_QUERY_ESC() already escape it, don't use $subId here
+ getRequestElement('subid')
+ ), __FUNCTION__, __LINE__);
+
+ // Add insert id for other filters
+ $filterData['insert_id'] = SQL_INSERTID();
+
+ // Register sub id in filter
+ setSession('subid', $subId);
+ } // END - if
+
+ // Return filter data
+ return $filterData;
+}
+
// [EOF]
?>
}
// Generates an URL for the dereferer
-function generateDerefererUrl ($url) {
+function generateDereferrerUrl ($url) {
// Don't de-refer our own links!
if (substr($url, 0, strlen(getUrl())) != getUrl()) {
// Encode URL
doGenericListBuilder('member', $listType, $tableName, $columns, $filterFunctions, $extraValues, $idColumn, $userIdColumn, $rawUserId);
}
+// Checks whether given address is IPv4
+function isIp4AddressValid ($address) {
+ // Is there cache?
+ if (!isset($GLOBALS[__FUNCTION__][$address])) {
+ // Determine it ...
+ $GLOBALS[__FUNCTION__][$address] = preg_match('/((25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9])\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[1-9]|0)\.(25[0-5]|2[0-4][0-9]|[0-1]{1}[0-9]{2}|[1-9]{1}[0-9]{1}|[0-9]))/', $address);
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__][$address];
+}
+
// ----------------------------------------------------------------------------
// "Translatation" functions for points_data table
// ----------------------------------------------------------------------------
'USER_404' => "Mitgliedsdaten nicht gefunden! Sind Sie noch angemeldet?",
'ADMIN_UNCONFIRMED_ACCOUNTS' => "Hier alle Accounts, deren Email-Adresse nicht bestätigt ist",
'_USERID' => "Mitglied-Id",
- 'REMOTE_IP' => "IP-Nummer",
+
'REFERRAL_USERID' => "Werber-Id",
'ACCOUNT_STATUS' => "Status",
'ACCOUNT_STATUS_UNKNOWN' => "Unbekannter Status <span class=\"data\">%s</span> erkannt.",
'APPLICATION_DIED_TITLE' => "Bug im Script erkannt.",
'ADMIN_CONTACT_LINK_TITLE' => "Kontakt zum Administrator",
'ADMIN_MAIL_NOTHING_DELETED' => "Die Mail mit der Id <span class=\"data\">%s</span> weisst keine Mitglieder auf.",
+ 'ENTRY_ADDED' => "Eintrag hinzugefügt",
+
+ 'REMOTE_IP' => "IP-Nummer",
+ 'REFERRER_URL' => "Aufrufende Seite",
+ 'USER_AGENT' => "Browserbezeichnung",
+ // Admin - password reset - titles
'ADMIN_RESET_PASSWORD_SEND_LINK_TITLE' => "1/4: Administratorkennwort zurücksetzen",
'ADMIN_VALIDATE_HASH_TITLE' => "2/4: Validierung Iher Logindaten",
'ADMIN_RESET_PASSWORD_TITLE' => "3/4: Neues Passwort eingeben",
'ADMIN_CONFIG_ADMIN_MENU_NOTICE' => "Das Menüsystem mit "logischen Bereichen" ist noch nicht fertig und führt zu Fehlern. Bitte dieses nur im Template aktivieren, wenn Sie daran mitprogrammieren wollen.",
'UNKNOWN_ERROR_CODE' => "Unbekannter Fehlercode <span class=\"data\">0x{%%pipe,getHexErrorCode=%s%%}</span> erkannt.",
'LOADER_SECURITY_HASH_MISMATCH' => "Der Sicherheitshash für den Dereferrer stimmt nicht mit der URL überein.",
+ 'URL_IS_BLACKLISTED' => "URL ist gesperrt.",
+ 'DATA_IS_HIDDEN' => "Daten sind verdeckt.",
// Time units
'TIME_UNIT' => "Zeiteinheit",
// Language definitions
addMessages(array(
- 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse <a href=\"{%pipe,generateDerefererUrl=https://sourceforge.net/projects/phpmailer/%}\" target=\"_blank\">PHPMailer</a> herunter, um diese Funktion nutzen zu können.",
+ 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse <a href=\"{%pipe,generateDereferrerUrl=https://sourceforge.net/projects/phpmailer/%}\" target=\"_blank\">PHPMailer</a> herunter, um diese Funktion nutzen zu können.",
'MEMBER_HTML_TITLE' => "HTML-Emfpang - Einstellung",
'MEMBER_HTML_TEXT' => "In unserem {?mt_word?} ist das Empfangen von HTML-Mails nun möglich. Gleichzeitig können Sie auch selber HTML-Mails versenden. Möchten Sie dies beides nutzen?",
'MEMBER_HTML_ORDER_TITLE' => "HTML- oder normale Text-Mails versenden?",
// Member - sub ids
'MEMBER_USER_SUBIDS_404' => "Sie haben noch keine Sub-Ids angelegt.",
- 'MEMBER_ADD_SUBID_SUBMIT' => "Sub-Id hinzufügen",
+ 'MEMBER_USER_SUBID_NOT_ASSIGNED_404' => "Die angegebene Sub-Id-Kennung ist Ihrem Mitgliedsaccount nicht zugewiesen oder existiert nicht.",
+ 'MEMBER_SUBID_STATS_404' => "Für diese Sub-Id ist noch keine Statistik abfragbar, da sie noch nicht aufgerufen wurde.",
'MEMBER_ENTER_SUBID' => "Geben Sie eine Sub-Id ein:",
'MEMBER_ADD_SUBID_LEGEND' => "Daten zur Sub-Id",
- 'MEMBER_ADD_SUBID_NOTICE' => "<strong>Hinweise:</strong>Mit Sub-Ids haben Sie die Möglichkeit, die Aufrufe Ihres Referral-Linkes noch genauer zu verfolgen. Zum Beispiel können Sie jedem Besuchertausch oder fremden Paidmailer eine eigene Sub-Id vergeben, indem Sie diese hier zuerst eingeben und dann am Ende des Referral-Linkes mit <strong>&subid=<em>Ihre Sub-Id</em></strong> anhängen. Bewerben Sie nun diesen erweiterten Link. Sobald Aufrufe auf diesen erfolgen, können Sie bei der jeweiligen Sub-Id auf "Aufruf-Statistik" klicken, um eine detailierte Statistik zu erhalten. Leerzeichen oder Bindestrichen werden automatisch in Unterstriche umgewandelt, es wurden nur Zeichen von A-Z (klein- und grossgeschrieben) und alle Zahlenzeichen sowie Unterstriche angenommen.",
'MEMBER_SUBID_NO_SELECTIONS' => "Sie haben keine Auswahl getroffen! Bitte navigieren Sie zurück, wählen Sie mindestens eine Sub-Id aus und versuchen Sie es dann erneut.",
'MEMBER_USER_SUBID_STATS_LINK' => "Aufrufstatistiken",
'MEMBER_USER_SUBID_ADDED' => "Sub-Id hinzugefügt",
'MEMBER_CHANGE_USER_SUBID' => "Geben Sie eine neue ein:",
'MEMBER_INVALID_DO_USER_SUBID' => "Ungültiges Sub-Modul aufgerufen! Sollten Sie der Meinung sein, dies ist ein Fehler, so teilen Sie bitte dem Support mit, wie es zu dieser Meldung gekommen ist.",
- 'MEMBER_USER_SUBID_NOT_ASSIGNED_404' => "Die angegebene Sub-Id-Kennung ist Ihrem Mitgliedsaccount nicht zugewiesen oder existiert nicht.",
+ 'MEMBER_BACK_SUBIDS_OVERVIEW_LINK' => "Zurück zur Sub-Id-Übersicht ...",
// Member - sub ids - submit buttons
+ 'MEMBER_USER_SUBIDS_ADD_SUBMIT' => "Sub-Id hinzufügen",
'MEMBER_USER_SUBIDS_CHANGE_SUBMIT' => "Sub-Ids ändern",
'MEMBER_USER_SUBIDS_REMOVE_SUBMIT' => "Sub-Ids löschen",
// Member - sub ids - notices
+ 'MEMBER_ADD_USER_SUBIDS_NOTICE' => "<strong>Hinweise:</strong>Mit Sub-Ids haben Sie die Möglichkeit, die Aufrufe Ihres Referral-Linkes noch genauer zu verfolgen. Zum Beispiel können Sie jedem Besuchertausch oder fremden Paidmailer eine eigene Sub-Id vergeben, indem Sie diese hier zuerst eingeben und dann am Ende des Referral-Linkes mit <strong>&subid=<em>Ihre Sub-Id</em></strong> anhängen. Bewerben Sie nun diesen erweiterten Link. Sobald Aufrufe auf diesen erfolgen, können Sie bei der jeweiligen Sub-Id auf "Aufruf-Statistik" klicken, um eine detailierte Statistik zu erhalten. Leerzeichen oder Bindestrichen werden automatisch in Unterstriche umgewandelt, es wurden nur Zeichen von A-Z (klein- und grossgeschrieben) und alle Zahlenzeichen sowie Unterstriche angenommen.",
'MEMBER_EDIT_USER_SUBIDS_NOTICE' => "Wenn Sie doch nichts ändern wollen, klicken Sie einfach auf <strong>{--MEMBER_USER_SUBIDS_CHANGE_SUBMIT--}</strong> oder in der Navigation <strong>{--YOU_ARE_HERE--}</strong> auf Sub-Id Tracking.",
'MEMBER_DELETE_USER_SUBIDS_NOTICE' => "Wollen Sie die oben aufgeführte(n) Sub-Id(s) wirklich löschen? Dieses ist nicht umkehrbar! Die Statistik dazu bleibt noch eine Weile gespeichert, ist aber nicht mehr aus der Auswahl aufrufbar (Sie können sich ja den Link notieren?).",
'MEMBER_ADD_SUBID_TITLE' => "Neue Sub-Id anlegen",
'MEMBER_EDIT_USER_SUBIDS_TITLE' => "Ausgewählte Sub-Ids editieren",
'MEMBER_DELETE_USER_SUBIDS_TITLE' => "Ausgewählte Sub-Ids löschen",
+ 'MEMBER_SUBID_STATS_TITLE' => "Aufrufstatistik für Ihre Sub-Ids",
// Member - sub ids - subject lines
'ADMIN_ADD_USER_SUBIDS_SUBJECT' => "Sub-Id wurde hinzugefügt",
} // END - foreach
// Now replace the URL against anchor container and pray...
- $text = substr($text, 0, strpos($text, $check2)) . '<a href="' . generateDerefererUrl($check) . '" target="_blank">' . $check . '</a>' . substr($text, strpos($text, $check2) + strlen($check));
+ $text = substr($text, 0, strpos($text, $check2)) . '<a href="' . generateDereferrerUrl($check) . '" target="_blank">' . $check . '</a>' . substr($text, strpos($text, $check2) + strlen($check));
// Finally remove the url from testing string (or we have a loop and maybe server overload!)
$test = substr($test, strpos($test, $check) + strlen($check));
} // END - foreach
// Now replace the URL against anchor container and pray...
- $text = substr($text, 0, strpos($text, $check2)) . generateDerefererUrl($check) . substr($text, strpos($text, $check2) + strlen($check));
+ $text = substr($text, 0, strpos($text, $check2)) . generateDereferrerUrl($check) . substr($text, strpos($text, $check2) + strlen($check));
// Finally remove the url from testing string (or we have a loop and maybe server overload!)
$test = substr($test, strpos($test, $check) + strlen($check));
case 'member':
// Build frameset
$content['order'] = bigintval(getRequestElement('order'));
- $content['url'] = generateDerefererUrl($url);
+ $content['url'] = generateDereferrerUrl($url);
loadTemplate('member_order_frametester', false, $content);
break;
case 'guest':
- $content['url'] = generateDerefererUrl($url);
+ $content['url'] = generateDereferrerUrl($url);
loadTemplate('guest_frametester', false, $content);
break;
} // END - switch
redirectToUrl('modules.php?module=login&what=subids');
}
+// List all entries
+showEntriesByXmlCallback('member_list_subid_stats');
+
// [EOF]
?>
} // END - if
// And shall I check that his URL is not in the black list?
- if (isUrlBlacklistEnabled()) {
- // Ok, I do that for you know...
- $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS tstamp FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
- array(postRequestElement('url')), __FILE__, __LINE__);
-
- if (SQL_NUMROWS($result) == 1) {
- // Jupp, we got one listed
- list($blist) = SQL_FETCHROW($result);
-
- // Create redirect-URL
- $url = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $blist;
- } // END - if
-
- // Free result
- SQL_FREERESULT($result);
+ if (isUrlBlacklisted(postRequestElement('url'))) {
+ // Create redirect-URL
+ $url = 'modules.php?module=login&what=order&code=' . getCode('BLIST_URL') . '&blist=' . $GLOBALS['blacklist_data'][postRequestElement('url')]['timestamp'];
} // END - if
// Enougth receivers entered?
// Textlink
$content['target_account'] = $content['link_text'];
}
- $content['target_bank'] = '<a href="' . generateDerefererUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
+ $content['target_bank'] = '<a href="' . generateDereferrerUrl($content['url']) . '" target="_blank">{--CLICK_HERE--}</a>';
} // END - if
// Prepare data for the template
);
}
+// Checks whether given URL is blacklisted
+function isUrlBlacklisted ($url) {
+ // Mark it as not listed by default
+ $listed = false;
+
+ // Is black-listing enbaled?
+ if (!isUrlBlacklistEnabled()) {
+ // No, then all URLs are not in this list
+ return false;
+ } elseif (!isset($GLOBALS['blacklist_data'][$url])) {
+ // Check black-list for given URL
+ $result = SQL_QUERY_ESC("SELECT UNIX_TIMESTAMP(`timestamp`) AS `blist_timestamp` FROM `{?_MYSQL_PREFIX?}_url_blacklist` WHERE `url`='%s' LIMIT 1",
+ array($url), __FILE__, __LINE__);
+
+ // Is there an entry?
+ if (SQL_NUMROWS($result) == 1) {
+ // Jupp, we got one listed
+ $GLOBALS['blacklist_data'][$url] = SQL_FETCHARRAY($result);
+
+ // Mark it as listed
+ $listed = true;
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } else {
+ // Is found in cache -> black-listed
+ $listed = true;
+ }
+
+ // Return result
+ return $listed;
+}
+
// [EOF]
?>
return $content;
}
+// Tries to anonymize some sensitive data (e.g. IP address, user agent, referrer, etc.)
+function anonymizeSensitiveData ($data) {
+ // Trim it
+ $data = trim($data);
+
+ // Is it empty?
+ if (empty($data)) {
+ // Then add three dashes
+ $data = '---';
+ } elseif (isUrlValid($data)) {
+ // Is a referrer, so is it black-listed?
+ if (isAdmin()) {
+ // Is admin, has always priority
+ $data = '[<a href="{%pipe,generateFrametesterUrl=' . $data . '%}" target="_blank">{--ADMIN_TEST_URL--}</a>]';
+ } elseif (isUrlBlacklisted($data)) {
+ // Yes, so replace it with text
+ $data = '<em>{--URL_IS_BLACKLISTED--}</em>';
+ } else {
+ // A member is viewing this referral URL
+ $data = '[<a href="{%pipe,generateDereferrerUrl=' . $data . '%}" target="_blank">{--MEMBER_TEST_URL--}</a>]';
+ }
+ } elseif (isIp4AddressValid($data)) {
+ // Is an IPv4 address
+ $ipArray = explode('.', $data);
+
+ // Only display first 2 octets
+ $data = $ipArray[0] . '.' . $ipArray[1] . '.?.?';
+ } else {
+ // Generic data
+ $data = '<em>{--DATA_IS_HIDDEN--}</em>';
+ }
+
+ // Return it (hopefully) anonymized
+ return $data;
+}
+
// [EOF]
?>
// Wrapper function to redirect to de-refered URL
function redirectToDereferedUrl ($url) {
// Redirect to to
- redirectToUrl(generateDerefererUrl($url));
+ redirectToUrl(generateDereferrerUrl($url));
}
// Wrapper function for checking if extension is installed and newer or same version
// Check for determined referral id
if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(determineReferralId()))) {
- // Update ref counter
- SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
- array(determineReferralId()), __FILE__, __LINE__);
+ // Run filter chain for updating referral data
+ runFilterChain('update_referral_data');
// Base URL for redirection
switch (getConfig('refid_target')) {
case 'index':
$url = 'modules.php?module=index';
break;
+
+ default: // Is not valid
+ reportBug(__FILE__, __LINE__, 'Invalid refid target ' . getConfig('refid_target') . ' detected.');
+ break;
} // END - switch
} // END - if
<td class="right" align="center">$content[id]</td>
<td class="right" align="center">$content[subject]</td>
<td class="right" align="center">
- <a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a>
</td>
<td class="right" align="center">$content[timestamp]</td>
<td align="center">$content[count]</td>
<td class="top right" align="center">{%pipe,generateUserProfileLink=$content[sender]%}</td>
<td class="top right" align="center">$content[subject]</td>
<td class="top right" align="center">
- <a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a>
</td>
<td class="top" align="center">$content[timestamp]</td>
</tr>
<tr>
<td class="right" align="center">$content[id]</td>
<td class="right" align="center">$content[subject]</td>
- <td class="right" align="center"><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></td>
+ <td class="right" align="center"><a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></td>
<td class="right" align="center">$content[timestamp]</td>
<td align="center">$content[count]</td>
</tr>
$content[email]
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
- <a href="{%pipe,generateDerefererUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
</td>
<td class="{%template,ColorSwitch%} bottom" align="center">
v$content[theme_version]
<a href="mailto:$content[theme_email]?Subject=[Theme:] $content[theme_name] ($content[unix])">$content[theme_author]</a>
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
- <a href="{%pipe,generateDerefererUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">v$content[theme_version]</td>
<td class="{%template,ColorSwitch%} bottom" align="center">
</tr>
<tr>
<td align="right" class="bottom right">{--SPONSOR_ENTER_URL--}:</td>
- <td class="bottom">[<a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank"><strong>{--ADMIN_TEST_URL--}</strong></a>]</td>
+ <td class="bottom">[<a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank"><strong>{--ADMIN_TEST_URL--}</strong></a>]</td>
</tr>
<tr>
<td colspan="2" align="center" class="table_header bottom">
<frameset rows="120,*" frameborder="no" framespacing="0" border="0">
<frame name="mailid_top" src="{%url=mailid_top.php?userid=$content[userid]&$content[type]=$content[data]%}" />
- <frame name="mailid_url" src="{%pipe,generateDerefererUrl=$content[url]%}" />
+ <frame name="mailid_url" src="{%pipe,generateDereferrerUrl=$content[url]%}" />
</frameset>
<noframes>
Ihr Browser unterstützt keine frames!
<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--}" />
+ <input type="submit" name="add_subid" class="form_submit" value="{--MEMBER_USER_SUBIDS_ADD_SUBMIT--}" />
</div>
</div>
</form>
</div>
<div class="notice">
- {--MEMBER_ADD_SUBID_NOTICE--}
+ {--MEMBER_ADD_USER_SUBIDS_NOTICE--}
</div>
--- /dev/null
+<div align="center">
+<table border="0" cellspacing="0" cellpadding="0" class="table dashed">
+ <tr>
+ <td colspan="6" align="center" class="table_header bottom">
+ <strong>{--MEMBER_SUBID_STATS_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"><strong>{--SUBID_VALUE--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--REFERRER_URL--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--REMOTE_IP--}</strong></td>
+ <td align="center" class="header_column bottom right"><strong>{--USER_AGENT--}</strong></td>
+ <td align="center" class="header_column bottom"><strong>{--ENTRY_ADDED--}</strong></td>
+ </tr>
+ $content
+ <tr>
+ <td colspan="6" class="table_footer">
+ <a href="{%url=modules.php?module=login&what=subids%}">{--MEMBER_BACK_SUBIDS_OVERVIEW_LINK--}</a>
+ </td>
+ </tr>
+</table>
+</div>
--- /dev/null
+<tr>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">
+ <strong>$content[id]</strong>
+ </td>
+ <td class="{%template,ColorSwitch%} bottom right" align="center">
+ $content[subid]
+ </td>
+ <td class="{%template,ColorSwitch%} bottom right">
+ {%pipe,anonymizeSensitiveData=$content[referral_url]%}
+ </td>
+ <td class="{%template,ColorSwitch%} bottom right">
+ {%pipe,anonymizeSensitiveData=$content[remote_address]%}
+ </td>
+ <td class="{%template,ColorSwitch%} bottom right">
+ {%pipe,anonymizeSensitiveData=$content[user_agent]%}
+ </td>
+ <td class="{%template,ColorSwitch%} bottom" align="center">
+ $content[entry_added]
+ </td>
+</tr>
<tr>
<td align="center" class="{%template,ColorSwitch%} bottom right">
- <a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank" title="{--MEMBER_TEST_URL--}">{--MEMBER_SURFBAR_TEST_URL--}</a>
</td>
<td align="center" class="{%template,ColorSwitch%} bottom right">
{%pipe,translateSurfbarUrlStatus=$content[url_status]%}
</td>
<td align="center" class="{%template,ColorSwitch%} top">
{--EMAIL_URL--}:<br />
- <strong><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong>
+ <strong><a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong>
</td>
</tr>
<tr>
<tr>
<td colspan="2" align="center" class="{%template,ColorSwitch%} top right">
{--EMAIL_URL--}:<br />
- <strong><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong>
+ <strong><a href="{%pipe,generateDereferrerUrl=$content[url]%}" target="_blank">{--MEMBER_TEST_URL--}</a></strong>
</td>
<td align="center" class="{%template,ColorSwitch%} top">
{--MEMBER_EMAIL_END_SEND--}:<br />
<a href="mailto:$content[theme_email]?Subject=[Theme:] $content[theme_name] ($content[unix])">$content[theme_author]</a>
</td>
<td class="{%template,ColorSwitch%} bottom right" align="center">
- <a href="{%pipe,generateDerefererUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
+ <a href="{%pipe,generateDereferrerUrl=$content[theme_url]%}" target="_blank">$content[theme_url]</a>
</td>
<td class="{%template,ColorSwitch%} bottom" align="center">v$content[theme_version]</td>
</tr>
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+This template provides meta data for listing member's sub id statistics
+
+@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_subid_stats" />
+ <!--
+ 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_subid_stats_row" />
+ <!--
+ Message id to display if no entry could be found
+ //-->
+ <no-entry-found-message type="string" value="MEMBER_SUBID_STATS_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="subid_log" />
+ <!--
+ 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="referral_url" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="remote_address" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="user_agent" alias="" function="" />
+ <select-data-from-list-entry type="string" table="" value="entry_added" alias="entry_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="refid" 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="entry_added" value="DESC" />
+ </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="entry_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="entry_added" value="2" />
+ </callback-extra-parameter-list>
+ </column-callback-list-entry>
+ </column-callback-list>
+</member-list-data>