// Init SQLs
initSqls();
- // First calculate the timestamp
- $PURGE = getConfig('auto_purge');
-
// Init variables
$admin_points = '0';
// Then check for outdated mail order. We don't delete them just the confirmation links will be deleted.
- $result = SQL_QUERY_ESC("SELECT
+ $result = SQL_QUERY("SELECT
s.id, s.userid, s.pool_id, t.price
FROM
`{?_MYSQL_PREFIX?}_user_stats` AS s
ON
s.payment_id=t.id
WHERE
- s.timestamp_ordered <= (UNIX_TIMESTAMP() - %s)
+ s.timestamp_ordered <= (UNIX_TIMESTAMP() - {?auto_purge?})
ORDER BY
- s.userid ASC",
- array(bigintval($PURGE)), __FILE__, __LINE__);
+ s.userid ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Start deleting procedure
$userid = '0'; $points = '0';
// Is the 'bonus' extension installed and activated?
if (isExtensionActive('bonus', true)) {
// Check for bonus campaigns
- $result = SQL_QUERY_ESC("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= %s ORDER BY `id` ASC",
- array(bigintval($PURGE)), __FILE__, __LINE__);
+ $result = SQL_QUERY("SELECT `id`, `points` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `data_type`='SEND' AND `timestamp` <= {?auto_purge?} ORDER BY `id` ASC", __FILE__, __LINE__);
if (SQL_NUMROWS($result) > 0) {
// Start deleting procedure
$points = '0';
if (!empty($receiver)) {
// Add bonus mail to queue
addBonusMailToQueue(
- $data['subject'],
- $data['text'],
- $receiver,
- $data['points'],
- $data['seconds'],
- $data['url'],
- $data['cat'],
- $mode,
- $data['receiver']
+ $data['subject'],
+ $data['text'],
+ $receiver,
+ $data['points'],
+ $data['seconds'],
+ $data['url'],
+ $data['cat'],
+ $mode,
+ $data['receiver']
);
// Mail inserted into bonus pool
- if ($output) loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_SEND--}');
- } elseif ($output) {
+ if ($output === true) {
+ loadTemplate('admin_settings_saved', false, '{--ADMIN_BONUS_SEND--}');
+ } // END - if
+ } elseif ($output === true) {
// More entered than can be reached!
loadTemplate('admin_settings_saved', false, '{--ADMIN_MORE_SELECTED--}');
} else {
// Debug log
- logDebugMessage(__FUNCTION__, __LINE__, "cat={$data['cat']},receiver={$data['receiver']},data=".base64_encode(serialize($data))." More selected, than available!");
+ logDebugMessage(__FUNCTION__, __LINE__, 'cat=' . $data['cat'] . ',receiver=' . $data['receiver'] . ',data=' . base64_encode(serialize($data)) . ' More selected, than available!');
}
}
$content['email'] = postRequestParameter('email');
// Use default SMTP data
- $smtpHost = getConfig('SMTP_HOSTNAME');
- $smtpUser = getConfig('SMTP_USER');
- $smtpPass1 = getConfig('SMTP_PASSWORD');
- $smtpPass2 = getConfig('SMTP_PASSWORD');
+ $smtpHost = '{?SMTP_HOSTNAME');
+ $smtpUser = '{?SMTP_USER?}';
+ $smtpPass1 = '{?SMTP_PASSWORD?}';
+ $smtpPass2 = '{?SMTP_PASSWORD?}';
// Overwrite it with the data from sent (failed) form
if (isPostRequestParameterSet('smtp_host')) $smtpHost = postRequestParameter('smtp_host');
`action`='%s',
`what`='%s',
`userid`=%s,
- `refid`='%s',
+ `refid`=%s,
`is_member`='%s',
`is_admin`='%s',
`timestamp`=UNIX_TIMESTAMP(),
if (isExtensionActive('autopurge')) {
// Start finding them...
- $since = getConfig('ap_inactive_since');
$EXCLUDE_LIST = '';
- if (getConfig('def_refid') > 0) {
- $EXCLUDE_LIST = ' AND d.userid != {?def_refid?}';
- } // END - if
// Check for more extensions
// @TODO These can be rewritten to filter
+ if (getConfig('def_refid') > 0) $EXCLUDE_LIST .= ' AND d.userid != {?def_refid?}';
if (isExtensionActive('beg')) $EXCLUDE_LIST .= ' AND d.userid != {?beg_userid?}';
if (isExtensionActive('bonus')) $EXCLUDE_LIST .= ' AND d.userid != {?bonus_userid?}';
if (isExtensionActive('doubler')) $EXCLUDE_LIST .= ' AND d.userid != {?doubler_userid?}';
`{?_MYSQL_PREFIX?}_user_data` AS d
WHERE
d.`status`='CONFIRMED' AND
- d.joined < (UNIX_TIMESTAMP() - ".$since.") AND
- d.last_online < (UNIX_TIMESTAMP() - ".$since.") AND
- d.ap_notified < (UNIX_TIMESTAMP() - ".$since.")
+ 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?})
".$EXCLUDE_LIST."
ORDER BY
d.userid ASC");
// Is the reward below one?
if ($data['reward'] < 1) $data['reward'] = 1;
- // Add website id
- $data['sid'] = getConfig('yoomedia_sid');
-
- // Add total receivers
- $data['all'] = translateComma(getTotalReceivers());
-
- // Add categories
- $data['categories'] = generateCategoryOptionsList('normal');
-
- // Decode entities
- $data['text'] = decodeEntities($data['text']);
-
// Load template
loadTemplate('admin_send_yoomedia', false, $data);
}
loadTemplate('admin_settings_saved', false, '{--ADMIN_SESSION_SAVE_PATH_INVALID--}');
}
} else {
- // Prepare content
- $content = array(
- 'session_save_path' => getConfig('session_save_path'),
- );
-
// Load template
- loadTemplate('admin_config_session', false, $content);
+ loadTemplate('admin_config_session');
}
// [EOF]
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
if (isFormSent()) {
- // Allow only direct points (non-floating)
- setPostRequestParameter('sponsor_min_points', bigintval(postRequestParameter('sponsor_min_points')));
- setPostRequestParameter('sponsor_ref_points', bigintval(postRequestParameter('sponsor_ref_points')));
-
// Save settings
adminSaveSettingsFromPostData();
} else {
- // Remember config data in constants for the template
- $content['min_points'] = getConfig('sponsor_min_points');
- $content['ref_points'] = getConfig('sponsor_ref_points');
-
// Load template
- loadTemplate('admin_config_sponsor', false, $content);
+ loadTemplate('admin_config_sponsor');
}
-//
+// [EOF]
?>
} else {
// Prepare content
$content = array(
- 'surfbar_static_reward' => translateComma(getConfig('surfbar_static_reward')),
- 'surfbar_static_costs' => translateComma(getConfig('surfbar_static_costs')),
'surfbar_static_time' => createTimeSelections(getConfig('surfbar_static_time') , 'surfbar_static_time' , 'ms' , 'left'),
'surfbar_static_lock' => createTimeSelections(getConfig('surfbar_static_lock') , 'surfbar_static_lock' , 'hm' , 'left'),
'surfbar_restart_time' => createTimeSelections(getConfig('surfbar_restart_time') , 'surfbar_restart_time' , 'ms' , 'left'),
- 'surfbar_dynamic_percent' => translateComma(getConfig('surfbar_dynamic_percent')),
- 'surfbar_max_order' => getConfig('surfbar_max_order'),
'surfbar_stats_reload' => createTimeSelections(getConfig('surfbar_stats_reload') , 'surfbar_stats_reload' , 'ms' , 'left'),
'surfbar_purge_deleted' => createTimeSelections(getConfig('surfbar_purge_deleted') , 'surfbar_purge_deleted' , 'WDh', 'left'),
'surfbar_purge_migrated' => createTimeSelections(getConfig('surfbar_purge_migrated'), 'surfbar_purge_migrated', 'WDh', 'left'),
- 'surfbar_pause_url' => getConfig('surfbar_pause_url'),
- 'surfbar_warn_low_points' => getConfig('surfbar_warn_low_points'),
'surfbar_low_interval' => createTimeSelections(getConfig('surfbar_low_interval') , 'surfbar_low_interval' , 'WDh', 'left'),
);
// Even some more...
foreach (array('surfbar_pay_model_static','surfbar_pay_model_dynamic','surfbar_pause_mode_internal','surfbar_pause_mode_external','surfbar_notification_mode_instant','surfbar_notification_mode_reset') as $entry) {
$content[$entry] = '';
- } // END - if
+ } // END - foreach
// Prepare selections
foreach (array('surfbar_pay_model','surfbar_pause_mode','surfbar_notification_mode') as $entry) {
// Save settings
adminSaveSettingsFromPostData();
} else {
- // Prepare constants for the template
- $content['max'] = getConfig('top10_max');
-
// Load form template
- loadTemplate('admin_config_top10', false, $content);
+ loadTemplate('admin_config_top10');
}
// [EOF]
return;
} // END - if
-// Prepare constants
-$content['points'] = translateComma(getConfig('beg_points'));
-$content['points_max'] = translateComma(getConfig('beg_points_max'));
-$content['userid'] = determineReferalId();
-
-// Selection boxes are now the default
-$content['timeout'] = createFancyTime(getConfig('beg_timeout'));
// @TODO No more needed? define('__BEG_UID_TIMEOUT', createFancyTime(getConfig('beg_userid_timeout')));
// Load final template
// Shall I display the refid or shall I make it editable?
if (getConfig('display_refid') == 'Y') {
// Load "hide" form template
- $content['refid_content'] = loadTemplate('guest_register_refid_hide', true, determineReferalId());
+ $content['refid_content'] = loadTemplate('guest_register_refid_hide', true);
} else {
// Load template to enter it
- $content['refid_content'] = loadTemplate('guest_register_refid', true, determineReferalId());
+ $content['refid_content'] = loadTemplate('guest_register_refid', true);
}
// You may want to modify the register_header.tpl.xx file and not this script when you add your scripts etc. :-)
$content['refid'] = bigintval(postRequestParameter('refid'));
} // END - if
- // Prepare referal id
- $content['refid'] = determineReferalId();
-
// Display registration form
loadTemplate('guest_sponsor_reg', false, $content);
} else {
} // END - if
// Autopurge installed?
-$lastOnline = "%s";
+$lastOnline = '%s';
$ONLINE = '';
if (isExtensionActive('autopurge')) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = '{?ap_inactive_since?}';
+ $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
} // END - if
// Let's check if there are some points left we can 'pay'...
$lastOnline = '%s'; $ONLINE = '';
if (isExtensionActive('autopurge')) {
// Use last online timestamp to keep inactive members away from here
- $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
- $ONLINE = getConfig('ap_inactive_since');
+ $lastOnline = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
} // END - if
// Let's check if there are some points left we can 'pay'...
// Pre-output categories
$content['category_selection'] = '';
foreach ($categories['id'] as $key => $value) {
- $content['category_selection'] .= " <option value=\"".$value."\"";
+ $content['category_selection'] .= ' <option value="' . $value . '"';
if (($OLD_ORDER) && ($content['cat_id'] == $value)) $content['category_selection'] .= ' selected="selected"';
- $content['category_selection'] .= ">".$categories['name'][$key]." (".$categories['userids'][$key]." {--USER_IN_CAT--})</option>\n";
+ $content['category_selection'] .= '>' . $categories['name'][$key]." (".$categories['userids'][$key] . ' {--USER_IN_CAT--})</option>';
} // END - foreach
// Mail type
$P = translateComma($types[$key][1]);
if (is_array($value)) {
// Output option line
- $content['type_selection'] .= " <option value=\"".$types[$key][0]."\"";
+ $content['type_selection'] .= ' <option value="' . $types[$key][0] . '"';
if (($OLD_ORDER) && ($content['payment_id'] == $types[$key][0])) $content['type_selection'] .= ' selected="selected"';
- $content['type_selection'] .= ">".$P." {--PER_MAIL--} - ".$types[$key][3]." - ".round($types[$key][2])." {--PAYMENT--}</option>\n";
+ $content['type_selection'] .= '>' . $P . ' {--PER_MAIL--} - ' . $types[$key][3] . ' - ' . round($types[$key][2]) . ' {--PAYMENT--}</option>';
} // END - if
} // END - foreach
$year = date('Y', time());
// Shall I include only active members?
-$add = "%s"; $value = '';
+$add = '%s'; $value = '';
if ((getConfig('birthday_active')) && (isExtensionActive('autopurge')) && (getConfig('autopurge_inactive') == 'Y') && (getConfig('ap_inactive_since') > 0)) {
- $add = " AND `last_online` >= (UNIX_TIMESTAMP() - %s)";
- $value = getConfig('ap_inactive_since');
+ $add = " AND `last_online` >= (UNIX_TIMESTAMP() - {?ap_inactive_since?})";
} // END - if
// Only confirmed members shall receive birthday mails...
// No refid by default
$URL = 'modules.php?module=index';
-if (determineReferalId() > 0) {
+if (determineReferalId() != 0) {
// Test if nickname or numeric id
if (isExtensionActive('nickname')) {
// Nickname in URL, so load the id
{--ADMIN_CONFIG_SESSION_SAVE_PATH--}:<br />
</td>
<td>
- <input type="text" name="session_save_path" value="$content[session_save_path]" size="30" maxlength="255" />
+ <input type="text" name="session_save_path" value="{?session_save_path?}" size="30" maxlength="255" />
</td>
</tr>
<tr>
{--ADMIN_CONFIG_SURFBAR_STATIC_REWARD--}
</td>
<td width="40%">
- <input type="text" name="surfbar_static_reward" size="6" maxlength="20" value="$content[surfbar_static_reward]" />
+ <input type="text" name="surfbar_static_reward" size="6" maxlength="20" value="{%config,translateComma=surfbar_static_reward%}" />
<span class="tiny">({?POINTS?})</span>
</td>
</tr>
{--ADMIN_CONFIG_SURFBAR_STATIC_COSTS--}
</td>
<td style="padding-left:5px">
- <input type="text" name="surfbar_static_costs" size="6" maxlength="20" value="$content[surfbar_static_costs]" />
+ <input type="text" name="surfbar_static_costs" size="6" maxlength="20" value="{%config,translateComma=surfbar_static_costs%}" />
<span class="tiny">({?POINTS?})</span>
</td>
</tr>
{--ADMIN_CONFIG_SURFBAR_DYNAMIC_PERCENT--}
</td>
<td style="padding-left:5px">
- <input type="text" name="surfbar_dynamic_percent" size="6" maxlength="20" value="$content[surfbar_dynamic_percent]" />%
+ <input type="text" name="surfbar_dynamic_percent" size="6" maxlength="20" value="{%config,translateComma=surfbar_dynamic_percent%}" />%
</td>
</tr>
<tr>
{--ADMIN_CONFIG_SURFBAR_MAX_ORDER--}
</td>
<td style="padding-left:5px">
- <input type="text" name="surfbar_max_order" size="6" maxlength="20" value="$content[surfbar_max_order]" />
+ <input type="text" name="surfbar_max_order" size="6" maxlength="20" value="{?surfbar_max_order?}" />
</td>
</tr>
<tr>
{--ADMIN_CONFIG_SURFBAR_PAUSE_URL--}
</td>
<td class="bottom" style="padding-left:5px">
- <input type="text" name="surfbar_pause_url" size="15" maxlength="255" value="$content[surfbar_pause_url]" />
+ <input type="text" name="surfbar_pause_url" size="15" maxlength="255" value="{?surfbar_pause_url?}" />
</td>
</tr>
<tr>
{--ADMIN_CONFIG_SURFBAR_WARN_LOW_POINTS--}
</td>
<td style="padding-left:5px">
- <input type="text" name="surfbar_warn_low_points" size="5" maxlength="20" value="$content[surfbar_warn_low_points]" />
+ <input type="text" name="surfbar_warn_low_points" size="5" maxlength="20" value="{?surfbar_warn_low_points?}" />
<span class="tiny">({?POINTS?})</span>
</td>
</tr>
<tr>
<td class="bottom" align="right">{--TOP10_ADMIN_MAX_TOP10--}:</td>
<td class="bottom">
- <input type="text" name="top10_max" class="admin_normal" value="$content[max]" size="4" maxlength="6" />
+ <input type="text" name="top10_max" class="admin_normal" value="{?top10_max?}" size="4" maxlength="6" />
</td>
</tr>
<tr>
<td>
<select name="cat" size="1" class="admin_select">
<option value="X" disabled="disabled">{--PLEASE_SELECT--}</option>
- <option value="0">{--ALL_MEMBERS--} ($content[all])</option>
- $content[categories]
+ <option value="0">{--ALL_MEMBERS--} ({%pipe,getTotalReceivers,translateComma%})</option>
+ {%pipe,generateCategoryOptionsList=normal%}
</select>
</td>
</tr>
<tr>
<td align="right" style="padding-right:5px" valign="top">{--ENTER_TEXT--}:</td>
<td>
- <textarea name="text" class="admin_normal" rows="8" cols="60">$content[text]</textarea>
+ <textarea name="text" class="admin_normal" rows="8" cols="60">{%pipe,decodeEntities=$content[text]%}</textarea>
</td>
</tr>
<tr>
<td align="right" style="padding-right:5px">{--MEMBER_ENTER_URL--}:</td>
<td>
- http://www.yoomedia.de/code/t-mail.php?id=$content[id]&sid=$content[sid]
+ http://www.yoomedia.de/code/t-mail.php?id=$content[id]&sid={?yoomedia_sid?}
<input type="hidden" name="id" value="$content[id]" />
- <input type="hidden" name="sid" value="$content[sid]" />
+ <input type="hidden" name="sid" value="{?yoomedia_sid?}" />
<input type="hidden" name="reload" value="$content[reload]" />
</td>
</tr>
</div>
<div class="beg_msg">
<div class="para">
- {--BEG_GUEST_EARN_1--} <strong>$content[points] {?POINTS?}</strong>
- {--BEG_GUEST_EARN_2--} <strong>$content[points_max] {?POINTS?}</strong>
+ {--BEG_GUEST_EARN_1--} <strong>{%config,translateComma=beg_points%} {?POINTS?}</strong>
+ {--BEG_GUEST_EARN_2--} <strong>{%config,translateComma=beg_points_max%} {?POINTS?}</strong>
{--BEG_GUEST_EARN_3--}
</div>
<div class="para">
- {%message,BEG_GUEST_TIMEOUT=$content[timeout]%}
+ {%message,BEG_GUEST_TIMEOUT={%config,createFancyTime=beg_timeout%}%}
</div>
<div class="para" align="right">
{--BEG_GUEST_HAVE_FUN--}
</div>
</div>
<div align="center" class="beg_msg">
- <a href="{%url=ref.php?refid=$content[userid]%}">{--BEG_CONTINUE_REGISTER--}</a>
+ <a href="{%url=ref.php?refid={%pipe,determineReferalId%}%}">{--BEG_CONTINUE_REGISTER--}</a>
</div>
</div>
{--REFID_BY--}:
</td>
<td class="register_right">
- <input type="text" name="refid" class="register_normal" size="5" maxlength="10" value="$content" />
+ <input type="text" name="refid" class="register_normal" size="5" maxlength="10" value="{%pipe,determineReferalId%}" />
</td>
</tr>
{--REFID_BY--}:
</td>
<td class="register_right">
- <strong>$content</strong>
- <input type="hidden" name="refid" value="$content" />
+ <strong>{%pipe,determineReferalId%}</strong>
+ <input type="hidden" name="refid" value="{%pipe,determineReferalId%}" />
</td>
</tr>
{--SPONSOR_REFID_WAS--}:
</td>
<td>
- <strong>$content[refid]</strong>
+ <strong>{%pipe,determineReferalId%}</strong>
</td>
</tr>
<tr>