From: Roland Häder Date: Sat, 25 Jun 2011 00:46:57 +0000 (+0000) Subject: Introduced function determinePointsColumnFromSubjectLocked(), renamed filter: X-Git-Url: https://git.mxchange.org/?p=mailer.git;a=commitdiff_plain;h=317ccb4b7ab8f37a0ab003e474a9bc1fd5e3f3ad;ds=sidebyside Introduced function determinePointsColumnFromSubjectLocked(), renamed filter: - Introduced function determinePointsColumnFromSubjectLocked() which allows to "route" added points to a different user's sub-account than just 'normal' and 'locked'. - Renamed filter 'add_points' to 'post_add_points'. You NEED to re-install ext-mediadata to get accurate media data back (ext-booking is still in development) --- diff --git a/inc/extensions/ext-booking.php b/inc/extensions/ext-booking.php index 7993769548..aa0f8f1ee2 100644 --- a/inc/extensions/ext-booking.php +++ b/inc/extensions/ext-booking.php @@ -77,7 +77,7 @@ PRIMARY KEY (`id`) addMemberMenuSql('main','booking','{OPEN_CONFIG}POINTS{CLOSE_CONFIG}-Kontoauszug','N','Y',5); // Add the filters - registerFilter('add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun()); + registerFilter('post_add_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun()); registerFilter('sub_points', 'ADD_BOOKING_RECORD', false, true, isExtensionDryRun()); break; @@ -87,7 +87,7 @@ PRIMARY KEY (`id`) addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='booking'"); // Remove the filters - unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun()); + unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun()); unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'ADD_BOOKING_RECORD', true, isExtensionDryRun()); break; diff --git a/inc/extensions/ext-mediadata.php b/inc/extensions/ext-mediadata.php index 3612365add..71da33b5aa 100644 --- a/inc/extensions/ext-mediadata.php +++ b/inc/extensions/ext-mediadata.php @@ -55,7 +55,7 @@ switch (getExtensionMode()) { addExtensionSql(''); // Add the filters - registerFilter('add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun()); + registerFilter('post_add_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun()); registerFilter('sub_points', 'UPDATE_MEDIADATA_ENTRY', false, true, isExtensionDryRun()); break; @@ -66,7 +66,7 @@ switch (getExtensionMode()) { addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `what`='mediadata'"); // Remove the filters - unregisterFilter(__FUNCTION__, __LINE__, 'add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun()); + unregisterFilter(__FUNCTION__, __LINE__, 'post_add_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun()); unregisterFilter(__FUNCTION__, __LINE__, 'sub_points', 'UPDATE_MEDIADATA_ENTRY', true, isExtensionDryRun()); break; diff --git a/inc/filters.php b/inc/filters.php index 9a2ca2d526..fec9baeae0 100644 --- a/inc/filters.php +++ b/inc/filters.php @@ -304,7 +304,9 @@ function FILTER_UPDATE_LOGIN_DATA () { $content = getUserDataArray(); // Maybe first login time? - if (empty($content['last_module'])) $content['last_module'] = 'login'; + if (empty($content['last_module'])) { + $content['last_module'] = 'login'; + } // END - if // This will be displayed on welcome page! :-) if (empty($GLOBALS['last_online']['module'])) { @@ -316,7 +318,9 @@ function FILTER_UPDATE_LOGIN_DATA () { if (!isWhatSet()) { // Fix it to default setWhat('welcome'); - if (getIndexHome() != '') setWhatFromConfig('index_home'); + if (getIndexHome() != '') { + setWhatFromConfig('index_home'); + } // END - if } // END - if // Update last module / online time diff --git a/inc/mysql-manager.php b/inc/mysql-manager.php index 143048b6de..58ea2ccaf1 100644 --- a/inc/mysql-manager.php +++ b/inc/mysql-manager.php @@ -996,7 +996,7 @@ function getReferalLevelPercents ($level) { /** * - * Dynamic referal system, can also send mails! + * Dynamic referal and points system, can also send mails! * * subject = Subject line, write in lower-case letters and underscore is allowed * userid = Referal id wich should receive... @@ -1007,19 +1007,18 @@ function getReferalLevelPercents ($level) { * add_mode = Add points only to $userid or also refs? (WARNING! Changing 'ref' to 'direct' * for default value will cause no referal will get points ever!!!) */ -function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $add_mode = 'ref') { +function addPointsThroughReferalSystem ($subject, $userid, $points, $sendNotify = false, $refid = '0', $addMode = 'ref') { // By default nothing has been added $added = false; //* DEBUG: */ debugOutput('----------------------- ' . __FUNCTION__ . ' - ENTRY ------------------------