templates/de/html/member/member_primera_mode_list_row.tpl -text
templates/de/html/member/member_primera_mode_pay.tpl -text
templates/de/html/member/member_receive_table.tpl -text
+templates/de/html/member/member_ref_list.tpl -text
+templates/de/html/member/member_ref_list_level.tpl -text
+templates/de/html/member/member_ref_list_row.tpl -text
templates/de/html/member/member_refback_edit.tpl -text
templates/de/html/member/member_refback_list.tpl -text
templates/de/html/member/member_refback_list_level.tpl -text
define('SERVER_URL', "http://www.mxchange.org");
// This current patch level
-define('CURR_SVN_REVISION', "492");
+define('CURR_SVN_REVISION', "493");
// Take a prime number which is long (if you know a longer one please try it out!)
define('_PRIME', 591623);
}
// Translates the american decimal dot into a german comma
-function TRANSLATE_COMMA ($dotted, $cut=true) {
+function TRANSLATE_COMMA ($dotted, $cut=true, $max=0) {
global $_CONFIG;
// Default is 3 you can change this in admin area "Misc -> Misc Options"
if (empty($_CONFIG['max_comma'])) $_CONFIG['max_comma'] = "3";
+
+ // Use from config is default
$maxComma = $_CONFIG['max_comma'];
+ // Use from parameter?
+ if ($max > 0) $maxComma = $max;
+
// Cut zeros off?
if ($cut) {
// Test for commata if in cut-mode
define('EMAIL_STATUS_QUEUE', "Wird versendet");
define('EMAIL_STATUS_TEMP', "Wird gerade gebucht");
+// Member activity
+define('MEMBER_ACTIVITY_ACTIVE', "Aktiv");
+define('MEMBER_ACTIVITY_INACTIVE', "Inaktiv");
+
+// Member reflist
+define('MEMBER_REFLIST_LIST_TITLE_1', "Ihre Referals in Ebene <u>");
+define('MEMBER_REFLIST_LIST_TITLE_2', "</u> (<u>");
+define('MEMBER_REFLIST_LIST_TITLE_3', "%</u> Ref-Vergütung)");
+define('MEMBER_REFLIST_TITLE', "Referal-Übersicht");
+define('MEMBER_REFLIST_POINTS', "Verdienst des Mitgliedes");
+define('MEMBER_REFLIST_ACTIVITY', "Mitglied aktiv?");
+define('MEMBER_REFLIST_COUNTER_1', "In dieser Ebene haben Sie <u>");
+define('MEMBER_REFLIST_COUNTER_2', "</u> Mitglieder geworben.");
+
+
//
?>
// Member language strings
define('MEMBER_REFBACK_LIST_TITLE_1', "Ref-Back Übersicht für Referal-Ebene <u>");
define('MEMBER_REFBACK_LIST_TITLE_2', "</u> (<u>");
-define('MEMBER_REFBACK_LIST_TITLE_3', "</u>% Ref-Vergütung)");
+define('MEMBER_REFBACK_LIST_TITLE_3', "%</u> Ref-Vergütung)");
define('MEMBER_REFBACK_TITLE', "Ref-Back und Referal-Übersicht");
define('MEMBER_REFBACK_NOTE', "Hier können Sie in jeder Referal-Ebene jedem von Ihnen geworbenen Mitglied Ref-Back einstellen. Sollte Ihr Referal {!POINTS!} verdienen und diese ihm/ihr nicht direkt gutgeschrieben werden, so erhält Ihr Referal die eingestellten Prozente von Ihrem Referalverdienst aufgebuch. Ihnen wird dafür sein Anteil (=eingestellte Prozente) von dem Refverdienst abgezogen. Unter <strong>{--MEMBER_REFBACK_POINTS--}</strong> sind die {!POINTS!}-Gutschriften durch Ref-Back an das jeweilige Mitglied zu verstehen.");
define('MEMBER_REFBACK_EXAMPLE', "Ein Rechenbeispiel: Ihr Ref <strong>X</strong> verdient 1000 {!POINTS!}, es sind 10% in Ref-Ebene 1 eingestellt. Sie erhalten somit 100 {!POINTS!} in Ref-Ebene 1 gutgeschrieben. Nun haben Sie einen Refback von 90% dem Ref gegeben. Ihrem Ref werden somit 90 und Ihnen die restlichen 10 {!POINTS!} gutgeschrieben.");
define('MEMBER_REFBACK_NO_ENTRIES', "Es gibt technische Probleme mit der Refback-Tabelle. Bitte Support benachrichtigen.");
define('MEMBER_REFBACK_EDIT_SUBMIT', "Refback einstellen");
-define('MEMBER_REFBACK_COUNTER_1', "In dieser Ebene haben Sie <u>");
-define('MEMBER_REFBACK_COUNTER_2', "</u> Mitglieder geworben.");
define('MEMBER_REFBACK_REFID', "User-ID (Nickname)");
define('MEMBER_REFBACK_STATUS', "Referal-Status");
define('MEMBER_REFBACK_PERCENTS', "Ref-Back Prozente");
return false;
}
-// Temporary set max comma
-$_CONFIG['max_comma'] = 5;
-
// Prepare all entries
$OUT = ""; $SW = 2;
foreach ($result as $entry) {
// Translate some data
- $entry['pay'] = TRANSLATE_COMMA($entry['pay']);
+ $entry['pay'] = TRANSLATE_COMMA($entry['pay'], true, 5);
$entry['remain'] = TRANSLATE_COMMA($entry['remain']);
$entry['sw'] = $SW;
'rate' => TRANSLATE_COMMA($rate),
'min' => $min,
'curr' => $curr,
- 'price' => $min,
+ 'price' => TRANSLATE_COMMA($min),
);
- if (!ereg(",", $content['price']))
- {
- // Add missing zeros
- $content['price'] .= ",".str_repeat("0", $_CONFIG['max_comma']);
- }
-
// Load row template and switch color
$OUT_PAY .= LOAD_TEMPLATE("guest_sponsor_pay_row", true, $content);
$SW = 3 - $SW;
return;
}
-// Is the reflist system enabled?
-if ($_CONFIG['reflist_enabled'] == "N") {
- // Output message
- LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_DISABLED);
- // Abort here
- return false;
-} // END - if
-
// Add description as navigation point
ADD_DESCR("member", __FILE__);
$SW = 2;
// Check for users ref in this level
- foreach (GET_USER_REFS($GLOBALS['userid'], $content['level']) as $refRow) {
- // Not-deleted account is default
- $deleted = false;
- if (is_null($refRow['status'])) $deleted = true;
-
+ foreach (GET_USER_REF_POINTS($GLOBALS['userid'], $content['level']) as $refRow) {
// Add/"translate" more content
- $refRow['sw'] = $SW;
- $refRow['points'] = TRANSLATE_COMMA($refRow['points']);
- $refRow['reflist'] = TRANSLATE_COMMA($refRow['reflist']);
- $refRow['status'] = TRANSLATE_STATUS($refRow['status']);
+ $refRow['sw'] = $SW;
+ $refRow['points'] = TRANSLATE_COMMA($refRow['points']);
+ $refRow['status'] = TRANSLATE_STATUS($refRow['status']);
+ $refRow['unconfirmed'] = TRANSLATE_COMMA($refRow['unconfirmed']);
+ $refRow['clickrate'] = TRANSLATE_COMMA($refRow['clickrate'], true, 1);
if (empty($refRow['nickname'])) $refRow['nickname'] = "---";
// Load row template
- if ($deleted) {
- $rows .= LOAD_TEMPLATE("member_reflist_list_row_deleted", true, $refRow);
- } else {
- $rows .= LOAD_TEMPLATE("member_reflist_list_row", true, $refRow);
- }
+ $rows .= LOAD_TEMPLATE("member_ref_list_row", true, $refRow);
// Count this ref and switch color
$counter++;
$content['rows'] = $rows;
// Load level template
- $OUT .= LOAD_TEMPLATE("member_reflist_list_level", true, $content);
+ $OUT .= LOAD_TEMPLATE("member_ref_list_level", true, $content);
} // END - while
// Load main template
- LOAD_TEMPLATE("member_reflist_list", false, $OUT);
+ LOAD_TEMPLATE("member_ref_list", false, $OUT);
} else {
// No entries
LOAD_TEMPLATE("admin_settings_saved", false, MEMBER_REFBACK_NO_ENTRIES);
}
}
+// "Getter" for array for user refs and points in given level
+function GET_USER_REF_POINTS ($uid, $level) {
+ global $_CONFIG;
+
+ //* DEBUG: */ print "----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n";
+ // Default is no refs and no nickname
+ $ADD = "";
+ $refs = array();
+
+ // Do we have nickname extension installed?
+ if (EXT_IS_ACTIVE("nickname")) {
+ $ADD = ", ud.nickname";
+ } // END - if
+
+ // Get refs from database
+ $result = SQL_QUERY_ESC("SELECT ur.id, ur.refid, ud.status, ud.last_online, ud.mails_confirmed, ud.emails_received".$ADD."
+FROM "._MYSQL_PREFIX."_user_refs AS ur
+LEFT JOIN "._MYSQL_PREFIX."_user_points AS up
+ON ur.refid=up.userid AND ur.level=0
+LEFT JOIN "._MYSQL_PREFIX."_user_data AS ud
+ON ur.refid=ud.userid
+WHERE ur.userid=%s AND ur.level=%s
+ORDER BY ur.refid ASC",
+ array(bigintval($uid), bigintval($level)), __FILE__, __LINE__);
+
+ // Are there some entries?
+ if (SQL_NUMROWS($result) > 0) {
+ // Fetch all entries
+ while ($row = SQL_FETCHARRAY($result)) {
+ // Get total points of this user
+ $row['points'] = GET_TOTAL_DATA($row['refid'], "user_points", "points") - GET_TOTAL_DATA($row['refid'], "user_data", "used_points");
+
+ // Get unconfirmed mails
+ $row['unconfirmed'] = GET_TOTAL_DATA($row['refid'], "user_links", "id", "userid", true);
+
+ // Calculate clickrate
+ $row['clickrate'] = ($row['mails_confirmed'] / $row['emails_received'] * 100);
+
+ // Activity is "active" by default because if autopurge is not installed
+ $row['activity'] = MEMBER_ACTIVITY_ACTIVE;
+
+ // Is autopurge installed and the user inactive?
+ if ((EXT_IS_ACTIVE("autopurge")) && ((time() - $_CONFIG['ap_inactive_since']) >= $row['last_online'])) {
+ // Inactive user!
+ $row['activity'] = MEMBER_ACTIVITY_INACTIVE;
+ } // END - if
+
+ // Remove some entries
+ unset($row['mails_confirmed']);
+ unset($row['emails_received']);
+ unset($row['last_online']);
+
+ // Add row
+ $refs[$row['id']] = $row;
+ } // END - while
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Return result
+ //* DEBUG: */ print "</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />\n";
+ return $refs;
+}
+
//
?>
--- /dev/null
+<table border="0" cellspacing="0" cellpadding="0" class="member_table dashed" width="740">
+<tr>
+ <td align="center" class="member_header bottom2">
+ <strong>{--MEMBER_REFLIST_TITLE--}</strong>
+ </td>
+</tr>
+<tr><td class="seperator" height="5"> </td></tr>
+$content
+<tr><td class="seperator"> </td></tr>
+</table>
--- /dev/null
+<tr>
+ <td align="center">
+<table border="0" cellspacing="0" cellpadding="0" class="member_table dashed" width="730">
+<tr>
+ <td align="center" class="member_header" colspan="6">
+ <strong>{--MEMBER_REFLIST_LIST_TITLE_1--}$content[level]{--MEMBER_REFLIST_LIST_TITLE_2--}$content[percents]{--MEMBER_REFLIST_LIST_TITLE_3--}</strong>
+ </td>
+</tr>
+<tr>
+ <td align="center" class="member_title2 bottom2 right2">
+ <strong>{--_UID--}</strong>
+ </td>
+ <td align="center" class="member_title2 bottom2 right2">
+ <strong>{--ACCOUNT_STATUS--}</strong>
+ </td>
+ <td align="center" class="member_title2 bottom2 right2">
+ <strong>{--MEMBER_REFLIST_POINTS--}</strong>
+ </td>
+ <td align="center" class="member_title2 bottom2 right2">
+ <strong>{--UNCONFIRMED_LINKS--}</strong>
+ </td>
+ <td align="center" class="member_title2 bottom2 right2">
+ <strong>{--EMAIL_PERCENT--}</strong>
+ </td>
+ <td align="center" class="member_title2 bottom2">
+ <strong>{--MEMBER_REFLIST_ACTIVITY--}</strong>
+ </td>
+</tr>
+$content[rows]
+<tr>
+ <td align="center" class="member_footer" colspan="6">
+ <span class="member_note">{--MEMBER_REFLIST_COUNTER_1--}$content[counter]{--MEMBER_REFLIST_COUNTER_2--}</span>
+ </td>
+</tr>
+</table>
+ </td>
+</tr>
+<tr><td class="seperator" height="5"> </td></tr>
--- /dev/null
+<tr>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[refid] ($content[nickname])
+ </td>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[status]
+ </td>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[points] {!POINTS!}
+ </td>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[unconfirmed]
+ </td>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[clickrate]%
+ </td>
+ <td align="center" class="switch_sw$content[sw] bottom2 right2">
+ $content[activity]
+ </td>
+</tr>
$content[rows]
<tr>
<td align="center" class="member_footer" colspan="5">
- <span class="member_note">{--MEMBER_REFBACK_COUNTER_1--}$content[counter]{--MEMBER_REFBACK_COUNTER_2--}</span>
+ <span class="member_note">{--MEMBER_REFLIST_COUNTER_1--}$content[counter]{--MEMBER_REFLIST_COUNTER_2--}</span>
</td>
</tr>
</table>