Comments fixed, ext-network continued, fix for mod stats:
[mailer.git] / inc / modules / admin / what-stats_mods.php
index ade4dda8f1cd96c0d5281f829967b7cad73cc2fe..7157b6e835740dceb13a54551ab497e4417ee719 100644 (file)
@@ -1,7 +1,7 @@
 <?php
 /************************************************************************
  * Mailer v0.2.1-FINAL                                Start: 08/27/2004 *
- * ================                             Last change: 08/27/2004 *
+ * ===================                          Last change: 08/27/2004 *
  *                                                                      *
  * -------------------------------------------------------------------- *
  * File              : what-stats_mods.php                              *
@@ -50,11 +50,10 @@ if (!isGetRequestElementSet('mod')) setRequestGetElement('mod', '');
 // Check if module was selected
 if ((getRequestElement('mod') == 'index') || (getRequestElement('mod') == 'login')) {
        // Select menu system
-       $mod = '';
-       $mod = mapModuleToTable($mod);
+       $mod = mapModuleToTable(getRequestElement('mod'));
 
        // Load module's detail statistic
-       $result = SQL_QUERY_ESC("SELECT action, title, counter FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `what` != '' AND `what` IS NOT NULL ORDER BY counter DESC",
+       $result = SQL_QUERY_ESC("SELECT `action`, `title`, `counter` FROM `{?_MYSQL_PREFIX?}_%s_menu` WHERE `what` != '' AND `what` IS NOT NULL ORDER BY `counter` DESC",
                array($mod), __FILE__, __LINE__);
        $OUT = ''; $SW = 2;
        while ($content = SQL_FETCHARRAY($result)) {
@@ -75,7 +74,7 @@ if ((getRequestElement('mod') == 'index') || (getRequestElement('mod') == 'login
        loadTemplate('admin_mods_stats2', false, $OUT);
 } else {
        // Load module statics
-       $result = SQL_QUERY("SELECT module, title, clicks FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY clicks DESC, module", __FILE__, __LINE__);
+       $result = SQL_QUERY("SELECT `module`, `title`, `clicks` FROM `{?_MYSQL_PREFIX?}_mod_reg` ORDER BY `clicks` DESC, `module` ASC", __FILE__, __LINE__);
        $OUT = ''; $SW = 2;
        while ($content = SQL_FETCHARRAY($result)) {
                if (empty($content['title'])) $content['title'] = '---';