$GLOBALS['tpl_content'] = readFromFile($FQFN);
// Run code
- $GLOBALS['tpl_content'] = "\$newContent = decodeEntities(\"".compileRawCode(escapeQuotes($GLOBALS['tpl_content']))."\");";
+ $GLOBALS['tpl_content'] = '$newContent = decodeEntities("' . compileRawCode(escapeQuotes($GLOBALS['tpl_content'])) . '");';
eval($GLOBALS['tpl_content']);
} elseif (!empty($template)) {
// Template file not found!
} // END - foreach
}
+// "Fixes" null or empty string to count of dashes
+function fixNullEmptyToDashes ($str, $num) {
+ // Use str as default
+ $return = $str;
+
+ // Is it empty?
+ if ((is_null($str)) || (trim($str) == '')) {
+ // Set it
+ $return = str_repeat('-', $num);
+ } // END - if
+
+ // Return final string
+ return $return;
+}
+
//////////////////////////////////////////////////
// AUTOMATICALLY RE-GENERATED MISSING FUNCTIONS //
//////////////////////////////////////////////////
'MEMBER_REFLINKS_FOOTER' => "Ihr Referal-Link eingebaut in Ihrer Homepage bringt Ihnen passiv mehr Referals. (Aber Ihren Referal-Link bewerben schadet auch nicht... ;-) )",
'MEMBER_MAIL_BONUS_CONFIRMED_ON' => "Sie haben diese Bonusmail <span class=\"data\">%s</span> bestätigt.",
+ 'MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Bonus-Mail <span class=\"data\">%s</span> bestätigt hatten.",
'MEMBER_MAIL_NORMAL_CONFIRMED_ON' => "Sie haben diese Klickmail <span class=\"data\">%s</span> bestätigt.",
+ 'MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN' => "Es konnte nicht festgestellt werden, wann Sie die Klickmail <span class=\"data\">%s</span> bestätigt hatten.",
// @TODO Rewrite these two constants
'MEMBER_MAIL_NORMAL_DETAILS_TITLE_1' => "Details zur Klickmail <u>",
return $errorCode;
}
+// Get timestamp for given stats type and data
+function getTimestampFromUserStats ($statsType, $statsData, $userid = '0') {
+ // Default timestamp is zero
+ $data['inserted'] = '0';
+
+ // User id set?
+ if ((isMemberIdSet()) && ($userid == '0')) {
+ $userid = getMemberId();
+ } // END - if
+
+ // Is the extension installed and updated?
+ if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
+ // Return zero here
+ return $data['inserted'];
+ } // END - if
+
+ // Try to find the entry
+ $result = SQL_QUERY_ESC("SELECT
+ UNIX_TIMESTAMP(`inserted`) AS inserted
+FROM
+ `{?_MYSQL_PREFIX?}_user_stats_data`
+WHERE
+ `userid`=%s AND
+ `stats_type`='%s' AND
+ `stats_data`='%s'
+LIMIT 1",
+ array(
+ bigintval($userid),
+ $statsType,
+ $statsData
+ ), __FUNCTION__, __LINE__);
+
+ // Is the entry there?
+ if (SQL_NUMROWS($result) == 1) {
+ // Get this stamp
+ $data = SQL_FETCHARRAY($result);
+ } // END - if
+
+ // Free result
+ SQL_FREERESULT($result);
+
+ // Return stamp
+ return $data['inserted'];
+}
+
+// Inserts user stats
+function insertUserStatsRecord ($userid, $statsType, $statsData) {
+ // Is the extension installed and updated?
+ if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
+ // Return zero here
+ return false;
+ } // END - if
+
+ // Does it exist?
+ if ((!getTimestampFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
+ // Then insert it!
+ SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
+ array(bigintval($userid), $statsType, $statsData), __FUNCTION__, __LINE__);
+ } elseif (is_array($statsData)) {
+ // Invalid data!
+ logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},type={$statsType},data={".gettype($statsData).": Invalid statistics data type!");
+ }
+}
+
// [EOF]
?>
+
} // END - if
// Is default value empty or null?
- if ((is_null($row['request_param_default'])) || (trim($row['request_param_default']) == '')) {
- // Fix it to three dashes
- $row['request_param_default'] = '---';
- } // END - if
+ $row['request_param_default'] = fixNullEmptyToDashes($row['request_param_default'], 3);
// Add row template and switch color
$OUT .= loadTemplate('admin_list_network_params_row', true, $row);
while ($row = SQL_FETCHARRAY($result)) {
// Add/translate some data
$row['sw'] = $SW;
- if (trim($row['network_type_banner_url']) == '') $row['network_type_banner_url'] = '---';
+ $row['network_type_banner_url'] = fixNullEmptyToDashes($row['network_type_banner_url'], 3);
// Set disabled entry
$networkData['disabled'][$row['network_type_handle']] = true;
$content = SQL_FETCHARRAY($result_data);
// Translate some data
- $content['timestamp'] = generateDateTime($content['timestamp'], 2);
- $content['category'] = getCategory($content['cat_id']);
- $content['points'] = translateComma($content['points']);
- $content['is_notify'] = translateYesNo($content['is_notify']);
- $content['sender'] = getMessage('USERNAME_ADMIN_SHORT');
- $content['time'] = createFancyTime($content['time']);
- $content['userid'] = getMemberId();
-
- // Get timestamp from insert
- $content['user_status'] = getMaskedMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON',
- generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2)
- );
+ $content['timestamp'] = generateDateTime($content['timestamp'], 2);
+ $content['category'] = getCategory($content['cat_id']);
+ $content['points'] = translateComma($content['points']);
+ $content['is_notify'] = translateYesNo($content['is_notify']);
+ $content['sender'] = getMessage('USERNAME_ADMIN_SHORT');
+ $content['time'] = createFancyTime($content['time']);
+ $content['userid'] = getMemberId();
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_BONUS_CONFIRMED_UNKNOWN', $content['id']);
+
+ // Is ext-user installed?
+ if (isExtensionInstalled('user')) {
+ // Get timestamp from insert
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_BONUS_CONFIRMED_ON',
+ generateDateTime(getTimestampFromUserStats('bonusid', $content['id']), 2)
+ );
+ } // END - if
// Display it depending on mail (data) type
loadTemplate('member_mail_bonus_'.strtolower($content['data_type']), false, $content);
$content['points'] = translateComma($content['points']);
$content['time'] = createFancyTime($content['time']);
$content['userid'] = getMemberId();
-
- // Get timestamp from insert
- $content['user_status'] = getMaskedMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON',
- generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2)
- );
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_NORMAL_CONFIRMED_UNKNOWN', $content['id']);
+
+ // Is ext-user installed?
+ if (isExtensionInstalled('user')) {
+ // Get timestamp from insert
+ $content['user_status'] = getMaskedMessage('MEMBER_MAIL_NORMAL_CONFIRMED_ON',
+ generateDateTime(getTimestampFromUserStats('mailid', $content['id']), 2)
+ );
+ } // END - if
// Display it depending on mail (data) type
loadTemplate('member_mail_normal_'.strtolower($content['data_type']), false, $content);
return $receiverList;
}
-// Get timestamp for given stats type and data
-function getTimestampFromUserStats ($statsType, $statsData, $userid = '0') {
- // Default timestamp is zero
- $data['inserted'] = '0';
-
- // User id set?
- if ((isMemberIdSet()) && ($userid == '0')) {
- $userid = getMemberId();
- } // END - if
-
- // Is the extension installed and updated?
- if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
- // Return zero here
- return $data['inserted'];
- } // END - if
-
- // Try to find the entry
- $result = SQL_QUERY_ESC("SELECT
- UNIX_TIMESTAMP(`inserted`) AS inserted
-FROM
- `{?_MYSQL_PREFIX?}_user_stats_data`
-WHERE
- `userid`=%s AND
- `stats_type`='%s' AND
- `stats_data`='%s'
-LIMIT 1",
- array(
- bigintval($userid),
- $statsType,
- $statsData
- ), __FUNCTION__, __LINE__);
-
- // Is the entry there?
- if (SQL_NUMROWS($result) == 1) {
- // Get this stamp
- $data = SQL_FETCHARRAY($result);
- } // END - if
-
- // Free result
- SQL_FREERESULT($result);
-
- // Return stamp
- return $data['inserted'];
-}
-
-// Inserts user stats
-function insertUserStatsRecord ($userid, $statsType, $statsData) {
- // Is the extension installed and updated?
- if ((!isExtensionActive('sql_patches')) || (isExtensionOlder('sql_patches', '0.5.6'))) {
- // Return zero here
- return false;
- } // END - if
-
- // Does it exist?
- if ((!getTimestampFromUserStats($statsType, $statsData, $userid)) && (!is_array($statsData))) {
- // Then insert it!
- SQL_QUERY_ESC("INSERT INTO `{?_MYSQL_PREFIX?}_user_stats_data` (`userid`,`stats_type`,`stats_data`) VALUES (%s,'%s','%s')",
- array(bigintval($userid), $statsType, $statsData), __FUNCTION__, __LINE__);
- } elseif (is_array($statsData)) {
- // Invalid data!
- logDebugMessage(__FUNCTION__, __LINE__, "userid={$userid},type={$statsType},data={".gettype($statsData).": Invalid statistics data type!");
- }
-}
-
// "Getter" for array for user refs and points in given level
function getUserReferalPoints ($userid, $level) {
//* DEBUG: */ print("----------------------- <font color=\"#00aa00\">".__FUNCTION__." - ENTRY</font> ------------------------<ul><li>\n");