X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-stats.php;h=a9fa152534df32a2ee3597876dd0b44aeed8936b;hb=8d2c9b91eb82ea74fac58b2541982f760d0f77fc;hp=5e5512d1583a9cc777cd5eaf52b8143230514eff;hpb=0fe94791af05018868398d3c6c87d2b16f9557a2;p=mailer.git diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index 5e5512d158..a9fa152534 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -14,10 +14,9 @@ * $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 * * * * This program is free software; you can redistribute it and/or modify * @@ -65,34 +64,20 @@ switch (getRequestParameter('mode')) { default: // Unsupported mode - debug_report_bug(sprintf("Unsupported mode %s detected.", secureString(getRequestParameter('mode')))); + debug_report_bug(__FILE__, __LINE__, sprintf("Unsupported mode %s detected.", secureString(getRequestParameter('mode')))); break; } // Set link title -$ltitle = getMessage('GUEST_STATS_' . strtoupper($lmode)); +$ltitle = '{--GUEST_STATS_' . strtoupper($lmode) . '--}'; // @TODO This can be rewritten in a dynamic include switch (getConfig('guest_stats')) { case 'MEMBERS': // Statistics about your members - // Members yesterday / today online - $ymem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_YDAY')." AND `last_online` < ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__)); - $tmem = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= ".getConfig('START_TDAY')." AND `status`='CONFIRMED'", __FILE__, __LINE__)); - - // Yesterday / today registered - $yreg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_YDAY')." AND `joined` < ".getConfig('START_TDAY'), __FILE__, __LINE__)); - $treg = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= ".getConfig('START_TDAY'), __FILE__, __LINE__)); - // Only males / females $male = countSumTotalData('M', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'"); $female = countSumTotalData('F', 'user_data', 'userid', 'gender', true, " AND `status`='CONFIRMED'"); - // Unconfirmed accounts - $unconfirmed = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status` != 'CONFIRMED'", __FILE__, __LINE__)); - - // Total members - $total = $male + $female; - // List every month $months = array(); for ($idx = 1; $idx < 13; $idx++) { @@ -125,21 +110,21 @@ switch (getConfig('guest_stats')) { } // END - foreach // Prepare data for the template - $content['total_users'] = $total; - $content['unconfirmed'] = $unconfirmed; + $content['total_users'] = ($male + $female); + $content['unconfirmed'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `status` != 'CONFIRMED'", __FILE__, __LINE__)); $content['total_males'] = $male; $content['total_females'] = $female; - $content['tmem_count'] = $tmem; - $content['ymem_count'] = $ymem; - $content['treg_count'] = $treg; - $content['yreg_count'] = $yreg; + $content['tmem_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__)); + $content['ymem_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `last_online` >= {?START_YDAY?} AND `last_online` < {?START_TDAY?} AND `status`='CONFIRMED'", __FILE__, __LINE__)); + $content['treg_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_TDAY?}", __FILE__, __LINE__)); + $content['yreg_count'] = SQL_NUMROWS(SQL_QUERY("SELECT `userid` FROM `{?_MYSQL_PREFIX?}_user_data` WHERE `joined` >= {?START_YDAY?} AND `joined` < {?START_TDAY?}", __FILE__, __LINE__)); $content['lmode'] = $lmode; $content['ltitle'] = $ltitle; // Generate monthly stats $SW = 2; $r2 = ' right'; $l = 'll'; $r = 'lr'; $OUT = ''; foreach ($months as $month => $cnt) { - if ($SW == 2) $OUT .= "