X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fadmin%2Fwhat-list_refs.php;h=8179b6a384602e0f9fc2a092d0d740c30ca0d343;hb=101e5f161c0c367c022c9288398226a57f3919d7;hp=9cb5f68824873efc1bf6020fa267d29068c15f3d;hpb=fe8e4c180ec67e320be98e1e8dc1f9ea612c3636;p=mailer.git
diff --git a/inc/modules/admin/what-list_refs.php b/inc/modules/admin/what-list_refs.php
index 9cb5f68824..8179b6a384 100644
--- a/inc/modules/admin/what-list_refs.php
+++ b/inc/modules/admin/what-list_refs.php
@@ -19,6 +19,7 @@
* *
* -------------------------------------------------------------------- *
* 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 *
@@ -43,11 +44,11 @@ if ((!defined('__SECURITY')) || (!isAdmin())) {
} // END - if
// Add description as navigation point
-addMenuDescription('admin', __FILE__);
+addYouAreHereLink('admin', __FILE__);
-if (isGetRequestElementSet('userid')) {
+if (isGetRequestParameterSet('userid')) {
// Secure userid
- $userid = bigintval(getRequestElement('userid'));
+ $userid = bigintval(getRequestParameter('userid'));
// Fix missing variable
$result_levels = false;
@@ -59,7 +60,7 @@ if (isGetRequestElementSet('userid')) {
$menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
// Output info message
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink(getRequestElement('userid')), $menge, $menge_lck));
+ displayMessage(sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink(getRequestParameter('userid')), $menge, $menge_lck));
// Load all referal levels
$result_levels = SQL_QUERY("SELECT
@@ -72,22 +73,19 @@ ORDER BY
`level` ASC", __FILE__, __LINE__);
// Are there some levels (VERY BAD IF NONE!)
- if (SQL_NUMROWS($result_levels) > 0) {
+ if (!SQL_HASZERONUMS($result_levels)) {
// List all ref levels or entries if no refback is installed
- $OUT = ''; $SW = 2;
+ $OUT = '';
while ($levels = SQL_FETCHARRAY($result_levels)) {
- // Insert more data
- $levels['sw'] = $SW;
-
// Is the refback still active? ;-)
if (isExtensionActive('refback')) {
// Load all refs of this user
- $result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`='%s' ORDER BY refid ASC",
+ $result_refs = SQL_QUERY_ESC("SELECT `refid` FROM `{?_MYSQL_PREFIX?}_user_refs` WHERE `userid`=%s AND `level`=%s ORDER BY `refid` ASC",
array($userid, $levels['level']), __FILE__, __LINE__);
- //* DEBUG: */ outputHtml($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs)."
");
+ //* DEBUG: */ debugOutput($userid.'/'.$levels['level'].'/'.SQL_NUMROWS($result_refs));
// Do we have levels?
- if (SQL_NUMROWS($result_refs) > 0) {
+ if (!SQL_HASZERONUMS($result_refs)) {
// Count entries
$menge = countSumTotalData($userid, 'user_data', 'userid', 'refid', true);
$menge_lck = countSumTotalData($userid, 'user_data', 'userid', 'refid', true, " AND `status` != 'CONFIRMED'");
@@ -96,7 +94,7 @@ ORDER BY
$levels['info'] = sprintf(getMessage('ADMIN_USER_TOTAL_REFS'), generateUserProfileLink($userid), $menge, $menge_lck);
// Init variables
- $OUT_REFS = ''; $SW = 2;
+ $OUT_REFS = '';
// Load all refs
while ($content = SQL_FETCHARRAY($result_refs)) {
@@ -106,20 +104,22 @@ ORDER BY
$refs_cnt = countSumTotalData(getUserData('userid'), 'user_refs', 'id', 'userid', true);
// Prepare data for the template
+ // @TODO Try to rewrite some to EL
$content = array(
- 'sw' => $SW,
- 'u_link' => generateUserProfileLink(getUserData('userid')),
- 'gender' => translateGender(getUserData('gender')),
+ 'userid' => getUserData('userid'),
+ 'gender' => getUserData('gender'),
'refs_link' => 0,
'surname' => getUserData('surname'),
'family' => getUserData('family'),
- 'email' => "[".getUserData('email')."]",
- 'status' => translateUserStatus(getUserData('status')),
+ 'email' => '[' . getUserData('email') . ']',
+ 'status' => getUserData('status'),
'registered' => generateDateTime(getUserData('joined'), 3),
);
// Check if referal count is larger 0 and update link
- if ($refs_cnt > 0) $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, "list_refs");
+ if ($refs_cnt > 0) {
+ $content['refs_link'] = generateUserProfileLink(getUserData('userid'), $refs_cnt, 'list_refs');
+ } // END - if
// Load template for level one
$OUT_REFS .= loadTemplate('admin_list_refs_row', true, $content);
@@ -130,9 +130,6 @@ ORDER BY
// Add content
$levels['rows'] = $OUT_REFS;
-
- // Switch colors
- $SW = 3 - $SW;
} // END - while
} else {
// Output info message
@@ -153,14 +150,13 @@ ORDER BY
// Prepare data for the template
$content = array(
- 'sw' => $SW,
- 'u_link' => generateUserProfileLink($levels['userid']),
- 'gender' => translateGender($levels['gender']),
+ 'userid' => $levels['userid'],
+ 'gender' => $levels['gender'],
'refs_link' => 0,
'surname' => $levels['surname'],
'family' => $levels['family'],
- 'email' => "[".$levels['email']."]",
- 'status' => translateUserStatus($levels['status']),
+ 'email' => '[' . $levels['email'] . ']',
+ 'status' => $levels['status'],
'registered' => generateDateTime($levels['joined'], 3),
);
@@ -169,16 +165,13 @@ ORDER BY
// Load template for level one
$OUT .= loadTemplate('admin_list_refs_row', true, $content);
-
- // Switch colors
- $SW = 3 - $SW;
}
} // END - while
// Prepare content
$content = array(
- 'rows' => $OUT,
- 'userid' => generateUserProfileLink(getRequestElement('userid'))
+ 'rows' => $OUT,
+ 'userid' => getRequestParameter('userid')
);
// Load main template
@@ -189,17 +182,17 @@ ORDER BY
}
} elseif (isExtensionActive('refback')) {
// No levels found, very bad!
- loadTemplate('admin_settings_saved', false, getMessage('ADMIN_NO_REF_LEVELS'));
+ displayMessage('{--ADMIN_NO_REFERAL_LEVELS--}');
} else {
// No refs made so far
- loadTemplate('admin_settings_saved', false, getMessage('USER_REF_404'));
+ displayMessage('{--USER_REFERAL_404--}');
}
// Free result
SQL_FREERESULT($result_levels);
} else {
// User not found
- loadTemplate('admin_settings_saved', false, sprintf(getMessage('ADMIN_MEMBER_404'), getRequestElement('userid')));
+ displayMessage('{%message,ADMIN_MEMBER_404=' . getRequestParameter('userid') . '%}');
}
} else {
// Output selection form with all confirmed user accounts listed