X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=inc%2Fmodules%2Fguest%2Fwhat-stats.php;h=0a0c4c267a1652039baee1ec61bb33adb62b2c35;hb=ee3a0b42f93de7676fca549c866c1c2e6f3f0576;hp=ff9863dd8b2ba6905685530c049b47abb9a9ba43;hpb=db0c6702086eea2c44d0aae1702dc2e77a0afc4e;p=mailer.git diff --git a/inc/modules/guest/what-stats.php b/inc/modules/guest/what-stats.php index ff9863dd8b..0a0c4c267a 100644 --- a/inc/modules/guest/what-stats.php +++ b/inc/modules/guest/what-stats.php @@ -17,7 +17,7 @@ * -------------------------------------------------------------------- * * Copyright (c) 2003 - 2009 by Roland Haeder * * Copyright (c) 2009 - 2011 by Mailer Developer Team * - * For more information visit: http://www.mxchange.org * + * 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 * @@ -43,13 +43,21 @@ if (!defined('__SECURITY')) { // Add description as navigation point addYouAreHereLink('guest', __FILE__); -// Derterminate which stats we want and set mode and title for the link below stats block -if (!isGetRequestParameterSet('mode')) setGetRequestParameter('mode', strtolower(getConfig('guest_stats'))); +// This part only works if ext-user is active +if ((!isExtensionActive('user')) && (!isAdmin())) { + displayMessage('{%pipe,generateExtensionInactiveNotInstalledMessage=user%}'); + return; +} // END - if + +// Determine which stats we want and set mode and title for the link below stats block +if (!isGetRequestElementSet('do')) { + setGetRequestElement('do', strtolower(getConfig('guest_stats'))); +} // END - if // Set config temporarily -setConfigEntry('guest_stats', strtoupper(getRequestParameter('mode'))); +setConfigEntry('guest_stats', strtoupper(getRequestElement('do'))); -switch (getRequestParameter('mode')) { +switch (getRequestElement('do')) { case 'members' : $lmode = 'modules'; break; @@ -64,7 +72,7 @@ switch (getRequestParameter('mode')) { default: // Unsupported mode - debug_report_bug(__FILE__, __LINE__, sprintf("Unsupported mode %s detected.", secureString(getRequestParameter('mode')))); + debug_report_bug(__FILE__, __LINE__, sprintf("Unsupported mode %s detected.", secureString(getRequestElement('do')))); break; } @@ -92,7 +100,7 @@ switch (getConfig('guest_stats')) { } // END - for // Members in categories - $result = SQL_QUERY("SELECT `id`, `cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `visible`='Y' ORDER BY `id` ASC", __FILE__, __LINE__); + $result = SQL_QUERY("SELECT `id`,`cat` FROM `{?_MYSQL_PREFIX?}_cats` WHERE `visible`='Y' ORDER BY `id` ASC", __FILE__, __LINE__); // Load categories first $cats = array(); $cat_cnt = array(); @@ -132,7 +140,7 @@ switch (getConfig('guest_stats')) { 'm_descr' => $GLOBALS['month_descr'][$month], 'r_class' => $r, 'r2_class' => $r2, - 'cnt' => $count + 'count' => $count ); // Load row template @@ -155,8 +163,8 @@ switch (getConfig('guest_stats')) { foreach ($cat_cnt as $id => $count) { // Prepare data for the template $data = array( - 'cat' => $cats[$id], - 'cnt' => $count, + 'cat' => $cats[$id], + 'count' => $count, ); // Load row template and switch colors @@ -174,8 +182,8 @@ switch (getConfig('guest_stats')) { if (isAdmin()) $AND = ''; // Query for guest and member menus - $guest_t10 = SQL_QUERY('SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__); - $mem_t10 = SQL_QUERY('SELECT `counter`, `title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__); + $guest_t10 = SQL_QUERY('SELECT `counter`,`title` FROM `{?_MYSQL_PREFIX?}_guest_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__); + $mem_t10 = SQL_QUERY('SELECT `counter`,`title` FROM `{?_MYSQL_PREFIX?}_member_menu` WHERE `counter` > 0' . $AND . ' ORDER BY `counter` DESC LIMIT 0,10', __FILE__, __LINE__); $OUT = ''; if (!SQL_HASZERONUMS($guest_t10)) {