}
// Create email link to user's account
-function generateUserEmailLink($email, $mod = 'admin') {
+function generateUserEmailLink ($email, $mod = 'admin') {
// Show contact link only if user is confirmed by default
$locked = " AND `status`='CONFIRMED'";
// Process all entries
while ($row = SQL_FETCHARRAY($result_main)) {
- // Merge both arrays
- $content = merge_array($content, $row);
-
// Remove depth to prevent booking errors. This is a bad coding
// practice, thats also why we need to write this project from
// scratch...
addPointsDirectly('admin_all', $content['userid'], bigintval(postRequestParameter('points')));
// Prepare content
- $content['text'] = SQL_ESCAPE(postRequestParameter('reason'));
- $content['points'] = bigintval(postRequestParameter('points'));
+ $content = array(
+ 'reason' => SQL_ESCAPE(postRequestParameter('reason')),
+ 'points' => bigintval(postRequestParameter('points'))
+ );
// Load email template and send email away
$message = loadEmailTemplate('add-points', $content, bigintval($content['userid']));
// Prepare content
$content = array(
- 'text' => SQL_ESCAPE(postRequestParameter('reason')),
+ 'reason' => SQL_ESCAPE(postRequestParameter('reason')),
'points' => bigintval(postRequestParameter('points'))
);
loadTemplate('admin_settings_saved', false, '{--ADMIN_POINTS_ADDED--}');
} else {
// Prepare content
- $content['user'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . $content['surname'] . ' ' . $content['family'] . '</a>';
$content['userid'] = bigintval(getRequestParameter('userid'));
// Output template
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
// Ok, add points to used points and send an email to him...
subtractPoints('admin_all', $content['userid'], postRequestParameter('points'));
- // Add more content
- $content['text'] = SQL_ESCAPE(postRequestParameter('reason'));
- $content['points'] = bigintval(postRequestParameter('points'));
+ // Prepare content
+ $content = array(
+ 'reason' => SQL_ESCAPE(postRequestParameter('reason')),
+ 'points' => bigintval(postRequestParameter('points'))
+ );
// Load message and send it away
$message = loadEmailTemplate('sub-points', $content, bigintval($content['userid']));
// Ok, add to used points and send an email to him...
subtractPoints('admin_single', bigintval(getRequestParameter('userid')), postRequestParameter('points'));
- // Add more content
- $content['text'] = SQL_ESCAPE(postRequestParameter('reason'));
- $content['points'] = bigintval(postRequestParameter('points'));
+ // Prepare content
+ $content = array(
+ 'reason' => SQL_ESCAPE(postRequestParameter('reason')),
+ 'points' => bigintval(postRequestParameter('points'))
+ );
// Load email and send it away
$message = loadEmailTemplate('sub-points', $content, bigintval(getRequestParameter('userid')));
loadTemplate('admin_settings_saved', false, '{--ADMIN_POINTS_SUBTRACTED--}');
} else {
// Prepare content
- $content['user'] = '<a href="' . generateEmailLink($content['email'], 'user_data') . '">' . translateGender($content['gender']) . ' ' . $content['surname'] . ' ' . $content['family'] . '</a>';
$content['userid'] = bigintval(getRequestParameter('userid'));
// Load form
return (getScriptOutputMode() == -1);
}
+// Wrapper to generate a user email link
+function generateWrappedUserEmailLink ($email) {
+ // Just call the inner function
+ return generateEmailLink($email, 'user_data');
+}
+
// [EOF]
?>
Grund dazu war folgender:
------------------------------
-$content[text]
+$content[reason]
------------------------------
Mit freundlichen Grüßen,
Grund dazu war folgender:
----------------
-$content[text]
+$content[reason]
----------------
Mit freundlichen Grüßen,
<tr>
<td class="admin_title bottom" colspan="2" align="center">
{--ADMIN_ADD_POINTS_TO_USER--}:<br />
- <strong>$content[user]</strong>
+ [<a href="{%user,email,generateWrappedUserEmailLink=$content[userid]%}">{%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%}</a>]
</td>
</tr>
<tr>
</tr>
<tr>
<td align="center">
- [ <a href="{%user,email,generateEmailLink=$content[userid]%}">{%user,surname=$content[userid]%} {%user,surname=$content[userid]%} ({%user,status,translateUserStatus=$content[userid]%})</a> ]
+ [ <a href="{%user,email,generateWrappedUserEmailLink=$content[userid]%}">{%user,surname=$content[userid]%} {%user,family=$content[userid]%} ({%user,status,translateUserStatus=$content[userid]%})</a> ]
</td>
</tr>
<tr>
<tr>
<td class="admin_title bottom" colspan="2" align="center">
{--ADMIN_SUB_POINTS_FROM_USER--}:<br />
- <strong>$content[user]</strong>
+ [<a href="{%user,email,generateWrappedUserEmailLink=$content[userid]%}">{%user,gender,translateGender=$content[userid]%} {%user,surname=$content[userid]%} {%user,family=$content[userid]%}</a>]
</td>
</tr>
<tr>