./inc/modules/member/what-unconfirmed.php:143: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
./inc/modules/order.php:76: // @TODO Unused: 2,4
./inc/monthly/monthly_bonus.php:69: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1173: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1428: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
-./inc/mysql-manager.php:1536: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1903: // @TODO Rewrite this to a filter
-./inc/mysql-manager.php:1947:// @TODO Fix inconsistency between last_module and getWhat()
+./inc/mysql-manager.php:1174: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1429: // @TODO Try to rewrite this to $content = SQL_FETCHARRAY()
+./inc/mysql-manager.php:1537: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1904: // @TODO Rewrite this to a filter
+./inc/mysql-manager.php:1948:// @TODO Fix inconsistency between last_module and getWhat()
./inc/mysql-manager.php:370: // @TODO Try to rewrite this to one or more functions
./inc/mysql-manager.php:46:// @TODO Can we cache this?
./inc/reset/reset_beg.php:51:// @TODO This should be converted in a daily beg rallye
die();
} // END - if
-// Init variables
-$bsent = '0'; $bclicks = '0'; $bcount = '0';
+// Init array/varriable
+$bcount = '0';
+$content = array(
+ 'normal_send' => 0,
+ 'normal_clicks' => 0,
+ 'bonus_send' => 0,
+ 'bonus_clicks' => 0
+);
// Check for normal mails
$result_media = SQL_QUERY('SELECT
- SUM(`max_rec`) AS max_rec,
- SUM(`clicks`) AS clicks
+ SUM(`max_rec`) AS `normal_send`,
+ SUM(`clicks`) AS `normal_clicks`
FROM
`{?_MYSQL_PREFIX?}_user_stats`', __FILE__, __LINE__);
-list($nsent, $nclicks) = SQL_FETCHROW($result_media);
-if (empty($nsent)) $nsent = '0';
-if (empty($nclicks)) $nclicks = '0';
+$content = merge_array($content, SQL_FETCHARRAY($result_media));
// Free memory
SQL_FREERESULT($result_media);
-// Count mail orders
-$ncount = countSumTotalData('', 'user_stats', 'id', '', true);
-
// Check for bonus extension
if (isExtensionActive('bonus')) {
// Count bonus mails
$bcount = countSumTotalData('', 'bonus', 'id', '', true);
// Check for bonus mails
- $result_media = SQL_QUERY('SELECT SUM(mails_sent) AS bonus_sent, SUM(clicks) AS bonus_clicks
-FROM `{?_MYSQL_PREFIX?}_bonus`', __FILE__, __LINE__);
- list($bsent, $bclicks) = SQL_FETCHROW($result_media);
- if (empty($bsent)) $bsent = '0';
- if (empty($bclicks)) $bclicks = '0';
+ $result_media = SQL_QUERY('SELECT
+ SUM(`mails_send`) AS `bonus_send`,
+ SUM(`clicks`) AS `bonus_clicks`
+FROM
+ `{?_MYSQL_PREFIX?}_bonus`', __FILE__, __LINE__);
+ $content = merge_array($content, SQL_FETCHARRAY($result_media));
+
+ // Free memory
+ SQL_FREERESULT($result_media);
} // END - if
// Load (maybe) missing file
loadIncludeOnce('inc/libs/mediadata_functions.php');
// Insert info to database
-updateMediadataEntry(array('total_send' , 'normal_send') , 'init', $nsent);
-updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'init', $nclicks);
-updateMediadataEntry(array('total_orders', 'normal_orders'), 'init', $ncount);
-updateMediadataEntry(array('total_send' , 'bonus_send' ) , 'init', $bsent);
-updateMediadataEntry(array('total_clicks', 'bonus_clicks') , 'init', $bclicks);
+updateMediadataEntry(array('total_send' , 'normal_send') , 'init', $content['normal_send']);
+updateMediadataEntry(array('total_clicks', 'normal_clicks'), 'init', $content['normal_clicks']);
+updateMediadataEntry(array('total_orders', 'normal_orders'), 'init', countSumTotalData('', 'user_stats', 'id', '', true));
+updateMediadataEntry(array('total_send' , 'bonus_send' ) , 'init', $content['bonus_send']);
+updateMediadataEntry(array('total_clicks', 'bonus_clicks') , 'init', $content['bonus_clicks']);
updateMediadataEntry(array('total_orders', 'bonus_orders') , 'init', $bcount);
// Aquire total used points
// Language definitions
addMessages(array(
- 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse <a href=\"".generateDerefererUrl("https://sourceforge.net/projects/phpmailer/")."\" target=\"_blank\">PHPMailer</a> herunter, um diese Funktion nutzen zu können.",
+ 'ADMIN_HTML_DOWNLOAD_CLASS' => "Bitte laden Sie sich die Klasse <a href=\"{%pipe,generateDerefererUrl=https://sourceforge.net/projects/phpmailer/%}\" target=\"_blank\">PHPMailer</a> herunter, um diese Funktion nutzen zu können.",
'MEMBER_HTML_INTRO' => "HTML-Emfpang - Einstellung",
'MEMBER_HTML_TEXT' => "In unserem {?mt_word?} ist das Empfangen von HTML-Mails nun möglich. Gleichzeitig können Sie auch selber HTML-Mails versenden. Möchten Sie dies beides nutzen?",
'MEMBER_HTML_ORDER_INTRO' => "HTML- oder normale Text-Mails versenden?",
// Some security stuff...
if ((!defined('__SECURITY')) || (!isAdmin())) {
die();
-}
+} // END - if
// Add description as navigation point
addMenuDescription('admin', __FILE__);
loadTemplate('admin_settings_saved', false, '{--ADMIN_USER_STATS_REMOVED--}');
} elseif ((isGetRequestParameterSet('bid')) && (isExtensionActive('bonus'))) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s",
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp`, `mails_sent` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('bid'))), __FILE__, __LINE__);
// Delete mail only once
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
SQL_FREERESULT($result);
} elseif ((isGetRequestParameterSet('nid')) && (isExtensionInstalledAndNewer('bonus', '0.8.7'))) {
// Load data from bonus mail
- $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s",
+ $result = SQL_QUERY_ESC("SELECT `id`, `subject`, `url`, `timestamp` FROM `{?_MYSQL_PREFIX?}_bonus` WHERE `id`=%s LIMIT 1",
array(bigintval(getRequestParameter('nid'))), __FILE__, __LINE__);
// Delete mail only once
$cnt += SQL_AFFECTEDROWS();
// Prepare data for the template
- $content['url'] = generateDerefererUrl($content['url']);
$content['timestamp'] = generateDateTime($content['timestamp'], 0);
$content['cnt'] = $cnt;
$OUT = '';
while ($content = SQL_FETCHARRAY($result)) {
// Prepare data for the template
- $content = array(
- 'cat_id' => $content['cat_id'],
- 'payment_id' => $content['payment_id'],
- 'url' => $content['url'],
- 'timestamp_ordered' => generateDateTime($content['timestamp_ordered'], 2),
- 'max_rec' => $content['max_rec'],
- 'timestamp_sent' => generateDateTime($content['timestamp_send'], 2),
- 'clicks' => $content['clicks'],
- 'subject' => $content['subject'],
- 'percents' => ($content['clicks'] / $content['max_rec'] * 100),
- );
+ $content['timestamp_ordered'] = generateDateTime($content['timestamp_ordered'], 2);
+ $content['timestamp_sent'] = generateDateTime($content['timestamp_send'], 2);
+ $content['percents'] = ($content['clicks'] / $content['max_rec'] * 100);
// Load row template and switch colors
$OUT .= loadTemplate('member_stats_row', true, $content);
- } // END - if
+ } // END - while
// Load main template
$main_content['stats'] = loadTemplate('member_stats_table', true, $OUT);
<td class="right" align="center">$content[id]</td>
<td class="right" align="center">$content[subject]</td>
<td class="right" align="center">
- <a href="$content[url]" target="_blank">{--ADMIN_TEST_URL--}</a>
+ <a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a>
</td>
<td class="right" align="center">$content[timestamp]</td>
<td align="center">$content[cnt]</td>
<tr>
<td class="right" align="center">$content[id]</td>
<td class="right" align="center">$content[subject]</td>
- <td class="right" align="center"><a href="$content[url]" target="_blank">{--ADMIN_TEST_URL--}</a></td>
+ <td class="right" align="center"><a href="{%pipe,generateDerefererUrl=$content[url]%}" target="_blank">{--ADMIN_TEST_URL--}</a></td>
<td class="right" align="center">$content[timestamp]</td>
<td align="center">$content[cnt]</td>
</tr>