inc/modules/member/action- svneol=native#text/plain
inc/modules/member/action-account.php svneol=native#text/plain
inc/modules/member/action-bank.php svneol=native#text/plain
+inc/modules/member/action-coupon.php svneol=native#text/plain
inc/modules/member/action-earn.php svneol=native#text/plain
inc/modules/member/action-extras.php svneol=native#text/plain
inc/modules/member/action-logout.php svneol=native#text/plain
inc/modules/member/what-beg2.php svneol=native#text/plain
inc/modules/member/what-bonus.php svneol=native#text/plain
inc/modules/member/what-booking.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-guest.php svneol=native#text/plain
templates/de/emails/member/member_birthday_confirm.tpl svneol=native#text/plain
templates/de/emails/member/member_bonus.tpl svneol=native#text/plain
templates/de/emails/member/member_contct.tpl svneol=native#text/plain
+templates/de/emails/member/member_coupon.tpl svneol=native#text/plain
templates/de/emails/member/member_del_surfbar_urls.tpl svneol=native#text/plain
templates/de/emails/member/member_doubler.tpl svneol=native#text/plain
templates/de/emails/member/member_edit_surfbar_urls.tpl svneol=native#text/plain
templates/de/html/member/member_bonus_404.tpl svneol=native#text/plain
templates/de/html/member/member_bonus_row.tpl svneol=native#text/plain
templates/de/html/member/member_bonus_turbo_row.tpl svneol=native#text/plain
+templates/de/html/member/member_cash_coupon.tpl svneol=native#text/plain
templates/de/html/member/member_cat_row.tpl svneol=native#text/plain
templates/de/html/member/member_cats_footer.tpl svneol=native#text/plain
templates/de/html/member/member_cats_header.tpl svneol=native#text/plain
templates/de/html/menu/menu_guest_advert_sponsor.tpl svneol=native#text/plain
templates/de/html/menu/menu_member_advert_account.tpl svneol=native#text/plain
templates/de/html/menu/menu_member_advert_bank.tpl svneol=native#text/plain
+templates/de/html/menu/menu_member_advert_coupon.tpl svneol=native#text/plain
templates/de/html/menu/menu_member_advert_earn.tpl svneol=native#text/plain
templates/de/html/menu/menu_member_advert_end.tpl svneol=native#text/plain
templates/de/html/menu/menu_member_advert_extras.tpl svneol=native#text/plain
./inc/classes/cachesystem.class.php:501: // @TODO Add support for more types which break in last else-block
./inc/config-functions.php:136: // @TODO Make this all better... :-/
./inc/daily/daily_beg.php:52:// @TODO This should be converted in a daily beg rallye
-./inc/daily/daily_birthday.php:92: // @TODO 4 is hard-coded here, should we move it out in config?
+./inc/daily/daily_birthday.php:95: // @TODO 4 is hard-coded here, should we move it out in config?
./inc/expression-functions.php:164:// @TODO FILTER_COMPILE_CONFIG does not handle call-back functions so we handle it here again
./inc/expression-functions.php:46: // @TODO is escapeQuotes() enougth for strings with single/double quotes?
./inc/extensions/ext-html_mail.php:136: // @TODO Move these arrays into config
./inc/extensions-functions.php:567: // @TODO Extension is loaded, what next?
./inc/filter/bonus_filter.php:55: // @TODO This query isn't right, it will only update if the user was for a longer time away!
./inc/filter/cache_filter.php:78: // @TODO This should be rewritten not to load the cache file for just checking if it is there for save removal.
-./inc/functions.php:1219: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
-./inc/functions.php:1307: // @TODO Are these convertions still required?
-./inc/functions.php:1325:// @TODO Rewrite this function to use readFromFile() and writeToFile()
+./inc/functions.php:1226: // @TODO Move this SQL code into a function, let's say 'getTimestampFromPoolId($id) ?
+./inc/functions.php:1314: // @TODO Are these convertions still required?
+./inc/functions.php:1332:// @TODO Rewrite this function to use readFromFile() and writeToFile()
./inc/functions.php:163:// @TODO Rewrite this to an extension 'smtp'
-./inc/functions.php:1907: // @TODO Find a way to cache this
-./inc/functions.php:2008: // @TODO This is still very static, rewrite it somehow
-./inc/functions.php:2188: // @TODO Rename column data_type to e.g. mail_status
+./inc/functions.php:1914: // @TODO Find a way to cache this
+./inc/functions.php:2015: // @TODO This is still very static, rewrite it somehow
+./inc/functions.php:2195: // @TODO Rename column data_type to e.g. mail_status
./inc/functions.php:92: // @TODO Extension 'msg' does not exist
./inc/gen_sql_patches.php:95:// @TODO Rewrite this to a filter
./inc/install-functions.php:57: // @TODO DEACTIVATED: changeDataInLocalConfigurationFile('OUTPUT-MODE', "setConfigEntry('OUTPUT_MODE', '", "');", postRequestParameter('omode'), 0);
-./inc/language/de.php:1082: // @TODO Rewrite these two constants
-./inc/language/de.php:1103: // @TODO Rewrite these three constants
-./inc/language/de.php:777:// @TODO Are these constants longer used?
+./inc/language/de.php:1083: // @TODO Rewrite these two constants
+./inc/language/de.php:1104: // @TODO Rewrite these three constants
+./inc/language/de.php:778:// @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/language/newsletter_de.php:13: * @TODO This language file is completely out-dated, please do no *
./inc/modules/admin/what-guest_add.php:80: // @TODO This can be somehow rewritten to a function
./inc/modules/admin/what-holiday_list.php:46:// @TODO Unused at the moment
./inc/modules/admin/what-list_autopurge.php:47:// @TODO Rewrite those lines to filter
-./inc/modules/admin/what-list_bonus.php:132: // @TODO Can't this be moved into our expression language?
+./inc/modules/admin/what-list_bonus.php:133: // @TODO Can't this be moved into our expression language?
./inc/modules/admin/what-list_cats.php:54: // @TODO No longer needed? define('__CATEGORIES_BASE' , '<a href="{%url=modules.php?module=admin&userid=');
./inc/modules/admin/what-list_cats.php:69: // @TODO Rewrite this to countSum.....() function
./inc/modules/admin/what-list_links.php:55: // @TODO Try to rewrite this to a filter
./inc/modules/member/what-beg.php:54:// @TODO Can't this be moved into EL?
./inc/modules/member/what-beg.php:63:// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getBegUseridTimeout()));
./inc/modules/member/what-bonus.php:55: // @TODO Rewrite this to a filter
+./inc/modules/member/what-cash_coupon.php:56: // @TODO
./inc/modules/member/what-categories.php:131: // @TODO Rewrite this to use $OUT .= ...
-./inc/modules/member/what-order.php:426: // @TODO Rewrite this to a filter
+./inc/modules/member/what-logout.php:17: * @TODO Rewrite the code to a filter *
+./inc/modules/member/what-order.php:427: // @TODO Rewrite this to a filter
+./inc/modules/member/what-order.php:85: // @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:55:// @TODO Should we rewrite this to a filter?
./inc/modules/member/what-rallyes.php:89: // @TODO Reactivate this: $content['admin'] = '<a href="{%url=modules.php?module=index&what=impressum&admin=' . $content['admin_id'] . '%}">' . $content['login'] . '</a>';
./inc/modules/member/what-unconfirmed.php:142: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/member/what-unconfirmed.php:207: // @TODO This 'userid' cannot be saved because of encapsulated EL code
./inc/modules/order.php:74: // @TODO Unused: 2,4
-./inc/monthly/monthly_bonus.php:67: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1208: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1468: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1556: // @TODO Rewrite these lines to a filter
-./inc/mysql-manager.php:1580: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1954: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1998:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/monthly/monthly_bonus.php:64: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1211: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1471: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1559: // @TODO Rewrite these lines to a filter
+./inc/mysql-manager.php:1583: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1957: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:2001:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:368: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:44:// @TODO Can we cache this?
./inc/revision-functions.php:169:// @TODO This function does also set and get in 'cache_array'
-./inc/template-functions.php:1050: // @TODO Deprecate this thing
-./inc/template-functions.php:1061: // @TODO Deprecate this thing
-./inc/template-functions.php:1148: // @TODO This can be easily moved out after the merge from EL branch to this is complete
-./inc/template-functions.php:1181: // @TODO Add a little more infos here
-./inc/template-functions.php:1492:// @TODO Lame description for this function
-./inc/template-functions.php:1514: // @TODO Move this in a filter
+./inc/template-functions.php:1055: // @TODO Deprecate this thing
+./inc/template-functions.php:1066: // @TODO Deprecate this thing
+./inc/template-functions.php:1153: // @TODO This can be easily moved out after the merge from EL branch to this is complete
+./inc/template-functions.php:1186: // @TODO Add a little more infos here
+./inc/template-functions.php:1497:// @TODO Lame description for this function
+./inc/template-functions.php:1519: // @TODO Move this in a filter
./inc/template-functions.php:189: * @TODO On some pages this is buggy
./inc/template-functions.php:265: // @TODO Remove this sanity-check if all is fine
-./inc/template-functions.php:578:// @TODO $simple/$constants are deprecated
-./inc/template-functions.php:604: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
+./inc/template-functions.php:583:// @TODO $simple/$constants are deprecated
+./inc/template-functions.php:609: // @TODO Do only use $content and deprecate $GLOBALS and $DATA in templates
./inc/wrapper-functions.php:130:// @TODO Implement $compress
./inc/wrapper-functions.php:137:// @TODO Implement $decompress
./inc/wrapper-functions.php:507:// @TODO Do some more sanity check here
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `beg_clicks`=`beg_clicks`+1 WHERE `userid`=%s LIMIT 1",
array(getUserData('userid')), __FILE__, __LINE__);
- // Check for last entry for userid w/o IP number
- $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE (`timeout` > (UNIX_TIMESTAMP() - {?beg_timeout?}) OR (`timeout` > (UNIX_TIMESTAMP() - {?beg_userid_timeout?}) AND `userid`=%s)) AND (`remote_ip`='%s' OR `sid`='%s') LIMIT 1",
+ // Check for last entry for userid w/o IP number 12 33 2 23 44 3 21 1 1
+ $result = SQL_QUERY_ESC("SELECT `id` FROM `{?_MYSQL_PREFIX?}_beg_ips` WHERE ((UNIX_TIMESTAMP() - `timeout`) >= {?beg_timeout?} OR ((UNIX_TIMESTAMP() - `timeout`) >= {?beg_userid_timeout?} AND `userid`=%s)) AND (`remote_ip`='%s' OR `sid`='%s') LIMIT 1",
array(getUserData('userid'), detectRemoteAddr(), session_id()), __FILE__, __LINE__);
// Entry not found, points set and not logged in?
* but only when there is no admin begging.
* Admins shall be able to test it!
*/
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_beg_ips` (`userid`, `remote_ip`,`sid`, `timeout`) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_beg_ips` (`userid`, `remote_ip`, `sid`, `timeout`) VALUES ('%s','%s','%s', UNIX_TIMESTAMP())",
array(
getUserData('userid'),
detectRemoteAddr(),
LEFT JOIN
`{?_MYSQL_PREFIX?}_payments` AS t
ON
- s.payment_id=t.id
+ s.`payment_id`=t.`id`
WHERE
- s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
+ (UNIX_TIMESTAMP() - s.`timestamp_ordered`) >= {?auto_purge?}
ORDER BY
s.userid ASC', __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
} // END - if
// Shall I look for inactive accounts and autopurge inactive accounts?
-if (getConfig('autopurge_inactive') == 'Y') {
+if (isAutopurgeInactiveEnabled()) {
// Init SQLs
initSqls();
// @TODO Rewrite these if() blocks to a filter
$EXCLUDE_LIST = '';
if (isValidUserId(getDefRefid())) $EXCLUDE_LIST .= ' AND `userid` != {?def_refid?}';
+
// Check for more extensions
if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND `userid` != {?beg_userid?}';
if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND `userid` != {?bonus_userid?}';
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
- `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+ (UNIX_TIMESTAMP() - `joined`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_since?}
" . $EXCLUDE_LIST . "
ORDER BY
`userid` ASC", __FILE__, __LINE__);
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
- `joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- `last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- `ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_time?})
+ (UNIX_TIMESTAMP() - `joined`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - `ap_notified`) >= {?ap_inactive_time?}
" . $EXCLUDE_LIST . "
ORDER BY
`userid` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result_inactive)) {
- // Prepare variable...
- $useridsContent = '';
+ // Prepare userid array for admin...
+ $userids = array();
// Delete inactive accounts
while ($content = SQL_FETCHARRAY($result_inactive)) {
// Remember userids for the admin
- $useridsContent .= $content['userid'] . ', ';
+ $useridsContent[] = $content['userid'];
// Get date/time from timestamp
$content['last_online'] = generateDateTime($content['last_online'], 0);
deleteUserAccount($content['userid'], loadEmailTemplate('member_autopurge_delete', $content['last_online'], ''));
} // END - while
- // Remove last comma
- $useridsContent = str_replace(', ', "\n", substr($useridsContent, 0, -2));
+ // Display all userids
+ $useridsContent = implode("\n", $userids);
// Send mail notification to admin
if (getConfig('ap_in_notify') == 'Y') {
`{?_MYSQL_PREFIX?}_pool`
WHERE
`data_type`='DELETED' AND
- `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+ (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?}
ORDER BY
`sender` ASC", __FILE__, __LINE__);
`{?_MYSQL_PREFIX?}_pool`
WHERE
`data_type`='DELETED' AND
- `timestamp` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+ (UNIX_TIMESTAMP() - `timestamp`) >= {?ap_dm_timeout?}
ORDER BY
`sender` ASC", __FILE__, __LINE__);
} // END - if
FROM
`{?_MYSQL_PREFIX?}_user_stats`
WHERE
- `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+ (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?}
ORDER BY
`userid` ASC", __FILE__, __LINE__);
FROM
`{?_MYSQL_PREFIX?}_user_stats`
WHERE
- `timestamp_send` <= (UNIX_TIMESTAMP() - {?ap_dm_timeout?})
+ (UNIX_TIMESTAMP() - `timestamp_send`) >= {?ap_dm_timeout?}
ORDER BY
`userid` ASC", __FILE__, __LINE__);
} // END - if
`{?_MYSQL_PREFIX?}_task_system`
WHERE
`status`='DELETED' AND
- `task_created` <= (UNIX_TIMESTAMP() - {?ap_tasks_time?})", __FILE__, __LINE__);
+ (UNIX_TIMESTAMP() - `task_created`) >= {?ap_tasks_time?}", __FILE__, __LINE__);
// Get deleted rows
$deletedTasks = SQL_AFFECTEDROWS();
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
- `status`='UNCONFIRMED' AND `joined` < (UNIX_TIMESTAMP() - {?ap_unconfirmed_time?})
+ `status`='UNCONFIRMED' AND
+ (UNIX_TIMESTAMP() - `joined`) >= {?ap_unconfirmed_time?}
ORDER BY
`userid` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result_uncon)) {
// Purge old entries
function purgeEntries() {
// SQL for cleaning up
- SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE UNIX_TIMESTAMP(`added`) < (UNIX_TIMESTAMP() - {?dns_cache_timeout?})',
+ SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_dns_cache` WHERE (UNIX_TIMESTAMP() - UNIX_TIMESTAMP(`added`) >= {?dns_cache_timeout?})',
__METHOD__, __LINE__);
}
}
// Do not execute when script is in CSS mode
return;
} elseif (!isExtensionActive('birthday')) {
+ // Extension not active/installed
logDebugMessage(__FILE__, __LINE__, 'Not resetting, needed extension disabled.');
return;
}
$month = getMonth();
$year = getYear();
+// Init variable
+$lastOnline = '';
+
// Shall I include only active members?
-$add = '%s'; $value = '';
-if ((getConfig('birthday_active')) && (isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
- $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+if ((getConfig('birthday_active') == 'Y') && (isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+ $add = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Only confirmed members shall receive birthday mails...
`birth_day`=%s AND
`birth_month`=%s AND
`birthday_sent` < (UNIX_TIMESTAMP() - ({?ONE_DAY?} * 364))
- ".$add."
+ ".$lastOnline."
ORDER BY
`userid` ASC",
- array($day, $month, $value), __FILE__, __LINE__);
+ array($day, $month), __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result_birthday)) {
// Start sending out birthday mails
WHERE
`status`='CONFIRMED' AND (
(
- `last_update` < (UNIX_TIMESTAMP() - {?profile_update?}) AND
+ (UNIX_TIMESTAMP() - `last_update`) >= {?profile_update?} AND
`last_update` > 0 AND
- `last_profile_sent` < (UNIX_TIMESTAMP() - {?resend_profile_update?})
+ (UNIX_TIMESTAMP() - `last_profile_sent`) >= {?resend_profile_update?}
) OR (
`last_update` = 0 AND
`last_profile_sent` = 0 AND
- `joined` < (UNIX_TIMESTAMP() - {?profile_update?})
+ (UNIX_TIMESTAMP() - `joined`) >= {?profile_update?}
)
)
ORDER BY
return $GLOBALS['sql_strings'][$sqlString];
}
+// Creates a MySQL TIMESTAMP compatible string from given Uni* timestamp
+function SQL_EPOCHE_TO_TIMESTAMP ($timestamp) {
+ return generateDateTime($timestamp, 7);
+}
+
// Check if there is a SQL table created
function isSqlTableCreated ($tableName) {
// Do we have cache?
addDropTableSql('coupon_data');
addCreateTableSql('coupon_data', "(
`id` BIGINT(20) UNSIGNED NOT NULL AUTO_INCREMENT,
-`timestamp_created` TIMESTAMP NULL DEFAULT NULL,
+`timestamp_created` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
`timestamp_expired` TIMESTAMP NULL DEFAULT NULL,
`coupon_type` ENUM('CODE','API') NOT NULL DEFAULT 'CODE',
`total_created` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
case 'activate': // Do stuff when admin activates this extension
// SQL commands to run
- addExtensionSql('');
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='Y', `locked`='N' WHERE `action`='coupon' LIMIT 3");
break;
case 'deactivate': // Do stuff when admin deactivates this extension
// SQL commands to run
- addExtensionSql('');
+ addExtensionSql("UPDATE `{?_MYSQL_PREFIX?}_member_menu` SET `visible`='N', `locked`='Y' WHERE `action`='coupon' LIMIT 3");
break;
case 'update': // Update an extension
`last_login`=UNIX_TIMESTAMP()
WHERE
`userid`=%s AND
- `last_login` < (UNIX_TIMESTAMP() - {?login_timeout?})
+ (UNIX_TIMESTAMP() - `last_login`) >= {?login_timeout?}
LIMIT 1',
array(
getMemberId()
if (($bonus === true) && (getRequestParameter('mode') == 'bonus')) {
// Output message with added points
$GLOBALS['message'] .= '<div class="tiny">{--MEMBER_BONUS_LOGIN_BONUS_ADDED--}</div>';
- } elseif (isExtensionActive('bonus')) {
+ } else {
// No login bonus added!
$GLOBALS['message'] .= '<div class="notice">{--MEMBER_BONUS_LOGIN_BONUS_NOT_ADDED--}</div>';
}
SQL_FREERESULT($result);
// Purge old entries
- SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE `timestamp` <= (UNIX_TIMESTAMP() - {?online_timeout?})', __FUNCTION__, __LINE__);
+ SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_online` WHERE (UNIX_TIMESTAMP() - `timestamp`) >= {?online_timeout?}', __FUNCTION__, __LINE__);
}
// [EOF]
}
// Generate a password in a specified length or use default password length
-function generatePassword ($length = '0') {
+function generatePassword ($length = '0', $exclude = array()) {
// Auto-fix invalid length of zero
- if ($length == '0') $length = getPassLen();
+ if ($length == '0') {
+ $length = getPassLen();
+ } // END - if
// Initialize array with all allowed chars
$ABC = explode(',', 'a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z,0,1,2,3,4,5,6,7,8,9,-,+,_,/,.');
+ // Exclude some entries
+ $ABC = array_diff($ABC, $exclude);
+
// Start creating password
$PASS = '';
for ($i = '0'; $i < $length; $i++) {
case '4': $ret = date('d.m.Y|H:i:s', $time); break;
case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
case '6': $ret = date('Ymd', $time); break;
+ case '7': $ret = date('Y-m-d H:i:s', $time); break; // Compatible with MySQL TIMESTAMP
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
case '4': $ret = date('d.m.Y|H:i:s', $time); break;
case '5': $ret = date('d-m-Y (l-F-T)', $time); break;
case '6': $ret = date('Ymd', $time); break;
+ case '7': $ret = date('Y-m-d H:i:s', $time); break; // Compatible with MySQL TIMESTAMP
default:
logDebugMessage(__FUNCTION__, __LINE__, sprintf("Invalid date mode %s detected.", $mode));
break;
// Language definitions
addMessages(array(
+ // Admin - Configuration
'ADMIN_CONFIG_COUPON_SETTINGS_TITLE' => "Allgemeine Einstellungen zu den Gutscheinen",
'ADMIN_CONFIG_COUPON_DEFAULT_TIME' => "Zeit, bis Gutscheine ablaufen sollen. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.",
'ADMIN_CONFIG_COUPON_DEFAULT_POINTS' => "Ausgangsvergütung in {?POINTS?}. Sie können diesen Ausgangswert beim Erstellen von neuen Gutscheinen nachträglich anpassen.",
+ // Admin - Send coupon to members
'ADMIN_SEND_COUPON_TITLE' => "Gutschein versenden (aktuell nur Code-Gutscheine)",
'ADMIN_SEND_COUPON_EXPIRATION_TIME' => "Ablaufzeit (ab Versandzeitpunkt)",
'ADMIN_SEND_COUPON_POINTS' => "Vergütung für eingelösten Gutschein",
'ADMIN_SEND_COUPON' => "Gutschein versenden",
'ADMIN_SEND_COUPON_POINTS_NOT_ENTERED' => "Bitte geben Sie eine Vergütung (in {?POINTS?}) ein.",
'ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED' => "Bitte geben Sie eine kurze Beschreibung (oder einen Hinweis an Ihre Mitglieder) ein.",
+
+ // Member
+ 'MEMBER_CASH_COUPON_TITLE' => "Gutschein einlösen",
+ 'MEMBER_CASH_COUPON_NOTE' => "Geben Sie hier den Gutschein-Code ein, den Sie aus unserer Mail erhalten haben. Sie erhalten dann eine Meldung, auf welches Konto die Gutschrift aufgebucht wurde.",
+ 'MEMBER_CASH_COUPON' => "Gutschein einlösen",
+ 'MEMBER_ENTER_COUPON_CODE' => "Gutschein-Code eingeben:",
+
+ // Subject lines
+ 'MEMBER_COUPON_SUBJECT' => "Gutschein bei {?MAIN_TITLE?}",
+ 'ADMIN_COUPON_SUBJECT' => "Es wurde ein Gutschein versendet",
));
// [EOF]
'ADMIN_ENTER_POINTS_REGISTER' => "Willkommensgutschrift",
'ADMIN_ENTER_POINTS_REFERAL' => "Einmalige Referal-Gutschrift",
'CHOOSE_MORE_CATEGORIES' => "Bitte wählen Sie mehr Kategorien aus! Minimum ist: <span class=\"data\">{?least_cats?}</span>",
- 'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns verboten.",
+ 'GUEST_EMAIL_IS_ALREADY_REGISTERED' => "Sie haben sich bereits mit dieser Email-Adresse angemeldet, oder jemand anderes verwendet Ihre. Doppelte Anmeldungen sind bei uns nicht erlaubt.",
+ 'MEMBER_EMAIL_IS_ALREADY_REGISTERED' => "Die Email-Adresse wird bereits von einem anderen Account verwendet.",
'ADMIN_CONFIG_REJECT_DOUBLE_EMAIL' => "Doppelt angemeldete Email-Adressen ablehnen?",
'ADMIN_EDIT_POINTS' => "Willkommensgutschrift und andere Festbeträge editieren",
'ADMIN_EDIT_REFERAL_DEPTHS' => "Referal-Ebenen editieren / löschen / hinzufügen",
sendEmail($userid, '{--MEMBER_AUTOPURGE_SUBJECT--}', $message);
}
-// Checks wether auto-purging is active
+// Checks wether auto-purging is enabled
function isAutoPurgingActive () {
// Do we have cache?
if (!isset($GLOBALS[__FUNCTION__])) {
return $GLOBALS[__FUNCTION__];
}
+// Wrapper for 'autopurge_inactive
+function getAutopurgeInactive () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getConfig('autopurge_inactive') == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether purging of inactive accounts is enabled
+function isAutopurgeInactiveEnabled () {
+ // Do we have cache?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // Determine it
+ $GLOBALS[__FUNCTION__] = (getAutopurgeInactive() == 'Y');
+ } // END - if
+
+ // Return cache
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
// Purges expired fast-click bonus entries
function purgeExpiredTurboBonus() {
// Remove entries
- $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE `timemark` < (UNIX_TIMESTAMP() - {?bonus_timeout?})', __FUNCTION__, __LINE__);
+ $result = SQL_QUERY('DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_bonus_turbo` WHERE (UNIX_TIMESTAMP() - `timemark`) >= {?bonus_timeout?}', __FUNCTION__, __LINE__);
if (!SQL_HASZEROAFFECTED()) {
// Send out email to admin
FROM
`{?_MYSQL_PREFIX?}_rallye_data`
WHERE
- `end_time` <= (UNIX_TIMESTAMP() - {?ONE_DAY?} - %s) AND
+ (UNIX_TIMESTAMP() - `end_time`) > ({?ONE_DAY?} * %s) AND
`expired`='Y'",
array($EXPIRE), __FUNCTION__, __LINE__);
if ((postRequestParameter('email') != '!') && (isCheckDoubleEmailEnabled())) {
// Does the email address already exists in our database?
- if ((!isAdmin()) && (isEmailTaken(postRequestParameter('email')))) {
+ if ((isEmailTaken(postRequestParameter('email'))) && (!isAdmin())) {
setPostRequestParameter('email', '?');
$isOkay = false;
} // END - if
return $GLOBALS[__FUNCTION__];
}
-// Getter for 'check_double_email'
-function getCheckDoubleEmail () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
-// Checks wether 'check_double_email' is "YES"
-function isCheckDoubleEmailEnabled () {
- // Is the cache entry set?
- if (!isset($GLOBALS[__FUNCTION__])) {
- // No, so determine it
- $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
- } // END - if
-
- // Return cached entry
- return $GLOBALS[__FUNCTION__];
-}
-
// Getter for 'register_default'
function getRegisterDefault () {
// Is the cache entry set?
`{?_MYSQL_PREFIX?}_user_data` AS d
WHERE
d.`status`='CONFIRMED' AND
- d.joined < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- d.last_online < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- d.ap_notified < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+ (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?}
".$EXCLUDE_LIST."
ORDER BY
d.userid ASC");
$USE = 'turbo_bonus';
}
- // Autopurge installed?
+ // Init variable
$lastOnline = '';
- if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
+
+ // Autopurge installed?
+ if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
addSql("SELECT
}
if (isExtensionInstalledAndNewer('beg', '0.1.2')) {
- // Begging rallye
+ // ----- Begging rallye -----
- // Autopurge installed?
+ // Init variable
$lastOnline = '';
- if ((isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getApInactiveSince() > 0)) {
+
+ // Autopurge installed?
+ if ((isExtensionActive('autopurge')) && (isAutopurgeInactiveEnabled()) && (getApInactiveSince() > 0)) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = ' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})';
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
addSql("SELECT
adminSaveSettingsFromPostData();
} else {
// Output de-/activation selections
- $content['ap_inactive_selection'] = addSelectionBox('yn', getConfig('autopurge_inactive') , 'autopurge_inactive');
+ $content['ap_inactive_selection'] = addSelectionBox('yn', getAutopurgeInactive() , 'autopurge_inactive');
$content['ap_unconfirmed_selection'] = addSelectionBox('yn', getConfig('autopurge_unconfirmed'), 'autopurge_unconfirmed');
$content['ap_tasks_selection'] = addSelectionBox('yn', getConfig('autopurge_tasks') , 'autopurge_tasks');
$content['ap_del_mails_selection'] = addSelectionBox('yn', getConfig('ap_del_mails') , 'ap_del_mails');
`{?_MYSQL_PREFIX?}_user_data` AS d
WHERE
d.`status`='CONFIRMED' AND
- d.`joined` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- d.`last_online` < (UNIX_TIMESTAMP() - {?ap_inactive_since?}) AND
- d.`ap_notified` < (UNIX_TIMESTAMP() - {?ap_inactive_since?})
+ (UNIX_TIMESTAMP() - d.`joined`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - d.`last_online`) >= {?ap_inactive_since?} AND
+ (UNIX_TIMESTAMP() - d.`ap_notified`) >= {?ap_inactive_since?}
".$EXCLUDE_LIST."
ORDER BY
d.`userid` ASC", __FILE__, __LINE__);
displayMessage('{--ADMIN_BEG_WITHDRAW_PREPARED--}');
} // END - if
- // Autopurge installed?
+ // Init variable
$lastOnline = '';
- if (isExtensionActive('autopurge')) {
+
+ // Autopurge installed?
+ if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Check if at least one is in the active rallye
$USE = '`turbo_bonus`';
}
+ // Init variables
+ $lastOnline = '';
+
// Autopurge installed?
- $lastOnline = '%s'; $ONLINE = '';
- if (isExtensionActive('autopurge')) {
+ if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Check if at least one is in the active rallye
- $result = SQL_QUERY_ESC("SELECT
+ $result = SQL_QUERY("SELECT
`userid`, `email`, `gender`, `surname`, `family`, ".$USE." AS `points`, `last_online`
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
`status`='CONFIRMED' AND
- ".$USE." > 0
- ".$lastOnline."
+ " . $USE . " > 0
+ " . $lastOnline . "
ORDER BY
`points` DESC,
`last_online` DESC,
- `userid` ASC",
- array($ONLINE), __FILE__, __LINE__);
+ `userid` ASC", __FILE__, __LINE__);
if (!SQL_HASZERONUMS($result)) {
// List users
displayMessage('{--ADMIN_SEND_COUPON_DESCRIPTION_NOT_ENTERED--}');
} else {
// All fields are set, so we can start looking for users who wants to receive coupons
+ $result = SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status`='CONFIRMED' AND `receiving_coupons`='Y' ORDER BY `userid` ASC",
+ __FILE__, __LINE__);
+
+ // Do we have entries left?
+ if (SQL_NUMROWS($result) > 0) {
+ // Convert timestamp selections
+ $expirationTime = time() + createEpocheTimeFromSelections('coupon_default_time', postRequestArray());
+
+ // Insert coupon data
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_coupon_data` (`timestamp_expired`, `total_created`, `points`, `coupon_description`) VALUES('{%%pipe,SQL_EPOCHE_TO_TIMESTAMP=%s%%}', %s,%s,'%s')",
+ array(
+ $expirationTime,
+ SQL_NUMROWS($result),
+ bigintval(postRequestParameter('points')),
+ postRequestParameter('description')
+ ), __FILE__, __LINE__
+ );
+
+ // Get the insert id from the table
+ $couponId = SQL_INSERTID();
+
+ // Load entry
+ while (list($userid) = SQL_FETCHROW($result)) {
+ // By default no code is unique
+ $isUnique = false;
+ $couponCode = '';
+
+ // Look for a unique id
+ while (!$isUnique) {
+ /**
+ * Add a coupon for this user, first we need to create a
+ * table-unique "id". The function generatePassword() can do
+ * this job for us but we want to exclude some characters.
+ */
+ $couponCode = generatePassword(30, array('-','+','_','/','.'));
+
+ // Is it really unique?
+ $isUnique = (countSumTotalData($couponCode, 'user_coupons', 'id', 'coupon_code', true) == 0);
+ } // END - while
+
+ // The above loop should always set $couponCode, so we can now insert it
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_coupons` (`coupon_id`, `userid`, `coupon_code`) VALUES(%s,%s,'%s')",
+ array($couponId, $userid, $couponCode), __FILE__, __LINE__);
+
+ // Fill array with all required data
+ $content = array(
+ 'coupon_id' => $couponId,
+ 'userid' => $userid,
+ 'points' => bigintval(postRequestParameter('points')),
+ 'coupon_code' => $couponCode,
+ 'coupon_expires' => generateDateTime($expirationTime, '0')
+ );
+
+ // Load member email template
+ $mailText = loadEmailTemplate('member_coupon', $content, $userid);
+
+ // And deliver it
+ sendEmail($userid, '{--MEMBER_COUPON_SUBJECT--}', $mailText);
+
+ // Rember this user for the admin email
+ $adminUserids[] = $userid;
+ } // END - while
+ } else {
+ // No user was found
+ displayMessage('{--ADMIN_SEND_COUPON_USER_404--}');
+ }
+
+ // Prepare content for template
+ $content = array(
+ 'userids' => implode(',', $adminUserids),
+ 'userid_count' => count($adminUserids),
+ 'coupon_id' => $couponId,
+ 'points' => bigintval(postRequestParameter('points')),
+ 'description' => postRequestParameter('description'),
+ 'coupon_expires' => generateDateTime($expirationTime, '0')
+ );
+
+ // Send admin notification
+ sendAdminNotification('{--ADMIN_COUPON_SUBJECT--}', 'admin_coupon', $content);
+
+ // Free result
+ SQL_FREERESULT($result);
}
} else {
// Prepare some template data
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 28/06/2011 *
+ * =================== Last change: 28/06/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : action-coupon.php *
+ * -------------------------------------------------------------------- *
+ * Short description : Coupons *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Gutscheine *
+ * -------------------------------------------------------------------- *
+ * $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();
+} elseif (isBlockModeEnabled()) {
+ // Block mode detected
+ return;
+}
+
+// Add description as navigation point
+addYouAreHereLink('member', __FILE__);
+
+if ((!isExtensionActive('coupon')) && (!isAdmin())) {
+ displayMessage(generateExtensionInactiveNotInstalledMessage('coupon'));
+ return;
+} // END - if
+
+// Load the include file
+$inc = sprintf("inc/modules/member/what-%s.php", getWhat());
+if (isIncludeReadable($inc)) {
+ // Ok, we finally load the member action module
+ loadInclude($inc);
+} else {
+ addFatalMessage(__FILE__, __LINE__, '{--MEMBER_404_WHAT--}', getWhat());
+}
+
+// [EOF]
+?>
// Add description as navigation point
addYouAreHereLink('member', __FILE__);
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('')) && (!isAdmin())) {
+ displayMessage(generateExtensionInactiveNotInstalledMessage(''));
+ return;
+} // END - if
+
// Loads the name-matching template
loadTemplate(substr(basename(__FILE__), 5, -4));
$lastOnline = '%s';
$ONLINE = '';
-if (isExtensionActive('autopurge')) {
+if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Let's check if there are some points left we can pay...
$USE = '`turbo_bonus`';
}
+// Init variables
+$lastOnline = '%s';
+$ONLINE = '';
+
// Autopurge installed?
-$lastOnline = '%s'; $ONLINE = '';
-if (isExtensionActive('autopurge')) {
+if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
+ $lastOnline = ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Let's check if there are some points left we can 'pay'...
// Add description as navigation point
addYouAreHereLink('member', __FILE__);
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('booking')) && (!isAdmin())) {
+ displayMessage(generateExtensionInactiveNotInstalledMessage('booking'));
+ return;
+} // END - if
+
// [EOF]
?>
--- /dev/null
+<?php
+/************************************************************************
+ * Mailer v0.2.1-FINAL Start: 28/06/2011 *
+ * =================== Last change: 28/06/2011 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : what-cash_coupon.php *
+ * -------------------------------------------------------------------- *
+ * Short description : To cash a coupon *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Einen Gutschein einloesen *
+ * -------------------------------------------------------------------- *
+ * $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__);
+
+// Continue only if the proper extension is active (admins can always continue)
+if ((!isExtensionActive('coupon')) && (!isAdmin())) {
+ displayMessage(generateExtensionInactiveNotInstalledMessage('coupon'));
+ return;
+} // END - if
+
+// Is the form sent?
+if (isFormSent()) {
+ // @TODO
+} else {
+ // Load form template
+ loadTemplate('member_cash_coupon', false);
+}
+
+// [EOF]
+?>
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
+ * @TODO Rewrite the code to a filter *
* -------------------------------------------------------------------- *
* Copyright (c) 2003 - 2009 by Roland Haeder *
* Copyright (c) 2009 - 2011 by Mailer Developer Team *
if (destroyMemberSession()) {
// Remove theme cookie as well
- if (isExtensionActive('theme')) setTheme('');
+ if (isExtensionActive('theme')) {
+ setTheme('');
+ } // END - if
// Logout completed
$url .= getCode('LOGOUT_DONE');
// How far is last change on his profile away from now?
if (($content['update_check'] > time()) && (!isAdmin()) && (getProfileLock() > 0)) {
+ // You cannot change your account
$content['update_check'] = generateDateTime($content['update_check'] + getProfileLock(), 0);
- // You cannot change your account
displayMessage($content['update_check']);
} elseif ((!isEmailValid(postRequestParameter('email'))) && (!isAdmin())) {
// Invalid email address!
displayMessage('{--INVALID_EMAIL_ENTERED--}');
+ } elseif ((isEmailTaken(postRequestParameter('email'))) && (isCheckDoubleEmailEnabled()) && (!isAdmin())) {
+ // Email address is already registered
+ displayMessage('{--MEMBER_EMAIL_IS_ALREADY_REGISTERED--}');
} else {
// Generate hash
$hash = generateHash(postRequestParameter('pass1'), substr($content['password'], 0, -40));
WHERE
`sender`=%s AND
`url`='%s' AND
- `timestamp` > (UNIX_TIMESTAMP() - {?url_tlock?})
+ (UNIX_TIMESTAMP() - `timestamp`) >= {?url_tlock?}
LIMIT 1",
array(
getMemberId(),
$type = 'TEMP'; $id = '0';
if (SQL_NUMROWS($result) == 1) {
// Load id and mail type
+ // @TODO Rewrite this to SQL_FETCHARRAY()
list($id, $type) = SQL_FETCHROW($result);
} // END - if
FROM
`{?_MYSQL_PREFIX?}_user_transfers_out`
WHERE
- `time_trans` > (UNIX_TIMESTAMP() - {?transfer_timeout?}) AND
+ (UNIX_TIMESTAMP() - `time_trans`) >= {?transfer_timeout?} AND
`userid`=%s
ORDER BY
`time_trans` DESC
// Check if month is done
if ((getBegRanks() > 0) && (!isCssOutputMode())) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
- $whereStatement1 = '';
+ $whereStatement = '';
// Shall we exclude webmaster's own userid?
if ((!isBegIncludeOwnEnabled()) && (isValidUserId(getBegUserid()))) {
// Exclude it
- $whereStatement1 = " AND `userid` != {?beg_userid?}";
+ $whereStatement = " AND `userid` != {?beg_userid?}";
} // END - if
// Let's check if there are some points left we can pay...
- if (isExtensionActive('autopurge')) {
- // Use last online stamp only when autopurge for inactive members is activated
- if ((getApInactiveSince() > 0) && (isBegActiveEnabled())) {
- // Okay, include last online timestamp
- $whereStatement1 .= " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
- } // END - if
+ if ((isExtensionActive('autopurge')) && (isBegActiveEnabled()) && ((getApInactiveSince() > 0))) {
+ // Okay, include last online timestamp
+ $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// SQL string to check for accounts
FROM
`{?_MYSQL_PREFIX?}_user_data`
WHERE
- `status`='CONFIRMED'" . $whereStatement1 . " AND
+ `status`='CONFIRMED'" . $whereStatement . " AND
`beg_points` > 0
ORDER BY
`beg_points` DESC,
if ((getConfig('bonus_ranks') > 0) && (!isCssOutputMode())) {
// Extension 'autopurge' is inactive or purging of inactive accounts is deactivated
- $whereStatement1 = "WHERE `status`='CONFIRMED'";
+ $whereStatement = "WHERE `status`='CONFIRMED'";
// Shall I keep inactive members away from here? (mostly wanted in an "active-rallye" ...)
- if (isExtensionActive('autopurge')) {
- // Use last online stamp only when autopurge for inactive members is activated
- if (getApInactiveSince() > 0) {
- // Okay, include last online timestamp
- $whereStatement1 = "WHERE `status`='CONFIRMED' AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
- } // END - if
+ if ((isExtensionActive('autopurge')) && ((getApInactiveSince() > 0))) {
+ // Okay, include last online timestamp
+ $whereStatement .= ' AND (UNIX_TIMESTAMP() - `last_online`) >= {?ap_inactive_since?}';
} // END - if
// Add more bonus points here
// Shall we add some entries?
if (!empty($add)) {
- $whereStatement1 .= ' AND (0' . $add . ') > 0';
+ $whereStatement .= ' AND (0' . $add . ') > 0';
} // END - if
// Run SQL string to check for accounts
`userid`, `email`, `gender`, `surname`, `family`, (0' . $add . ') AS `points`
FROM
`{?_MYSQL_PREFIX?}_user_data`
-' . $whereStatement1 . '
+' . $whereStatement . '
ORDER BY
`points` DESC,
`userid` ASC
// Checks wether the given email address is used.
function isEmailTaken ($email) {
+ // Replace dot with {DOT}
+ $email = str_replace('.', '{DOT}', $email);
+
// Query the database
- $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' OR `email` LIKE '%%%s%%' LIMIT 1",
- array($email, str_replace('.', '{DOT}', $email)), __FUNCTION__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `email` LIKE '%%%s%%' LIMIT 1",
+ array($email), __FUNCTION__, __LINE__);
// Is the email there?
- $ret = (SQL_NUMROWS($result) == 1);
+ $isTaken = (SQL_NUMROWS($result) == 1);
// Free the result
SQL_FREERESULT($result);
// Return result
- return $ret;
+ return $isTaken;
}
// Validate the given menu action
//* DEBUG: */ debugOutput(__LINE__ . ':' . $mode . '/' . $action . '/' . $what . '*');
if (($mode != 'admin') && ($updateEntry === true)) {
// Update guest or member menu
- $sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET counter=counter+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
+ $sql = SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_%s_menu` SET `counter`=`counter`+1 WHERE `action`='%s' AND `what`='%s'".$add." LIMIT 1",
array(
$mode,
$action,
// Merge data if valid
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - PRE<br />");
if ((isUserDataValid()) && ($loadUserData === true)) {
+ // It is valid
$content = merge_array($content, getUserDataArray());
+
+ // But we don't like hashed passwords be mailed
+ unset($content['password']);
} // END - if
+
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, "content()=".count($content)." - AFTER<br />");
} // END - if
} // END - foreach
}
+// Getter for 'check_double_email'
+function getCheckDoubleEmail () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = getConfig('check_double_email');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
+// Checks wether 'check_double_email' is "YES"
+function isCheckDoubleEmailEnabled () {
+ // Is the cache entry set?
+ if (!isset($GLOBALS[__FUNCTION__])) {
+ // No, so determine it
+ $GLOBALS[__FUNCTION__] = (getCheckDoubleEmail() == 'Y');
+ } // END - if
+
+ // Return cached entry
+ return $GLOBALS[__FUNCTION__];
+}
+
// [EOF]
?>
--- /dev/null
+Hallo {%user,gender,translateGender=$userid%} {%user,surname=$userid%} {%user,family=$userid%},
+
+------------------------------
+Ihre Mitglied-Id lautet: $userid
+------------------------------
+
+Es wurde soeben ein Gutschein erstellt und der Code Ihnen per Email zugesandt. Der Wert ist {%pipe,translateComma=$content[points]%} {?POINTS?}.
+
+Hier ist Ihr persönlicher Gutscheincode, den nur Sie kennen:
+$content[coupon_code]
+
+Sie können diesen im Mitgliedbereich bis zum $content[coupon_expires] einlösen.
+
+Sie können den Empfang von Gutscheinen jederzeit im Mitgliedsbereich unter Gutscheine->Gutschein einlösen abbestellen und auch wieder bestellen.
+
+Mit freundlichen Grüßen,
+ Ihr {?MAIN_TITLE?} Team
+
+{?URL?}/login.php ({?WEBMASTER?})
--- /dev/null
+<div align="center">
+<form accept-charset="UTF-8" id="form" action="{%url=modules.php?module=login&what=cash_coupon%}" method="post">
+<div class="table dashed">
+ <div class="table_header bottom">
+ <strong>{--MEMBER_CASH_COUPON_TITLE--}</strong>
+ </div>
+ <div class="bottom" style="height:23px;padding-top:4px">
+ {--MEMBER_ENTER_COUPON_CODE--}
+ <input type="text" class="form_field" name="coupon_code" size="30" maxlength="30" />
+ </div>
+ <div class="table_footer">
+ <input type="reset" class="form_reset" value="{--CLEAR_FORM--}" />
+ <input type="submit" class="form_submit" name="ok" value="{--MEMBER_CASH_COUPON--}" />
+ </div>
+</div>
+</form>
+</div>
+
+<div class="notice">
+ {--MEMBER_CASH_COUPON_NOTE--}
+</div>
--- /dev/null
+<tr>
+ <td class="menu_advert">
+ <!-- Fuegen Sie hier Ihre Werbung ein! //-->
+ <a href="{%url=modules.php?module=index&what=impressum%}" target="_blank">Hier könnte Ihre Werbung stehen!</a>
+ </td>
+</tr>