From: Roland Häder Date: Fri, 5 Aug 2011 07:43:47 +0000 (+0000) Subject: earning_name renamed to earning_provider X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=f328172e16c619d30889fac830e873f2eeef857a;p=mailer.git earning_name renamed to earning_provider --- diff --git a/.gitattributes b/.gitattributes index f93f232da8..60f5bfe0fc 100644 --- a/.gitattributes +++ b/.gitattributes @@ -533,6 +533,7 @@ inc/modules/admin/what-list_coupon.php svneol=native#text/plain inc/modules/admin/what-list_doubler.php svneol=native#text/plain inc/modules/admin/what-list_email_max_rec.php svneol=native#text/plain inc/modules/admin/what-list_forced_ads.php svneol=native#text/plain +inc/modules/admin/what-list_forced_campaigns.php svneol=native#text/plain inc/modules/admin/what-list_holiday.php svneol=native#text/plain inc/modules/admin/what-list_links.php svneol=native#text/plain inc/modules/admin/what-list_network_api_translation.php svneol=native#text/plain diff --git a/inc/db/lib.php b/inc/db/lib.php index d703948c98..c18c0adaa1 100644 --- a/inc/db/lib.php +++ b/inc/db/lib.php @@ -48,7 +48,7 @@ if (isIncludeReadable($inc)) { loadIncludeOnce($inc); } else { // Bye, bye... - die('Cannot load database abstraction layer ' . getConfig('_DB_TYPE') . ' -> R.I.P.'); + debug_report_bug(__FILE__, __LINE__, 'Cannot load database abstraction layer ' . getConfig('_DB_TYPE') . ' -> R.I.P.'); } // [EOF] diff --git a/inc/extensions/ext-earning.php b/inc/extensions/ext-earning.php index 4934f2a78c..52f103d50b 100644 --- a/inc/extensions/ext-earning.php +++ b/inc/extensions/ext-earning.php @@ -62,10 +62,10 @@ switch (getExtensionMode()) { addCreateTableSql('earning_data', " `earning_id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT, `earning_group` VARCHAR(255) NOT NULL DEFAULT 'INVALID', -`earning_name` VARCHAR(255) NOT NULL DEFAULT 'INVALID', +`earning_provider` VARCHAR(255) NOT NULL DEFAULT 'INVALID', `earning_sorting` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0, PRIMARY KEY (`earning_id`), -UNIQUE `earning_group_name` (`earning_group`,`earning_name`)", +UNIQUE `earning_group_name` (`earning_group`,`earning_provider`)", 'Registered (extra) earnings'); // User->earnings connection table diff --git a/inc/extensions/ext-forced.php b/inc/extensions/ext-forced.php index fc0eb66b93..1c8c17f759 100644 --- a/inc/extensions/ext-forced.php +++ b/inc/extensions/ext-forced.php @@ -134,7 +134,7 @@ INDEX (`forced_stats_userid`)", addMemberMenuSql('extras', 'book_forced', 'Forced-Kampagne buchen', 3); // Register Forced-PopUps with earning_data table - addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_earning_data` (`earning_group`,`earning_name`,`earning_sorting`) VALUES ('POPUP','FORCED_POPUP',1)"); + addExtensionSql("INSERT INTO `{?_MYSQL_PREFIX?}_earning_data` (`earning_group`,`earning_provider`,`earning_sorting`) VALUES ('POPUP','FORCED_POPUP',1)"); // Register filters registerFilter('add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', false, true, isExtensionDryRun()); @@ -152,8 +152,11 @@ INDEX (`forced_stats_userid`)", addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `action`='forced'"); addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what` IN ('forced_banner','forced_textlink','book_forced') LIMIT 3"); - // Unregister Forced-PopUps from earning_data - addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_earning_data` WHERE `earning_name`='FORCED_POPUP' LIMIT 1"); + // Is earning_data there? + if (isSqlTableCreated('earning_data')) { + // Unregister Forced-PopUps from earning_data + addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_earning_data` WHERE `earning_provider`='FORCED_POPUP' LIMIT 1"); + } // END - if // Remove filter unregisterFilter(__FUNCTION__, __LINE__, 'add_forced_ads_types', 'FORCED_AD_TYPE_DEFAULTS', true, isExtensionDryRun()); diff --git a/inc/filter/earning_filter.php b/inc/filter/earning_filter.php index 3378375c5f..1c93328607 100644 --- a/inc/filter/earning_filter.php +++ b/inc/filter/earning_filter.php @@ -52,7 +52,7 @@ function FILTER_ADD_EARNING_GROUP_POPUP ($filterData) { // Now check if the user has subscription and amount left $result = SQL_QUERY_ESC("SELECT d.`earning_id`, - d.`earning_name`, + d.`earning_provider`, u.`earning_current_amount`, u.`earning_daily_amount` FROM @@ -80,7 +80,7 @@ ORDER BY $content = merge_array($content, $filterData); // Construct callback function name - $callbackName = 'get' . capitalizeUnderscoreString($content['earning_name']) . 'DataByEarningArray'; + $callbackName = 'get' . capitalizeUnderscoreString($content['earning_provider']) . 'DataByEarningArray'; // And call it $content = call_user_func($callbackName, $content); diff --git a/inc/filter/forced_filter.php b/inc/filter/forced_filter.php index 2ddd254bdf..7b9bb28931 100644 --- a/inc/filter/forced_filter.php +++ b/inc/filter/forced_filter.php @@ -65,11 +65,12 @@ function FILTER_FORCED_AD_TYPE_DEFAULTS ($data) { function FILTER_FORCED_POPUP_TABLE_DATA ($filterData) { //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!'); // Is this the right filter? - if ($filterData['earning_name'] == 'FORCED_POPUP') { + if ($filterData['earning_provider'] == 'FORCED_POPUP') { // Set group $filterData['earning_group'] = 'POPUP'; // Get max/min/count of all popups + // @TODO This part is unfinished //die(__FUNCTION__.':OK!'); } // END - if diff --git a/inc/functions.php b/inc/functions.php index df40ef0d65..26d0bafc5a 100644 --- a/inc/functions.php +++ b/inc/functions.php @@ -2173,7 +2173,7 @@ function handleFieldWithBraces ($field) { // Converts a zero or NULL to word 'NULL' function makeZeroToNull ($number) { // Is it a valid username? - if ((!is_null($number)) && ($number > 0)) { + if ((!is_null($number)) && (!empty($number)) && ($number > 0)) { // Always secure it $number = bigintval($number); } else { diff --git a/inc/language/earning_de.php b/inc/language/earning_de.php index 96a721c987..37411a49e9 100644 --- a/inc/language/earning_de.php +++ b/inc/language/earning_de.php @@ -44,7 +44,7 @@ if (!defined('__SECURITY')) { addMessages(array( // Member strings 'MEMBER_EARNINGS_404' => "Es wurden noch keine Zusatzverdienste durch die Administratoren eingerichtet. Bitte kommen Sie später hier erneut vorbei.", - 'MEMBER_EARNING_POPUP_FORM_TITLE' => "Zusatzverdienst durch PopUps - Kategorie: {%%pipe,translateEarningName=%s%%}", + 'MEMBER_EARNING_POPUP_FORM_TITLE' => "Zusatzverdienst durch PopUps - Kategorie: {%%pipe,translateEarningProvider=%s%%}", 'MEMBER_EARNING_ENTER_DAILY_POPUP_AMOUNT' => "Wie viele PopUps wollen Sie im Login täglich maximal sehen?", 'MEMBER_EARNING_SUBSCRIBE_SUBMIT' => "Zusatzverdienst aktivieren", 'MEMBER_EARNING_DATA_MIN_POINTS' => "Mindestens verdienbar:", @@ -52,7 +52,7 @@ addMessages(array( 'MEMBER_EARNING_DATA_COUNT' => "Anzahl Verdiensteinträge:", 'MEMBER_EARNING_DATA_EXCLUDE_USERID' => "Ausgeschlossene Mitgliedsnummer:", 'MEMBER_EARNING_DATA_GROUP' => "Gruppe Zusatzverdienst:", - 'MEMBER_EARNING_DATA_NAME' => "Bezeichnung Zusatzverdienst:", + 'MEMBER_EARNING_DATA_PROVIDER' => "Bezeichnung Zusatzverdienst:", 'MEMBER_EARNING_CHANGE_DAILY_POPUP_AMOUNT' => "Ändern von täglich maximal eingeblendeten PopUps:", 'MEMBER_EARNING_CHANGE_IS_ACTIVE' => "Zusatzverdienst aktiv?", 'MEMBER_EARNING_POINTS' => "Bereits erzielter Zusatzverdienst:", diff --git a/inc/language/forced_de.php b/inc/language/forced_de.php index cad4041102..09cf5c39e0 100644 --- a/inc/language/forced_de.php +++ b/inc/language/forced_de.php @@ -68,7 +68,7 @@ addMessages(array( 'ADMIN_FORCED_ADS_ADDED' => "Hinzugefügt", // Earning names - 'EARNING_NAME_FORCED_POPUP' => "Forced-PopUp", + 'EARNING_PROVIDER_FORCED_POPUP' => "Forced-PopUp", )); // [EOF] diff --git a/inc/libs/earning_functions.php b/inc/libs/earning_functions.php index 809fda2563..b0300dbcf0 100644 --- a/inc/libs/earning_functions.php +++ b/inc/libs/earning_functions.php @@ -46,18 +46,18 @@ function translateEarningGroup ($earningGroup) { } // Translates the "earning name" into human-readable -function translateEarningName ($earningName) { - return sprintf("{--EARNING_NAME_%s--}", $earningName); +function translateEarningProvider ($earningProvider) { + return sprintf("{--EARNING_PROVIDER_%s--}", $earningProvider); } /* * Generates a table (with templates) to display data for extra earnings (to * the member) by given "earning name". * - * @param $earningName Name of the earning + * @param $earningProvider Name of the earning * @return $output Generated HTML output */ -function generateMemberEarningDataTable ($earningName) { +function generateMemberEarningDataTable ($earningProvider) { // Init array for filter $filterData = array( // Minimum points to get @@ -72,7 +72,7 @@ function generateMemberEarningDataTable ($earningName) { // "earning group" 'earning_group' => 'INVALID', // "earning name" again - 'earning_name' => $earningName + 'earning_provider' => $earningProvider ); // Run the filter chain to get the data diff --git a/inc/libs/forced_functions.php b/inc/libs/forced_functions.php index cd2aba8ba1..84dceb8851 100644 --- a/inc/libs/forced_functions.php +++ b/inc/libs/forced_functions.php @@ -54,8 +54,12 @@ function doTemplateForcedAdTypeSelectionBox ($templateName, $clear = false, $def // Translate the status IN/OUT function translateForcedAdType ($status) { - // Is the status empty? - if (empty($status)) { + // Is the status null or empty? + if (is_null($status)) { + // Is NULL + $status = 'NULL'; + } elseif (empty($status)) { + // Is empty (string) $status = 'EMPTY'; } // END - if @@ -77,7 +81,7 @@ function translateForcedAdType ($status) { // "Getter" for an array of data from all Forced-PopUps function getForcedPopupDataByEarningArray ($content) { - die(__FUNCTION__ . ':content=
'.print_r($content,true).'
'); + debug_report_bug(__FUNCTION__, __LINE__, 'content=' . print_r($content, true)); } // [EOF] diff --git a/inc/modules/admin/what-list_forced_campaigns.php b/inc/modules/admin/what-list_forced_campaigns.php new file mode 100644 index 0000000000..4656edd2a1 --- /dev/null +++ b/inc/modules/admin/what-list_forced_campaigns.php @@ -0,0 +1,95 @@ + 0) && ((!isPostRequestElementSet('forced_campaigns_id')) || (!is_array(postRequestElement('forced_campaigns_id'))) || (count(postRequestElement('forced_campaigns_id')) == 0))) { + // Not found so output message + displayMessage('{--ADMIN_FORCED_CAMPAIGNS_NO_SELECTIONS--}'); + + // Abort here + return; +} // END - if + +// Edit or delete button hit? +if (isFormSent('add')) { + // Add new forced ad + showEntriesByXmlCallback('admin_add_do_forced_campaigns'); +} elseif (isFormSent('edit')) { + // Show entries for editing + showEntriesByXmlCallback('admin_edit_show_forced_campaigns'); + + // Do not show the list of URLs after this template + $show = false; +} elseif (isFormSent('do_edit')) { + // Change data of entries + showEntriesByXmlCallback('admin_edit_do_forced_campaigns'); +} elseif (isFormSent('delete')) { + // Show entries for deletion + showEntriesByXmlCallback('admin_delete_show_forced_campaigns'); + + // Do not show the list of URLs after this template + $show = false; +} elseif (isFormSent('do_delete')) { + // Remove entries from database + showEntriesByXmlCallback('admin_delete_do_forced_campaigns'); +} + +// Show entries? +if ($show === false) { + // No, a form has already been show + return false; +} // END - if + +// List all URLs +showEntriesByXmlCallback('admin_list_forced_campaigns'); + +// Display form for adding a forced-ad +loadTemplate('admin_add_forced_campaign'); + +// [EOF] +?> diff --git a/inc/modules/member/what-earning.php b/inc/modules/member/what-earning.php index a9ffe4f708..27c2a9a3ae 100644 --- a/inc/modules/member/what-earning.php +++ b/inc/modules/member/what-earning.php @@ -59,7 +59,7 @@ if (isFormSent()) { $result = SQL_QUERY('SELECT d.`earning_id`, d.`earning_group`, - d.`earning_name` + d.`earning_provider` FROM `{?_MYSQL_PREFIX?}_earning_data` AS d ORDER BY diff --git a/inc/xml-functions.php b/inc/xml-functions.php index 09373597f1..6011378073 100644 --- a/inc/xml-functions.php +++ b/inc/xml-functions.php @@ -185,7 +185,9 @@ function xmlCharacterHandler ($resource, $characters) { // Nothing to handle return; } // END - if - die('characters[]='.strlen($characters)); + + // @TODO Handle characters + die(__FUNCTION__ . ':characters[]='.strlen($characters)); } // Checks if given type is valid, makes all lower-case diff --git a/templates/de/html/member/member_earning_data_invalid.tpl b/templates/de/html/member/member_earning_data_invalid.tpl index 303357540f..e3aefafe15 100644 --- a/templates/de/html/member/member_earning_data_invalid.tpl +++ b/templates/de/html/member/member_earning_data_invalid.tpl @@ -23,8 +23,8 @@ {%pipe,translateEarningGroup=$content[earning_group]%}
- {--MEMBER_EARNING_DATA_NAME--}
- {%pipe,translateEarningName=$content[earning_name]%} + {--MEMBER_EARNING_DATA_PROVIDER--}
+ {%pipe,translateEarningProvider=$content[earning_provider]%}