X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-mediadata.php;h=f008903b9ed00273546bd0d497d1e5c9cb109010;hb=8f4f49ab24b34a707b024ba5406458bc4c8f6695;hp=6fd3e085d1201f16b3c5b193eac09b69bf2d5ba0;hpb=15d03825972c38fbd95abad41f304c7494c5a70e;p=mailer.git diff --git a/inc/modules/guest/what-mediadata.php b/inc/modules/guest/what-mediadata.php index 6fd3e085d1..f008903b9e 100644 --- a/inc/modules/guest/what-mediadata.php +++ b/inc/modules/guest/what-mediadata.php @@ -10,21 +10,14 @@ * -------------------------------------------------------------------- * * 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 * - * Copyright (c) 2009, 2010 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * Copyright (c) 2009 - 2012 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 * @@ -44,16 +37,20 @@ // Some security stuff... if (!defined('__SECURITY')) { - die(); + exit(); } // 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'] = getTotalConfirmedUser(); @@ -62,20 +59,20 @@ $content['user_locked'] = getTotalLockedUser(); $content['user_count'] = ($content['user_confirmed'] + $content['user_unconfirmed'] + $content['user_locked']); // Start of this exchange -$content['mt_start'] = generateDateTime(getConfig('mt_start'), 3); +$content['mt_start'] = generateDateTime(getMtStart(), '3'); // Project timestamp when number of members are reached $PROJECTED = '0'; if ($content['user_count'] > 0) { // @TODO Find a better formular than this one - $PROJECTED = round((time() - getConfig('mt_start')) / $content['user_count'] * getConfig('mt_stage') + getConfig('mt_start')); + $PROJECTED = round((time() - getMtStart()) / $content['user_count'] * getConfig('mt_stage') + getMtStart()); } // END - if // Generate timestamp $TEST = makeTime(0, 0, 0, $PROJECTED); if ($TEST > time()) { - $content['projected'] = getMaskedMessage('USER_MT_PROJECTED', generateDateTime($PROJECTED, 3)); + $content['projected'] = '{%message,USER_MT_PROJECTED=' . generateDateTime($PROJECTED, '3') . '%}'; } else { $content['projected'] = getMaskedMessage('USER_MT_PROJECTED', '{--USER_PROJECTION_UNKNOWN--}'); } @@ -93,7 +90,11 @@ $content['max'] = countSumTotalData('CONFIRMED', 'user_data', 'max_mails', 'stat $content['rec'] = countSumTotalData('CONFIRMED', 'user_data', 'receive_mails', 'status', false, " AND `receive_mails` > 0"); // Initial lots of variables -$bmails = '0'; $sent = '0'; $max = '0'; $rec = '0'; $clicks = '0'; +$bmails = '0'; +$sent = '0'; +$max = '0'; +$rec = '0'; +$clicks = '0'; // Mail orders (only current) $nmails = getMediadataEntry('normal_orders'); @@ -124,22 +125,24 @@ $content['sent'] = $sent; // 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); @@ -150,11 +153,11 @@ if (empty($points)) $points = '0'; 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 @@ -188,7 +191,7 @@ if (isExtensionActive('beg')) { 'value' => countSumTotalData('0', 'user_data', 'beg_clicks', 'userid', false, ' AND `beg_clicks` > 0') ); $OUT_EXTRA .= loadTemplate('mediadata_extra_row', true, $data); -} +} // END - if if (isExtensionActive('doubler')) { // Add header @@ -217,7 +220,7 @@ if (isExtensionActive('doubler')) { '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 @@ -240,12 +243,12 @@ WHERE 'value' => $holiday ); $OUT_USER .= loadTemplate('mediadata_extra_row', true, $data); -} +} // 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 @@ -258,10 +261,14 @@ ON 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); @@ -297,9 +304,6 @@ $content['out_points'] = $OUT_POINTS; $content['out_user'] = $OUT_USER; $content['out_special'] = $OUT_SPECIAL; -// Patch timespamp -$content['patch_ctime'] = generateDateTime(getConfig('patch_ctime'), 2); - // Load template loadTemplate('mediadata', false, $content);