Beehive PHP Cross Reference Discussion Forums

Source: /admin_forum_stats.php - 831 lines - 40464 bytes - Summary - Text - Print

   1  <?php
   2  
   3  /*======================================================================
   4  
   5  Copyright Project Beehive Forum 2002
   6  
   7  This file is part of Beehive Forum.
   8  
   9  Beehive Forum is free software; you can redistribute it and/or modify
  10  it under the terms of the GNU General Public License as published by
  11  the Free Software Foundation; either version 3 of the License, or
  12  (at your option) any later version.
  13  
  14  Beehive Forum is distributed in the hope that it will be useful,
  15  but WITHOUT ANY WARRANTY; without even the implied warranty of
  16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17  GNU General Public License for more details.
  18  
  19  You should have received a copy of the GNU General Public License
  20  along with Beehive; if not, write to the Free Software
  21  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307
  22  USA
  23  
  24  ======================================================================*/
  25  
  26  // Bootstrap
  27  require_once  'boot.php';
  28  
  29  // Required includes
  30  require_once  BH_INCLUDE_PATH . 'admin.inc.php';
  31  require_once  BH_INCLUDE_PATH . 'attachments.inc.php';
  32  require_once  BH_INCLUDE_PATH . 'cache.inc.php';
  33  require_once  BH_INCLUDE_PATH . 'constants.inc.php';
  34  require_once  BH_INCLUDE_PATH . 'format.inc.php';
  35  require_once  BH_INCLUDE_PATH . 'html.inc.php';
  36  require_once  BH_INCLUDE_PATH . 'session.inc.php';
  37  require_once  BH_INCLUDE_PATH . 'stats.inc.php';
  38  require_once  BH_INCLUDE_PATH . 'timezone.inc.php';
  39  require_once  BH_INCLUDE_PATH . 'user.inc.php';
  40  require_once  BH_INCLUDE_PATH . 'word_filter.inc.php';
  41  // End Required includes
  42  
  43  // Check we're logged in correctly
  44  if (!session::logged_in()) {
  45      html_guest_error();
  46  }
  47  
  48  // Check we have Admin / Moderator access
  49  if (!(session::check_perm(USER_PERM_ADMIN_TOOLS, 0))) {
  50      html_draw_error(gettext("You do not have permission to use this section."));
  51  }
  52  
  53  // Perform additional admin login.
  54  admin_check_credentials();
  55  
  56  // Cache page for 5 minutes
  57  cache_check_request_throttle(300);
  58  
  59  // User count is used by a few stats. Get it once here.
  60  $user_count = user_count();
  61  
  62  // And off we go ...
  63  html_draw_top(sprintf('title=%s', gettext("Admin - Forum Stats")), 'class=window_title', 'main_css=admin.css');
  64  
  65  echo "<h1>", gettext("Admin"), "<img src=\"", html_style_image('separator.png'), "\" alt=\"\" border=\"0\" />", gettext("Forum Stats"), "</h1>\n";
  66  
  67  echo "  <br />\n";
  68  echo "  <div align=\"center\">\n";
  69  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
  70  echo "    <tr>\n";
  71  echo "      <td align=\"left\">\n";
  72  echo "        <table class=\"box\" width=\"100%\">\n";
  73  echo "          <tr>\n";
  74  echo "            <td align=\"left\" class=\"posthead\">\n";
  75  echo "              <table class=\"posthead\" width=\"100%\">\n";
  76  echo "                <tr>\n";
  77  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Folder Stats"), "</td>\n";
  78  echo "                </tr>\n";
  79  echo "                <tr>\n";
  80  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
  81  echo "                </tr>\n";
  82  
  83  if (($folder_count = stats_get_folder_count()) !== false) {
  84  
  85      echo "                <tr>\n";
  86      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of folders"), ":&nbsp;</td>\n";
  87      echo "                  <td align=\"left\">", number_format($folder_count, 0, '.', ','), "</td>\n";
  88      echo "                </tr>\n";
  89  }
  90  
  91  if (($folder_most_threads = stats_get_folder_with_most_threads()) !== false) {
  92  
  93      echo "                <tr>\n";
  94      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Folder with most threads"), ":&nbsp;</td>\n";
  95      echo "                  <td align=\"left\"><a href=\"index.php?webtag=$webtag&amp;final_uri=discussion.php%3Fwebtag%3D$webtag%26folder={$folder_most_threads['FID']}\">", word_filter_add_ob_tags($folder_most_threads['TITLE'], true), "</a> (", number_format($folder_most_threads['THREAD_COUNT'], 0, '.', ','), " ", gettext("threads"), ")</td>\n";
  96      echo "                </tr>\n";
  97  }
  98  
  99  if (($folder_most_posts = stats_get_folder_with_most_posts()) !== false) {
 100  
 101      echo "                <tr>\n";
 102      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Folder with most posts"), ":&nbsp;</td>\n";
 103      echo "                  <td align=\"left\"><a href=\"index.php?webtag=$webtag&amp;final_uri=discussion.php%3Fwebtag%3D$webtag%26folder={$folder_most_posts['FID']}\">", word_filter_add_ob_tags($folder_most_posts['TITLE'], true), "</a> (", number_format($folder_most_posts['POST_COUNT'], 0, '.', ','), " ", gettext("Posts"), ")</td>\n";
 104      echo "                </tr>\n";
 105  }
 106  
 107  echo "                <tr>\n";
 108  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 109  echo "                </tr>\n";
 110  echo "              </table>\n";
 111  echo "            </td>\n";
 112  echo "          </tr>\n";
 113  echo "        </table>\n";
 114  echo "      </td>\n";
 115  echo "    </tr>\n";
 116  echo "  </table>\n";
 117  echo "  <br />\n";
 118  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 119  echo "    <tr>\n";
 120  echo "      <td align=\"left\">\n";
 121  echo "        <table class=\"box\" width=\"100%\">\n";
 122  echo "          <tr>\n";
 123  echo "            <td align=\"left\" class=\"posthead\">\n";
 124  echo "              <table class=\"posthead\" width=\"100%\">\n";
 125  echo "                <tr>\n";
 126  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Thread Stats"), "</td>\n";
 127  echo "                </tr>\n";
 128  echo "                <tr>\n";
 129  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
 130  echo "                </tr>\n";
 131  
 132  if (($thread_count = stats_get_thread_count()) !== false) {
 133  
 134      echo "                <tr>\n";
 135      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of threads"), ":&nbsp;</td>\n";
 136      echo "                  <td align=\"left\">", number_format($thread_count, 0, '.', ','), "</td>\n";
 137      echo "                </tr>\n";
 138      echo "                <tr>\n";
 139      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average thread count per folder"), ":&nbsp;</td>\n";
 140      echo "                  <td align=\"left\">", (($thread_count > 0) && ($folder_count > 0)) ? number_format($thread_count / $folder_count, 2, ".", ",") : 0, "</td>\n";
 141      echo "                </tr>\n";
 142  }
 143  
 144  if (($longest_thread = stats_get_longest_thread()) !== false) {
 145  
 146      echo "                <tr>\n";
 147      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Longest thread"), ":&nbsp;</td>\n";
 148      echo "                  <td align=\"left\"><a href=\"index.php?webtag=$webtag&amp;msg={$longest_thread['TID']}.1\" target=\"_blank\">", word_filter_add_ob_tags($longest_thread['TITLE'], true), "</a> (", number_format($longest_thread['LENGTH'], 0, '.', ','), " ", gettext("Posts"), ")</td>\n";
 149      echo "                </tr>\n";
 150  }
 151  
 152  if (($most_read_thread = stats_get_most_read_thread()) !== false) {
 153  
 154      echo "                <tr>\n";
 155      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most read thread"), ":&nbsp;</td>\n";
 156      echo "                  <td align=\"left\"><a href=\"index.php?webtag=$webtag&amp;msg={$most_read_thread['TID']}.1\" target=\"_blank\">", word_filter_add_ob_tags($most_read_thread['TITLE'], true), "</a> (", number_format($most_read_thread['VIEWCOUNT'], 0, '.', ','), " ", gettext("Views"), ")</td>\n";
 157      echo "                </tr>\n";
 158  }
 159  
 160  if (($thread_subscription_count = stats_get_thread_subscription_count()) !== false) {
 161  
 162      echo "                <tr>\n";
 163      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of thread subscriptions"), ":&nbsp;</td>\n";
 164      echo "                  <td align=\"left\">", number_format($thread_subscription_count, 0, '.', ','), "</td>\n";
 165      echo "                </tr>\n";
 166  }
 167  
 168  if (($most_subscribed_thread = stats_get_most_subscribed_thread()) !== false) {
 169  
 170      echo "                <tr>\n";
 171      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most popular thread by subscription"), ":&nbsp;</td>\n";
 172      echo "                  <td align=\"left\"><a href=\"index.php?webtag=$webtag&amp;msg={$most_subscribed_thread['TID']}.1\" target=\"_blank\">", word_filter_add_ob_tags($most_subscribed_thread['TITLE'], true), "</a> (", number_format($most_subscribed_thread['SUBSCRIBERS'], 0, '.', ','), " ", gettext("Subscribers"), ")</td>\n";
 173      echo "                </tr>\n";
 174  
 175  } else {
 176  
 177      echo "                <tr>\n";
 178      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most popular thread by subscription"), ":&nbsp;</td>\n";
 179      echo "                  <td align=\"left\">", gettext("none"), "</td>\n";
 180      echo "                </tr>\n";
 181  }
 182  
 183  echo "                <tr>\n";
 184  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 185  echo "                </tr>\n";
 186  echo "              </table>\n";
 187  echo "            </td>\n";
 188  echo "          </tr>\n";
 189  echo "        </table>\n";
 190  echo "      </td>\n";
 191  echo "    </tr>\n";
 192  echo "  </table>\n";
 193  echo "  <br />\n";
 194  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 195  echo "    <tr>\n";
 196  echo "      <td align=\"left\">\n";
 197  echo "        <table class=\"box\" width=\"100%\">\n";
 198  echo "          <tr>\n";
 199  echo "            <td align=\"left\" class=\"posthead\">\n";
 200  echo "              <table class=\"posthead\" width=\"100%\">\n";
 201  echo "                <tr>\n";
 202  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Post Stats"), "</td>\n";
 203  echo "                </tr>\n";
 204  echo "                <tr>\n";
 205  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
 206  echo "                </tr>\n";
 207  
 208  if (($total_post_count = stats_get_post_count()) !== false) {
 209  
 210      echo "                <tr>\n";
 211      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of posts"), ":&nbsp;</td>\n";
 212      echo "                  <td align=\"left\">", number_format($total_post_count, 0, '.', ','), "</td>\n";
 213      echo "                </tr>\n";
 214  }
 215  
 216  if (($recent_post_count = stats_get_recent_post_count()) !== false) {
 217  
 218      echo "                <tr>\n";
 219      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of posts made in last 60 minutes"), ":&nbsp;</td>\n";
 220      echo "                  <td align=\"left\">", number_format($recent_post_count, 0, '.', ','), "</td>\n";
 221      echo "                </tr>\n";
 222  }
 223  
 224  if (($most_posts = stats_get_most_posts()) !== false) {
 225  
 226      echo "                <tr>\n";
 227      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most posts made in one 60 minute period"), ":&nbsp;</td>\n";
 228      echo "                  <td align=\"left\">", number_format($most_posts['MOST_POSTS_COUNT'], 0, '.', ','), "</td>\n";
 229      echo "                </tr>\n";
 230  }
 231  
 232  echo "                <tr>\n";
 233  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average posts per user"), ":&nbsp;</td>\n";
 234  echo "                  <td align=\"left\">", (($total_post_count > 0) && ($user_count > 0)) ? number_format($total_post_count / $user_count, 2, ".", ",") : 0, "</td>\n";
 235  echo "                </tr>\n";
 236  
 237  if (($top_poster = stats_get_top_poster()) !== false) {
 238  
 239      echo "                <tr>\n";
 240      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Top poster"), ":&nbsp;</td>\n";
 241      echo "                  <td align=\"left\"><a href=\"user_profile.php?webtag=$webtag&amp;uid={$top_poster['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($top_poster['LOGON'], $top_poster['NICKNAME']), true), "</a> (", number_format($top_poster['POST_COUNT'], 0, '.', ','), " ", gettext("Posts"), ") [<a href=\"admin_post_stats.php?webtag=$webtag\">", gettext("View Top 20"), "</a>]</td>\n";
 242      echo "                </tr>\n";
 243  }
 244  
 245  echo "                <tr>\n";
 246  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 247  echo "                </tr>\n";
 248  echo "              </table>\n";
 249  echo "            </td>\n";
 250  echo "          </tr>\n";
 251  echo "        </table>\n";
 252  echo "      </td>\n";
 253  echo "    </tr>\n";
 254  echo "  </table>\n";
 255  echo "  <br />\n";
 256  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 257  echo "    <tr>\n";
 258  echo "      <td align=\"left\">\n";
 259  echo "        <table class=\"box\" width=\"100%\">\n";
 260  echo "          <tr>\n";
 261  echo "            <td align=\"left\" class=\"posthead\">\n";
 262  echo "              <table class=\"posthead\" width=\"100%\">\n";
 263  echo "                <tr>\n";
 264  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Poll Stats"), "</td>\n";
 265  echo "                </tr>\n";
 266  echo "                <tr>\n";
 267  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
 268  echo "                </tr>\n";
 269  
 270  if (($poll_count = stats_get_poll_count()) !== false) {
 271  
 272      echo "                <tr>\n";
 273      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of polls"), ":&nbsp;</td>\n";
 274      echo "                  <td align=\"left\">", number_format($poll_count, 0, '.', ','), "</td>\n";
 275      echo "                </tr>\n";
 276  }
 277  
 278  if (($poll_option_count = stats_get_poll_option_count()) !== false) {
 279  
 280      echo "                <tr>\n";
 281      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of poll options"), ":&nbsp;</td>\n";
 282      echo "                  <td align=\"left\">", number_format($poll_option_count, 0, '.', ','), "</td>\n";
 283      echo "                </tr>\n";
 284  }
 285  
 286  if (($poll_vote_count = stats_get_poll_vote_count()) !== false) {
 287  
 288      echo "                <tr>\n";
 289      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of poll votes"), ":&nbsp;</td>\n";
 290      echo "                  <td align=\"left\">", number_format($poll_vote_count, 0, '.', ','), "</td>\n";
 291      echo "                </tr>\n";
 292  }
 293  
 294  echo "                <tr>\n";
 295  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average votes per poll"), ":&nbsp;</td>\n";
 296  echo "                  <td align=\"left\">", (($poll_vote_count > 0) && ($poll_option_count > 0)) ? number_format($poll_vote_count / $poll_count, 2, ".", ",") : 0, "</td>\n";
 297  echo "                </tr>\n";
 298  echo "                <tr>\n";
 299  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 300  echo "                </tr>\n";
 301  echo "              </table>\n";
 302  echo "            </td>\n";
 303  echo "          </tr>\n";
 304  echo "        </table>\n";
 305  echo "      </td>\n";
 306  echo "    </tr>\n";
 307  echo "  </table>\n";
 308  echo "  <br />\n";
 309  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 310  echo "    <tr>\n";
 311  echo "      <td align=\"left\">\n";
 312  echo "        <table class=\"box\" width=\"100%\">\n";
 313  echo "          <tr>\n";
 314  echo "            <td align=\"left\" class=\"posthead\">\n";
 315  echo "              <table class=\"posthead\" width=\"100%\">\n";
 316  echo "                <tr>\n";
 317  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Attachments Stats"), "</td>\n";
 318  echo "                </tr>\n";
 319  echo "                <tr>\n";
 320  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
 321  echo "                </tr>\n";
 322  
 323  if (($attachment_count = stats_get_attachment_count()) !== false) {
 324  
 325      echo "                <tr>\n";
 326      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of attachments"), ":&nbsp;</td>\n";
 327      echo "                  <td align=\"left\">", number_format($attachment_count, 0, '.', ','), "</td>\n";
 328      echo "                </tr>\n";
 329  }
 330  
 331  echo "                <tr>\n";
 332  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average attachment count per post"), ":&nbsp;</td>\n";
 333  echo "                  <td align=\"left\">", (($attachment_count > 0) && ($total_post_count > 0)) ? number_format($attachment_count / $total_post_count, 2, ".", ",") : 0, "</td>\n";
 334  echo "                </tr>\n";
 335  
 336  if ((($most_downloaded_attachment = stats_get_most_downloaded_attachment()) !== false) && ($attachment_href = attachments_make_link($most_downloaded_attachment, false))) {
 337  
 338      echo "                <tr>\n";
 339      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most downloaded attachment"), ":&nbsp;</td>\n";
 340      echo "                  <td align=\"left\">$attachment_href <a href=\"index.php?webtag=$webtag&amp;msg={$most_downloaded_attachment['msg']}\" target=\"_blank\">", gettext('View Message'), "</a></td>\n";
 341      echo "                </tr>\n";
 342  
 343  } else {
 344  
 345      echo "                <tr>\n";
 346      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most downloaded attachment"), ":&nbsp;</td>\n";
 347      echo "                  <td align=\"left\">", gettext("none"), "</td>\n";
 348      echo "                </tr>\n";
 349  }
 350  
 351  echo "                <tr>\n";
 352  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 353  echo "                </tr>\n";
 354  echo "              </table>\n";
 355  echo "            </td>\n";
 356  echo "          </tr>\n";
 357  echo "        </table>\n";
 358  echo "      </td>\n";
 359  echo "    </tr>\n";
 360  echo "  </table>\n";
 361  echo "  <br />\n";
 362  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 363  echo "    <tr>\n";
 364  echo "      <td align=\"left\">\n";
 365  echo "        <table class=\"box\" width=\"100%\">\n";
 366  echo "          <tr>\n";
 367  echo "            <td align=\"left\" class=\"posthead\">\n";
 368  echo "              <table class=\"posthead\" width=\"100%\">\n";
 369  echo "                <tr>\n";
 370  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("User Preferences Stats"), "</td>\n";
 371  echo "                </tr>\n";
 372  echo "                <tr>\n";
 373  echo "                  <td align=\"left\" rowspan=\"32\" width=\"1%\">&nbsp;</td>\n";
 374  echo "                </tr>\n";
 375  
 376  if (($most_popular_forum_style = stats_get_most_popular_forum_style()) !== false) {
 377  
 378      echo "                <tr>\n";
 379      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used forum style"), ":&nbsp;</td>\n";
 380      echo "                  <td align=\"left\">{$most_popular_forum_style['STYLE']} (", number_format($most_popular_forum_style['USER_COUNT'], 0, '.', ','), " ", gettext("Users"), ")</td>\n";
 381      echo "                </tr>\n";
 382  }
 383  
 384  if (($most_popular_language = stats_get_most_popular_language()) !== false) {
 385  
 386      echo "                <tr>\n";
 387      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used language file"), ":&nbsp;</td>\n";
 388      echo "                  <td align=\"left\">{$most_popular_language['LANGUAGE']} (", number_format($most_popular_language['USER_COUNT'], 0, '.', ','), " ", gettext("Users"), ")</td>\n";
 389      echo "                </tr>\n";
 390  }
 391  
 392  if (($most_popular_timezone = stats_get_most_popular_timezone()) !== false) {
 393  
 394      echo "                <tr>\n";
 395      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used Time zone"), ":&nbsp;</td>\n";
 396      echo "                  <td align=\"left\">", timezone_id_to_string($most_popular_timezone['TIMEZONE']), " (", number_format($most_popular_timezone['USER_COUNT'], 0, '.', ','), " ", gettext("Users"), ")</td>\n";
 397      echo "                </tr>\n";
 398  
 399  } else {
 400  
 401      echo "                <tr>\n";
 402      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used Time zone"), ":&nbsp;</td>\n";
 403      echo "                  <td align=\"left\">", gettext("none"), "</td>\n";
 404      echo "                </tr>\n";
 405  }
 406  
 407  if (($most_popular_emoticon_pack = stats_get_most_popular_emoticon_pack()) !== false) {
 408  
 409      echo "                <tr>\n";
 410      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used Emoticon pack"), ":&nbsp;</td>\n";
 411      echo "                  <td align=\"left\">{$most_popular_emoticon_pack['EMOTICONS']} (", number_format($most_popular_emoticon_pack['USER_COUNT'], 0, '.', ','), " ", gettext("Users"), ")</td>\n";
 412      echo "                </tr>\n";
 413  
 414  } else {
 415  
 416      echo "                <tr>\n";
 417      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most used Time zone"), ":&nbsp;</td>\n";
 418      echo "                  <td align=\"left\">", gettext("none"), "</td>\n";
 419      echo "                </tr>\n";
 420  }
 421  
 422  echo "                <tr>\n";
 423  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 424  echo "                </tr>\n";
 425  echo "              </table>\n";
 426  echo "            </td>\n";
 427  echo "          </tr>\n";
 428  echo "        </table>\n";
 429  echo "      </td>\n";
 430  echo "    </tr>\n";
 431  echo "  </table>\n";
 432  echo "  <br />\n";
 433  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 434  echo "    <tr>\n";
 435  echo "      <td align=\"left\">\n";
 436  echo "        <table class=\"box\" width=\"100%\">\n";
 437  echo "          <tr>\n";
 438  echo "            <td align=\"left\" class=\"posthead\">\n";
 439  echo "              <table class=\"posthead\" width=\"100%\">\n";
 440  echo "                <tr>\n";
 441  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("User Stats"), "</td>\n";
 442  echo "                </tr>\n";
 443  echo "                <tr>\n";
 444  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 445  echo "                </tr>\n";
 446  echo "                <tr>\n";
 447  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users"), ":&nbsp;</td>\n";
 448  echo "                  <td align=\"left\">", number_format($user_count, 0, '.', ','), "</td>\n";
 449  echo "                </tr>\n";
 450  
 451  if (($contributing_user_count = stats_get_active_user_count()) !== false) {
 452  
 453      echo "                <tr>\n";
 454      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of contributing users"), ":&nbsp;</td>\n";
 455      echo "                  <td align=\"left\">", number_format($contributing_user_count, 0, '.', ','), "</td>\n";
 456      echo "                </tr>\n";
 457  }
 458  
 459  if (($noncontributing_user_count = stats_get_inactive_user_count()) !== false) {
 460  
 461      echo "                <tr>\n";
 462      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of non-contributing users"), ":&nbsp;</td>\n";
 463      echo "                  <td align=\"left\">", number_format($noncontributing_user_count, 0, '.', ','), "</td>\n";
 464      echo "                </tr>\n";
 465  }
 466  
 467  if (($newest_user = stats_get_newest_user()) !== false) {
 468  
 469      echo "                <tr>\n";
 470      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Newest User"), ":&nbsp;</td>\n";
 471      echo "                  <td align=\"left\"><a href=\"user_profile.php?webtag=$webtag&amp;uid={$newest_user['UID']}\" target=\"_blank\" class=\"popup 650x500\">", word_filter_add_ob_tags(format_user_name($newest_user['LOGON'], $newest_user['NICKNAME']), true), "</a></td>\n";
 472      echo "                </tr>\n";
 473  }
 474  
 475  echo "                <tr>\n";
 476  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 477  echo "                </tr>\n";
 478  echo "              </table>\n";
 479  echo "            </td>\n";
 480  echo "          </tr>\n";
 481  echo "        </table>\n";
 482  echo "      </td>\n";
 483  echo "    </tr>\n";
 484  echo "  </table>\n";
 485  
 486  $week_start = 0;
 487  $week_end = 0;
 488  
 489  if ((($visitor_count = stats_get_visitor_counts()) !== false) && stats_get_mysql_week($week_start, $week_end)) {
 490  
 491      echo "  <br />\n";
 492      echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 493      echo "    <tr>\n";
 494      echo "      <td align=\"left\">\n";
 495      echo "        <table class=\"box\" width=\"100%\">\n";
 496      echo "          <tr>\n";
 497      echo "            <td align=\"left\" class=\"posthead\">\n";
 498      echo "              <table class=\"posthead\" width=\"100%\">\n";
 499      echo "                <tr>\n";
 500      echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Visitor Stats"), "</td>\n";
 501      echo "                </tr>\n";
 502      echo "                <tr>\n";
 503      echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 504      echo "                </tr>\n";
 505      echo "                <tr>\n";
 506      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of visitors today"), ":&nbsp;</td>\n";
 507      echo "                  <td align=\"left\">", number_format($visitor_count['DAY'], 0, '.', ','), "</td>\n";
 508      echo "                </tr>\n";
 509  
 510      if ($visitor_count['WEEK'] > $visitor_count['DAY']) {
 511  
 512          echo "                <tr>\n";
 513          echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", sprintf(gettext("Number of visitors this week"), format_date($week_start), format_date($week_end)), ":&nbsp;</td>\n";
 514          echo "                  <td align=\"left\">", number_format($visitor_count['WEEK'], 0, '.', ','), "</td>\n";
 515          echo "                </tr>\n";
 516      }
 517  
 518      if ($visitor_count['MONTH'] > $visitor_count['WEEK']) {
 519  
 520          echo "                <tr>\n";
 521          echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of visitors this month"), ":&nbsp;</td>\n";
 522          echo "                  <td align=\"left\">", number_format($visitor_count['MONTH'], 0, '.', ','), "</td>\n";
 523          echo "                </tr>\n";
 524      }
 525  
 526      if ($visitor_count['YEAR'] > $visitor_count['MONTH']) {
 527  
 528          echo "                <tr>\n";
 529          echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of visitors this year"), ":&nbsp;</td>\n";
 530          echo "                  <td align=\"left\">", number_format($visitor_count['YEAR'], 0, '.', ','), "</td>\n";
 531          echo "                </tr>\n";
 532      }
 533  
 534      echo "                <tr>\n";
 535      echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 536      echo "                </tr>\n";
 537      echo "              </table>\n";
 538      echo "            </td>\n";
 539      echo "          </tr>\n";
 540      echo "        </table>\n";
 541      echo "      </td>\n";
 542      echo "    </tr>\n";
 543      echo "  </table>\n";
 544  }
 545  
 546  echo "  <br />\n";
 547  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 548  echo "    <tr>\n";
 549  echo "      <td align=\"left\">\n";
 550  echo "        <table class=\"box\" width=\"100%\">\n";
 551  echo "          <tr>\n";
 552  echo "            <td align=\"left\" class=\"posthead\">\n";
 553  echo "              <table class=\"posthead\" width=\"100%\">\n";
 554  echo "                <tr>\n";
 555  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Session Stats"), "</td>\n";
 556  echo "                </tr>\n";
 557  echo "                <tr>\n";
 558  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 559  echo "                </tr>\n";
 560  
 561  if (($active_user_count = stats_get_active_session_count()) !== false) {
 562  
 563      echo "                <tr>\n";
 564      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Total number of active users"), "&nbsp;</td>\n";
 565      echo "                  <td align=\"left\">", number_format($active_user_count, 0, '.', ','), "</td>\n";
 566      echo "                </tr>\n";
 567  }
 568  
 569  if (($active_registered_user_count = stats_get_active_registered_user_count()) !== false) {
 570  
 571      echo "                <tr>\n";
 572      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of active registered users"), ":&nbsp;</td>\n";
 573      echo "                  <td align=\"left\">", number_format($active_registered_user_count, 0, '.', ','), "</td>\n";
 574      echo "                </tr>\n";
 575  }
 576  
 577  if (($active_guest_count = stats_get_active_guest_count()) !== false) {
 578  
 579      echo "                <tr>\n";
 580      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of active guests"), ":&nbsp;</td>\n";
 581      echo "                  <td align=\"left\">", number_format($active_guest_count, 0, '.', ','), "</td>\n";
 582      echo "                </tr>\n";
 583  }
 584  
 585  if (($most_users = stats_get_most_users()) !== false) {
 586  
 587      echo "                <tr>\n";
 588      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most users ever online"), ":&nbsp;</td>\n";
 589      echo "                  <td align=\"left\">", sprintf(gettext("%s on %s"), number_format($most_users['MOST_USERS_COUNT'], 0, '.', ','), format_time($most_users['MOST_USERS_DATE'])), "</td>\n";
 590      echo "                </tr>\n";
 591  }
 592  
 593  echo "                <tr>\n";
 594  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 595  echo "                </tr>\n";
 596  echo "              </table>\n";
 597  echo "            </td>\n";
 598  echo "          </tr>\n";
 599  echo "        </table>\n";
 600  echo "      </td>\n";
 601  echo "    </tr>\n";
 602  echo "  </table>\n";
 603  echo "  <br />\n";
 604  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 605  echo "    <tr>\n";
 606  echo "      <td align=\"left\">\n";
 607  echo "        <table class=\"box\" width=\"100%\">\n";
 608  echo "          <tr>\n";
 609  echo "            <td align=\"left\" class=\"posthead\">\n";
 610  echo "              <table class=\"posthead\" width=\"100%\">\n";
 611  echo "                <tr>\n";
 612  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Profile Stats"), "</td>\n";
 613  echo "                </tr>\n";
 614  echo "                <tr>\n";
 615  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 616  echo "                </tr>\n";
 617  
 618  if (($user_profile_count = stats_get_users_with_profile_count()) !== false) {
 619  
 620      echo "                <tr>\n";
 621      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users with profile"), ":&nbsp;</td>\n";
 622      echo "                  <td align=\"left\">", number_format($user_profile_count, 0, '.', ','), "</td>\n";
 623      echo "                </tr>\n";
 624  }
 625  
 626  if (($user_no_profile_count = stats_get_users_without_profile_count()) !== false) {
 627  
 628      echo "                <tr>\n";
 629      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users without profile"), ":&nbsp;</td>\n";
 630      echo "                  <td align=\"left\">", number_format($user_no_profile_count, 0, '.', ','), "</td>\n";
 631      echo "                </tr>\n";
 632  }
 633  
 634  echo "                <tr>\n";
 635  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 636  echo "                </tr>\n";
 637  echo "              </table>\n";
 638  echo "            </td>\n";
 639  echo "          </tr>\n";
 640  echo "        </table>\n";
 641  echo "      </td>\n";
 642  echo "    </tr>\n";
 643  echo "  </table>\n";
 644  echo "  <br />\n";
 645  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 646  echo "    <tr>\n";
 647  echo "      <td align=\"left\">\n";
 648  echo "        <table class=\"box\" width=\"100%\">\n";
 649  echo "          <tr>\n";
 650  echo "            <td align=\"left\" class=\"posthead\">\n";
 651  echo "              <table class=\"posthead\" width=\"100%\">\n";
 652  echo "                <tr>\n";
 653  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Signature Stats"), "</td>\n";
 654  echo "                </tr>\n";
 655  echo "                <tr>\n";
 656  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 657  echo "                </tr>\n";
 658  
 659  if (($user_signature_count = stats_get_users_with_signature_count()) !== false) {
 660  
 661      echo "                <tr>\n";
 662      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users with signature"), ":&nbsp;</td>\n";
 663      echo "                  <td align=\"left\">", number_format($user_signature_count, 0, '.', ','), "</td>\n";
 664      echo "                </tr>\n";
 665  }
 666  
 667  if (($user_no_signature_count = stats_get_users_without_signature_count()) !== false) {
 668  
 669      echo "                <tr>\n";
 670      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users without signature"), ":&nbsp;</td>\n";
 671      echo "                  <td align=\"left\">", number_format($user_no_signature_count, 0, '.', ','), "</td>\n";
 672      echo "                </tr>\n";
 673  }
 674  
 675  echo "                <tr>\n";
 676  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 677  echo "                </tr>\n";
 678  echo "              </table>\n";
 679  echo "            </td>\n";
 680  echo "          </tr>\n";
 681  echo "        </table>\n";
 682  echo "      </td>\n";
 683  echo "    </tr>\n";
 684  echo "  </table>\n";
 685  echo "  <br />\n";
 686  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 687  echo "    <tr>\n";
 688  echo "      <td align=\"left\">\n";
 689  echo "        <table class=\"box\" width=\"100%\">\n";
 690  echo "          <tr>\n";
 691  echo "            <td align=\"left\" class=\"posthead\">\n";
 692  echo "              <table class=\"posthead\" width=\"100%\">\n";
 693  echo "                <tr>\n";
 694  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Age and Birthday Stats"), "</td>\n";
 695  echo "                </tr>\n";
 696  echo "                <tr>\n";
 697  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 698  echo "                </tr>\n";
 699  
 700  if (($average_age = stats_get_average_age()) !== false) {
 701  
 702      echo "                <tr>\n";
 703      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average age"), ":&nbsp;</td>\n";
 704      echo "                  <td align=\"left\">", number_format($average_age, 2, '.', ','), "</td>\n";
 705      echo "                </tr>\n";
 706  
 707  } else {
 708  
 709      echo "                <tr>\n";
 710      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average age"), ":&nbsp;</td>\n";
 711      echo "                  <td align=\"left\">", gettext("Unknown"), "</td>\n";
 712      echo "                </tr>\n";
 713  }
 714  
 715  if (($most_popular_birthday = stats_get_most_popular_birthday()) !== false) {
 716  
 717      echo "                <tr>\n";
 718      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most popular birthday"), ":&nbsp;</td>\n";
 719      echo "                  <td align=\"left\">", format_birthday($most_popular_birthday['DOB']), " (", number_format($most_popular_birthday['DOB_COUNT'], 0, '.', ','), " ", gettext("Users"), ")</td>\n";
 720      echo "                </tr>\n";
 721  
 722  } else {
 723  
 724      echo "                <tr>\n";
 725      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Most popular birthday"), ":&nbsp;</td>\n";
 726      echo "                  <td align=\"left\">", gettext("No Birthday Data Available"), "</td>\n";
 727      echo "                </tr>\n";
 728  }
 729  
 730  echo "                <tr>\n";
 731  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 732  echo "                </tr>\n";
 733  echo "              </table>\n";
 734  echo "            </td>\n";
 735  echo "          </tr>\n";
 736  echo "        </table>\n";
 737  echo "      </td>\n";
 738  echo "    </tr>\n";
 739  echo "  </table>\n";
 740  echo "  <br />\n";
 741  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 742  echo "    <tr>\n";
 743  echo "      <td align=\"left\">\n";
 744  echo "        <table class=\"box\" width=\"100%\">\n";
 745  echo "          <tr>\n";
 746  echo "            <td align=\"left\" class=\"posthead\">\n";
 747  echo "              <table class=\"posthead\" width=\"100%\">\n";
 748  echo "                <tr>\n";
 749  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Relationship Stats"), "</td>\n";
 750  echo "                </tr>\n";
 751  echo "                <tr>\n";
 752  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 753  echo "                </tr>\n";
 754  
 755  if (($relationship_count = stats_get_relationships_count()) !== false) {
 756  
 757      echo "                <tr>\n";
 758      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of user relationships"), ":&nbsp;</td>\n";
 759      echo "                  <td align=\"left\">", number_format($relationship_count, 0, '.', ','), "</td>\n";
 760      echo "                </tr>\n";
 761  
 762  } else {
 763  
 764      echo "                <tr>\n";
 765      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average age"), ":&nbsp;</td>\n";
 766      echo "                  <td align=\"left\">", gettext("Unknown"), "</td>\n";
 767      echo "                </tr>\n";
 768  }
 769  
 770  echo "                <tr>\n";
 771  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average relationships per user"), ":&nbsp;</td>\n";
 772  echo "                  <td align=\"left\">", (($relationship_count > 0) && ($user_count > 0)) ? number_format($relationship_count / $user_count, 2, ".", ",") : 0, "</td>\n";
 773  echo "                </tr>\n";
 774  echo "                <tr>\n";
 775  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 776  echo "                </tr>\n";
 777  echo "              </table>\n";
 778  echo "            </td>\n";
 779  echo "          </tr>\n";
 780  echo "        </table>\n";
 781  echo "      </td>\n";
 782  echo "    </tr>\n";
 783  echo "  </table>\n";
 784  echo "  <br />\n";
 785  echo "  <table cellpadding=\"0\" cellspacing=\"0\" width=\"86%\">\n";
 786  echo "    <tr>\n";
 787  echo "      <td align=\"left\">\n";
 788  echo "        <table class=\"box\" width=\"100%\">\n";
 789  echo "          <tr>\n";
 790  echo "            <td align=\"left\" class=\"posthead\">\n";
 791  echo "              <table class=\"posthead\" width=\"100%\">\n";
 792  echo "                <tr>\n";
 793  echo "                  <td align=\"left\" class=\"subhead\" colspan=\"3\">", gettext("Word Filter Stats"), "</td>\n";
 794  echo "                </tr>\n";
 795  echo "                <tr>\n";
 796  echo "                  <td align=\"left\" rowspan=\"19\" width=\"1%\">&nbsp;</td>\n";
 797  echo "                </tr>\n";
 798  
 799  if (($users_with_word_filter = stats_get_users_with_word_filter_count()) !== false) {
 800  
 801      echo "                <tr>\n";
 802      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users using word filter"), ":&nbsp;</td>\n";
 803      echo "                  <td align=\"left\">", number_format($users_with_word_filter, 0, '.', ','), "</td>\n";
 804      echo "                </tr>\n";
 805  }
 806  
 807  if (($users_without_word_filter = stats_get_users_without_word_filter_count()) !== false) {
 808  
 809      echo "                <tr>\n";
 810      echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Number of users not using word filter"), ":&nbsp;</td>\n";
 811      echo "                  <td align=\"left\">", number_format($users_without_word_filter, 0, '.', ','), "</td>\n";
 812      echo "                </tr>\n";
 813  }
 814  
 815  echo "                <tr>\n";
 816  echo "                  <td align=\"left\" style=\"white-space: nowrap\" width=\"40%\">", gettext("Average word filter entries per user"), ":&nbsp;</td>\n";
 817  echo "                  <td align=\"left\">", (($users_with_word_filter > 0) && ($user_count > 0)) ? number_format($users_with_word_filter / $user_count, 2, ".", ",") : 0, "</td>\n";
 818  echo "                </tr>\n";
 819  echo "                <tr>\n";
 820  echo "                  <td align=\"left\" colspan=\"3\">&nbsp;</td>\n";
 821  echo "                </tr>\n";
 822  echo "              </table>\n";
 823  echo "            </td>\n";
 824  echo "          </tr>\n";
 825  echo "        </table>\n";
 826  echo "      </td>\n";
 827  echo "    </tr>\n";
 828  echo "  </table>\n";
 829  echo "  </div>\n";
 830  
 831  html_draw_bottom();

title

Description

title

Description

title

Description

title

title

Body