templates/de/html/admin/admin_add_admins_acl.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_bank_package.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_cat.tpl svneol=native#text/plain
+templates/de/html/admin/admin_add_config_network_type.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_country.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_forced_ad.tpl svneol=native#text/plain
templates/de/html/admin/admin_add_guest_menu.tpl svneol=native#text/plain
/.cache
/.project
/.settings
+DOCS/debug-lines.log
DOCS/doxygen/*.tmp
DOCS/doxygen/html
DOCS/template-warnings.log
./inc/modules/admin/what-admins_mails.php:58: // @TODO Can this be rewritten to an API function?
./inc/modules/admin/what-bonus.php:46:// @TODO Unused at the moment
./inc/modules/admin/what-config_mods.php:55: // @TODO This can be moved into mysql-function.php, see checkModulePermissions() function
-./inc/modules/admin/what-config_network_types.php:60: // @TODO Do something here
./inc/modules/admin/what-config_points.php:110: // @TODO Rewrite this to a filter
./inc/modules/admin/what-config_rallye_prices.php:195: // @TODO Rewrite these two constants
./inc/modules/admin/what-config_rallye_prices.php:227: // @TODO rename: start->start_time, end->end_time
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,%s,%s,'%s', UNIX_TIMESTAMP(), 'N','N')",
array(
getUserData('userid'),
- makeZeroToNull(determineReferralId()),
+ convertZeroToNull(determineReferralId()),
bigintval(postRequestElement('points') * 2),
detectRemoteAddr()
), __FILE__, __LINE__);
// Okay add a refid line and apply refid percents
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_doubler` (`userid`,`refid`,`points`,`remote_ip`,`timemark`,`completed`,`is_ref`) VALUES (%s,0,%s,'%s',UNIX_TIMESTAMP(),'N','Y')",
array(
- makeZeroToNull(determineReferralId()),
+ convertZeroToNull(determineReferralId()),
(postRequestElement('points') * 2 * getConfig('doubler_ref') / 100),
detectRemoteAddr()
), __FILE__, __LINE__);
getModule(),
$action,
getWhat(),
- makeZeroToNull($userid),
- makeZeroToNull(determineReferralId()),
+ convertZeroToNull($userid),
+ convertZeroToNull(determineReferralId()),
$isMember,
$isAdmin,
detectRemoteAddr(),
getModule(),
$action,
getWhat(),
- makeZeroToNull($userid),
- makeZeroToNull(determineReferralId()),
+ convertZeroToNull($userid),
+ convertZeroToNull(determineReferralId()),
$isMember,
$isAdmin,
session_id(),
}
// Converts a zero or NULL to word 'NULL'
-function makeZeroToNull ($number) {
+function convertZeroToNull ($number) {
// Is it a valid username?
if ((!is_null($number)) && (!empty($number)) && ($number > 0)) {
// Always secure it
}
// Converts a NULL to zero
-function makeNullToZero ($number) {
+function convertNullToZero ($number) {
// Is it a valid username?
if ((!is_null($number)) && (!empty($number)) && ($number > 0)) {
// Always secure it
'ADMIN_NETWORK_REQUEST_PARAMETER_DELETE_TITLE' => "API-Parameter löschen",
'ADMIN_ADD_NETWORK_API_TRANSLATION_TITLE' => "Werbenetzwerk verwalten - Neues API-Arrayelement hinzufügen",
'ADMIN_LIST_NETWORK_API_TRANSLATION_TITLE' => "API-Arrayelemente auflisten und verwalten",
+ 'ADMIN_ADD_CONFIG_NETWORK_TYPE_TITLE' => "Werbeart-Handler einrichten - {%%pipe,translateNetworkTypeHandler=%s%%}",
// - Link titles
'ADMIN_NETWORK_CONFIG_LINK_TITLE' => "Weiter zur API-Konfiguration",
'ADMIN_LIST_NETWORK_TYPES_LINK_TITLE' => "Weiter zu den Werbearten",
'ADMIN_CHANGE_NETWORK_REQUEST_PARAMETER_SUBMIT' => "API-Parameter ändern",
'ADMIN_REMOVE_NETWORK_REQUEST_PARAMETER_SUBMIT' => "API-Parameter entfernen",
'ADMIN_ADD_NETWORK_API_TRANSLATION_SUBMIT' => "API-Arrayelement hinzufügen",
+ 'ADMIN_ADD_CONFIG_NETWORK_TYPE_SUBMIT' => "Jetzt den Werbeart-Handler einrichten",
// - Success titles
'ADMIN_NETWORK_ADDED_TITLE' => "Allgemeine Werbenetzwerkdaten hinzugefügt",
'ADMIN_NETWORK_TYPES_ADDED_TITLE' => "Werbeart-Handler hinzugefügt",
'ADMIN_CONFIG_NETWORK_API_NOT_SAVED' => "API-Konfiguration NICHT gespeichert (keine Änderungen).",
'ADMIN_NETWORK_API_NOT_CONFIGURED' => "Konfiguration fehlt",
'ADMIN_NETWORK_API_CONFIGURED' => "Konfiguration vorhanden",
+ // Network types configuration
+ 'ADMIN_CONFIG_NETWORK_TYPES_404' => "Es wurden keine Daten zur Werbenetzwerk-Id <span class=\"data\">%s</span> gefunden. Bitte benachrichtigen Sie das Entwickler-Team.",
+ 'ADMIN_ADD_CONFIG_NETWORK_TYPE_404_NOTE' => "Damit das Script auch das Interface des Werbenetzwerks ansprechen kann, muss ein Werbeart-Handler eingerichtet werden.",
// Error codes
'ADMIN_NETWORK_AFF_ID_PASS_WRONG_ERROR_CODE' => "Affiliate-Id oder -Passwort falsch",
'ADMIN_NETWORK_SITE_ID_NOT_ASSIGNED_ERROR_CODE' => "Seiten-Id nicht zugewiesen/ungültig",
// Generate menu mode selection box for given admin it
function generateAdminMenuModeSelectionBox ($adminId = NULL) {
// Start the selection box
- $OUT = '<select name="la_mode[{%pipe,makeNullToZero=' . makeZeroToNull($adminId) . '%}]" size="1" class="form_select">';
+ $OUT = '<select name="la_mode[{%pipe,convertNullToZero=' . convertZeroToNull($adminId) . '%}]" size="1" class="form_select">';
// Add option list
$OUT .= generateOptionList('/ARRAY/', array('global', 'OLD', 'NEW'), array('{--ADMIN_ADMINS_LA_MODE_GLOBAL--}', '{--ADMIN_ADMINS_LA_MODE_OLD--}', '{--ADMIN_ADMINS_LA_MODE_NEW--}'), getAdminMenuMode($adminId));
* call. If you do so, you will check the wrong direction, $userid
* is always bigger than $refid.
*/
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero($refid) . ' - CALLING getRefbackPercents()');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero($refid) . ' - CALLING getRefbackPercents()');
$content['refback_percents'] = getRefbackPercents($refid, $userid);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero($refid) . ',refback_percents=' . $content['refback_percents']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero($refid) . ',refback_percents=' . $content['refback_percents']);
// Some percents given?
if ($content['refback_percents'] > 0) {
// Something must have been updated
if (SQL_HASZEROAFFECTED()) {
// Please report this bug
- debug_report_bug(__FUNCTION__, __LINE__, 'Nothing has been updated in user_refs,userid=' . $userid . ',refid=' . makeNullToZero($refid) . ',refbackPoints=' . $refbackPoints);
+ debug_report_bug(__FUNCTION__, __LINE__, 'Nothing has been updated in user_refs,userid=' . $userid . ',refid=' . convertNullToZero($refid) . ',refbackPoints=' . $refbackPoints);
} // END - if
// Add points again, but only directly
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refbackPoints=' . $refbackPoints . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . makeNullToZero($refid) . ' - REFBACK-UPDATE! (' . SQL_AFFECTEDROWS() . ')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refbackPoints=' . $refbackPoints . ',userid=' . $userid . ',ref=' . $ref . ',refid=' . convertNullToZero($refid) . ' - REFBACK-UPDATE! (' . SQL_AFFECTEDROWS() . ')');
addPointsThroughReferralSystem(sprintf("refback:%s", $refid), $userid, $refbackPoints);
// Reduce points if refid is found
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . $refid . ' - ENTERED!');
if ((!isValidUserId($userid)) || (!isValidUserId($refid))) {
// userid and/or refid is invalid
- debug_report_bug(__FUNCTION__, __LINE__, 'userid=' . makeNullToZero($userid) . ', refid=' . makeNullToZero($refid) . ' - Both must be > 0');
+ debug_report_bug(__FUNCTION__, __LINE__, 'userid=' . convertNullToZero($userid) . ', refid=' . convertNullToZero($refid) . ' - Both must be > 0');
} elseif ($userid == $refid) {
// Skip identical ids
return 0;
// "Getter" for userid array which will return only one entry
function getArrayFromRefbackLevel ($refid, $level) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',level=' . $level . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ' - ENTERED!');
// Init userids
$userIds = array();
if (!SQL_HASZERONUMS($result)) {
// Add all
while ($content = SQL_FETCHARRAY($result)) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',level=' . $level . ',userid=' . $content['userid']);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',level=' . $level . ',userid=' . $content['userid']);
$userIds[] = $content['userid'];
} // END - while
} // END - if
SQL_FREERESULT($result);
// Return array
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . makeNullToZero($refid) . ',userIds()=' . count($userIds) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'refid=' . convertNullToZero($refid) . ',userIds()=' . count($userIds) . ' - EXIT!');
return $userIds;
}
generateHash(postRequestElement('pass1')),
bigintval(postRequestElement('max_mails')),
bigintval(postRequestElement('max_mails')),
- makeZeroToNull(postRequestElement('refid')),
+ convertZeroToNull(postRequestElement('refid')),
$hash
), __FUNCTION__, __LINE__);
$title = $userid;
} elseif (!isValidUserId($userid)) {
// User id zero is invalid
- return '<strong>' . makeNullToZero($userid) . '</strong>';
+ return '<strong>' . convertNullToZero($userid) . '</strong>';
}
if (($title == '0') && ($what == 'list_refs')) {
if ($key == $userIdColumn[0]) {
// Add it again as raw id
//* DEBUG: */ debug_report_bug(__FUNCTION__, __LINE__, 'key=' . $key . ',userIdColumn=' . $userIdColumn[0]);
- $content[$userIdColumn[0]] = makeZeroToNull($value);
+ $content[$userIdColumn[0]] = convertZeroToNull($value);
$content[$userIdColumn[0] . '_raw'] = $content[$userIdColumn[0]];
} // END - if
// Do we have a network selected?
if (isGetRequestElementSet('network_id')) {
- // @TODO Do something here
+ // Is a network type handler selected?
+ if (isGetRequestElementSet('network_type_id')) {
+ // Load data for given network
+ $result = SQL_QUERY_ESC('SELECT
+ `network_id`,
+ `network_type_id`,
+ `network_type_handle`,
+ `network_type_api_url`,
+ `network_type_click_url`,
+ `network_type_banner_url`,
+ NULL AS `network_data_id`,
+ NULL AS `network_max_reload_time`,
+ NULL AS `network_min_waiting_time`,
+ NULL AS `network_min_remain_clicks`,
+ NULL AS `network_min_payment`,
+ NULL AS `network_allow_erotic`
+FROM
+ `{?_MYSQL_PREFIX?}_network_types`
+WHERE
+ `network_id`=%s AND
+ `network_type_id`=%s
+LIMIT 1',
+ array(
+ bigintval(getRequestElement('network_id')),
+ bigintval(getRequestElement('network_type_id'))
+ ), __FUNCTION__, __LINE__);
+
+ // Do we have a record?
+ if (SQL_NUMROWS($result) == 1) {
+ // Load it
+ $content = SQL_FETCHARRAY($result);
+
+ // Check for network type configuration
+ $result_config = SQL_QUERY_ESC('SELECT
+ `network_data_id`,
+ `network_max_reload_time`,
+ `network_min_waiting_time`
+ `network_min_remain_clicks`,
+ `network_min_payment`,
+ `network_allow_erotic`
+FROM
+ `{?_MYSQL_PREFIX?}_network_types_config`
+WHERE
+ `network_id`=%s AND
+ `network_type_id`=%s
+LIMIT 1',
+ array(
+ bigintval(getRequestElement('network_id')),
+ bigintval($content['network_type_id'])
+ ), __FUNCTION__, __LINE__);
+
+ // Do we also have configuration?
+ if (SQL_NUMROWS($result_config) == 1) {
+ // Load as well and merge it
+ $content = merge_array($content, SQL_FETCHARRAY($result_config));
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result_config);
+
+ // Load template
+ loadTemplate('admin_add_config_network_type_form', false, $content);
+
+ // Abort here
+ return;
+ } else {
+ // No entry found
+ displayMessage('{%message,ADMIN_ADD_CONFIG_NETWORK_TYPE_404', bigintval(getRequestElement('network_id')) . '/' . bigintval(getRequestElement('network_type_id')));
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+ } // END - if
+
+ // Get all type handlers
+ $result = SQL_QUERY_ESC('SELECT
+ `network_id`,
+ `network_type_id`,
+ `network_type_handle`,
+ `network_type_api_url`,
+ `network_type_click_url`,
+ `network_type_banner_url`
+FROM
+ `{?_MYSQL_PREFIX?}_network_types`
+WHERE
+ `network_id`=%s
+ORDER BY
+ `network_type_handle` ASC',
+ array(
+ bigintval(getRequestElement('network_id'))
+ ), __FUNCTION__, __LINE__);
+
+ // Do we have entries left?
+ if (!SQL_HASZERONUMS($result)) {
+ // Init row output
+ $OUT = '';
+
+ // List all entries
+ while ($content = SQL_FETCHARRAY($result)) {
+ // Check if config entry is there
+ $result_config = SQL_QUERY_ESC('SELECT
+ `network_data_id`,
+ `network_max_reload_time`,
+ `network_min_waiting_time`,
+ `network_min_remain_clicks`,
+ `network_min_payment`,
+ `network_allow_erotic`
+FROM
+ `{?_MYSQL_PREFIX?}_network_types_config`
+WHERE
+ `network_id`=%s AND
+ `network_type_id`=%s
+LIMIT 1',
+ array(
+ bigintval(getRequestElement('network_id')),
+ bigintval($content['network_type_id'])
+ ), __FUNCTION__, __LINE__);
+
+ // Do we have an entry?
+ if (SQL_NUMROWS($result_config) == 1) {
+ // Load this data as well
+ $contentConfig = SQL_FETCHARRAY($result_config);
+
+ // Add it with extra template
+ $content['network_types_config_content'] = loadTemplate('admin_show_config_network_type', true, $contentConfig);
+ } else {
+ // No configuration found, so display form
+ $content['network_types_config_content'] = loadTemplate('admin_add_config_network_type', true, $content);
+ }
+
+ // Free result
+ SQL_FREERESULT($result_config);
+
+ // Load row template
+ $OUT .= loadTemplate('admin_config_network_types_row', true, $content);
+ } // END - while
+
+ // Load main template
+ loadTemplate('admin_config_network_types', false, $OUT);
+ } else {
+ // No entries found
+ displayMessage('{%message,ADMIN_CONFIG_NETWORK_TYPES_404=' . bigintval(getRequestElement('network_id')) . '%}');
+ }
+
+ // Free result
+ SQL_FREERESULT($result);
} else {
// Generate network list for this script
outputHtml(generateAdminNetworkList());
LIMIT 1",
array(
getMemberId(),
- makeZeroToNull($content['level'])
+ convertZeroToNull($content['level'])
), __FILE__, __LINE__);
// Do we have an entry?
// Insert the task data into the database
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_task_system` (`assigned_admin`,`userid`,`status`,`task_type`,`subject`,`text`,`task_created`) VALUES (%s,%s,'NEW','%s','%s','%s', UNIX_TIMESTAMP())",
array(
- makeZeroToNull($adminId),
- makeZeroToNull($userid),
+ convertZeroToNull($adminId),
+ convertZeroToNull($userid),
$taskType,
$subject,
$notes
* refid = inc/modules/guest/what-confirm.php need this
*/
function addPointsThroughReferralSystem ($subject, $userid, $points, $refid = NULL) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . makeNullToZero($refid) . ' - ENTERED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',refid=' . convertNullToZero($refid) . ' - ENTERED!');
// By default nothing has been added
$added = false;
// Get percents
$per = getReferralLevelPercents($GLOBALS['ref_level']);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ',per=' . $per . ',mode=' . $paymentMethod . ',pointsColumn=' . $pointsColumn . ',locked=' . intval($locked) . ',refid=' . getUserData('refid'));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',points=' . $points . ',depth=' . convertNullToZero($GLOBALS['ref_level']) . ',per=' . $per . ',mode=' . $paymentMethod . ',pointsColumn=' . $pointsColumn . ',locked=' . intval($locked) . ',refid=' . getUserData('refid'));
// Some percents found?
if ($per > 0) {
$ref_points = $points * $per / 100;
// Pay refback here if level > 0 and in ref-mode
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',points=' . $points . ',paymentMethod=' . $paymentMethod);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero(getUserData('refid')) . ',points=' . $points . ',paymentMethod=' . $paymentMethod);
if (($userid != $refid) && ($paymentMethod == 'REFERRAL') && (isValidUserId(getUserData('refid'))) && (isExtensionActive('refback'))) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ' - BEFORE!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . convertNullToZero($GLOBALS['ref_level']) . ' - BEFORE!');
$ref_points = addRefbackPoints($userid, getUserData('refid'), $points, $ref_points);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . makeNullToZero($GLOBALS['ref_level']) . ' - AFTER!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero(getUserData('refid')) . ',ref_points=' . $ref_points . ',depth=' . convertNullToZero($GLOBALS['ref_level']) . ' - AFTER!');
} // END - if
// Update points...
bigintval($GLOBALS['ref_level'])
), __FUNCTION__, __LINE__);
}
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.makeNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'pointsColumn='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.convertNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - UPDATE! ('.SQL_AFFECTEDROWS().')');
// No entry updated?
if (SQL_HASZEROAFFECTED()) {
array(
$pointsColumn,
bigintval($userid),
- makeZeroToNull($GLOBALS['ref_level']),
+ convertZeroToNull($GLOBALS['ref_level']),
$ref_points
), __FUNCTION__, __LINE__);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.makeNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'data='.$pointsColumn.',ref_points='.$ref_points.',userid='.$userid.',depth='.convertNullToZero($GLOBALS['ref_level']).',mode='.$paymentMethod.' - INSERTED! ('.SQL_AFFECTEDROWS().')');
} // END - if
// Check affected rows
if ($paymentMethod == 'REFERRAL') {
// Increase it
$GLOBALS['ref_level']++;
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referral level increased, ref_level=' . makeNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referral level increased, ref_level=' . convertNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . convertNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
} elseif (isDebugModeEnabled()) {
// Not increasing referral level, DIRECT payment method
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referral level *NOT* increased, ref_level=' . makeNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'Referral level *NOT* increased, ref_level=' . convertNullToZero($GLOBALS['ref_level']) . ',points=' . $points . ',refid=' . convertNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
}
// Maybe there's another ref?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',refid(var|data)=' . makeNullToZero($refid) . '|' . makeNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'points=' . $points . ',refid(var|data)=' . convertNullToZero($refid) . '|' . convertNullToZero(getUserData('refid')) . ',userid=' . $userid . ',paymentMethod=' . $paymentMethod);
if ((isValidUserId(getUserData('refid'))) && ($points > 0) && (getUserData('refid') != $userid) && ($paymentMethod == 'REFERRAL')) {
// Then let's credit him here...
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . makeNullToZero(getUserData('refid')) . ',points=' . $points . ',ref_points=' . $ref_points . ',added[' . gettype($added) . ']=' . intval($added) . ' - ADVANCE!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',refid=' . convertNullToZero(getUserData('refid')) . ',points=' . $points . ',ref_points=' . $ref_points . ',added[' . gettype($added) . ']=' . intval($added) . ' - ADVANCE!');
$added = ($added && addPointsThroughReferralSystem(sprintf("%s_ref:%s", $subject, $GLOBALS['ref_level']), getUserData('refid'), $points, getFetchedUserData('userid', getUserData('refid'), 'refid')));
} // END - if
} // END - if
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',sendNotify=' . intval($sendNotify) . ',refid=' . makeNullToZero($refid) . ',paymentMethod=' . $paymentMethod . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'subject=' . $subject . ',userid=' . $userid . ',points=' . $points . ',sendNotify=' . intval($sendNotify) . ',refid=' . convertNullToZero($refid) . ',paymentMethod=' . $paymentMethod . ' - EXIT!');
return $added;
}
if (fetchUserData($userid)) {
// Get it
$ref = getUserData('refid');
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref) . ' - FETCHED!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . convertZeroToNull($ref) . ' - FETCHED!');
} // END - if
// Init entries
$GLOBALS['cache_array']['ref_level'][$ref] = NULL;
} // END - if
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . convertZeroToNull($ref));
// When he has a referral...
if (($ref > 0) && ($ref != $userid)) {
SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_refsystem` (`userid`,`level`,`counter`) VALUES (%s,%s,1)",
array(
bigintval($ref),
- makeZeroToNull($GLOBALS['cache_array']['ref_level'][$ref])
+ convertZeroToNull($GLOBALS['cache_array']['ref_level'][$ref])
), __FUNCTION__, __LINE__);
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . $ref . ',level=' . $GLOBALS['cache_array']['ref_level'][$ref] . ',SQL_AFFECTEDROWS()=' . SQL_AFFECTEDROWS());
} // END - if
updateReferralCounter($ref);
} elseif ((($ref == $userid) || ($ref == '0')) && (isExtensionInstalledAndNewer('cache', '0.1.2'))) {
// Remove cache here
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . makeZeroToNull($ref) . ' - CACHE!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'ref=' . convertZeroToNull($ref) . ' - CACHE!');
rebuildCache('refsystem', 'refsystem');
}
// Update the referral table
updateReferralTable($userid);
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . makeZeroToNull($ref) . ',level=' . makeZeroToNull($GLOBALS['cache_array']['ref_level'][$ref]) . ' - EXIT!');
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',ref=' . convertZeroToNull($ref) . ',level=' . convertZeroToNull($GLOBALS['cache_array']['ref_level'][$ref]) . ' - EXIT!');
}
// Subtract points from database and mediadata cache
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . $refid);
// Does the refid have an array?
if (isset($GLOBALS['referral_refid'][$refid])) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',count()=' . count($GLOBALS['referral_refid'][$refid]));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . convertNullToZero($refid) . ',count()=' . count($GLOBALS['referral_refid'][$refid]));
// Okay, then walk through here, too
foreach ($GLOBALS['referral_refid'][$refid] as $refLevel => $refArray) {
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',refLevel=' . $refLevel . ',count()=' . count($refArray));
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . convertNullToZero($refid) . ',refLevel=' . $refLevel . ',count()=' . count($refArray));
// Also walk through this one
foreach ($refArray as $refRefid) {
// Calculate new level
$newLevel = $level + $refLevel;
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . makeNullToZero($refid) . ',refLevel=' . $refLevel . ',refRefid=' . $refRefid . ',newLevel=' . $newLevel);
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'userid=' . $userid . ',level=' . $level . ',refid=' . convertNullToZero($refid) . ',refLevel=' . $refLevel . ',refRefid=' . $refRefid . ',newLevel=' . $newLevel);
// Is the refRefid not in?
if ((!isset($GLOBALS['referral_refid'][$userid][$newLevel])) || (!in_array($refRefid, $GLOBALS['referral_refid'][$userid][$newLevel]))) {
// Then we must add this ref's refid to the userid's next level
if ((isExtensionActive('user')) && (isReferralIdValid()) && (isValidUserId(determineReferralId()))) {
// Update ref counter
SQL_QUERY_ESC("UPDATE `{?_MYSQL_PREFIX?}_user_data` SET `ref_clicks`=`ref_clicks`+1 WHERE `userid`=%s LIMIT 1",
- array(makeZeroToNull(determineReferralId())), __FILE__, __LINE__);
+ array(convertZeroToNull(determineReferralId())), __FILE__, __LINE__);
// Base URL for redirection
switch (getConfig('refid_target')) {
--- /dev/null
+<div align="center">
+<form accept-charset="UTF-8" action="{%url=modules.php?%}" method="get">
+<div class="table dashed">
+ <div class="table_header bottom">
+ <strong>{%message,ADMIN_ADD_CONFIG_NETWORK_TYPE_TITLE=$content[network_type_handle]%}</strong>
+ </div>
+ <div class="bottom">
+ {--ADMIN_ADD_CONFIG_NETWORK_TYPE_404_NOTE--}
+ </div>
+ <div class="table_footer">
+ <input type="hidden" name="module" value="admin" />
+ <input type="hidden" name="what" value="config_network_types" />
+ <input type="hidden" name="network_id" value="$content[network_id]" />
+ <input type="hidden" name="network_type_id" value="$content[network_type_id]" />
+ <input type="submit" class="form_submit" value="{--ADMIN_ADD_CONFIG_NETWORK_TYPE_SUBMIT--}" />
+ </div>
+</form>
+</div>
<tr>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,makeZeroToNull=$content[url_userid_raw]%}" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,convertZeroToNull=$content[url_userid_raw]%}" />
$content[url_userid]
</td>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<tr>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,makeZeroToNull=$content[url_userid_raw]%}" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,convertZeroToNull=$content[url_userid_raw]%}" />
$content[url_userid]
</td>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<tr>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,makeZeroToNull=$content[url_userid_raw]%}" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,convertZeroToNull=$content[url_userid_raw]%}" />
<input type="hidden" name="url_last_locked[$content[url_id]]" value="NOW()" />
$content[url_userid]
</td>
<tr>
<td align="center" class="bottom right {%template,ColorSwitch%}">
<input type="hidden" name="url_id[$content[url_id]]" value="1" />
- <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,makeZeroToNull=$content[url_userid_raw]%}" />
+ <input type="hidden" name="url_userid[$content[url_id]]" value="{%pipe,convertZeroToNull=$content[url_userid_raw]%}" />
$content[url_userid]
</td>
<td align="center" class="bottom right {%template,ColorSwitch%}">
</td>
<td class="register_right">
<strong>{%pipe,determineReferralId%}</strong>
- <input type="hidden" name="refid" value="{%pipe,determineReferralId,makeZeroToNull%}" />
+ <input type="hidden" name="refid" value="{%pipe,determineReferralId,convertZeroToNull%}" />
</td>
</tr>
<tr>
- <td class="member_data">{%pipe,makeNullToZero=$content[level]%}. {--REFERRAL_LEVEL--} ({%pipe,translateComma=$content[percents]%}%)</td>
+ <td class="member_data">{%pipe,convertNullToZero=$content[level]%}. {--REFERRAL_LEVEL--} ({%pipe,translateComma=$content[percents]%}%)</td>
<td class="member_data">{%pipe,translateComma=$content[points]%} {?POINTS?}</td>
<td class="member_data">{%pipe,translateComma=$content[order_points]%} {?POINTS?}</td>
<td class="member_data" align="center">{%pipe,translateComma=$content[counter]%}</td>
</li>
<li class="listing">
{--MEMBER_YOUR_REFID_IS--}:<br />
- <strong>{%user,refid,makeNullToZero%}</strong> (<strong>{%user,nickname,fixEmptyContentToDashes=refid%}</strong>)
+ <strong>{%user,refid,convertNullToZero%}</strong> (<strong>{%user,nickname,fixEmptyContentToDashes=refid%}</strong>)
</li>
</div>
</div>