array(bigintval(getRequestParameter('userid'))), __FILE__, __LINE__);
}
- // Get number of rows from the query
- $nums = SQL_NUMROWS($result);
-
- if ($nums > 0) {
+ // Do we have some entries?
+ if (SQL_NUMROWS($result) > 0) {
// Some unconfirmed mails left
if (getRequestParameter('del') == "all") {
// Delete all unconfirmed mails by this user
SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_links` WHERE `userid`=%s LIMIT %s",
- array(bigintval(getRequestParameter('userid')), $nums), __FILE__, __LINE__);
+ array(bigintval(getRequestParameter('userid')), SQL_NUMROWS($result)), __FILE__, __LINE__);
// Prepare mail and send it away
- $message = loadEmailTemplate('admin-del_links', $nums, bigintval(getRequestParameter('userid')));
- sendEmail(getUserData('email'), '{--ADMIN_DEL_LINK_SUBJECT--}', $message);
+ $message = loadEmailTemplate('admin-del_links', SQL_NUMROWS($result), bigintval(getRequestParameter('userid')));
+ sendEmail(getUserData('email'), '{--ADMIN_DELETE_LINK_SUBJECT--}', $message);
// Display message
loadTemplate('admin_settings_saved', false, '{--ADMIN_LINKS_DELETED--}');
} else {
// Init variables
- $OUT = ''; $SW = 2;
+ $OUT = '';
// List all unconfirmed mails
// @TODO Find a way to rewrite this. See some lines above for different queries
// Initializes some variables
$cat = '';
$DATA = '';
- $PROBLEM = '{--GENERAL_MAIL_PROBLEM--}';
+ $PROBLEM = '{--ADMIN_GENERAL_MAIL_PROBLEM--}';
$result_data = false; // Closes Bug #58
// Load data from stats table...
break;
} // END - switch
+ // Do we have an entry?
if (SQL_NUMROWS($result_data) == 1) {
// Mail was found!
$content = SQL_FETCHARRAY($result_data);
// Prepare data for the row template
$content = array(
- 'sw' => $SW,
'link' => $LINK,
'subject' => $content['subject'],
'timestamp' => generateDateTime($content['timestamp'], 0),
- 'cat' => getCategory($content['cat_id']),
+ 'cat_id' => $content['cat_id'],
);
// Load row template
// Load template for error
$OUT .= loadTemplate('admin_list_links_problem', true,
array(
- 'sw' => $SW,
'problem' => $PROBLEM,
'data' => $DATA
)
);
}
- // Switch color and free result
- $SW = 3 - $SW;
+ // Free result
SQL_FREERESULT($result_data);
} // END - while
- // Free memory
- SQL_FREERESULT($result);
-
// Remember list in constant for the template
$content['surname'] = getUserData('surname');
$content['family'] = getUserData('family');
$content['email'] = '<a href="' . generateEmailLink(getUserData('email'), 'user_data') . '">' . getUserData('email') . '</a>';
$content['rows'] = $OUT;
- $content['nums'] = $nums;
+ $content['nums'] = SQL_NUMROWS($result);
$content['userid'] = bigintval(getRequestParameter('userid'));
+ // Free memory
+ SQL_FREERESULT($result);
+
// Load final template
loadTemplate('admin_list_links', false, $content);
}