inc/extensions/ext-profile.php -text
inc/extensions/ext-rallye.php -text
inc/extensions/ext-refback.php -text
+inc/extensions/ext-refsell.php -text
inc/extensions/ext-register.php -text
inc/extensions/ext-removeip.php -text
inc/extensions/ext-repair.php -text
templates/de/html/ext/ext_profile.tpl -text
templates/de/html/ext/ext_rallye.tpl -text
templates/de/html/ext/ext_refback.tpl -text
+templates/de/html/ext/ext_refsell.tpl -text
templates/de/html/ext/ext_register.tpl -text
templates/de/html/ext/ext_removeip.tpl -text
templates/de/html/ext/ext_repair.tpl -text
templates/de/html/member/member_mail_normal_temp.tpl -text
templates/de/html/member/member_menu_bottom.tpl -text
templates/de/html/member/member_menu_row.tpl -text
+templates/de/html/member/member_menu_start.tpl -text
templates/de/html/member/member_menu_title.tpl -text
templates/de/html/member/member_menu_whats.tpl -text
templates/de/html/member/member_mydata_button.tpl -text
templates/de/html/member/member_refback_list_level.tpl -text
templates/de/html/member/member_refback_list_row.tpl -text
templates/de/html/member/member_refback_list_row_deleted.tpl -text
+templates/de/html/member/member_reflink.tpl -text
+templates/de/html/member/member_reflink_nickname.tpl -text
+templates/de/html/member/member_reflink_no_nickname.tpl -text
templates/de/html/member/member_reflinks_row.tpl -text
templates/de/html/member/member_reflinks_table.tpl -text
templates/de/html/member/member_stats_pool.tpl -text
--- /dev/null
+<?php
+/************************************************************************
+ * MXChange v0.2.1 Start: 10/30/2009 *
+ * ================ Last change: 10/30/2009 *
+ * *
+ * -------------------------------------------------------------------- *
+ * File : ext-refsell.php *
+ * -------------------------------------------------------------------- *
+ * Short description : An extension for selling referals *
+ * -------------------------------------------------------------------- *
+ * Kurzbeschreibung : Eine Erweiterung zum Verkauf von Referals *
+ * -------------------------------------------------------------------- *
+ * $Revision:: 856 $ *
+ * $Date:: 2009-03-06 20:24:32 +0100 (Fr, 06. March 2009) $ *
+ * $Tag:: 0.2.1-FINAL $ *
+ * $Author:: stelzi $ *
+ * Needs to be in all Files and every File needs "svn propset *
+ * svn:keywords Date Revision" (autoprobset!) at least!!!!!! *
+ * -------------------------------------------------------------------- *
+ * Copyright (c) 2003 - 2009 by Roland Haeder *
+ * For more information visit: http://www.mxchange.org *
+ * *
+ * This program is free software; you can redistribute it and/or modify *
+ * it under the terms of the GNU General Public License as published by *
+ * the Free Software Foundation; either version 2 of the License, or *
+ * (at your option) any later version. *
+ * *
+ * This program is distributed in the hope that it will be useful, *
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of *
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+ * GNU General Public License for more details. *
+ * *
+ * You should have received a copy of the GNU General Public License *
+ * along with this program; if not, write to the Free Software *
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, *
+ * MA 02110-1301 USA *
+ ************************************************************************/
+
+// Some security stuff...
+if (!defined('__SECURITY')) {
+ die();
+} // END - if
+
+// Version number
+setThisExtensionVersion('0.0');
+
+// Version history array (add more with , '0.1.0' and so on)
+setExtensionVersionHistory(array('0.0'));
+
+switch (getExtensionMode()) {
+ case 'register': // Do stuff when installation is running (modules.php?module=admin is called)
+ // SQL commands to run
+ break;
+
+ case 'remove': // Do stuff when removing extension
+ // SQL commands to run
+ break;
+
+ case 'activate': // Do stuff when admin activates this extension
+ // SQL commands to run
+ break;
+
+ case 'deactivate': // Do stuff when admin deactivates this extension
+ // SQL commands to run
+ break;
+
+ case 'update': // Update an extension
+ switch (getCurrentExtensionVersion()) {
+ case '0.0.1': // SQL queries for v0.0.1
+ addExtensionSql('');
+
+ // Update notes (these will be set as task text!)
+ setExtensionUpdateNotes('');
+ break;
+ } // END - switch
+ break;
+
+ case 'modify': // When the extension got modified
+ break;
+
+ case 'test': // For testing purposes. For details see file inc/modules/admin/what-extensions.php, arround line 305.
+ break;
+
+ case 'init': // Do stuff when extension is initialized
+ break;
+
+ default: // Unknown extension mode
+ DEBUG_LOG(__FILE__, __LINE__, sprintf("Unknown extension mode %s detected.", getExtensionMode()));
+ break;
+} // END - switch
+
+// [EOF]
+?>
$_userid = '---';
// List only users with at least one ref!
- //* DEBUG: */ outputHtml("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
+ //* DEBUG: */ print("*".$cnt.'/'.$content['userid'].'/'.$content['curr_points'].'/'.$refpoints."*<br />");
if (($cnt > 0) && ($refpoints > $content['curr_points'])) { $_userid = $content['userid']; } else { $cnt = ''; }
// Save values to array
$cnt = 0;
foreach ($GLOBALS['cache_array']['refsystem']['userid'] as $id => $userid) {
// Do we have a ref for this user?
- //* DEBUG: */ outputHtml("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
+ //* DEBUG: */ print("id={$id},userid={$userid},userid={$userid},old={$old},level={$GLOBALS['cache_array']['refsystem']['level'][$id]}<br />");
if (($userid == $userid) && ($GLOBALS['cache_array']['refsystem']['level'][$id] == 1)) {
- //* DEBUG: */ outputHtml("userid matches!<br />");
+ //* DEBUG: */ print("userid matches!<br />");
foreach ($GLOBALS['cache_array']['refdepths']['level'] as $level) {
if (($level == $GLOBALS['cache_array']['refsystem']['level'][$id]) && ($level == 1)) {
// Level does exist so abort here
$cnt = $GLOBALS['cache_array']['refsystem']['counter'][$id];
- //* DEBUG: */ outputHtml("*".$userid.'/'.$cnt."*<br />");
+ //* DEBUG: */ print("*".$userid.'/'.$cnt."*<br />");
break;
} elseif ($level > 1) {
// Not interesting here...
} // END - if
} // END - foreach
- //* DEBUG: */ outputHtml("<pre>");
- //* DEBUG: */ outputHtml(print_r($GLOBALS['cache_array']['refsystem'], true));
- //* DEBUG: */ outputHtml("</pre>");
+ //* DEBUG: */ print("<pre>");
+ //* DEBUG: */ print(print_r($GLOBALS['cache_array']['refsystem'], true));
+ //* DEBUG: */ print("</pre>");
//* DEBUG: */ shutdown();
if ($cnt > 0) {
incrementStatsEntry('cache_hits');
// Remove old refs
- //* DEBUG: */ outputHtml('+'.$cnt.'/'.$old."+<br />");
+ //* DEBUG: */ print('+'.$cnt.'/'.$old."+<br />");
$cnt -= $old;
} // END - if
} else {
}
// Return count
- //* DEBUG: */ outputHtml("*".$userid.'/'.$old.'/'.$cnt."*<br />");
+ //* DEBUG: */ print("*".$userid.'/'.$old.'/'.$cnt."*<br />");
return $cnt;
}
// Payback refback for refid and reduce it for current user
function addRefbackPoints ($userid, $ref, $points, $ref_points) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Back ref depths
$GLOBALS['refback_depth'][$userid][$ref] = $GLOBALS['ref_level'];
unset($GLOBALS['ref_level']);
// "Walk" through all refids
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref},level={$content['level']},points={$points}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref},level={$content['level']},points={$points}<br />");
foreach (getArrayFromRefbackLevel($userid, $content['level']) as $refid) {
// Skip level zero or if both are the same
if ($userid == $refid) continue;
// Get refback percents
$percents = getRefbackPercents($userid, $refid);
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref},refid={$refid},points={$points},percents={$percents}<br />");
// Some percents given?
if ($percents > 0) {
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$points},perc={$content['percents']},percents={$percents},level={$content['level']}<br />");
// Calculate points for refback
$refback = $points * ($content['percents'] / 100) * ($percents / 100);
// Update refback table ("refid" and "userid" must be exchanged!)
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_refs` SET `points`=`points`+%s WHERE `userid`=%s AND `refid`=%s LIMIT 1",
array($refback, $refid, $userid), __FUNCTION__, __LINE__);
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},userid={$userid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback},userid={$userid},refid={$refid} - UPDATE! (".SQL_AFFECTEDROWS().")<br />");
// Add points again, but only directly
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):refback={$refback}<br />");
addPointsDirectly(sprintf("refback:%s", $refid), $userid, $refback);
// Reduce points if refid is found
if ($refid == $ref) {
// Reduce points here!
$return = $points * ($content['percents'] / 100) - $refback;
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):points={$return} - REDUCED<br />");
} // END - if
} // END - if
} // END foreach
$GLOBALS['ref_level'] = $GLOBALS['refback_depth'][$userid][$ref];
// Return them
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $return;
}
// "Getter" for refback percents
function getRefbackPercents ($userid, $ref) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref}<br />");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$ref}<br />");
// Skip identical ids
if ($userid == $ref) return 0;
if (SQL_NUMROWS($result) == 1) {
// Fetch percents
list($percents) = SQL_FETCHROW($result);
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):percents={$percents}<br />");
} else {
// Debug log
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>): NO ENTRY FOUND! :-(<br />");
logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},ref={$ref} - No entry found! :-(");
}
SQL_FREERESULT($result);
// Return percents
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $percents;
}
// "Getter" for userid array which will return only one entry
function getArrayFromRefbackLevel ($rid, $level) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level}<br />");
// Init userids
$userIds = array();
array($rid,$level), __FUNCTION__, __LINE__);
// Entries found?
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):numRows=".SQL_NUMROWS($result)."<br />");
if (SQL_NUMROWS($result) > 0) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},level={$level},userid={$content['userid']}<br />");
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):rid={$rid},count()=".count($userIds)."<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $userIds;
}
// Update "refback table"
function updateRefbackTable ($userid) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Make it sure referal level zero (member him-/herself) is at least selected
if (empty($GLOBALS['refback_level'])) $GLOBALS['refback_level'] = 1;
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']}<br />");
// Init refid
$GLOBALS['refback_refid'][$GLOBALS['refback_level']] = 0;
array(bigintval($userid)), __FUNCTION__, __LINE__);
// When no entry was updated then we have to create it here
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):found=".SQL_NUMROWS($result_refid)."<br />");
if (SQL_NUMROWS($result_refid) > 0) {
// Load all refids
while (list($GLOBALS['refback_refid'][$GLOBALS['refback_level']]) = SQL_FETCHROW($result_refid)) {
$GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']]] = $userid;
// Refid set?
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]}<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]}<br />");
if (($GLOBALS['refback_refid'][$GLOBALS['refback_level']] > 0) && ($GLOBALS['refback_refid'][$GLOBALS['refback_level']] != $userid) && (isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']]))) {
// New userid?
if ((isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']-1])) && (isset($GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]]))) {
$old = $userid;
$userid = $GLOBALS['refback_userid'][$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]];
$minus = 1;
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},old={$old},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - NEW UID!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},old={$old},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - NEW UID!<br />");
} // END - if
// Check existence
array(bigintval($userid), $GLOBALS['refback_level'], bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
// Do we have no entry?
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},minus={$minus},numRows=".SQL_NUMROWS($result)." - FOUND!<br />");
if (SQL_NUMROWS($result) == 0) {
// Insert this level
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - ADD!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - ADD!<br />");
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
array(bigintval($userid), $GLOBALS['refback_level'], bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
array(bigintval($userid), ($GLOBALS['refback_level']-$minus), bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
// Do we have no entry?
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level=".($GLOBALS['refback_level']-$minus).",ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level=".($GLOBALS['refback_level']-$minus).",ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]},numRows=".SQL_NUMROWS($result)." - BACK!<br />");
if (SQL_NUMROWS($result) == 0) {
// Insert this level
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_refs` (`userid`,`level`,`refid`) VALUES (%s,%s,%s)",
array(bigintval($userid), ($GLOBALS['refback_level']-$minus), bigintval($GLOBALS['refback_refid'][$GLOBALS['refback_level']])), __FUNCTION__, __LINE__);
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level=".($GLOBALS['refback_level']-$minus).",ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - RETURNED!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level=".($GLOBALS['refback_level']-$minus).",ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - RETURNED!<br />");
} // END - if
} // END - if
} // END - if
// When he has a referal...
if ((($GLOBALS['refback_refid'][$GLOBALS['refback_level']] == $userid) || ($GLOBALS['refback_refid'][$GLOBALS['refback_level']] == 0)) && (getExtensionVersion('cache') >= '0.1.2') && (!isset($GLOBALS['refback_cached']))) {
// Remove cache here
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - CACHE!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']]} - CACHE!<br />");
if ($GLOBALS['cache_instance']->loadCacheFile('refback')) $GLOBALS['cache_instance']->removeCacheFile();
$GLOBALS['refback_cached'] = 1;
} // END - if
// "Walk" back here
$GLOBALS['refback_level']--;
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']} - LEVEL!<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']} - LEVEL!<br />");
// Fix empty refid
if (!isset($GLOBALS['refback_refid'][$GLOBALS['refback_level']-1])) $GLOBALS['refback_refid'][$GLOBALS['refback_level']-1] = 0;
- //* DEBUG: */ outputHtml(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]} - BACK!<br />");
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print(__FUNCTION__."(<font color=\"#0000aa\">".__LINE__."</font>):userid={$userid},level={$GLOBALS['refback_level']},ref={$GLOBALS['refback_refid'][$GLOBALS['refback_level']-1]} - BACK!<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
}
// "Getter" for array for user refs in given level
function getArrayFromRefbackUserRefs ($userid, $level) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default is no refs and no nickname
$add = '';
$refs = array();
SQL_FREERESULT($result);
// Return result
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $refs;
}
// "Getter" for refback entry
function getArrayFromUserRefbackData ($id) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default data is nothing
$data = array();
SQL_FREERESULT($result);
// Return entry
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $data;
}
// Update refback percents (but with some sanity-checks!
function updateMemberRefbackPercents ($id, $percents) {
- //* DEBUG: */ outputHtml("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
+ //* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");
// Default status is failed
$status['message'] = getMessage('MEMBER_REFBACK_ERROR_GENERAL');
$status['ok'] = true;
// Return status array
- //* DEBUG: */ outputHtml("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
+ //* DEBUG: */ print("</li></ul>----------------------- <font color=\"#aa0000\">".__FUNCTION__." - EXIT</font> ------------------------<br />");
return $status;
}
//
// Check if the user setups his MySQL stuff...
if ((empty($GLOBALS['mysql']['login'])) && (!isInstalling()) && (!isGetRequestElementSet('installing')) && (isInstalled())) {
// No login entered and outside installation mode
- outputHtml('<strong>{--LANG_WARNING--}:</strong> ');
+ outputHtml('<strong>{--LANG_WARNING--}:</strong>');
if (isInstalled()) {
// You have changed my configuration file!
app_die(__FILE__, __LINE__, '{--DIE_CONFIG_CHANGED_YOU--}');
}
} elseif ((!isInstalling()) && (empty($GLOBALS['mysql']['password'])) && (getConfig('WARN_NO_PASS') == 'Y')) {
// No database password entered!!!
- outputHtml('<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}');
+ loadTemplate('admin_settings_saved', false, '<div>{--LANG_WARNING--}:</div> {--WARN_NULL_PASSWORD--}');
}
-//
+// [EOF]
?>
$cnt = 0;
foreach (postRequestElement('sel') as $id => $sel) {
// Get the userid
- $result = SQL_QUERY_ESC("SELECT userid, holiday_start, holiday_end
-FROM `{?_MYSQL_PREFIX?}_user_holidays`
-WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+ $result = SQL_QUERY_ESC("SELECT
+ `userid`, `holiday_start`, `holiday_end`
+FROM
+ `{?_MYSQL_PREFIX?}_user_holidays`
+WHERE
+ `id`=%s
+LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
if (SQL_NUMROWS($result) == 1) {
// Load data and free memory
list($userid, $start, $end) = SQL_FETCHROW($result);
// Update user's account
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data`
-SET `holiday_active`='N', holiday_activated=0
-WHERE `userid`=%s LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__);
+SET
+ `holiday_active`='N',
+ `holiday_activated`=0
+WHERE
+ `userid`=%s
+LIMIT 1", array(bigintval($userid)), __FILE__, __LINE__);
// Remove holiday
- SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM `{?_MYSQL_PREFIX?}_user_holidays`
-WHERE `id`=%s LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
+ SQL_QUERY_ESC("DELETE LOW_PRIORITY FROM
+ `{?_MYSQL_PREFIX?}_user_holidays`
+WHERE
+ `id`=%s
+LIMIT 1", array(bigintval($id)), __FILE__, __LINE__);
// Prepare loaded data for the
$content = array(
loadTemplate('admin_settings_saved', false, getMessage('HOLIDAY_NO_DIRECT_CALL'));
}
-//
+// [EOF]
?>
if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
// Check only if bonus extension is active
if (SQL_NUMROWS($result_bonus) > 0) outputHtml('<br /><br />');
- }
+ } // END - if
}
if ((isExtensionActive('bonus')) && ($WHO == getMessage('_ALL'))) {
} // END - if
// Open div tag
-outputHtml("<div align=\"center\">");
+outputHtml('<div align="center">');
// Check for possible running rallyes
$ADMIN = " AND d.is_active='Y'";
handleCodeMessage();
// Begin menu block here
-outputHtml("<tr>
- <td class=\"member_menu\">");
+loadTemplate('member_menu_start');
// Adding the main content module here
if (!isActionSet()) {
// Load current referal clicks
$result = SQL_QUERY_ESC("SELECT `ref_clicks` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
array(getUserId()), __FILE__, __LINE__);
+
+// Load it
$content = SQL_FETCHARRAY($result);
+
+// Free result
SQL_FREERESULT($result);
-outputHtml("<div class=\"tiny\">{--YOUR_PERSONAL_REFLINK--}:<br />
-<strong><a href=\"{?URL?}/ref.php?refid=".getUserId()."\" target=\"_blank\">{?URL?}/ref.php?ref=".getUserId()."</a></strong><br />
-<br />");
+// Prepare some data
+$content['userid'] = getUserId();
+// @TODO Move this into a filter
if (isExtensionActive('nickname')) {
// Add nickname link when nickname is entered
$nick = getNickname(getUserId());
if (!empty($nick)) {
// Display nickname link
- outputHtml("{--NICKNAME_YOUR_REFLINK--}:<br />
-<strong><a href=\"{?URL?}/ref.php?ref=".$nick."\" target=\"_blank\">{?URL?}/ref.php?ref=".$nick."</a></strong><br />
-<br />");
+ $content['nickname_content'] = loadTemplate('member_reflink_nickname', true, $nick);
} else {
// Display link to nickname form
- outputHtml("<div class=\"guest_note\">{--NO_NICKNAME_SET--}</strong><br />
-<a class=\"tiny\" href=\"{?URL?}/modules.php?module=login&what=nickname\">{--PLEASE_CLICK_NICKNAME_FORM--}</a>");
+ $content['nickname_content'] = loadTemplate('member_reflink_no_nickname', true);
}
-}
-
-// Clicks on your reflink
-outputHtml("{--YOUR_REFCLICKS--}: <strong>".$content['ref_clicks']."</strong> {--CLICKS--}</div><br /><br />");
+} // END - if
$whereStatement = " WHERE `visible`='Y'";
if (isAdmin()) $whereStatement = '';
if (SQL_NUMROWS($result) > 0) {
// List available ref banners
$OUT = ''; $SW = 2;
- while ($content = SQL_FETCHARRAY($result)) {
- $test = str_replace(getConfig('URL'), getConfig('PATH'), $content['url']); $size = 0;
- if ($test == $content['url']) {
+ while ($row = SQL_FETCHARRAY($result)) {
+ $test = str_replace(getConfig('URL'), getConfig('PATH'), $row['url']); $size = 0;
+ if ($test == $row['url']) {
// Download banner (I hope you keep the banner on same server???)
- $fp = sendGetRequest($content['url']); $bannerContent = '';
+ $fp = sendGetRequest($row['url']); $bannerContent = '';
if ((!empty($fp)) && (is_array($fp)) && (count($fp) > 0)) {
// Loads only found banner, when there is a 404 error this foreach() command
// will cause an "Invalid argument supplied for foreach()" error
$size = filesize($test);
}
- if ($size > 0) $content['alternate'] .= ' (' .translateComma(round($size / 102.4) / 10) . ' {--KBYTES--})';
+ if ($size > 0) $row['alternate'] .= ' (' .translateComma(round($size / 102.4) / 10) . ' {--KBYTES--})';
// Add some more data
- $content['sw'] = $SW;
- $content['userid'] = getUserId();
+ $row['sw'] = $SW;
+ $row['userid'] = getUserId();
// Add row
- $OUT .= loadTemplate('member_reflinks_row', true, $content);
+ $OUT .= loadTemplate('member_reflinks_row', true, $row);
// Switchcolors
$SW = 3 - $SW;
} // END - while
// Load final template
- loadTemplate('member_reflinks_table', false, $OUT);
+ $content['refbanner_content'] = loadTemplate('member_reflinks_table', true, $OUT);
} else {
// No refbanner found!
- loadTemplate('admin_settings_saved', false, getMessage('MEMBER_NO_REFBANNER_FOUND'));
+ $content['refbanner_content'] = loadTemplate('admin_settings_saved', true, getMessage('MEMBER_NO_REFBANNER_FOUND'));
}
// Free result
SQL_FREERESULT($result);
+// Load main template
+loadTemplate('member_reflink', false, $content);
+
// [EOF]
?>
// We can now send mails to them...
foreach ($RECEIVERS as $key => $userid) {
// Load personal data
- //* DEBUG: */ outputHtml("*L:".__LINE__.'/'.$userid."*<br />");
+ //* DEBUG: */ print("*L:".__LINE__.'/'.$userid."*<br />");
$result_user = SQL_QUERY_ESC("SELECT `surname`, `family`, `email` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `userid`=%s LIMIT 1",
array(bigintval($userid)), __FILE__, __LINE__);
if (SQL_NUMROWS($result_user) == 1) {
// The final receiver does exists so we can continue...
list($surname, $family, $email) = SQL_FETCHROW($result_user);
- //* DEBUG: */ outputHtml("OK!/L:".__LINE__."<br />");
+ //* DEBUG: */ print("OK!/L:".__LINE__."<br />");
// Mark this user as "spammed" ;-) And place a line for him...
if (removeReceiver($dummy, $key, $userid, $DATA['id'], $DATA['id'], true) == 'done') {
// Do we have send maximum mails?
if (($GLOBALS['pool_cnt'] >= getConfig('max_send')) || (countSelection($dummy) == 0)) {
// Yes, we have
- //* DEBUG: */ outputHtml("*EXIT/L:".__LINE__."<br />");
+ //* DEBUG: */ print("*EXIT/L:".__LINE__."<br />");
break;
} // END - if
} // END - if
// Update entry (or add missing
$P = $GLOBALS['pool_cnt'];
if (!empty($cnt2) && empty($GLOBALS['pool_cnt'])) $P = $cnt2;
- //* DEBUG: */ outputHtml("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
+ //* DEBUG: */ print("+MEDIA/L:".__LINE__.'/'.$P."+<br />");
updateMediadataEntry(array("total_send", "bonus_send"), 'add', $P);
} // END - if
// Close sending system
- //* DEBUG: */ outputHtml("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
+ //* DEBUG: */ print("-L:".__LINE__.'/'.countSelection($dummy)."-<br />");
if (countSelection($dummy) == 0) {
// Queue reached!
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='SEND', `target_send`=0, `receivers`='' WHERE `id`=%s LIMIT 1",
array(bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ outputHtml("*L:".__LINE__."*<br />");
+ //* DEBUG: */ print("*L:".__LINE__."*<br />");
// Update mediadata if version is 0.0.4 or higher
if (getExtensionVersion('mediadata') >= '0.0.4') {
// Update entry (or add missing)
- //* DEBUG: */ outputHtml("*MEDIA/L:".__LINE__."*<br />");
+ //* DEBUG: */ print("*MEDIA/L:".__LINE__."*<br />");
updateMediadataEntry(array("total_orders", "bonus_orders"), 'add', 1);
} // END - if
} elseif ($GLOBALS['pool_cnt'] >= getConfig('max_send')) {
// Update bonus pool
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_bonus` SET `data_type`='NEW', `target_send`=%s, `receivers`='%s' WHERE `id`=%s LIMIT 1",
array(countSelection($dummy), implode(';', $dummy), bigintval($DATA['id'])), __FILE__, __LINE__);
- //* DEBUG: */ outputHtml("*L:".__LINE__."<pre>");
- //* DEBUG: */ outputHtml(print_r($dummy, true));
- //* DEBUG: */ outputHtml("</pre>\n!!!<br />");
+ //* DEBUG: */ print("*L:".__LINE__."<pre>");
+ //* DEBUG: */ print(print_r($dummy, true));
+ //* DEBUG: */ print("</pre>\n!!!<br />");
break;
}
}
--- /dev/null
+Bietet Ihnen die Möglichkeit an, in Ihrem {?MT_WORD?} Referals zu
+verkaufen, die noch keinen Werber haben. Dabei werden Preise basierend auf
+verschiedenste Daten des Mitgliedes und aller Mitglieder berechnet, um einen
+guten und fairen Preis zu erziehlen.
--- /dev/null
+<tr>
+ <td class="member_menu">
--- /dev/null
+<div>
+ {--YOUR_PERSONAL_REFLINK--}:
+</div>
+<div style="padding-bottom:5px">
+ <strong><a href="{?URL?}/ref.php?refid=$content[userid]" target="_blank">{?URL?}/ref.php?ref=$content[userid]</a></strong>
+</div>
+$content[nickname_content]
+<div style="padding-top:5px">
+ {--YOUR_REFCLICKS--}: <strong>$content[ref_clicks]</strong> {--CLICKS--}
+</div>
+<div>
+ $content[refbanner_content]
+</div>
--- /dev/null
+<div>
+ {--NICKNAME_YOUR_REFLINK--}:
+</div>
+<div>
+ <strong><a href="{?URL?}/ref.php?ref=$content" target="_blank">{?URL?}/ref.php?ref=$content</a></strong>
+</div>
--- /dev/null
+<div class="guest_note">
+ {--NO_NICKNAME_SET--}
+ <a class="tiny" href="{?URL?}/modules.php?module=login&what=nickname">{--PLEASE_CLICK_NICKNAME_FORM--}</a>
+</div>