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
loadIncludeOnce($inc);
} else {
// Bye, bye...
- die('Cannot load database abstraction layer <u>' . getConfig('_DB_TYPE') . '</u> -> R.I.P.');
+ debug_report_bug(__FILE__, __LINE__, 'Cannot load database abstraction layer <u>' . getConfig('_DB_TYPE') . '</u> -> R.I.P.');
}
// [EOF]
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
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());
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());
// 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
$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);
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
// 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 {
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:",
'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:",
'ADMIN_FORCED_ADS_ADDED' => "Hinzugefügt",
// Earning names
- 'EARNING_NAME_FORCED_POPUP' => "Forced-PopUp",
+ 'EARNING_PROVIDER_FORCED_POPUP' => "Forced-PopUp",
));
// [EOF]
}
// 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
// "earning group"
'earning_group' => 'INVALID',
// "earning name" again
- 'earning_name' => $earningName
+ 'earning_provider' => $earningProvider
);
// Run the filter chain to get the data
// 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
// "Getter" for an array of data from all Forced-PopUps
function getForcedPopupDataByEarningArray ($content) {
- die(__FUNCTION__ . ':content=<pre>'.print_r($content,true).'</pre>');
+ debug_report_bug(__FUNCTION__, __LINE__, 'content=' . print_r($content, true));
}
// [EOF]
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 08/04/2011 *
+ * =================== Last change: 08/04/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-list_forced_campaigns.php *
+ * -------------------------------------------------------------------- *
+ * Short description : List/add Forced-Ads *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Auflisten/Hinzufuegen von Forced-Werbemitteln *
+ * -------------------------------------------------------------------- *
+ * $Revision:: $ *
+ * $Date:: $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: $ *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if ((!defined('__SECURITY')) || (!isAdmin())) {
+ die();
+} // END - if
+
+// Add description as navigation point
+addYouAreHereLink('admin', __FILE__);
+
+// By default show the list...
+$show = true;
+
+// Check for 'url_id' element
+if ((countRequestPost() > 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]
+?>
$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
// 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
<strong>{%pipe,translateEarningGroup=$content[earning_group]%}</strong>
</div>
<div style="padding-top:3px;padding-bottom:3px" class="bottom">
- {--MEMBER_EARNING_DATA_NAME--}<br />
- <strong>{%pipe,translateEarningName=$content[earning_name]%}</strong>
+ {--MEMBER_EARNING_DATA_PROVIDER--}<br />
+ <strong>{%pipe,translateEarningProvider=$content[earning_provider]%}</strong>
</div>
<div class="table_footer notice">
{--MEMBER_EARNING_DATA_INVALID_NOTE--}
<form accept-charset="UTF-8" id="earning_$content[earning_id]" action="{%url=modules.php?module=login&what=earning%}" method="post">
<div class="table dashed">
<div class="table_header bottom">
- <strong>{%message,MEMBER_EARNING_POPUP_FORM_TITLE=$content[earning_name]%}</strong>
+ <strong>{%message,MEMBER_EARNING_POPUP_FORM_TITLE=$content[earning_provider]%}</strong>
</div>
<div class="bottom" style="height:25px;padding-top:5px">
{--MEMBER_EARNING_ENTER_DAILY_POPUP_AMOUNT--}
<input type="text" class="form_field" name="earning_daily_amount" size="5" maxlength="20" />
</div>
<div class="bottom">
- {%pipe,generateMemberEarningDataTable=$content[earning_name]%}
+ {%pipe,generateMemberEarningDataTable=$content[earning_provider]%}
</div>
<div class="table_footer">
<input type="hidden" name="earning_id" value="$content[earning_id]" />
<form accept-charset="UTF-8" id="earning_$content[earning_id]" action="{%url=modules.php?module=login&what=earning%}" method="post">
<div class="table dashed">
<div class="table_header bottom">
- <strong>{%message,MEMBER_EARNING_POPUP_FORM_TITLE=$content[earning_name]%}</strong>
+ <strong>{%message,MEMBER_EARNING_POPUP_FORM_TITLE=$content[earning_provider]%}</strong>
</div>
<div class="bottom" style="padding-top:5px;padding-bottom:5px">
{--MEMBER_EARNING_CHANGE_DAILY_POPUP_AMOUNT--}