$search = substr($search, 0, -4);
} // END - if
+ // Is ext-sql_patches installed?
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'isExtensionInstalledAndNewer()=' . intval(isExtensionInstalledAndNewer('sql_patches', '0.2.3')) . ',youre_here=' . getConfig('youre_here') . ',isAdmin()=' . intval(isAdmin()) . ',modCheck=' . $modCheck);
if (((isExtensionInstalledAndNewer('sql_patches', '0.2.3')) && (getConfig('youre_here') == 'Y')) || ((isAdmin()) && ($modCheck == 'admin'))) {
// Output HTML code
$OUT = $prefix . '<strong><a class="you_are_here" href="{%url=modules.php?module=' . $modCheck . '&' . $type . '=' . $search . $LINK_ADD . '%}">' . getTitleFromMenu($accessLevel, $search, $type, $ADD) . '</a></strong>';
// Can we close the you-are-here navigation?
- //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type . 'getWhat()=' . getWhat());
- if (($type == 'what') || (($type == 'action') && ((!isWhatSet()) || (getWhat() == 'welcome')))) {
+ //* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type . ',getWhat()=' . getWhat() . ',isWhatSet()=' . intval(isWhatSet()));
+ if (($type == 'what') || (($type == 'action') && (!isWhatSet()))) {
//* DEBUG: */ logDebugMessage(__FUNCTION__, __LINE__, 'type=' . $type);
// Add closing div and br-tag
$GLOBALS['nav_depth'] = '0';
// Secure userid
$value = bigintval($value);
- // Set it here
- setCurrentUserId($value);
-
// Don't look for invalid userids...
if (!isValidUserId($value)) {
// Invalid, so abort here
}
// Get a string of "mail title" and price back
-function getPaymentTitlePrice ($pid, $full = false) {
+function getPaymentTitlePrice ($paymentsId, $full = false) {
// Only title or also including price?
if ($full === false) {
- $ret = getPaymentData($pid, 'main_title');
+ $ret = getPaymentData($paymentsId, 'main_title');
} else {
- $ret = getPaymentData($pid, 'main_title') . ' / {%pipe,getPaymentData,translateComma=' . $pid . '%} {?POINTS?}';
+ $ret = getPaymentData($paymentsId, 'main_title') . ' / {%pipe,getPaymentData,translateComma=' . $paymentsId . '%} {?POINTS?}';
}
// Return result
}
// "Getter" for payment data (cached)
-function getPaymentData ($pid, $lookFor = 'price') {
+function getPaymentData ($paymentsId, $lookFor = 'price') {
// Default value...
$data[$lookFor] = NULL;
// Do we have cache?
- if (isset($GLOBALS['cache_array']['payments']['id'][$pid])) {
+ if (isset($GLOBALS['cache_array']['payments'][$paymentsId]['id'])) {
// Use it if found to save SQL queries
- die('<pre>'.print_r($GLOBALS['cache_array']['payments'],true).'</pre>');
- $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$pid];
+ $data[$lookFor] = $GLOBALS['cache_array']['payments'][$lookFor][$paymentsId];
// Update cache hits
incrementStatsEntry('cache_hits');
$result = SQL_QUERY_ESC('SELECT `%s` FROM `{?_MYSQL_PREFIX?}_payments` WHERE `id`=%s LIMIT 1',
array(
$lookFor,
- bigintval($pid)
+ bigintval($paymentsId)
), __FUNCTION__, __LINE__);
// Is the entry there?
$add = '';
// Is the extension equal or newer 0.8.9?
- if ((getExtensionMode() == 'register') || (getExtensionMode() == 'update') || (isExtensionInstalledAndNewer('sql_patches', '0.8.9'))) {
+ if (((isInstallationPhase()) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (isExtensionInstalledAndNewer('sql_patches', '0.8.9'))) {
// Then add provider
$add = " AND `account_provider`='EXTENSION'";
} // END - if
// Is the 'subject' there?
if (((!ifSqlTableExists('points_data')) && ((getExtensionMode() == 'register') || (getExtensionMode() == 'update'))) || (countSumTotalData($subject, 'points_data', 'id', 'subject', true, $add) == 0)) {
- // Not found so add an SQL query
+ // Not found so:
+ if (isset($GLOBALS['previous_extension'][getCurrentExtensionName()])) {
+ $dummy = $GLOBALS['previous_extension'][getCurrentExtensionName()];
+ reportBug(__FUNCTION__, __LINE__, 'previous_extension[' . gettype($dummy) . ']=' . $dummy . ',getCurrentExtensionName()=' . getCurrentExtensionName() . ' - Under development, please report this!');
+ } // END - if
+
+ // ... add an SQL query
addExtensionSql(sprintf("INSERT INTO `{?_MYSQL_PREFIX?}_points_data` (`subject`,`column_name`,`locked_mode`,`payment_method`) VALUES ('%s','%s','%s','%s')",
$subject,
$columnName,