inc/filter/booking_filter.php svneol=native#text/plain
inc/filter/cache_filter.php svneol=native#text/plain
inc/filter/coupon_filter.php svneol=native#text/plain
+inc/filter/earning_filter.php svneol=native#text/plain
inc/filter/forced_filter.php svneol=native#text/plain
inc/filter/mediadata_filter.php svneol=native#text/plain
inc/filter/online_filter.php svneol=native#text/plain
inc/modules/member/what-cash_coupon.php svneol=native#text/plain
inc/modules/member/what-categories.php svneol=native#text/plain
inc/modules/member/what-doubler.php svneol=native#text/plain
+inc/modules/member/what-earning.php svneol=native#text/plain
inc/modules/member/what-earnings.php svneol=native#text/plain
inc/modules/member/what-guest.php svneol=native#text/plain
inc/modules/member/what-holiday.php svneol=native#text/plain
./inc/modules/admin/what-chk_regs.php:2:// @DEPRECATED
./inc/modules/admin/what-config_admins.php:2:// @DEPRECATED
./inc/modules/admin/what-config_email.php:2:// @DEPRECATED
+./inc/modules/member/what-earnings.php:2:// @DEPRECATED
./inc/modules/member/what-surfbar_book.php:2:// @DEPRECATED
./inc/modules/member/what-surfbar_start.php:2:// @DEPRECATED
./inc/modules/member/what-surfbar_stats.php:2:// @DEPRECATED
switch (getExtensionMode()) {
case 'register': // Do stuff when installation is running
// Add member menu
- addMemberMenuSql('earn', 'earnings', 'Zusatzverdienste', 2);
+ addMemberMenuSql('earn', 'earning', 'Zusatzverdienste', 2);
// Admin menu
- addAdminMenuSql('setup', 'list_earnings', 'Zusatzverdienste...', 'Veralten Sie hier bequem alle Zusatzverdienste (wie z.B. vergütete PopUps usw.).', 6);
+ addAdminMenuSql('setup', 'list_earning', 'Zusatzverdienste...', 'Veralten Sie hier bequem alle Zusatzverdienste (wie z.B. vergütete PopUps usw.).', 6);
// Earning data table
addDropTableSql('earning_data');
`earning_added` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`earning_cancelled` TIMESTAMP NULL DEFAULT NULL,
`earning_daily_amount` SMALLINT(7) NOT NULL DEFAULT 0,
+`earning_current_amount` SMALLINT(7) NOT NULL DEFAULT 0,
`earning_points` FLOAT(20,5) NOT NULL DEFAULT 0.00000,
PRIMARY KEY (`id`),
UNIQUE `user_earning` (`earning_id`,`earning_userid`),
INDEX (`earning_userid`)",
'User->Earning connections');
+
+ // Register filter
+ registerFilter('member_footer_extras', 'ADD_EARNING_GROUP_POPUP', false, true, isExtensionDryRun());
break;
case 'remove': // Do stuff when removing extension
addDropTableSql('user_earning');
// Delete entries in menus
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='earnings' LIMIT 1");
- addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='list_earnings' LIMIT 1");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `what`='earning' LIMIT 1");
+ addExtensionSql("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_admin_menu` WHERE `what`='list_earning' LIMIT 1");
+
+ // Unregister filter
+ unregisterFilter(__FUNCTION__, __LINE__, 'member_footer_extras', 'ADD_EARNING_GROUP_POPUP', true, isExtensionDryRun());
break;
case 'activate': // Do stuff when admin activates this extension
// SQL commands to run
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='earnings' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `what`='earning' LIMIT 1");
break;
case 'deactivate': // Do stuff when admin deactivates this extension
// SQL commands to run
- addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='earnings' LIMIT 1");
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `what`='earning' LIMIT 1");
break;
case 'update': // Update an extension
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 08/03/2011 *
+ * =================== Last change: 08/03/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : earning_filter.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Filters for ext-earning *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Filter fuer ext-earning *
+ * -------------------------------------------------------------------- *
+ * $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')) {
+ die();
+} // END - if
+
+// Filter function to add 'earning_group' POPUP
+function FILTER_ADD_EARNING_GROUP_POPUP ($filterData) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Called!');
+ // Check if the current userid is same as in $filterData
+ if (getMemberId() != $filterData['userid']) {
+ // Not the same
+ debug_report_bug(__FUNCTION__, __LINE__, 'Validation of userid failed. ' . getMemberId() . '!=' . $filterData['userid']);
+ } // END - if
+
+ // Now check if the user has subscription and amount left
+ $result = SQL_QUERY_ESC("SELECT
+ d.`earning_id`,
+ d.`earning_name`,
+ u.`earning_current_amount`,
+ u.`earning_daily_amount`
+FROM
+ `{?_MYSQL_PREFIX?}_user_earning` AS u
+INNER JOIN
+ `{?_MYSQL_PREFIX?}_earning_data` AS d
+ON
+ u.`earning_id`=d.`earning_id`
+WHERE
+ u.`earning_userid`=%s AND
+ u.`earning_active`='Y' AND
+ u.`earning_current_amount` < u.`earning_daily_amount` AND
+ d.`earning_group`='POPUP'
+ORDER BY
+ d.`earning_sorting` ASC",
+ array(
+ getMemberId()
+ ), __FUNCTION__, __LINE__);
+
+ // Do we have entries left?
+ if (SQL_NUMROWS($result) > 0) {
+ // Load all names
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Merge the $filterData array in
+ $content = merge_array($content, $filterData);
+
+ // Construct callback function name
+ $callbackName = 'get' . capitalizeUnderscoreString($content['earning_name']) . 'DataByEarningArray';
+
+ // And call it
+ $content = call_user_func($callbackName, $content);
+ } // END - if
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Return filter data
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
+ return $filterData;
+}
+
+// [EOF]
+?>
// Get max/min/count of all popups
//die(__FUNCTION__.':OK!');
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
// Return filter data array
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Done!');
return $filterData;
}
return $return;
}
+// "Getter" for an array of data from all Forced-PopUps
+function getForcedPopupDataByEarningArray ($content) {
+ die(__FUNCTION__ . ':content=<pre>'.print_r($content,true).'</pre>');
+}
+
// [EOF]
?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 07/31/2011 *
+ * =================== Last change: 07/31/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-earnings.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Extra earnings for the user *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Zusatzverdienst fuer die Mitglieder *
+ * -------------------------------------------------------------------- *
+ * $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')) {
+ die();
+} elseif (!isMember()) {
+ redirectToIndexMemberOnlyModule();
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+// Is the form sent?
+if (isFormSent()) {
+ // Then handle the extra earning request
+ doMemberEarning(
+ postRequestElement('earning_id'),
+ postRequestElement('earning_daily_amount'),
+ postRequestElement('earning_active')
+ );
+} // END - if
+
+// Check for all earnings
+$result = SQL_QUERY('SELECT
+ d.`earning_id`,
+ d.`earning_group`,
+ d.`earning_name`
+FROM
+ `{?_MYSQL_PREFIX?}_earning_data` AS d
+ORDER BY
+ d.`earning_sorting` ASC', __FILE__, __LINE__);
+
+// Do we have entries?
+if (SQL_NUMROWS($result) > 0) {
+ // Init output
+ $OUT = '';
+
+ // List all entries
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Load user_earning data
+ $result2 = SQL_QUERY_ESC('SELECT
+ u.`earning_active`,
+ UNIX_TIMESTAMP(u.`earning_added`) AS `earning_added`,
+ UNIX_TIMESTAMP(u.`earning_cancelled`) AS `earning_cancelled`,
+ u.`earning_daily_amount`,
+ u.`earning_points`
+FROM
+ `{?_MYSQL_PREFIX?}_user_earning` AS u
+WHERE
+ u.`earning_id`=%s AND
+ u.`earning_userid`=%s
+LIMIT 1',
+ array(
+ bigintval($content['earning_id']),
+ getMemberId()
+ ), __FILE__, __LINE__);
+
+ // Do we have an entry?
+ if (SQL_NUMROWS($result2) == 1) {
+ // Load it
+ $content = merge_array($content, SQL_FETCHARRAY($result2));
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result2);
+
+ // Do we have user_earning data available?
+ if (!isset($content['earning_active'])) {
+ // Load row template "open subscription"
+ $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_form_row', true, $content);
+ } else {
+ // Load row template "already subscribed"
+ $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_row', true, $content);
+ }
+ } // END - while
+
+ // Load main template
+ loadTemplate('member_earning', false, $OUT);
+} else {
+ // Display message
+ displayMessage('{--MEMBER_EARNINGS_404--}');
+}
+
+// Free result
+SQL_FREERESULT($result);
+
+// [EOF]
+?>
<?php
-/************************************************************************
- * Mailer v0.2.1-FINAL Start: 07/31/2011 *
- * =================== Last change: 07/31/2011 *
- * *
- * -------------------------------------------------------------------- *
- * File : what-earnings.php *
- * -------------------------------------------------------------------- *
- * Short description : Extra earnings for the user *
- * -------------------------------------------------------------------- *
- * Kurzbeschreibung : Zusatzverdienst fuer die Mitglieder *
- * -------------------------------------------------------------------- *
- * $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')) {
- die();
-} elseif (!isMember()) {
- redirectToIndexMemberOnlyModule();
-}
-
-// Add description as navigation point
-addYouAreHereLink('member', __FILE__);
-
-// Is the form sent?
-if (isFormSent()) {
- // Then handle the extra earning request
- doMemberEarning(
- postRequestElement('earning_id'),
- postRequestElement('earning_daily_amount'),
- postRequestElement('earning_active')
- );
-} // END - if
-
-// Check for all earnings
-$result = SQL_QUERY_ESC('SELECT
- d.`earning_id`,
- d.`earning_group`,
- d.`earning_name`,
- u.`earning_active`,
- UNIX_TIMESTAMP(u.`earning_added`) AS `earning_added`,
- UNIX_TIMESTAMP(u.`earning_cancelled`) AS `earning_cancelled`,
- u.`earning_daily_amount`,
- u.`earning_points`
-FROM
- `{?_MYSQL_PREFIX?}_earning_data` AS d
-LEFT JOIN
- `{?_MYSQL_PREFIX?}_user_earning` AS u
-ON
- d.`earning_id`=u.`earning_id`
-WHERE
- u.`earning_userid` IS NULL OR
- u.`earning_userid`=%s
-ORDER BY
- d.`earning_sorting` ASC',
- array(
- getMemberId()
- ), __FILE__, __LINE__);
-
-// Do we have entries?
-if (SQL_NUMROWS($result) > 0) {
- // Init output
- $OUT = '';
-
- // List all entries
- while ($content = SQL_FETCHARRAY($result)) {
- // Do we have user_earning data available?
- if (is_null($content['earning_active'])) {
- // Load row template "open subscription"
- $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_form_row', true, $content);
- } else {
- // Load row template "already subscribed"
- $OUT .= loadTemplate('member_earning_' . strtolower($content['earning_group']) . '_row', true, $content);
- }
- } // END - while
-
- // Load main template
- loadTemplate('member_earning', false, $OUT);
-} else {
- // Display message
- displayMessage('{--MEMBER_EARNINGS_404--}');
-}
-
-// Free result
-SQL_FREERESULT($result);
-
-// [EOF]
+// @DEPRECATED
?>
return $OUT;
}
+// Helper function to add extra content for member area (module=login)
+function doTemplateMemberFooterExtras ($template, $clear) {
+ // Is a member logged in?
+ if (!isMember()) {
+ // This shall not happen
+ debug_report_bug(__FUNCTION__, __LINE__, 'Please use this template helper only for logged-in members.');
+ } // END - if
+
+ // Init filter data
+ $filterData = array(
+ 'userid' => getMemberId(),
+ 'template' => $template,
+ 'output' => '',
+ );
+
+ // Run the filter chain
+ $filterData = runFilterChain('member_footer_extras', $filterData);
+
+ // Return output
+ return $filterData['output'];
+}
+
// [EOF]
?>
<div align="center">
-<form accept-charset="UTF-8" id="earning_$content[earning_id]" action="{%url=modules.php?module=login&what=earnings%}" method="post">
+<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>
<div align="center">
-<form accept-charset="UTF-8" id="earning_$content[earning_id]" action="{%url=modules.php?module=login&what=earnings%}" method="post">
+<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>
</td>
</tr>
</table>
-<!-- Fuss unterhalb des Mitgliederbereiches //-->
+
+{%template,MemberFooterExtras%}