* -------------------------------------------------------------------- *
* Kurzbeschreibung : Mediendaten *
* -------------------------------------------------------------------- *
- * mod_media - By Robert Niedziela *
- * (c)2003 www.megacomputing.net *
- * -------------------------------------------------------------------- *
- * Rewritten by Roland Haeder, 2003 - 2009 *
- * -------------------------------------------------------------------- *
* $Revision:: $ *
* $Date:: $ *
* $Tag:: 0.2.1-FINAL $ *
* $Author:: $ *
- * 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 *
+ * Copyright (c) 2009 - 2011 by Mailer Developer Team *
+ * For more information visit: http://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 *
} // END - if
// Add description as navigation point
-addMenuDescription('guest', __FILE__);
+addYouAreHereLink('guest', __FILE__);
+// Both ext-mediadata and ext-user must be there
if ((!isExtensionActive('mediadata')) && (!isAdmin())) {
- loadTemplate('admin_settings_saved', false, generateExtensionInactiveNotInstalledMessage('mediadata'));
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=mediadata%}');
return;
-} // END - if
+} elseif ((!isExtensionActive('user')) && (!isAdmin())) {
+ displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}');
+ return;
+}
// Get total confirmed user ids...
-$content['user_confirmed'] = round(countSumTotalData('CONFIRMED' , 'user_data', 'userid', 'status', true));
-$content['user_unconfirmed'] = round(countSumTotalData('UNCONFIRMED', 'user_data', 'userid', 'status', true));
-$content['user_locked'] = round(countSumTotalData('LOCKED' , 'user_data', 'userid', 'status', true));
+$content['user_confirmed'] = getTotalConfirmedUser();
+$content['user_unconfirmed'] = getTotalUnconfirmedUser();
+$content['user_locked'] = getTotalLockedUser();
$content['user_count'] = ($content['user_confirmed'] + $content['user_unconfirmed'] + $content['user_locked']);
// Start of this exchange
$TEST = makeTime(0, 0, 0, $PROJECTED);
if ($TEST > time()) {
- $content['projected'] = generateDateTime($PROJECTED, 3);
+ $content['projected'] = '{%message,USER_MT_PROJECTED=' . generateDateTime($PROJECTED, '3') . '%}';
} else {
- $content['projected'] = getMessage('USER_PROJECTION_UNKNOWN');
+ $content['projected'] = getMaskedMessage('USER_MT_PROJECTED', '{--USER_PROJECTION_UNKNOWN--}');
}
// User who can receive mails
// All clicks
$content['user_links'] = abs($sent - $clicks);
-$clr = '0.00000';
-if ($sent > 0) $clr = $clicks / $sent * 100;
-$content['_clr'] = translateComma($clr) . '%';
+// Click rate
+$content['click_rate'] = '0';
+if ($sent > 0) {
+ $content['click_rate'] = $clicks / $sent * 100;
+} // END - if
// Load jackpot
$jackpot = '0';
if (isExtensionActive('jackpot')) $jackpot = getJackpotPoints();
if (empty($jackpot)) $jackpot = '0';
-$content['jackpot'] = translateComma($jackpot);
+$content['jackpot'] = $jackpot;
-// Total referal link clicks, total logins
-$result = SQL_QUERY("SELECT
+// Total referral link clicks, total logins
+$result = SQL_QUERY('SELECT
SUM(d.ref_clicks), SUM(d.total_logins)
FROM
- `{?_MYSQL_PREFIX?}_user_data` AS d", __FILE__, __LINE__);
+ `{?_MYSQL_PREFIX?}_user_data` AS d', __FILE__, __LINE__);
list($ref, $logins) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (empty($ref)) $ref = '0';
if (empty($logins)) $logins = '0';
-$content['total_points'] = translateComma($points);
+$content['total_points'] = $points;
$content['total_refclicks'] = $ref;
$content['total_logins'] = $logins;
-// Referal banner
+// Referral banner
$total = countSumTotalData('Y', 'refbanner', 'id', 'visible', true);
// Total views and clicks
//
// Initialize Variables
-$OUT_EXTRA = ''; $ROWS_EXTRA = 2;
-$OUT_POINTS = ''; $ROWS_POINTS = 2;
-$OUT_USER = ''; $ROWS_USER = 6;
+$OUT_EXTRA = '';
+$OUT_POINTS = '';
+$OUT_USER = '';
$OUT_SPECIAL = ''; // We don't need row count here
// @TODO Rewrite all these if-blocks to filters
if (isExtensionActive('beg')) {
// Clicks on beg links
$data = array(
- 'lang' => getMessage('MEDIA_BEG_CLICKS'),
- 'value' => countSumTotalData(1, 'user_data', 'beg_clicks', 1, false, " AND `beg_clicks` > 0")
+ 'lang' => '{--MEDIA_BEG_CLICKS--}',
+ 'value' => countSumTotalData('0', 'user_data', 'beg_clicks', 'userid', false, ' AND `beg_clicks` > 0')
);
$OUT_EXTRA .= loadTemplate('mediadata_extra_row', true, $data);
- $ROWS_EXTRA++;
-}
+} // END - if
if (isExtensionActive('doubler')) {
// Add header
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, getMessage('MEDIA_DOUBLER_HEADER'));
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, '{--MEDIA_DOUBLER_HEADER--}');
// Add first line (count)
$data = array(
- 'lang' => getMessage('MEDIA_DOUBLER_COUNT'),
- 'value' => countSumTotalData('Y','doubler','id','completed', true, " AND `points` > 0"),
- 'rows' => 4
+ 'lang' => '{--MEDIA_DOUBLER_COUNT--}',
+ 'value' => countSumTotalData('Y','doubler','id','completed', true, ' AND `points` > 0'),
);
// Add points
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_DOUBLER_CPOINTS'),
- 'value' => translateComma(countSumTotalData('Y','doubler','id','completed', false, " AND `points` > 0"))
+ 'lang' => '{--MEDIA_DOUBLER_CPOINTS--}',
+ 'value' => countSumTotalData('Y','doubler','id','completed', false, ' AND `points` > 0')
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_DOUBLER_WAITING'),
- 'value' => translateComma(countSumTotalData('N','doubler','id','completed', true, " AND `points` > 0"))
+ 'lang' => '{--MEDIA_DOUBLER_WAITING--}',
+ 'value' => countSumTotalData('N','doubler','id','completed', true, ' AND `points` > 0')
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_DOUBLER_WPOINTS'),
- 'value' => translateComma(countSumTotalData('N','doubler','id','completed', false, " AND `points` > 0"))
+ 'lang' => '{--MEDIA_DOUBLER_WPOINTS--}',
+ 'value' => countSumTotalData('N','doubler','id','completed', false, ' AND `points` > 0')
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
-}
+} // END - if
if (isExtensionActive('holiday')) {
// Total holiday requests
SQL_FREERESULT($result);
if (empty($holiday)) $holiday = '0';
$data = array(
- 'lang' => getMessage('MEDIA_HOLIDAY_COUNT'),
+ 'lang' => '{--MEDIA_HOLIDAY_COUNT--}',
'value' => $holiday
);
$OUT_USER .= loadTemplate('mediadata_extra_row', true, $data);
- $ROWS_USER++;
-}
+} // END - if
if (isExtensionActive('transfer')) {
// Statistics for points transfers
$result = SQL_QUERY("SELECT
- COUNT(t.id) AS cnt, SUM(t.points) AS points
+ COUNT(t.id) AS cnt, SUM(t.points) AS `points`
FROM
`{?_MYSQL_PREFIX?}_user_transfers_in` AS t
LEFT JOIN
if (empty($count_in)) $count_in = '0';
if (empty($points_in)) $points_in = '0';
- $result = SQL_QUERY("SELECT COUNT(t.id), SUM(t.points)
-FROM `{?_MYSQL_PREFIX?}_user_transfers_out` AS t
-LEFT JOIN `{?_MYSQL_PREFIX?}_user_data` AS d
-ON t.userid=d.userid",
+ $result = SQL_QUERY("SELECT
+ COUNT(t.id), SUM(t.points)
+FROM
+ `{?_MYSQL_PREFIX?}_user_transfers_out` AS t
+LEFT JOIN
+ `{?_MYSQL_PREFIX?}_user_data` AS d
+ON
+ t.userid=d.userid",
__FILE__, __LINE__);
list($count_out, $points_out) = SQL_FETCHROW($result);
SQL_FREERESULT($result);
if (empty($points_out)) $points_out = '0';
// Add header
- $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, getMessage('MEDIA_TRANSFER_HEADER'));
+ $OUT_SPECIAL .= loadTemplate('mediadata_extra_hrow', true, '{--MEDIA_TRANSFER_HEADER--}');
$data = array(
- 'lang' => getMessage('MEDIA_TRANSFER_IN_COUNT'),
+ 'lang' => '{--MEDIA_TRANSFER_IN_COUNT--}',
'value' => $count_in,
- 'rows' => 4
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row2', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_TRANSFER_IN_POINTS'),
- 'value' => translateComma($points_in)
+ 'lang' => '{--MEDIA_TRANSFER_IN_POINTS--}',
+ 'value' => $points_in
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_TRANSFER_OUT_COUNT'),
+ 'lang' => '{--MEDIA_TRANSFER_OUT_COUNT--}',
'value' => $count_out
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
$data = array(
- 'lang' => getMessage('MEDIA_TRANSFER_OUT_POINTS'),
- 'value' => translateComma($points_out)
+ 'lang' => '{--MEDIA_TRANSFER_OUT_POINTS--}',
+ 'value' => $points_out
);
$OUT_SPECIAL .= loadTemplate('mediadata_extra_row', true, $data);
} // END - if
-$content['out_extra'] = $OUT_EXTRA;
-$content['out_points'] = $OUT_POINTS;
-$content['out_user'] = $OUT_USER;
-$content['out_special'] = $OUT_SPECIAL;
-$content['rowspan_extra'] = $ROWS_EXTRA;
-$content['rowspan_points'] = $ROWS_POINTS;
-$content['rowspan_user'] = $ROWS_USER;
-
-// Patch timespamp
-$content['patch_ctime'] = generateDateTime(getConfig('patch_ctime'), 2);
+$content['out_extra'] = $OUT_EXTRA;
+$content['out_points'] = $OUT_POINTS;
+$content['out_user'] = $OUT_USER;
+$content['out_special'] = $OUT_SPECIAL;
// Load template
loadTemplate('mediadata', false, $content);